services

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOpts

type CreateOpts struct {
	// Configuration of domain.
	AdDomain *Domain `json:"ad_domains" required:"true"`
	// VPC ID.
	VpcId string `json:"vpc_id" required:"true"`
	// The network IDs of the service subnet. The subnet cannot conflict with 172.16.0.0/12.
	Subnets []Subnet `json:"subnet_ids" required:"true"`
	// Access mode.
	// + INTERNET: Indicates Internet access.
	// + DEDICATED: Indicates dedicated line access.
	// + BOTH: Indicates that both access methods are supported.
	AccessMode string `json:"access_mode" required:"true"`
	// Enterprise ID.
	// The enterprise ID is the unique identification in the workspace service.
	// If omited, the system will automatically generate an enterprise ID.
	// The ID can contain `1` to `32` characters, only letters, digits, hyphens (-) and underscores (_) are allowed.
	EnterpriseId string `json:"enterprise_id,omitempty"`
	// The CIDR of management subnet.
	// It cannot conflict with 172.16.0.0/12 and the CIDRs of service subnet.
	ManagementSubnetCidr string `json:"manage_subnet_cidr,omitempty"`
	// Dedicated subnet list.
	DedicatedSubnets string `json:"dedicated_subnets,omitempty"`
}

CreateOpts is the structure required by the Create method to subscribe Workspace service.

type CreateResp

type CreateResp struct {
	RequestResp
}

CreateResp 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 subscribe Workspace service using given parameters.

type DeleteResp

type DeleteResp struct {
	RequestResp
}

DeleteResp is the structure that represents the API response of Delete method request.

func Delete

func Delete(c *golangsdk.ServiceClient) (*DeleteResp, error)

Delete is a method to unregistry the Workspace service using given parameters.

type Domain

type Domain struct {
	// Domain type.
	// + LITE_AS: Local authentication.
	// + LOCAL_AD: Local AD.
	// When the domain type is "LOCAL_AD", make sure that the selected VPC network and the network to which AD
	//   belongs can be connected.
	Type string `json:"domain_type" required:"domain_type"`
	// Domain name. It needs to be configured when the domain type is LOCAL_AD.
	// The domain name must be an existing domain name on the AD server, and the length should not exceed 55.
	Name string `json:"domain_name,omitempty"`
	// Domain administrator account. It needs to be configured when the domain type is "LOCAL_AD".
	// It must be an existing domain administrator account on the AD server.
	AdminAccount string `json:"domain_admin_account,omitempty"`
	// Domain administrator account password. It needs to be configured when the domain type is "LOCAL_AD".
	Password string `json:"domain_password,omitempty"`
	// Primary domain controller IP address. It needs to be configured when the domain type is LOCAL_AD.
	ActiveDomainIp string `json:"active_domain_ip,omitempty"`
	// Primary domain controller name. It needs to be configured when the domain type is LOCAL_AD.
	AcitveDomainName string `json:"active_domain_name,omitempty"`
	// The IP address of the standby domain controller.
	// It needs to be configured when the domain type is LOCAL_AD and the standby node is configured.
	StandyDomainIp string `json:"standy_domain_ip,omitempty"`
	// The name of the standby domain controller.
	// It needs to be configured when the domain type is LOCAL_AD and the standby node is configured.
	StandyDomainName string `json:"standy_domain_name,omitempty"`
	// Primary DNS IP address.
	// It needs to be configured when the domain type is LOCAL_AD.
	ActiveDnsIp string `json:"active_dns_ip,omitempty"`
	// Backup DNS IP address.
	// It needs to be configured when the domain type is LOCAL_AD and the standby node is configured.
	StandyDnsIp string `json:"standy_dns_ip,omitempty"`
	// Whether to delete the corresponding computer object on AD while deleting the desktop.
	// + 0 means not delete
	// + 1 means delete.
	DeleteComputerObject *int `json:"delete_computer_object,omitempty"`
	// Whether to enable LDAPS.
	UseLdaps bool `json:"use_idaps,omitempty"`
	// The configuration of TLS.
	TlsConfig *TlsConfig `json:"tls_config,omitempty"`
}

Domain is an object to specified the configuration of AD domain.

type DomainResp

