actions

package
v0.0.0-r7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	Pub   s.Pub
	SPPub s.Pub
)
View Source
var Actions = map[string]ServiceAction{
	"poweroff":   Poweroff,
	"suspend":    Suspend,
	"reboot":     Reboot,
	"resume":     Resume,
	"state":      State,
	"snapcreate": SnapCreate,
	"snapdelete": SnapDelete,
	"snaprevert": SnapRevert,
	"start_vnc":  StartVNC,
}
View Source
var (
	SPPDPub pd.Pub
)

Functions

func ConfigurePublicDataClient

func ConfigurePublicDataClient(logger *zap.Logger, rbmq *amqp.Connection)

func ConfigureStatusesClient

func ConfigureStatusesClient(logger *zap.Logger, rbmq *amqp.Connection)

func MakePostStateRequest

func MakePostStateRequest(uuid string, meta map[string]*structpb.Value) *stpb.ObjectState

func PostServicesProviderPublicData

func PostServicesProviderPublicData(publicData *one.LocationPublicData)

func PostServicesProviderState

func PostServicesProviderState(state *one.LocationState)

func Poweroff

func Poweroff(
	client *one.ONeClient,
	inst *ipb.Instance,
	data map[string]*structpb.Value,
) (*ipb.InvokeResponse, error)

Powers off a running VM

func Reboot

func Reboot(
	client *one.ONeClient,
	inst *ipb.Instance,
	data map[string]*structpb.Value,
) (*ipb.InvokeResponse, error)

Reboots an already deployed VM

func Resume

func Resume(
	client *one.ONeClient,
	inst *ipb.Instance,
	data map[string]*structpb.Value,
) (*ipb.InvokeResponse, error)

Resumes the execution of a saved VM.

func SnapCreate

func SnapCreate(
	client *one.ONeClient,
	inst *ipb.Instance,
	data map[string]*structpb.Value,
) (*ipb.InvokeResponse, error)

Creates new snapshot of vm

func SnapDelete

func SnapDelete(
	client *one.ONeClient,
	inst *ipb.Instance,
	data map[string]*structpb.Value,
) (*ipb.InvokeResponse, error)

Deletes Snapshot by ID

func SnapRevert

func SnapRevert(
	client *one.ONeClient,
	inst *ipb.Instance,
	data map[string]*structpb.Value,
) (*ipb.InvokeResponse, error)

Reverts Snapshot by ID

func StartVNC

func StartVNC(
	client *one.ONeClient,
	inst *ipb.Instance,
	data map[string]*structpb.Value,
) (*ipb.InvokeResponse, error)

func State

func State(
	client *one.ONeClient,
	inst *ipb.Instance,
	data map[string]*structpb.Value,
) (*ipb.InvokeResponse, error)

Returns the VM state of the VirtualMachine

func StatusesClient

func StatusesClient(
	client *one.ONeClient,
	inst *ipb.Instance,
	data map[string]*structpb.Value,
	result *ipb.InvokeResponse,
) (*ipb.InvokeResponse, error)

Returns the VM state of the VirtualMachine to statuses server

func Suspend

func Suspend(
	client *one.ONeClient,
	inst *ipb.Instance,
	data map[string]*structpb.Value,
) (*ipb.InvokeResponse, error)

Saves a running VM

Types

type ServiceAction

type ServiceAction func(
	*one.ONeClient,
	*ipb.Instance,
	map[string]*structpb.Value,
) (*ipb.InvokeResponse, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL