Documentation ¶
Index ¶
- func BindEip(c *golangsdk.ServiceClient, opts BindEipOpts) error
- func Delete(c *golangsdk.ServiceClient, desktopId string, opts DeleteOpts) error
- func UnbindEip(c *golangsdk.ServiceClient, opts UnbindEipOpt) error
- type ActionOpts
- type ActionResp
- type AddressInfo
- type BindEipOpts
- type CreateOpts
- type CreateResp
- type DeleteOpts
- type Desktop
- type DesktopConfig
- type DesktopUpdateConfig
- type EipPage
- type EipResp
- type ExpandVolumeConfig
- type ExpandVolumesResp
- type FailedOperationList
- type FlavorInfo
- type FlavorLinkInfo
- type GetResp
- type Job
- type ListEipOpts
- type NetworkInfos
- type NetworkResp
- type NewVolumeConfig
- type NewVolumeOpts
- type NewVolumesResp
- type Nic
- type PortObject
- type ProductInfo
- type ProductUpdateOpts
- type PublicIpInfo
- type RebuildOpts
- type RebuildResp
- type RequestResp
- type SecurityGroup
- type SubnetInfo
- type UnbindEipOpt
- type UpdateNetworkOpts
- type UpdateNetworkResp
- type UpdateResp
- type Volume
- type VolumeExpandOpts
- type VolumeResp
- type VpcInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindEip ¶
func BindEip(c *golangsdk.ServiceClient, opts BindEipOpts) error
BindEip is the method that used to bind EIP to desktop.
func Delete ¶
func Delete(c *golangsdk.ServiceClient, desktopId string, opts DeleteOpts) error
Delete is a method to remove an existing desktop using given parameters, if the user does not have any desktop under it, the user can delete it together with the desktop.
func UnbindEip ¶
func UnbindEip(c *golangsdk.ServiceClient, opts UnbindEipOpt) error
UnbindEip is the method that used to unbind EIP from desktop.
Types ¶
type ActionOpts ¶
type ActionOpts struct { // ID list of workspace desktops that wants to operate. DesktopIds []string `json:"desktop_ids" required:"true"` // The power type of the desktop. The valid values are as follows: // + os-start // + os-stop // + reboot // + os-hibernate OpType string `json:"op_type" requires:"true"` // The operation type. The valid values are as follows: // + SOFT: Normal operation. // + HARD: Forced operation. Type string `json:"type,omitempty"` }
ActionOpts is the structure required by the DoAction method operate the power state of the desktop.
type ActionResp ¶
type ActionResp struct { // Job ID. JobId string `json:"job_id"` // The desktops list of the operation failed. FailedOperationList []FailedOperationList `json:"failed_operation_list"` }
ActionResp is the structure that represents the response of the DoAction method.
func DoAction ¶
func DoAction(client *golangsdk.ServiceClient, opts ActionOpts) (*ActionResp, error)
DoAction is a method that used to operate the power state of the desktop.
type AddressInfo ¶
type AddressInfo struct { // IP address. Address string `json:"addr"` // IP address version. // + 4: IPv4 // + 6: IPv6 Version string `json:"version"` // MAC address. MacAddress string `json:"OS-EXT-IPS-MAC:mac_addr"` // IP address allocation method. // + fixed private IP address. // + floating Floating IP address. Type string `json:"OS-EXT-IPS:type"` }
AddressInfo is an object to specified the IP address details of desktop.
type BindEipOpts ¶
type BindEipOpts struct { // ID list of workspace desktops that wants to apply EIP. DesktopId string `json:"desktop_id" required:"true"` // EIP ID of worksoaces that wants to apply. ID string `json:"eip_id" required:"true"` }
BindEipOpts is the structure that used to bind EIP to desktop.
type CreateOpts ¶
type CreateOpts struct { // Configuration of system volume. RootVolume *Volume `json:"root_volume" required:"true"` // Configuration of desktops. Desktops []DesktopConfig `json:"desktops" required:"true"` // Desktop type. // + DEDICATED: dedicated desktop. DesktopType string `json:"desktop_type" required:"true"` // Product ID of desktop. ProductId string `json:"product_id" required:"true"` // The availability zone where the desktop is located. AvailabilityZone string `json:"availability_zone,omitempty"` // Image type, the default value is private. // + market // + gold // + private ImageType string `json:"image_type,omitempty"` // Image ID. ImageId string `json:"image_id,omitempty"` // Vpc ID, first creation time must be specified. VpcId string `json:"vpc_id,omitempty"` // Whether to send emails to user mailbox during important operations. EmailNotification *bool `json:"email_notification,omitempty"` // Configuration of data volumes. DataVolumes []Volume `json:"data_volumes,omitempty"` // NIC information corresponding to the desktop. Nics []Nic `json:"nics,omitempty"` // Configuration of security groups, the default security group (WorkspaceUserSecurityGroup) must be specified. SecurityGroups []SecurityGroup `json:"security_groups,omitempty"` // Specifies the key/value pairs of the desktop. Tags []tags.ResourceTag `json:"tags,omitempty"` // EnterpriseProject ID of desktop EnterpriseProjectId string `json:"enterprise_project_id,omitempty"` }
CreateOpts is the structure required by the Create method to create a new desktop.
type CreateResp ¶
type CreateResp struct {
RequestResp
}
RequestResp is the structure that represents the API response of Create method request.
func Create ¶
func Create(c *golangsdk.ServiceClient, opts CreateOpts) (*CreateResp, error)
Create is a method to create a desktop using given parameters.
type DeleteOpts ¶
type DeleteOpts struct { // Whether to delete user associated with this desktop after deleting it. DeleteUser bool `q:"delete_users"` // Whether to send emails to user mailbox during delete operation. EmailNotification bool `q:"email_notification"` }
DeleteOpts is the structure required by the Delete method to delete an existing desktop.
type Desktop ¶
type Desktop struct { // Desktop ID. ID string `json:"desktop_id"` // Desktop name. Name string `json:"computer_name"` // IP address list of desktop. Addresses map[string][]AddressInfo `json:"addresses"` // IP address list. IpAddresses []string `json:"ip_addresses"` // Desktop type. Type string `json:"desktop_type"` // Desktop metadata. // + charging_mode: charging information, 1 means prePaid, 0 means postPaid. // + image_name: image name. // + metering.image_id: image ID. // + metering.resourcespeccode: resource specification code. // + metering.resourcetype: resource type. // + os_bit: operation system bit: 32 or 64. // + os_type: operation system type. // + desktop_os_version: operation system version. Metadata map[string]string `json:"metadata"` // Product information. Flavor FlavorInfo `json:"flavor"` // Desktop status. Status string `json:"status"` // Task status of desktop. // + scheduling: Creating and scheduling. // + block_device_mapping: In the process of being created, the disk is being prepared. // + networking: Creating, preparing for networking. // + spawning: Creating, creating internally. // + rebooting: rebooting. // + reboot_pending: Rebooting, the reboot is being issued. // + reboot_started: Rebooting, start internal reboot. // + rebooting_hard: Forced rebooting. // + reboot_pending_hard: A reboot is being issued during a forced reboot. // + reboot_started_hard: During a forced reboot, the internal reboot is started. // + rebuilding: rebuilding. // + rebuild_block_device_mapping: Rebuilding, preparing disk. // + rebuild_spawning: Rebuilding, rebuilding internally. // + migrating: Live migration is in progress. // + resize_prep: The specification is being adjusted and is in the preparation stage. // + resize_migrating: Adjusting the specification, in the migrating stage. // + resize_migrated: In adjusting the specification, the migration has been completed. // + resize_finish: Resize specification, resize is being completed. // + resize_reverting: In the resize specification, the resize is being rolled back. // + powering-off: Stopping. // + powering-on: Starting. // + deleting: Deleting. // + deleteFailed: Delete failed. TaskStatus string `json:"task_status"` // The time that the desktop was created. CreatedAt string `json:"created"` // Configuration of security groups SecurityGroups []SecurityGroup `json:"security_groups"` // The login status of the desktop. // + UNREGISTER: Indicates the state when the desktop is not registered (after the desktop is started, it will be // automatically registered). The unregistered state also appears after shutdown. // + REGISTERED: After the desktop is registered, it is waiting for the user to connect. // + CONNECTED: Indicates that the user has successfully logged in and is using the desktop. // + DISCONNECTED: Indicates the state displayed after the session is disconnected from the desktop and the client, // which may be caused by closing the client window or disconnecting the client from the desktop network. LoginStatus string `json:"login_status"` // User name. UserName string `json:"user_name"` // Product ID. ProductId string `json:"product_id"` // Configuration of root volume. RootVolume VolumeResp `json:"root_volume"` // Configuration of data volumes. DataVolumes []VolumeResp `json:"data_volumes"` // User group. UserGroup string `json:"user_group"` // Availability zone where the desktop is located. AvailabilityZone string `json:"availability_zone"` // Product information. Product ProductInfo `json:"product"` // OU name. OuName string `json:"ou_name"` // OS version. OsVersion string `json:"os_version"` // SID. SID string `json:"sid"` // Order ID. OrderId string `json:"order_id"` // The key/value pairs of the desktop. Tags []tags.ResourceTag `json:"tags"` // EnterpriseProject ID of desktop EnterpriseProjectId string `json:"enterprise_project_id"` }
Desktop is the structure that represents the desktop detail.
type DesktopConfig ¶
type DesktopConfig struct { // User name. UserName string `json:"user_name" required:"true"` // User email. UserEmail string `json:"user_email" required:"true"` // User group. UserGroup string `json:"user_group,omitempty"` // Desktop name. DesktopName string `json:"computer_name,omitempty"` // Name prefix of desktop. DesktopNamePrefix string `json:"desktop_name_prefix"` }
DesktopConfig is an object to specified the basic configuration of desktop.
type DesktopUpdateConfig ¶
type DesktopUpdateConfig struct { // Desktop ID. DesktopId string `json:"desktop_id"` }
DesktopUpdateConfig is an object to specified the update configuration of desktop.
type EipPage ¶
type EipPage struct {
pagination.OffsetPageBase
}
EipPage is a single page maximum result representing a query by offset page.
type EipResp ¶
type EipResp struct { // EIP ID. ID string `json:"id"` // + bandwidth: billed by bandwidth // + traffic: billed by traffic // Defaults to bandwidth. ChargeMode string `json:"eip_charge_mode"` // address of EIP Address string `json:"address"` // bandwidth size of EIP BandWidthSize int `json:"bandwidth_size"` // creation time, in UTC format: yyyy-MM-ddTHH:mm:ss. CreateAt string `json:"create_time"` // Desktop id of binded. AttachedDesktopId string `json:"attached_desktop_id"` // Desktop name of binded. AttachedDesktopName string `json:"attached_desktop_name"` // EnterpriseProject ID of desktop EnterpriseProjectId string `json:"enterprise_project_id"` }
EipResp is the structure that represents the bind information between EIP and desktop.
func ExtractEips ¶
func ExtractEips(r pagination.Page) ([]EipResp, error)
ExtractEips is a method to extract the list of EIP information.
type ExpandVolumeConfig ¶
type ExpandVolumeConfig struct { // The desktop ID to which the volume belongs. DesktopId string `json:"desktop_id,omitempty"` // Volume ID. VolumeId string `json:"volume_id,omitempty"` // The size of the disk after resizing, in GB. // For root volume, the valid value is range from 80 to 1020. // For data volume, the valid value is range from 10 to 8200. NewSize int `json:"new_size,omitempty"` }
ExpandVolumeConfig is an object to specified the volume configuration.
type ExpandVolumesResp ¶
type ExpandVolumesResp struct {
RequestResp
}
ExpandVolumesResp is the structure that represents the API response of ExpandVolumes method request.
func ExpandVolumes ¶
func ExpandVolumes(c *golangsdk.ServiceClient, opts VolumeExpandOpts) (*ExpandVolumesResp, error)
ExpandVolumes is a method to batch expand the desktop volumes size.
type FailedOperationList ¶
type FailedOperationList struct { // Desktop ID. DesktopId string `json:"desktop_id"` // Desktop name. DesktopName string `json:"desktop_name"` // Error Code. ErrorCode string `json:"error_code"` // Error message. ErrorMsg string `json:"error_msg"` }
FailedOperationList is the structure that represents the desktops list of the operation failed.
type FlavorInfo ¶
type FlavorInfo struct { // Flavor ID. ID string `json:"id"` // Shortcut link information of relevant tags for the corresponding specifications of the desktop. Links []FlavorLinkInfo `json:"links"` }
FlavorInfo is an object to specified the flavor details of desktop.
type FlavorLinkInfo ¶
type FlavorLinkInfo struct { // Name of the shortcut link. Rel string `json:"rel"` // Address of the shortcut link. Hrel string `json:"hrel"` }
FlavorLinkInfo is an object to specified the shortcut link information.
type GetResp ¶
type GetResp struct { // Desktop details. Desktop Desktop `json:"desktop"` }
GetResp is the structure that represents the API response of Get method request.
type Job ¶
type Job struct { // Desktop ID. DesktopId string `json:"desktop_id"` // Job ID. ID string `json:"job_id"` }
Job is an object to specified the operation detail of desktop.
func UpdateProduct ¶
func UpdateProduct(c *golangsdk.ServiceClient, opts ProductUpdateOpts) ([]Job, error)
UpdateProduct is a method to create a desktop using given parameters.
type ListEipOpts ¶
type ListEipOpts struct { // EnterpriseProject ID of desktop. EnterpriseProjectId string `q:"enterprise_project_id"` // Desktop ID. DesktopId string `q:"desktop_id"` // Desktop name. DesktopName string `q:"desktop_name"` // User name. UserName string `q:"user_name"` // EIP address. Address string `q:"address"` // Offset from which the query starts. // The starting record sequence number of the query starts from 0. Offset int `q:"offset"` // Number of items displayed on each page. // If not specified, all matching records are returned. Limit int `q:"limit"` // EIP binding status. // + bind: binded EIP // + unbind: unbinded EIP State string `q:"state"` }
ListEipOpts is the structure that used to query the bound desktop and unbound EIPs.
type NetworkInfos ¶
type NetworkInfos struct { // Configured VPC information. Vpc VpcInfo `json:"vpc_info"` // Configured subnet information. Subnet SubnetInfo `json:"subnet_info"` // Configured port information. PortInfo PortObject `json:"port_info"` // Configured Elastic IP information. PublicIp PublicIpInfo `json:"public_ip_info"` // Configured security groups information. SecurityGroups []SecurityGroup `json:"security_groups"` }
NetworkInfos is the structure that represents the desktop network details.
func GetNetwork ¶
func GetNetwork(c *golangsdk.ServiceClient, desktopId string) ([]NetworkInfos, error)
GetNetwork is the method that used to query desktop network infomation.
type NetworkResp ¶
type NetworkResp struct { // Desktop name. Name string `json:"computer_name"` // Desktop id. DesktopId string `json:"computer_id"` // Error message. Network []NetworkInfos `json:"network_infos"` }
NetworkResp is the structure that represents the queried desktop network detail.
type NewVolumeConfig ¶
type NewVolumeConfig struct { // The desktop ID to which the volume belongs. DesktopId string `json:"desktop_id,omitempty"` //Configuration of data volumes. Volumes []Volume `json:"volumes,omitempty"` }
NewVolumeConfig is an object to specified the volume configuration.
type NewVolumeOpts ¶
type NewVolumeOpts struct { // New volumes parameters. VolumeConfigs []NewVolumeConfig `json:"addDesktopVolumesReq,omitempty"` }
NewVolumeOpts is the structure required by the NewVolumes method to add some volumes to the desktop.
type NewVolumesResp ¶
type NewVolumesResp struct {
RequestResp
}
NewVolumesResp is the structure that represents the API response of NewVolumes method request.
func NewVolumes ¶
func NewVolumes(c *golangsdk.ServiceClient, opts NewVolumeOpts) (*NewVolumesResp, error)
NewVolumes is a method to add some new volumes to the desktop.
type Nic ¶
type Nic struct { // Network ID. NetworkId string `json:"subnet_id" required:"true"` }
Nic is an object to specified the NIC information corresponding to the desktop.
type PortObject ¶
type PortObject struct { // ID of Private ip . ID string `json:"id"` // Address of Private ip. Address string `json:"ip_address"` }
PortObject is an object to specified the private IP detail of desktop.
type ProductInfo ¶
type ProductInfo struct { // Product ID. ID string `json:"product_id"` // Flavor ID. FlavorId string `json:"flavor_id"` // Product type. Type string `json:"type"` // CPU number. CPU string `json:"cpu"` // Memory size. Memory string `json:"memory"` // Product description. Description string `json:"description"` // Charging info. ChargingMode string `json:"charge_mode"` }
ProductInfo is an object to specified the product details.
type ProductUpdateOpts ¶
type ProductUpdateOpts struct { // Batch create configuration of desktop list. Desktops []DesktopUpdateConfig `json:"desktops" required:"true"` // Product ID. ProductId string `json:"product_id" required:"true"` // Whether the product ID can be changed when the desktop is powered on. Mode string `json:"mode" required:"true"` }
ProductUpdateOpts is the structure required by the UpdateProduct method to change the desktop product.
type PublicIpInfo ¶
type PublicIpInfo struct { // ID of elastic IP. ID string `json:"id"` // Address of elastic IP. Address string `json:"public_ip_address"` }
PublicIpInfo is an object to specified the elastic IP detail of desktop.
type RebuildOpts ¶
type RebuildOpts struct { // ID list of workspace desktops that wants to rebuild. DesktopIds []string `json:"desktop_ids" required:"true"` // New image type. ImageType string `json:"image_type" required:"true"` // New image ID. ImageId string `json:"image_id" required:"true"` // New OS type. OsType string `json:"os_type,omitempty"` // Delay time. DelayTime string `json:"delay_time,omitempty"` // Rebuild message send to the users. Message string `json:"message,omitempty"` // Enterprise project ID. EnterpriseProjectId string `json:"enterprise_project_id,omitempty"` }
RebuildOpts is the structure that used to modify desktop image and os.
type RebuildResp ¶
type RebuildResp struct { // Job ID. JobId string `json:"job_id"` // Error Code. ErrorCode string `json:"error_code"` // Error message. ErrorMsg string `json:"error_msg"` }
RebuildResp is the structure that represents the response of the Rebuild method.
func Rebuild ¶
func Rebuild(c *golangsdk.ServiceClient, opts RebuildOpts) (*RebuildResp, error)
Rebuild is the method that used to modify desktop using given parameters.
type RequestResp ¶
type RequestResp struct { // Job ID. JobId string `json:"job_id"` }
RequestResp is the structure that represents the API response of desktop methods request.
type SecurityGroup ¶
type SecurityGroup struct {
ID string `json:"id" required:"true"`
}
SecurityGroup is an object to specified the security group to which the desktop belongs.
type SubnetInfo ¶
type SubnetInfo struct { // The subnet ID to which the desktop belongs. ID string `json:"id"` // The subnet name to which the desktop belongs. Name string `json:"name"` // The subnet segment to which the desktop belongs. Cidr string `json:"cidr"` }
SubnetInfo is an object to specified the subnet detail of desktop.
type UnbindEipOpt ¶
type UnbindEipOpt struct { // Desktop ID of the EIP want to be unbind. DesktopIds []string `json:"desktop_ids" required:"true"` }
UnbindEipOpt is the structure that used to unbind EIP from desktop.
type UpdateNetworkOpts ¶
type UpdateNetworkOpts struct { DesktopId string `json:"-"` // The ID of the vpc to be change. VpcId string `json:"vpc_id" required:"true"` // The ID of the subnet to be change. SubnetId string `json:"subnet_id" required:"true"` // ID list of security group. SecurityGroupIds []string `json:"security_group_ids" required:"true"` // Specifies a private ID address. PrivateId string `json:"private_ip,omitempty"` }
UpdateNetworkOpts is the structure that used to modify desktop network.
type UpdateNetworkResp ¶
type UpdateNetworkResp struct { // Job ID. JobId string `json:"job_id"` // Error Code. ErrorCode string `json:"error_code"` // Error message. ErrorMsg string `json:"error_msg"` }
UpdateNetworkResp is the structure that represents the response of the update network infomation method.
func UpdateNetwork ¶
func UpdateNetwork(c *golangsdk.ServiceClient, opts UpdateNetworkOpts) (*UpdateNetworkResp, error)
UpdateNetwork is the method that used to modify desktop network infomation using given parameters.
type UpdateResp ¶
type UpdateResp struct { // Job list. Jobs []Job `json:"jobs"` }
UpdateResp is the structure that represents the API response of UpdateProduct method request.
type Volume ¶
type Volume struct { // Volume type. // + **SAS**: High I/O disk type. // + **SSD**: Ultra-high I/O disk type. Type string `json:"type" required:"true"` // Volume size. // For root volume, the valid value is range from 80 to 1020. // For data volume, the valid value is range from 10 to 8200. Size int `json:"size" required:"true"` }
Volume is an object to specified the disk configuration of root volume or data volume.
type VolumeExpandOpts ¶
type VolumeExpandOpts struct { // Volumes expansion parameters. VolumeConfigs []ExpandVolumeConfig `json:"expandVolumesReq,omitempty"` }
VolumeExpandOpts is the structure required by the ExpandVolumes method to batch expand volumes size.
type VolumeResp ¶
type VolumeResp struct { // Volume type. Type string `json:"type"` // Volume size. Size int `json:"size"` // The device name to which the volume is attached. Device string `json:"device"` // Unique ID of volume map. ID string `json:"id"` // volume ID. VolumeId string `json:"volume_id"` // The time that the volume was created. CreatedAt string `json:"create_time"` // Volume name. Name string `json:"display_name"` }
VolumeResp is an object to specified the volume details of root volume or data volume.
type VpcInfo ¶
type VpcInfo struct { // The VPC ID to which the desktop belongs. ID string `json:"id"` // The VPC name to which the desktop belongs. Name string `json:"name"` // The VPC segment to which the desktop belongs. Cidr string `json:"cidr"` }
VpcInfo is an object to specified the VPC detail of desktop.