instances

package
v0.8.14 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Action

func Action(client *gcorecloud.ServiceClient, instanceID string, opts ActionOptsBuilder) (r tasks.Result)

Action run an action for the instance.

func MetadataItemDelete added in v0.8.13

func MetadataItemDelete(client *gcorecloud.ServiceClient, id string, opts MetadataItemOpts) (r metadata.MetadataActionResult)

MetadataItemDelete deletes defined metadata key for an instance.

func MetadataItemGet added in v0.8.13

func MetadataItemGet(client *gcorecloud.ServiceClient, id string, opts MetadataItemOpts) (r metadata.MetadataResult)

MetadataItemGet gets defined metadata key for an instance.

Types

type ActionOpts

type ActionOpts struct {
	Action          types.InstanceActionType `json:"action" required:"true" validate:"required,enum"`
	ActivateProfile *bool                    `json:"activate_profile,omitempty"`
}

ActionOpts represents options used to run action.

func (ActionOpts) ToActionMap

func (opts ActionOpts) ToActionMap() (map[string]interface{}, error)

ToActionMap builds a request body from ActionOpts.

func (ActionOpts) Validate

func (opts ActionOpts) Validate() error

Validate checks if the ActionOpts is valid.

type ActionOptsBuilder

type ActionOptsBuilder interface {
	ToActionMap() (map[string]interface{}, error)
}

ActionOptsBuilder allows extensions to add parameters to the action request.

type MetadataItemBuilder added in v0.8.13

type MetadataItemBuilder interface {
	ToMetadataItemQuery() (string, error)
}

type MetadataItemOpts added in v0.8.13

type MetadataItemOpts struct {
	Key string `q:"key" validate:"required"`
}

MetadataItemOpts represents options used to find a metadata.

func (MetadataItemOpts) ToMetadataItemQuery added in v0.8.13

func (opts MetadataItemOpts) ToMetadataItemQuery() (string, error)

ToMetadataItemQuery builds a query string from MetadataItemOpts.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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