desktops

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

Types

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 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"`
}

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"`
}

Desktop is the structure that represents the desktop detail.

func Get

func Get(c *golangsdk.ServiceClient, desktopId string) (*Desktop, error)

Get is a method to obtain the desktop detail by its ID.

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 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 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 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 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 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 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.

Jump to

Keyboard shortcuts

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