type DomainResp struct {
	// Domain type.
	// + LITE_AS: Local authentication.
	// + LOCAL_AD: Local AD.
	// When the domain type is "LOCAL_AD", make sure that the selected VPC network and the network to which AD
	//   belongs can be connected.
	Type string `json:"domain_type"`
	// Domain name. It needs to be configured when the domain type is LOCAL_AD.
	// The domain name must be an existing domain name on the AD server, and the length should not exceed 55.
	Name string `json:"domain_name"`
	// Domain administrator account. It needs to be configured when the domain type is "LOCAL_AD".
	// It must be an existing domain administrator account on the AD server.
	AdminAccount string `json:"domain_admin_account"`
	// Domain administrator account password. It needs to be configured when the domain type is "LOCAL_AD".
	Password string `json:"domain_password"`
	// Primary domain controller IP address. It needs to be configured when the domain type is LOCAL_AD.
	ActiveDomainIp string `json:"active_domain_ip"`
	// Primary domain controller name. It needs to be configured when the domain type is LOCAL_AD.
	AcitveDomainName string `json:"active_domain_name"`
	// The IP address of the standby domain controller.
	// It needs to be configured when the domain type is LOCAL_AD and the standby node is configured.
	StandyDomainIp string `json:"standy_domain_ip"`
	// The name of the standby domain controller.
	// It needs to be configured when the domain type is LOCAL_AD and the standby node is configured.
	StandyDomainName string `json:"standy_domain_name"`
	// Primary DNS IP address.
	// It needs to be configured when the domain type is LOCAL_AD.
	ActiveDnsIp string `json:"active_dns_ip"`
	// Backup DNS IP address.
	// It needs to be configured when the domain type is LOCAL_AD and the standby node is configured.
	StandyDnsIp string `json:"standy_dns_ip"`
	// Whether to delete the corresponding computer object on AD while deleting the desktop.
	// + 0 means not delete
	// + 1 means delete.
	DeleteComputerObject string `json:"delete_computer_object"`
	// Whether to enable LDAPS.
	UseLdaps bool `json:"use_idaps"`
	// The configuration of TLS.
	TlsConfig TlsConfig `json:"tls_config"`
}

DomainResp is an object to specified the configuration details of AD domain.

type RequestResp

type RequestResp struct {
	JobId string `json:"job_id"`
}

RequestResp is the structure that represents the API response of service methods request.

type SecurityGroup

type SecurityGroup struct {
	// Security Group ID.
	ID string `json:"id"`
	// Security Group name.
	Name string `json:"name"`
}

SecurityGroup is an object to specified the security group that service have.

type Service

type Service struct {
	// Workspace service ID.
	ID string `json:"id"`
	// Domain information.
	AdDomain DomainResp `json:"ad_domains"`
	// VPC ID.
	VpcId string `json:"vpc_id"`
	// VPC name.
	VpcName string `json:"vpc_name"`
	// Access mode.
	// + INTERNET: Indicates Internet access.
	// + DEDICATED: Indicates dedicated line access.
	// + BOTH: Indicates that both access methods are supported.
	AccessMode string `json:"access_mode"`
	// Dedicated access network segment.
	// This parameter is returned only when the access_mode is "DEDICATED" or "BOTH".
	DedicatedSubnets string `json:"dedicated_subnets"`
	// Dedicated access address
	// This parameter is returned only when the access_mode is "DEDICATED" or "BOTH".
	DedicatedAccessAddress string `json:"dedicated_access_address"`
	// Internet access address.
	// This parameter is returned only when the access_mode is "INTERNET" or "BOTH".
	InternetAccessAddress string `json:"internet_access_address"`
	// Internet access port.
	InternetAccessPort string `json:"internet_access_port"`
	// Status of cloud office services.
	// + PREPARING: ready to open.
	// + SUBSCRIBING: Subscription is in progress.
	// + SUBSCRIBED: subscribed.
	// + SUBSCRIPTION_FAILED: Subscription failed.
	// + DEREGISTERING: The account is being sold out.
	// + DEREGISTRATION_FAILED: Account cancellation failed.
	// + CLOSED: The account that has been closed has not been opened.
	Status string `json:"status"`
	// The status of the Internet and private line switching tasks.
	// + init: Initialization - the initial state after the service is activated.
	// + available: Available - The normal state where the task was executed and returned after success.
	// + internetOpening: On - Internet Access is on.
	// + dedicatedOpening: Open - Dedicated line access is open.
	// + internetOpenFailed: Failed to open - Open internet access failed to open.
	// + dedicatedOpenFailed: Failed to open - Dedicated line access failed to open.
	// + openSuccess: Open successfully - Internet access is successfully opened.
	// + internetClosing: Closing - Closing Internet access is closing.
	// + dedicatedClosing: Closing - Dedicated line access is closed.
	// + internetCloseFailed: Failed to close - Failed to close the internet access method.
	// + dedicatedCloseFailed: Failed to close - Failed to close dedicated line access.
	// + closeSuccess: Close Success - Close the access method successfully.
	// + internetAccessPortModifying: The internet access port is being modified.
	// + internetAccessPortModifyFailed: Port modification failed.
	AccessStatus string `json:"access_status"`
	// Service subnet which to specify the returned network ID to order desktops.
	SubnetIds []Subnet `json:"subnet_ids"`
	// The subnet segment for the management component.
	ManagementSubentCidr string `json:"management_subnet_cidr"`
	// The management component security group automatically created under the specified VPC after the service is enabled.
	InfrastructureSecurityGroup SecurityGroup `json:"infrastructure_security_group"`
	// The desktop security group automatically created under the specified VPC after the service is enabled.
	DesktopSecurityGroup SecurityGroup `json:"desktop_security_group"`
	// Whether the service can be canceled.
	Closable bool `json:"closable"`
	// Configuration status.
	// + 0: The service is successfully activated and the connection to AD is successful.
	// + 1: The service is successfully activated, but the AD configuration fails.
	// + 2: The service is successfully activated, but there are other errors after the AD configuration fails.
	// + 3: The service is successfully activated, but the AD connection is not enabled.
	ConfigStatus string `json:"config_status"`
	// The progress of service activation or deregistration, in percentage format, for example: 100%.
	Progress string `json:"progress"`
	// The job ID of service activation or deregistration.
	JobId string `json:"job_id"`
	// Failure error code.
	FailCode int `json:"fail_code"`
	// Failure reason.
	FailReason string `json:"fail_reason"`
	// Enterprise ID.
	EnterpriseId string `json:"enterprise_id"`
}

