Documentation
¶
Index ¶
- Constants
- func AttachInterface(client *gcorecloud.ServiceClient, id string, opts InterfaceOptsBuilder) (r tasks.Result)
- func Create(client *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
- func Delete(client *gcorecloud.ServiceClient, instanceID string, opts DeleteOptsBuilder) (r tasks.Result)
- func DetachInterface(client *gcorecloud.ServiceClient, id string, opts InterfaceOptsBuilder) (r tasks.Result)
- func ExtractInstanceIDFromTask(task *tasks.Task) (string, error)
- func ExtractInstanceInterfacesInto(r pagination.Page, v interface{}) error
- func ExtractInstancePortIDFromTask(task *tasks.Task) (string, error)
- func ExtractInstancePortInto(r pagination.Page, v interface{}) error
- func ExtractInstanceSecurityGroupInto(r pagination.Page, v interface{}) error
- func ExtractInstanceSecurityGroups(r pagination.Page) ([]gcorecloud.ItemIDName, error)
- func ExtractInstancesInto(r pagination.Page, v interface{}) error
- func ExtractMetadata(r pagination.Page) ([]metadata.Metadata, error)
- func ExtractMetadataInto(r pagination.Page, v interface{}) error
- func List(client *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- func ListAvailableFlavors(client *gcorecloud.ServiceClient, id string, opts flavors.ListOptsBuilder) (r flavors.ListResult)
- func ListInterfaces(client *gcorecloud.ServiceClient, id string) pagination.Pager
- func ListPorts(client *gcorecloud.ServiceClient, id string) pagination.Pager
- func ListSecurityGroups(client *gcorecloud.ServiceClient, id string) pagination.Pager
- func ListSecurityGroupsAll(client *gcorecloud.ServiceClient, id string) ([]gcorecloud.ItemIDName, error)
- func MetadataList(client *gcorecloud.ServiceClient, id string) pagination.Pager
- func MetadataListAll(client *gcorecloud.ServiceClient, id string) ([]metadata.Metadata, error)
- func PutToServerGroup(client *gcorecloud.ServiceClient, id string, opts PutToServerGroupOptsBuilder) (r tasks.Result)
- func RemoveFromServerGroup(client *gcorecloud.ServiceClient, id string) (r tasks.Result)
- func Resize(client *gcorecloud.ServiceClient, id string, opts ChangeFlavorOptsBuilder) (r tasks.Result)
- type ChangeFlavorOpts
- type ChangeFlavorOptsBuilder
- type CreateNewInterfaceFloatingIPOpts
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type CreateVolumeOpts
- type DeleteOpts
- type DeleteOptsBuilder
- type DeleteResult
- type DiskMetrics
- type FloatingIP
- type GetResult
- type Instance
- type InstanceAddress
- type InstanceInterfacePage
- type InstanceLocation
- type InstanceMetrics
- type InstancePage
- type InstancePorts
- type InstancePortsPage
- type InstanceSecurityGroupPage
- type InstanceTaskResult
- type InstanceVolume
- type Interface
- type InterfaceActionResult
- type InterfaceInstanceCreateOpts
- type InterfaceOpts
- type InterfaceOptsBuilder
- type ListInstanceLocationOpts
- type ListInstanceLocationOptsBuilder
- type ListMetricsOpts
- type ListMetricsOptsBuilder
- type ListMetricsResult
- type ListOpts
- type ListOptsBuilder
- type MetadataActionResult
- func MetadataCreate(client *gcorecloud.ServiceClient, id string, opts MetadataSetOpts) (r MetadataActionResult)
- func MetadataDelete(client *gcorecloud.ServiceClient, id string, key string) (r MetadataActionResult)
- func MetadataUpdate(client *gcorecloud.ServiceClient, id string, opts MetadataSetOpts) (r MetadataActionResult)
- type MetadataOpts
- type MetadataOptsBuilder
- type MetadataPage
- type MetadataResult
- type MetadataSetOpts
- type NetworkDetail
- type PortIP
- type PortSecurityGroupNames
- type PutServerGroupOpts
- type PutToServerGroupOptsBuilder
- type RemoteConsole
- type RemoteConsoleResult
- type RenameInstanceOpts
- type RenameInstanceOptsBuilder
- type SearchLocationResult
- type SecurityGroupActionResult
- type SecurityGroupOpts
- type SecurityGroupOptsBuilder
- type SubPort
- type Subnet
- type UpdateResult
- func PowerCycle(client *gcorecloud.ServiceClient, id string) (r UpdateResult)
- func Reboot(client *gcorecloud.ServiceClient, id string) (r UpdateResult)
- func Resume(client *gcorecloud.ServiceClient, id string) (r UpdateResult)
- func Start(client *gcorecloud.ServiceClient, id string) (r UpdateResult)
- func Stop(client *gcorecloud.ServiceClient, id string) (r UpdateResult)
- func Suspend(client *gcorecloud.ServiceClient, id string) (r UpdateResult)
Constants ¶
const DefaultAvailabilityZone = "nova"
Variables ¶
This section is empty.
Functions ¶
func AttachInterface ¶
func AttachInterface(client *gcorecloud.ServiceClient, id string, opts InterfaceOptsBuilder) (r tasks.Result)
AttachInterface adds a interface to the instance.
func Create ¶
func Create(client *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
Create creates an instance.
func Delete ¶
func Delete(client *gcorecloud.ServiceClient, instanceID string, opts DeleteOptsBuilder) (r tasks.Result)
func DetachInterface ¶
func DetachInterface(client *gcorecloud.ServiceClient, id string, opts InterfaceOptsBuilder) (r tasks.Result)
DetachInterface removes a interface from the instance.
func ExtractInstanceInterfacesInto ¶
func ExtractInstanceInterfacesInto(r pagination.Page, v interface{}) error
func ExtractInstancePortIDFromTask ¶ added in v0.5.0
func ExtractInstancePortInto ¶ added in v0.4.51
func ExtractInstancePortInto(r pagination.Page, v interface{}) error
func ExtractInstanceSecurityGroupInto ¶
func ExtractInstanceSecurityGroupInto(r pagination.Page, v interface{}) error
func ExtractInstanceSecurityGroups ¶
func ExtractInstanceSecurityGroups(r pagination.Page) ([]gcorecloud.ItemIDName, error)
ExtractInstanceSecurityGroups accepts a Page struct, specifically a InstanceSecurityGroupPage struct, and extracts the elements into a slice of instance security group structs. In other words, a generic collection is mapped into a relevant slice.
func ExtractInstancesInto ¶
func ExtractInstancesInto(r pagination.Page, v interface{}) error
func ExtractMetadata ¶
func ExtractMetadata(r pagination.Page) ([]metadata.Metadata, error)
ExtractMetadata accepts a Page struct, specifically a MetadataPage struct, and extracts the elements into a slice of instance metadata structs. In other words, a generic collection is mapped into a relevant slice.
func ExtractMetadataInto ¶
func ExtractMetadataInto(r pagination.Page, v interface{}) error
func List ¶
func List(client *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
func ListAvailableFlavors ¶ added in v0.4.24
func ListAvailableFlavors(client *gcorecloud.ServiceClient, id string, opts flavors.ListOptsBuilder) (r flavors.ListResult)
ListAvailableFlavors get available flavors for the instance to resize into.
func ListInterfaces ¶
func ListInterfaces(client *gcorecloud.ServiceClient, id string) pagination.Pager
ListInterfaces retrieves network interfaces for instance
func ListPorts ¶ added in v0.4.51
func ListPorts(client *gcorecloud.ServiceClient, id string) pagination.Pager
ListPorts retrieves ports for instance
func ListSecurityGroups ¶
func ListSecurityGroups(client *gcorecloud.ServiceClient, id string) pagination.Pager
ListSecurityGroups retrieves security groups interfaces for instance
func ListSecurityGroupsAll ¶
func ListSecurityGroupsAll(client *gcorecloud.ServiceClient, id string) ([]gcorecloud.ItemIDName, error)
ListSecurityGroupsAll is a convenience function that returns all instance security groups.
func MetadataList ¶
func MetadataList(client *gcorecloud.ServiceClient, id string) pagination.Pager
func MetadataListAll ¶
func MetadataListAll(client *gcorecloud.ServiceClient, id string) ([]metadata.Metadata, error)
func PutToServerGroup ¶ added in v0.8.5
func PutToServerGroup(client *gcorecloud.ServiceClient, id string, opts PutToServerGroupOptsBuilder) (r tasks.Result)
PutToServerGroup instance.
func RemoveFromServerGroup ¶ added in v0.8.5
func RemoveFromServerGroup(client *gcorecloud.ServiceClient, id string) (r tasks.Result)
RemoveFromServerGroup instance.
func Resize ¶
func Resize(client *gcorecloud.ServiceClient, id string, opts ChangeFlavorOptsBuilder) (r tasks.Result)
Resize instance.
Types ¶
type ChangeFlavorOpts ¶
type ChangeFlavorOpts struct {
FlavorID string `json:"flavor_id" required:"true" validate:"required"`
}
func (ChangeFlavorOpts) ToChangeFlavorActionMap ¶
func (opts ChangeFlavorOpts) ToChangeFlavorActionMap() (map[string]interface{}, error)
ToChangeFlavorActionMap builds a request body from ChangeFlavorOpts.
func (ChangeFlavorOpts) Validate ¶
func (opts ChangeFlavorOpts) Validate() error
type ChangeFlavorOptsBuilder ¶
type ChangeFlavorOptsBuilder interface {
ToChangeFlavorActionMap() (map[string]interface{}, error)
}
ChangeFlavorOptsBuilder builds parameters or change flavor request.
type CreateNewInterfaceFloatingIPOpts ¶
type CreateNewInterfaceFloatingIPOpts struct {
Source types.FloatingIPSource `json:"source" validate:"required,enum"`
ExistingFloatingID string `json:"existing_floating_id" validate:"rfe=Source:existing,sfe=Source:new,omitempty,uuid"`
}
func (CreateNewInterfaceFloatingIPOpts) Validate ¶
func (opts CreateNewInterfaceFloatingIPOpts) Validate() error
Validate
type CreateOpts ¶
type CreateOpts struct {
Flavor string `json:"flavor" required:"true"`
Names []string `json:"names,omitempty" validate:"required_without=NameTemplates"`
NameTemplates []string `json:"name_templates,omitempty" validate:"required_without=Names"`
Volumes []CreateVolumeOpts `json:"volumes" validate:"dive"`
Interfaces []InterfaceInstanceCreateOpts `json:"interfaces" required:"true" validate:"required,dive"`
SecurityGroups []gcorecloud.ItemID `json:"security_groups,omitempty" validate:"omitempty,dive,uuid4"`
Keypair string `json:"keypair_name,omitempty"`
Password string `json:"password" validate:"omitempty,required_with=Username"`
Username string `json:"username" validate:"omitempty,required_with=Password"`
UserData string `json:"user_data" validate:"omitempty,base64"`
Metadata *MetadataSetOpts `json:"metadata,omitempty" validate:"omitempty,dive"`
Configuration *MetadataSetOpts `json:"configuration,omitempty" validate:"omitempty,dive"`
AllowAppPorts bool `json:"allow_app_ports,omitempty"`
ServerGroupID string `json:"servergroup_id,omitempty" validate:"omitempty,uuid4"`
}
CreateOpts represents options used to create a instance.
func (CreateOpts) ToInstanceCreateMap ¶
func (opts CreateOpts) ToInstanceCreateMap() (map[string]interface{}, error)
ToInstanceCreateMap builds a request body from CreateOpts.
type CreateOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
CreateResult represents the result of a create operation. Call its Extract method to interpret it as a Instance.
func (CreateResult) Extract ¶
Extract is a function that accepts a result and extracts a instance resource.
func (CreateResult) ExtractInto ¶
func (r CreateResult) ExtractInto(v interface{}) error
type CreateVolumeOpts ¶
type CreateVolumeOpts struct {
Source types.VolumeSource `json:"source" required:"true" validate:"required,enum"`
BootIndex int `json:"boot_index"`
Size int `json:"size,omitempty" validate:"rfe=Source:image;new-volume,sfe=Source:snapshot;existing-volume"`
TypeName volumes.VolumeType `json:"type_name,omitempty" validate:"omitempty"`
AttachmentTag string `json:"attachment_tag,omitempty" validate:"omitempty"`
Name string `json:"name,omitempty" validate:"omitempty"`
ImageID string `` /* 156-byte string literal not displayed */
SnapshotID string `` /* 156-byte string literal not displayed */
VolumeID string `` /* 156-byte string literal not displayed */
Metadata map[string]string `json:"metadata,omitempty" validate:"omitempty"`
DeleteOnTermination bool `json:"delete_on_termination,omitempty"`
}
CreateVolumeOpts represents options used to create a volume.
func (*CreateVolumeOpts) Validate ¶
func (opts *CreateVolumeOpts) Validate() error
type DeleteOpts ¶
type DeleteOpts struct {
Volumes []string `q:"volumes" validate:"omitempty,dive,uuid4" delimiter:"comma"`
DeleteFloatings bool `q:"delete_floatings" validate:"omitempty,allowed_without=FloatingIPs"`
FloatingIPs []string `q:"floatings" validate:"omitempty,allowed_without=DeleteFloatings,dive,uuid4" delimiter:"comma"`
}
DeleteOpts. Set parameters for delete operation
func (DeleteOpts) ToInstanceDeleteQuery ¶
func (opts DeleteOpts) ToInstanceDeleteQuery() (string, error)
ToInstanceDeleteQuery formats a DeleteOpts into a query string.
func (*DeleteOpts) Validate ¶
func (opts *DeleteOpts) Validate() error
type DeleteOptsBuilder ¶
DeleteOptsBuilder allows extensions to add additional parameters to the Delete request.
type DeleteResult ¶
type DeleteResult struct {
// contains filtered or unexported fields
}
DeleteResult represents the result of a delete operation
func (DeleteResult) Extract ¶
Extract is a function that accepts a result and extracts a instance resource.
func (DeleteResult) ExtractInto ¶
func (r DeleteResult) ExtractInto(v interface{}) error
type DiskMetrics ¶ added in v0.4.24
type FloatingIP ¶
type FloatingIP struct {
FloatingIPAddress net.IP `json:"floating_ip_address"`
RouterID string `json:"router_id"`
SubnetID string `json:"subnet_id"`
Status string `json:"status"`
ID string `json:"id"`
PortID string `json:"port_id"`
DNSDomain string `json:"dns_domain"`
DNSName string `json:"dns_name"`
FixedIPAddress net.IP `json:"fixed_ip_address"`
UpdatedAt *gcorecloud.JSONRFC3339Z `json:"updated_at"`
CreatedAt gcorecloud.JSONRFC3339Z `json:"created_at"`
CreatorTaskID *string `json:"creator_task_id"`
ProjectID int `json:"project_id"`
RegionID int `json:"region_id"`
Region string `json:"region"`
Metadata []metadata.Metadata `json:"metadata"`
}
FloatingIP represents a floating ip of instance port.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents the result of a get operation. Call its Extract method to interpret it as a Instance.
func Get ¶
func Get(client *gcorecloud.ServiceClient, id string) (r GetResult)
Get retrieves a specific instance based on its unique ID.
func RenameInstance ¶ added in v0.4.36
func RenameInstance(client *gcorecloud.ServiceClient, id string, opts RenameInstanceOptsBuilder) (r GetResult)
RenameInstance rename instance.
func (GetResult) Extract ¶
Extract is a function that accepts a result and extracts a instance resource.
func (GetResult) ExtractInto ¶
func (r GetResult) ExtractInto(v interface{}) error
type Instance ¶
type Instance struct {
ID string `json:"instance_id"`
Name string `json:"instance_name"`
Description string `json:"instance_description"`
CreatedAt gcorecloud.JSONRFC3339ZZ `json:"instance_created"`
Status string `json:"status"`
VMState string `json:"vm_state"`
TaskState *string `json:"task_state"`
Flavor flavors.Flavor `json:"flavor"`
Metadata map[string]interface{} `json:"metadata"`
MetadataDetailed []metadata.Metadata `json:"metadata_detailed"`
Volumes []InstanceVolume `json:"volumes"`
Addresses map[string][]InstanceAddress `json:"addresses"`
SecurityGroups []gcorecloud.ItemName `json:"security_groups"`
CreatorTaskID *string `json:"creator_task_id"`
TaskID *string `json:"task_id"`
ProjectID int `json:"project_id"`
RegionID int `json:"region_id"`
Region string `json:"region"`
AvailabilityZone string `json:"availability_zone"`
DdosProfile *ddos.Profile `json:"ddos_profile"`
}
Instance represents a instance structure.
func ExtractInstances ¶
func ExtractInstances(r pagination.Page) ([]Instance, error)
ExtractInstances accepts a Page struct, specifically a InstancePage struct, and extracts the elements into a slice of instance structs. In other words, a generic collection is mapped into a relevant slice.
func ListAll ¶
func ListAll(client *gcorecloud.ServiceClient, opts ListOptsBuilder) ([]Instance, error)
ListAll is a convenience function that returns all instances.
func (*Instance) UnmarshalJSON ¶
UnmarshalJSON - implements Unmarshaler interface
type InstanceAddress ¶
type InstanceInterfacePage ¶
type InstanceInterfacePage struct {
pagination.LinkedPageBase
}
InstanceInterfacePage is the page returned by a pager when traversing over a collection of instance interfaces.
func (InstanceInterfacePage) IsEmpty ¶
func (r InstanceInterfacePage) IsEmpty() (bool, error)
IsEmpty checks whether a InstanceInterfacePage struct is empty.
func (InstanceInterfacePage) NextPageURL ¶
func (r InstanceInterfacePage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of instance interfaces has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type InstanceLocation ¶ added in v0.4.24
type InstanceMetrics ¶ added in v0.4.24
type InstanceMetrics struct {
CPUUtil float64 `json:"cpu_util"`
Disks []DiskMetrics `json:"disks"`
MemoryUtil float64 `json:"memory_util"`
NetworkBPSEgress float64 `json:"network_Bps_egress"`
NetworkBPSIngress float64 `json:"network_Bps_ingress"`
NetworkPPSEgress float64 `json:"network_pps_egress"`
NetworkPPSIngress float64 `json:"network_pps_ingress"`
Time gcorecloud.JSONRFC3339ZZ `json:"time"`
}
InstanceMetrics represent a instance metrics struct
type InstancePage ¶
type InstancePage struct {
pagination.LinkedPageBase
}
InstancePage is the page returned by a pager when traversing over a collection of instances.
func (InstancePage) IsEmpty ¶
func (r InstancePage) IsEmpty() (bool, error)
IsEmpty checks whether a InstancePage struct is empty.
func (InstancePage) NextPageURL ¶
func (r InstancePage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of instances has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type InstancePorts ¶ added in v0.4.51
type InstancePorts struct {
ID string `json:"id"`
Name string `json:"name"`
SecurityGroups []gcorecloud.ItemIDName `json:"security_groups"`
}
func ExtractInstancePorts ¶ added in v0.4.51
func ExtractInstancePorts(r pagination.Page) ([]InstancePorts, error)
ExtractInstancePorts accepts a Page struct, specifically a InstancePortsPage struct, and extracts the elements into a slice of instance security group structs. In other words, a generic collection is mapped into a relevant slice.
func ListPortsAll ¶ added in v0.4.51
func ListPortsAll(client *gcorecloud.ServiceClient, id string) ([]InstancePorts, error)
ListPortsAll is a convenience function that returns all instance ports.
type InstancePortsPage ¶ added in v0.4.51
type InstancePortsPage struct {
pagination.LinkedPageBase
}
InstancePortsPage is the page returned by a pager when traversing over a collection of instance ports.
func (InstancePortsPage) IsEmpty ¶ added in v0.4.51
func (r InstancePortsPage) IsEmpty() (bool, error)
IsEmpty checks whether a InstancePortsPage struct is empty.
func (InstancePortsPage) NextPageURL ¶ added in v0.4.51
func (r InstancePortsPage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of instance ports has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type InstanceSecurityGroupPage ¶
type InstanceSecurityGroupPage struct {
pagination.LinkedPageBase
}
InstanceSecurityGroupPage is the page returned by a pager when traversing over a collection of instance security groups.
func (InstanceSecurityGroupPage) IsEmpty ¶
func (r InstanceSecurityGroupPage) IsEmpty() (bool, error)
IsEmpty checks whether a InstanceSecurityGroupPage struct is empty.
func (InstanceSecurityGroupPage) NextPageURL ¶
func (r InstanceSecurityGroupPage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of instance security groups has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type InstanceTaskResult ¶
type InstanceVolume ¶
type Interface ¶
type Interface struct {
Name *string `json:"interface_name"`
PortID string `json:"port_id"`
MacAddress gcorecloud.MAC `json:"mac_address"`
NetworkID string `json:"network_id"`
PortSecurityEnabled bool `json:"port_security_enabled"`
IPAssignments []PortIP `json:"ip_assignments"`
NetworkDetails NetworkDetail `json:"network_details"`
FloatingIPDetails []FloatingIP `json:"floatingip_details"`
SubPorts []SubPort `json:"sub_ports"`
AllowedAddressPairs []reservedfixedips.AllowedAddressPairs `json:"allowed_address_pairs"`
}
Interface represents a instance port interface.
func ExtractInstanceInterfaces ¶
func ExtractInstanceInterfaces(r pagination.Page) ([]Interface, error)
ExtractInstanceInterfaces accepts a Page struct, specifically a InstanceInterfacePage struct, and extracts the elements into a slice of instance interface structs. In other words, a generic collection is mapped into a relevant slice.
func ListInterfacesAll ¶
func ListInterfacesAll(client *gcorecloud.ServiceClient, id string) ([]Interface, error)
ListInterfacesAll is a convenience function that returns all instance interfaces.
type InterfaceActionResult ¶
type InterfaceActionResult struct {
gcorecloud.ErrResult
}
InterfaceActionResult represents the result of a actions operation(no content)
type InterfaceInstanceCreateOpts ¶ added in v0.5.0
type InterfaceInstanceCreateOpts struct {
InterfaceOpts
SecurityGroups []gcorecloud.ItemID `json:"security_groups,omitempty"`
}
func (InterfaceInstanceCreateOpts) ToInterfaceActionMap ¶ added in v0.5.1
func (opts InterfaceInstanceCreateOpts) ToInterfaceActionMap() (map[string]interface{}, error)
ToInterfaceActionMap builds a request body from InterfaceOpts.
func (InterfaceInstanceCreateOpts) Validate ¶ added in v0.5.0
func (opts InterfaceInstanceCreateOpts) Validate() error
Validate
type InterfaceOpts ¶
type InterfaceOpts struct {
Type types.InterfaceType `json:"type,omitempty" validate:"omitempty,enum"`
Name *string `json:"interface_name,omitempty" validate:"omitempty,max=255"`
NetworkID string `json:"network_id,omitempty" validate:"rfe=Type:any_subnet,omitempty,uuid4"`
SubnetID string `json:"subnet_id,omitempty" validate:"rfe=Type:subnet,omitempty,uuid4"`
PortID string `json:"port_id,omitempty" validate:"rfe=Type:reserved_fixed_ip,allowed_without_all=NetworkID SubnetID,omitempty,uuid4"`
IpAddress string `json:"ip_address,omitempty" validate:"allowed_without_all=Type NetworkID SubnetID FloatingIP,omitempty"`
IPFamily types.IPFamilyType `json:"ip_family,omitempty" validate:"omitempty,enum"`
FloatingIP *CreateNewInterfaceFloatingIPOpts `json:"floating_ip,omitempty" validate:"omitempty,dive"`
}
func (InterfaceOpts) ToInterfaceActionMap ¶
func (opts InterfaceOpts) ToInterfaceActionMap() (map[string]interface{}, error)
ToInterfaceActionMap builds a request body from InterfaceOpts.
type InterfaceOptsBuilder ¶
InterfaceOptsBuilder allows extensions to add parameters to the interface request.
type ListInstanceLocationOpts ¶ added in v0.4.24
ListInstanceLocationOpts set parameters for search instance location operation
func (ListInstanceLocationOpts) ToListInstanceLocationQuery ¶ added in v0.4.24
func (opts ListInstanceLocationOpts) ToListInstanceLocationQuery() (string, error)
ToListInstanceLocationQuery formats a ListInstanceLocationOpts into a query string.
func (*ListInstanceLocationOpts) Validate ¶ added in v0.4.24
func (opts *ListInstanceLocationOpts) Validate() error
type ListInstanceLocationOptsBuilder ¶ added in v0.4.24
ListInstanceLocationOptsBuilder allows extensions to add additional parameters to the ListInstanceLocation request.
type ListMetricsOpts ¶ added in v0.4.24
type ListMetricsOpts struct {
TimeUnit types.MetricsTimeUnit `json:"time_unit" required:"true" validate:"required,enum"`
TimeInterval int `json:"time_interval" required:"true" validate:"required"`
}
func (ListMetricsOpts) ToListMetricsMap ¶ added in v0.4.24
func (opts ListMetricsOpts) ToListMetricsMap() (map[string]interface{}, error)
ToListMetricsMap builds a request body from ListMetricsOpts.
func (ListMetricsOpts) Validate ¶ added in v0.4.24
func (opts ListMetricsOpts) Validate() error
type ListMetricsOptsBuilder ¶ added in v0.4.24
ListMetricsOptsBuilder builds parameters or change flavor request.
type ListMetricsResult ¶ added in v0.4.24
type ListMetricsResult struct {
gcorecloud.Result
}
func ListInstanceMetrics ¶ added in v0.4.24
func ListInstanceMetrics(client *gcorecloud.ServiceClient, id string, opts ListMetricsOptsBuilder) (r ListMetricsResult)
ListInstanceMetrics retrieves instance's metrics.
func (ListMetricsResult) Extract ¶ added in v0.4.24
func (r ListMetricsResult) Extract() ([]InstanceMetrics, error)
Extract is a function that accepts a result and extracts a instance's metrics resource.
func (ListMetricsResult) ExtractInto ¶ added in v0.4.24
func (r ListMetricsResult) ExtractInto(v interface{}) error
type ListOpts ¶
type ListOpts struct {
ExcludeSecGroup string `q:"exclude_secgroup"`
AvailableFloating bool `q:"available_floating"`
IncludeAI bool `q:"include_ai"`
IncludeBaremetal bool `q:"include_baremetal"`
Name string `q:"name"`
FlavorID string `q:"flavor_id"`
Limit int `q:"limit" validate:"omitempty,gt=0"`
Offset int `q:"offset" validate:"omitempty,gt=0"`
Metadata map[string]string `q:"metadata_kv" validate:"omitempty"`
WithDdos bool `q:"with_ddos" validate:"omitempty"`
}
ListOpts allows the filtering and sorting of paginated collections through the API.
func (ListOpts) ToInstanceListQuery ¶
ToInstanceListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request.
type MetadataActionResult ¶
type MetadataActionResult struct {
gcorecloud.ErrResult
}
MetadataActionResult represents the result of a create, delete or update operation(no content)
func MetadataCreate ¶
func MetadataCreate(client *gcorecloud.ServiceClient, id string, opts MetadataSetOpts) (r MetadataActionResult)
MetadataCreate creates a metadata for an instance.
func MetadataDelete ¶
func MetadataDelete(client *gcorecloud.ServiceClient, id string, key string) (r MetadataActionResult)
MetadataDelete deletes defined metadata key for an instance.
func MetadataUpdate ¶
func MetadataUpdate(client *gcorecloud.ServiceClient, id string, opts MetadataSetOpts) (r MetadataActionResult)
MetadataUpdate updates a metadata for an instance.
type MetadataOpts ¶
type MetadataOpts struct {
Key string `json:"key" validate:"required,max=255"`
Value string `json:"value" validate:"required,max=255"`
}
MetadataOpts. Set parameters for Create or Update operation
type MetadataOptsBuilder ¶
MetadataOptsBuilder allows extensions to add additional parameters to the metadata Create and Update request.
type MetadataPage ¶
type MetadataPage struct {
pagination.LinkedPageBase
}
MetadataPage is the page returned by a pager when traversing over a collection of instance metadata objects.
func (MetadataPage) IsEmpty ¶
func (r MetadataPage) IsEmpty() (bool, error)
IsEmpty checks whether a MetadataPage struct is empty.
func (MetadataPage) NextPageURL ¶
func (r MetadataPage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of instance metadata objects has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type MetadataResult ¶
type MetadataResult struct {
// contains filtered or unexported fields
}
MetadataResult represents the result of a get operation
func MetadataGet ¶
func MetadataGet(client *gcorecloud.ServiceClient, id string, key string) (r MetadataResult)
MetadataGet gets defined metadata key for an instance.
func (MetadataResult) Extract ¶
func (r MetadataResult) Extract() (*metadata.Metadata, error)
Extract is a function that accepts a result and extracts a instance metadata resource.
func (MetadataResult) ExtractInto ¶
func (r MetadataResult) ExtractInto(v interface{}) error
type MetadataSetOpts ¶
type MetadataSetOpts struct {
Metadata []MetadataOpts `json:"metadata" validate:"required,min=1,dive"`
}
MetadataSetOpts. Set parameters for Create or Update operation
func (MetadataSetOpts) ToMetadataMap ¶
func (opts MetadataSetOpts) ToMetadataMap() (map[string]interface{}, error)
ToMetadataMap builds a request body from MetadataSetOpts.
type NetworkDetail ¶
type NetworkDetail struct {
Mtu int `json:"mtu"`
UpdatedAt *gcorecloud.JSONRFC3339Z `json:"updated_at"`
CreatedAt gcorecloud.JSONRFC3339Z `json:"created_at"`
ID string `json:"id"`
External bool `json:"external"`
Default bool `json:"default"`
Name string `json:"name"`
Subnets []Subnet `json:"subnets"`
ProjectID int `json:"project_id"`
RegionID int `json:"region_id"`
Region string `json:"region"`
TaskID *string `json:"task_id"`
CreatorTaskID *string `json:"creator_task_id"`
}
NetworkDetail represents a NetworkDetails of instance port.
type PortSecurityGroupNames ¶ added in v0.5.0
type PutServerGroupOpts ¶ added in v0.8.5
type PutServerGroupOpts struct {
ServerGroupID string `json:"servergroup_id" required:"true" validate:"required,uuid4"`
}
func (PutServerGroupOpts) ToPutToServerGroupActionMap ¶ added in v0.8.5
func (opts PutServerGroupOpts) ToPutToServerGroupActionMap() (map[string]interface{}, error)
func (PutServerGroupOpts) Validate ¶ added in v0.8.5
func (opts PutServerGroupOpts) Validate() error
type PutToServerGroupOptsBuilder ¶ added in v0.8.5
type RemoteConsole ¶ added in v0.4.24
type RemoteConsoleResult ¶ added in v0.4.24
type RemoteConsoleResult struct {
gcorecloud.Result
}
func GetInstanceConsole ¶ added in v0.4.24
func GetInstanceConsole(client *gcorecloud.ServiceClient, id string) (r RemoteConsoleResult)
GetInstanceConsole retrieves a specific spice console based on instance unique ID.
func GetSpiceConsole ¶ added in v0.4.24
func GetSpiceConsole(client *gcorecloud.ServiceClient, id string) (r RemoteConsoleResult)
GetSpiceConsole retrieves a specific spice console based on instance unique ID.
func (RemoteConsoleResult) Extract ¶ added in v0.4.24
func (r RemoteConsoleResult) Extract() (*RemoteConsole, error)
Extract is a function that accepts a result and extracts a remote console resource.
func (RemoteConsoleResult) ExtractInto ¶ added in v0.4.24
func (r RemoteConsoleResult) ExtractInto(v interface{}) error
type RenameInstanceOpts ¶ added in v0.4.36
type RenameInstanceOpts struct {
Name string `json:"name" required:"true" validate:"required"`
}
func (RenameInstanceOpts) ToRenameInstanceActionMap ¶ added in v0.4.36
func (opts RenameInstanceOpts) ToRenameInstanceActionMap() (map[string]interface{}, error)
ToRenameInstanceActionMap builds a request body from RenameInstanceOpts.
func (RenameInstanceOpts) Validate ¶ added in v0.4.36
func (opts RenameInstanceOpts) Validate() error
Validate.
type RenameInstanceOptsBuilder ¶ added in v0.4.36
type RenameInstanceOptsBuilder interface {
ToRenameInstanceActionMap() (map[string]interface{}, error)
}
RenameInstanceOptsBuilder allows extensions to add parameters to rename instance request.
type SearchLocationResult ¶ added in v0.4.24
type SearchLocationResult struct {
gcorecloud.Result
}
func ListInstanceLocation ¶ added in v0.4.24
func ListInstanceLocation(client *gcorecloud.ServiceClient, opts ListInstanceLocationOptsBuilder) (r SearchLocationResult)
ListInstanceLocation get flavors available for the instance to resize into.
func (SearchLocationResult) Extract ¶ added in v0.4.24
func (r SearchLocationResult) Extract() ([]InstanceLocation, error)
Extract is a function that accepts a result and extracts a instance's location resource.
func (SearchLocationResult) ExtractInto ¶ added in v0.4.24
func (r SearchLocationResult) ExtractInto(v interface{}) error
type SecurityGroupActionResult ¶
type SecurityGroupActionResult struct {
gcorecloud.ErrResult
}
SecurityGroupActionResult represents the result of a actions operation(no content)
func AssignSecurityGroup ¶
func AssignSecurityGroup(client *gcorecloud.ServiceClient, id string, opts SecurityGroupOptsBuilder) (r SecurityGroupActionResult)
AssignSecurityGroup adds a security groups to the instance.
func UnAssignSecurityGroup ¶
func UnAssignSecurityGroup(client *gcorecloud.ServiceClient, id string, opts SecurityGroupOptsBuilder) (r SecurityGroupActionResult)
UnAssignSecurityGroup removes a security groups from the instance.
type SecurityGroupOpts ¶
type SecurityGroupOpts struct {
Name string `json:"name,omitempty"`
PortsSecurityGroupNames []PortSecurityGroupNames `json:"ports_security_group_names,omitempty"`
}
func (SecurityGroupOpts) ToSecurityGroupActionMap ¶
func (opts SecurityGroupOpts) ToSecurityGroupActionMap() (map[string]interface{}, error)
ToSecurityGroupActionMap builds a request body from SecurityGroupOpts.
type SecurityGroupOptsBuilder ¶
type SecurityGroupOptsBuilder interface {
ToSecurityGroupActionMap() (map[string]interface{}, error)
}
SecurityGroupOptsBuilder allows extensions to add parameters to the security groups request.
type SubPort ¶ added in v0.3.37
type SubPort struct {
PortID string `json:"port_id"`
MacAddress gcorecloud.MAC `json:"mac_address"`
NetworkID string `json:"network_id"`
IPAssignments []PortIP `json:"ip_assignments"`
NetworkDetails NetworkDetail `json:"network_details"`
FloatingIPDetails []FloatingIP `json:"floatingip_details"`
SegmentationID int `json:"segmentation_id"`
SegmentationType string `json:"segmentation_type"`
}
SubPort represent a instance sub port interface
type Subnet ¶
type Subnet struct {
ID string `json:"id"`
Name string `json:"name"`
IPVersion gcorecloud.IPVersion `json:"ip_version"`
EnableDHCP bool `json:"enable_dhcp"`
Cidr gcorecloud.CIDR `json:"cidr"`
CreatedAt gcorecloud.JSONRFC3339Z `json:"created_at"`
UpdatedAt *gcorecloud.JSONRFC3339Z `json:"updated_at"`
NetworkID string `json:"network_id"`
TaskID *string `json:"task_id"`
CreatorTaskID *string `json:"creator_task_id"`
ProjectID int `json:"project_id"`
RegionID int `json:"region_id"`
Region string `json:"region"`
}
Subnet port subnet
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a Instance.
func PowerCycle ¶
func PowerCycle(client *gcorecloud.ServiceClient, id string) (r UpdateResult)
PowerCycle instance.
func Reboot ¶
func Reboot(client *gcorecloud.ServiceClient, id string) (r UpdateResult)
Reboot instance.
func Resume ¶
func Resume(client *gcorecloud.ServiceClient, id string) (r UpdateResult)
Resume instance.
func Start ¶
func Start(client *gcorecloud.ServiceClient, id string) (r UpdateResult)
Start instance.
func Suspend ¶
func Suspend(client *gcorecloud.ServiceClient, id string) (r UpdateResult)
Suspend instance.
func (UpdateResult) Extract ¶
Extract is a function that accepts a result and extracts a instance resource.
func (UpdateResult) ExtractInto ¶
func (r UpdateResult) ExtractInto(v interface{}) error