Documentation
¶
Index ¶
- func GetJobEntity(client *golangsdk.ServiceClient, jobID string, label string) (interface{}, error)
- func WaitForJobSuccess(client *golangsdk.ServiceClient, secs int, jobID string) error
- type Address
- type BandWidth
- type CloudServer
- type CreateOpts
- type CreateOptsBuilder
- type DataVolume
- type Eip
- type EipExtendParam
- type Fault
- type Flavor
- type GetResult
- type Image
- type JobEntity
- type JobResponse
- type JobResult
- type JobStatus
- type MetaData
- type Metadata
- type Nic
- type OrderResponse
- type OrderResult
- type OsSchedulerHints
- type PublicIp
- type RootVolume
- type SchedulerHints
- type SecurityGroup
- type SecurityGroups
- type ServerExtendParam
- type SubJob
- type SysTags
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
- type VolumeAttached
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetJobEntity ¶
func GetJobEntity(client *golangsdk.ServiceClient, jobID string, label string) (interface{}, error)
func WaitForJobSuccess ¶
func WaitForJobSuccess(client *golangsdk.ServiceClient, secs int, jobID string) error
Types ¶
type CloudServer ¶
type CloudServer struct { ID string `json:"id"` UserID string `json:"user_id"` Name string `json:"name"` TenantID string `json:"tenant_id"` HostID string `json:"hostId"` Addresses map[string][]Address `json:"addresses"` KeyName string `json:"key_name"` Image Image `json:"image"` Flavor Flavor `json:"flavor"` SecurityGroups []SecurityGroups `json:"security_groups"` AccessIPv4 string `json:"accessIPv4"` AccessIPv6 string `json:"accessIPv6"` Status string `json:"status"` Progress *int `json:"progress"` ConfigDrive string `json:"config_drive"` Metadata Metadata `json:"metadata"` TaskState string `json:"OS-EXT-STS:task_state"` VMState string `json:"OS-EXT-STS:vm_state"` Host string `json:"OS-EXT-SRV-ATTR:host"` InstanceName string `json:"OS-EXT-SRV-ATTR:instance_name"` PowerState *int `json:"OS-EXT-STS:power_state"` HypervisorHostname string `json:"OS-EXT-SRV-ATTR:hypervisor_hostname"` AvailabilityZone string `json:"OS-EXT-AZ:availability_zone"` DiskConfig string `json:"OS-DCF:diskConfig"` Fault Fault `json:"fault"` VolumeAttached []VolumeAttached `json:"os-extended-volumes:volumes_attached"` Description string `json:"description"` HostStatus string `json:"host_status"` Hostname string `json:"OS-EXT-SRV-ATTR:hostname"` ReservationID string `json:"OS-EXT-SRV-ATTR:reservation_id"` LaunchIndex *int `json:"OS-EXT-SRV-ATTR:launch_index"` KernelID string `json:"OS-EXT-SRV-ATTR:kernel_id"` RamdiskID string `json:"OS-EXT-SRV-ATTR:ramdisk_id"` RootDeviceName string `json:"OS-EXT-SRV-ATTR:root_device_name"` UserData string `json:"OS-EXT-SRV-ATTR:user_data"` Locked *bool `json:"locked"` Tags []string `json:"tags"` OsSchedulerHints OsSchedulerHints `json:"os:scheduler_hints"` EnterpriseProjectID string `json:"enterprise_project_id"` SysTags []SysTags `json:"sys_tags"` }
CloudServer is only used for method that requests details on a single server, by ID. Because metadata struct must be a map.
type CreateOpts ¶
type CreateOpts struct { ImageRef string `json:"imageRef" required:"true"` FlavorRef string `json:"flavorRef" required:"true"` Name string `json:"name" required:"true"` MetaData MetaData `json:"metadata" required:"true"` UserData []byte `json:"-"` AdminPass string `json:"adminPass,omitempty"` KeyName string `json:"key_name,omitempty"` SecurityGroups []SecurityGroup `json:"security_groups,omitempty"` Nics []Nic `json:"nics" required:"true"` AvailabilityZone string `json:"availability_zone" required:"true"` VpcId string `json:"vpcid" required:"true"` PublicIp *PublicIp `json:"publicip,omitempty"` Count int `json:"count,omitempty"` RootVolume *RootVolume `json:"root_volume,omitempty"` DataVolumes []DataVolume `json:"data_volumes,omitempty"` ExtendParam ServerExtendParam `json:"extendparam" required:"true"` SchedulerHints *SchedulerHints `json:"os:scheduler_hints,omitempty"` ServerTags []tags.ResourceTag `json:"server_tags,omitempty"` }
func (CreateOpts) ToServerCreateMap ¶
func (opts CreateOpts) ToServerCreateMap() (map[string]interface{}, error)
ToServerCreateMap assembles a request body based on the contents of a CreateOpts.
type CreateOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type DataVolume ¶
type Eip ¶
type Eip struct { IpType string `json:"iptype" required:"true"` BandWidth BandWidth `json:"bandwidth" required:"true"` ExtendParam EipExtendParam `json:"extendparam" required:"true"` }
type EipExtendParam ¶
type EipExtendParam struct {
ChargingMode string `json:"chargingMode" required:"true"`
}
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult is the response from a Get operation. Call its Extract method to interpret it as a Server.
func Get ¶
func Get(c *golangsdk.ServiceClient, id string) (r GetResult)
Get retrieves a particular Server based on its unique ID.
func (GetResult) Extract ¶
func (r GetResult) Extract() (*CloudServer, error)
type Image ¶
type Image struct { ID string `json:"id"` Name string `json:"name"` Type string `json:"__os_type"` }
Image defines a image struct in details of a server.
type JobEntity ¶
type JobEntity struct { // Specifies the number of subtasks. // When no subtask exists, the value of this parameter is 0. SubJobsTotal int `json:"sub_jobs_total"` // Specifies the execution information of a subtask. // When no subtask exists, the value of this parameter is left blank. SubJobs []SubJob `json:"sub_jobs"` }
type JobResponse ¶
type JobResponse struct {
JobID string `json:"job_id"`
}
type JobResult ¶
func (JobResult) ExtractJobResponse ¶
func (r JobResult) ExtractJobResponse() (*JobResponse, error)
func (JobResult) ExtractJobStatus ¶
type JobStatus ¶
type JobStatus struct { Status string `json:"status"` Entities JobEntity `json:"entities"` JobID string `json:"job_id"` JobType string `json:"job_type"` BeginTime string `json:"begin_time"` EndTime string `json:"end_time"` ErrorCode string `json:"error_code"` FailReason string `json:"fail_reason"` }
type Metadata ¶
type Metadata struct { ChargingMode string `json:"charging_mode"` OrderID string `json:"metering.order_id"` ProductID string `json:"metering.product_id"` VpcID string `json:"vpc_id"` ImageID string `json:"metering.image_id"` Imagetype string `json:"metering.imagetype"` PortList string `json:"baremetalPortIDList"` Resourcespeccode string `json:"metering.resourcespeccode"` ResourceType string `json:"metering.resourcetype"` ImageName string `json:"image_name"` OpSvcUserId string `json:"op_svc_userid"` OsType string `json:"os_type"` BmsSupportEvs string `json:"__bms_support_evs"` OsBit string `json:"os_bit"` }
Metadata is only used for method that requests details on a single server, by ID. Because metadata struct must be a map.
type OrderResponse ¶
type OrderResult ¶
func CreatePrePaid ¶
func CreatePrePaid(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r OrderResult)
CreatePrePaid requests a server to be provisioned to the user in the current tenant.
func (OrderResult) ExtractOrderResponse ¶
func (r OrderResult) ExtractOrderResponse() (*OrderResponse, error)
type OsSchedulerHints ¶
type OsSchedulerHints struct {
DecBaremetal []string `json:"dec_baremetal"`
}
type RootVolume ¶
type SchedulerHints ¶
type SchedulerHints struct {
DecBaremetal string `json:"dec_baremetal,omitempty"`
}
type SecurityGroup ¶
type SecurityGroup struct {
ID string `json:"id" required:"true"`
}
type SecurityGroups ¶
type ServerExtendParam ¶
type ServerExtendParam struct { ChargingMode string `json:"chargingMode,omitempty"` RegionID string `json:"regionID,omitempty"` PeriodType string `json:"periodType,omitempty"` PeriodNum int `json:"periodNum,omitempty"` IsAutoRenew string `json:"isAutoRenew,omitempty"` IsAutoPay string `json:"isAutoPay,omitempty"` EnterpriseProjectId string `json:"enterprise_project_id,omitempty"` }
type SubJob ¶
type SubJob struct { // Specifies the task ID. Id string `json:"job_id"` // Task type. Type string `json:"job_type"` //Specifies the task status. // SUCCESS: indicates the task is successfully executed. // RUNNING: indicates that the task is in progress. // FAIL: indicates that the task failed. // INIT: indicates that the task is being initialized. Status string `json:"status"` // Specifies the time when the task started. BeginTime string `json:"begin_time"` // Specifies the time when the task finished. EndTime string `json:"end_time"` // Specifies the returned error code when the task execution fails. ErrorCode string `json:"error_code"` // Specifies the cause of the task execution failure. FailReason string `json:"fail_reason"` // Specifies the object of the task. Entities map[string]string `json:"entities"` }
type UpdateOpts ¶
type UpdateOpts struct {
Name string `json:"name,omitempty"`
}
func (UpdateOpts) ToServerUpdateMap ¶
func (opts UpdateOpts) ToServerUpdateMap() (map[string]interface{}, error)
type UpdateOptsBuilder ¶
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
func Update ¶
func Update(client *golangsdk.ServiceClient, id string, ops UpdateOptsBuilder) (r UpdateResult)
func (UpdateResult) Extract ¶
func (r UpdateResult) Extract() (*CloudServer, error)