Service is the structure that represents the Workspace service details.

func Get

func Get(c *golangsdk.ServiceClient) (*Service, error)

Get is a method to obtain the Workspace serivce details.

type Subnet

type Subnet struct {
	// The network ID of subnet.
	NetworkId string `json:"subnet_id" required:"true"`
}

Subnet is an object to specified the network configuration of VPC subnet to which the service and desktops belongs.

type TlsConfig

type TlsConfig struct {
	// The pem content, used to update or upload. The query will not return.
	CertPem string `json:"cert_pem,omitempty"`
	// The valid start time of the certificate, please refer to the example "2022-01-25T09:24:27".
	CertStartTime string `json:"cert_start_time,omitempty"`
	// The valid end time of the certificate, please refer to the example 2022-01-25T09:24:27.
	CertEndTime string `json:"cert_end_time,omitempty"`
}

TlsConfig is an object to specified the configuration TLS (SLL) certificate.

type UpdateOpts

type UpdateOpts struct {
	// Configuration of domain.
	AdDomain *Domain `json:"ad_domains,omitempty"`
	// Access mode.
	// + INTERNET: Indicates Internet access.
	// + DEDICATED: Indicates dedicated line access.
	// + BOTH: Indicates that both access methods are supported.
	AccessMode string `json:"access_mode,omitempty"`
	// Dedicated subnet list.
	DedicatedSubnets string `json:"dedicated_subnets,omitempty"`
	// Service subnet which to specify the returned network ID to order desktops.
	Subnets []string `json:"subnet_ids,omitempty"`
	// Internet access port.
	InternetAccessPort string `json:"internet_access_port,omitempty"`
	// Enterprise ID.
	// The enterprise ID is the unique identification in the workspace service.
	// If omited, the system will automatically generate an enterprise ID.
	// The ID can contain `1` to `32` characters, only letters, digits, hyphens (-) and underscores (_) are allowed.
	EnterpriseId string `json:"enterprise_id,omitempty"`
}

UpdateOpts is the structure required by the Update method to change servie configuration.

type UpdateResp

type UpdateResp struct {
	RequestResp
	// Enterprise ID.
	EnterpriseId string `json:"enterprise_id"`
}

UpdateResp is the structure that represents the API response of Update method request.

func Update

func Update(c *golangsdk.ServiceClient, opts UpdateOpts) (*UpdateResp, error)

Update is a method to change service configuration using givin parameters.

Jump to

Keyboard shortcuts

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