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 DeleteOpts
- type Eip
- type Fault
- type Flavor
- type GetResult
- type Image
- type JobEntity
- type JobResponse
- type JobResult
- type JobStatus
- type ListOpts
- type ListOptsBuilder
- type MetaData
- type Metadata
- type Nic
- type OrderResponse
- type OrderResult
- type OsSchedulerHints
- type PublicIp
- type SecurityGroup
- type SecurityGroups
- type Server
- type ServerExtendParam
- type SubJob
- type SysTags
- type UpdateResult
- type VolumeAttached
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetJobEntity ¶
func WaitForJobSuccess ¶
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"` UserData []byte `json:"-"` AdminPass string `json:"admin_password,omitempty"` KeyName string `json:"key_name,omitempty"` SecurityGroups []SecurityGroup `json:"security_groups"` 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"` DataVolumes []DataVolume `json:"data_volumes,omitempty"` ExtendParam ServerExtendParam `json:"extendparam,omitempty"` Tags []interface{} `json:"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 DeleteOpts ¶
type DeleteOpts struct { Servers []Server `json:"servers" required:"true"` DeletePublicIp bool `json:"delete_publicip"` DeleteVolume bool `json:"delete_volume"` }
func (DeleteOpts) ToServerDeleteMap ¶
func (opts DeleteOpts) ToServerDeleteMap() (map[string]interface{}, error)
ToServerDeleteMap assembles a request body based on the contents of a DeleteOpts.
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(client *golangsdk.ServiceClient, id string, opts ListOptsBuilder) (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 ¶
type JobResult struct {
golangsdk.Result
}
func Create ¶
func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r JobResult)
CreatePrePaid requests a server to be provisioned to the user in the current tenant.
func Delete ¶
func Delete(client *golangsdk.ServiceClient, opts DeleteOpts) (r 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 ListOpts ¶
type ListOpts struct { // Name of the server as a string; can be queried with regular expressions. // Realize that ?name=bob returns both bob and bobb. If you need to match bob // only, you can use a regular expression matching the syntax of the // underlying database server implemented for Compute. Name string `q:"name"` // Status is the value of the status of the server so that you can filter on // "ACTIVE" for example. Status string `q:"status"` // Specifies the BMS' id. ID string `q:"id"` // Specifies the BMS' tags. Tags string `q:"tags"` // Expected field to be returned. ExpectFields string `q:"expect_fields"` // Specifies the BMS that is bound to an enterprise project. EnterpriseProjectID string `q:"enterprise_project_id"` // Specifies the maximum number of ECSs on one page. // Each page contains 25 BMSs by default, and a maximum of 1000 BMSs are returned. Limit int `q:"limit"` // Specifies a page number. The default value is 1. // The value must be greater than or equal to 0. If the value is 0, the first page is displayed. Offset int `q:"offset"` }
ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the server attributes you want to see returned. Marker and Limit are used for pagination.
func (ListOpts) ToServerListQuery ¶
ToServerListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request.
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 ¶
type OrderResult struct {
golangsdk.Result
}
func (OrderResult) ExtractOrderResponse ¶
func (r OrderResult) ExtractOrderResponse() (*OrderResponse, error)
type OsSchedulerHints ¶
type OsSchedulerHints struct {
DecBaremetal []string `json:"dec_baremetal"`
}
type SecurityGroup ¶
type SecurityGroup struct {
ID string `json:"id" required:"true"`
}
type SecurityGroups ¶
type ServerExtendParam ¶
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 UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
func (UpdateResult) Extract ¶
func (r UpdateResult) Extract() (*CloudServer, error)