cloudservers

package
v1.0.26 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create added in v1.0.25

func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (jobId, serverIds string, err error)

Create requests a server to be provisioned to the user in the current tenant.

func ListDetail

func ListDetail(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager

ListDetail makes a request against the API to list servers accessible to you.

Types

type Address

type Address struct {
	Version string `json:"version"`
	Addr    string `json:"addr"`
	MacAddr string `json:"OS-EXT-IPS-MAC:mac_addr"`
	PortID  string `json:"OS-EXT-IPS:port_id"`
	Type    string `json:"OS-EXT-IPS:type"`
}

type BandWidth added in v1.0.25

type BandWidth struct {
	//带宽(Mbit/s),取值范围为[1,300]。
	Size int `json:"size,omitempty"`

	//带宽的共享类型。PER,表示独享,WHOLE,表示共享。
	ShareType string `json:"sharetype" required:"true"`

	//带宽的计费类型。
	ChargeMode string `json:"chargemode,omitempty"`

	//带宽ID,创建WHOLE类型带宽的弹性IP时可以指定之前的共享带宽创建。
	Id string `json:"id,omitempty"`
}

type BatchChangeOpts

type BatchChangeOpts struct {
	AdminPass string    `json:"adminpass,omitempty"`
	KeyName   string    `json:"keyname,omitempty"`
	UserID    string    `json:"userid,omitempty"`
	ImageID   string    `json:"imageid" required:"true"`
	Servers   []Server  `json:"servers" required:"true"`
	MetaData  *MetaData `json:"metadata,omitempty"`
}

BatchChangeOpts defining the configuration to batch change OS of servers

func (BatchChangeOpts) ToServerBatchChangeMap

func (opts BatchChangeOpts) ToServerBatchChangeMap() (map[string]interface{}, error)

ToServerBatchChangeMap builds a request body from BatchChangeOpts.

type BatchChangeOptsBuilder

type BatchChangeOptsBuilder interface {
	// Returns value that can be passed to json.Marshal
	ToServerBatchChangeMap() (map[string]interface{}, error)
}

BatchChangeOptsBuilder allows extensions to add additional parameters to the BatchChangeOpts request.

type BatchChangeResult

type BatchChangeResult struct {
	gophercloud.Result
}

BatchChangeResult defining the result struct of batch change OS function.

func BatchChangeOS

func BatchChangeOS(client *gophercloud.ServiceClient, opts BatchChangeOptsBuilder) (r BatchChangeResult)

BatchChangeOS batch change OS of servers based on the configuration defined in the BatchChangeOpts struct.

func (BatchChangeResult) ExtractJob

func (r BatchChangeResult) ExtractJob() (*Job, error)

ExtractJob defining the result of batch change OS function by extracting job.

type BatchOperateError added in v1.0.19

type BatchOperateError struct {
	BasicError    errorObj      `json:"error"`
	InternalError []internalErr `json:"internalError"`
}

func (BatchOperateError) Error added in v1.0.19

func (e BatchOperateError) Error() string

Error,Implement the Error() interface.

func (BatchOperateError) ErrorCode added in v1.0.19

func (e BatchOperateError) ErrorCode() string

ErrorCode,Error code converted to string type.

func (BatchOperateError) Message added in v1.0.19

func (e BatchOperateError) Message() string

Message,Return error message.

type BatchRebootOpts added in v1.0.19

type BatchRebootOpts struct {
	// Type is the type of reboot to perform on the server.
	Type    Type     `json:"type" required:"true"`
	Servers []Server `json:"servers" required:"true"`
}

BatchRebootOpts defining the configuration to batch reboot servers

func (BatchRebootOpts) ToServerBatchRebootMap added in v1.0.19

func (opts BatchRebootOpts) ToServerBatchRebootMap() (map[string]interface{}, error)

ToServerBatchRebootMap builds a request body from BatchRebootOpts.

type BatchRebootOptsBuilder added in v1.0.19

type BatchRebootOptsBuilder interface {
	// Returns value that can be passed to json.Marshal
	ToServerBatchRebootMap() (map[string]interface{}, error)
}

BatchRebootOptsBuilder allows extensions to add additional parameters to the BatchRebootOpts request.

type BatchStartOpts added in v1.0.19

type BatchStartOpts struct {
	Servers []Server `json:"servers" required:"true"`
}

BatchStartOpts defining the configuration to batch start servers

func (BatchStartOpts) ToServerBatchStartMap added in v1.0.19

func (opts BatchStartOpts) ToServerBatchStartMap() (map[string]interface{}, error)

ToServerBatchStartMap builds a request body from BatchStartOpts.

type BatchStartOptsBuilder added in v1.0.19

type BatchStartOptsBuilder interface {
	// Returns value that can be passed to json.Marshal
	ToServerBatchStartMap() (map[string]interface{}, error)
}

BatchStartOptsBuilder allows extensions to add additional parameters to the BatchStartOpts request.

type BatchStopOpts added in v1.0.19

type BatchStopOpts struct {
	// Type is the type of stop to perform on the server.
	Type    Type     `json:"type,omitempty"`
	Servers []Server `json:"servers" required:"true"`
}

BatchStopOpts defining the configuration to batch stop servers

func (BatchStopOpts) ToServerBatchStopMap added in v1.0.19

func (opts BatchStopOpts) ToServerBatchStopMap() (map[string]interface{}, error)

ToServerBatchStopMap builds a request body from BatchStopOpts.

type BatchStopOptsBuilder added in v1.0.19

type BatchStopOptsBuilder interface {
	// Returns value that can be passed to json.Marshal
	ToServerBatchStopMap() (map[string]interface{}, error)
}

BatchStopOptsBuilder allows extensions to add additional parameters to the BatchStopOpts request.

type BatchTagCreateOpts added in v1.0.19

type BatchTagCreateOpts struct {
	Tags []TagCreate `json:"tags" required:"true"`
}

BatchTagCreateOpts defining the configuration for batch server tags action

func (BatchTagCreateOpts) ToTagBatchCreateMap added in v1.0.19

func (opts BatchTagCreateOpts) ToTagBatchCreateMap() (map[string]interface{}, error)

ToTagBatchCreateMap builds a request body from BatchTagActionOpts.

type BatchTagCreateOptsBuilder added in v1.0.19

type BatchTagCreateOptsBuilder interface {
	// Returns value that can be passed to json.Marshal
	ToTagBatchCreateMap() (map[string]interface{}, error)
}

BatchTagCreateOptsBuilder allows extensions to add additional parameters to the BatchTagActionOpts request.

type BatchTagDeleteOpts added in v1.0.19

type BatchTagDeleteOpts struct {
	Tags []TagDelete `json:"tags" required:"true"`
}

BatchTagDeleteOpts defining the configuration for batch server tags action

func (BatchTagDeleteOpts) ToTagBatchDeleteMap added in v1.0.19

func (opts BatchTagDeleteOpts) ToTagBatchDeleteMap() (map[string]interface{}, error)

ToTagBatchDeleteMap builds a request body from BatchTagActionOpts.

type BatchTagDeleteOptsBuilder added in v1.0.19

type BatchTagDeleteOptsBuilder interface {
	// Returns value that can be passed to json.Marshal
	ToTagBatchDeleteMap() (map[string]interface{}, error)
}

BatchTagDeleteOptsBuilder allows extensions to add additional parameters to the BatchTagActionOpts request.

type BatchUpdateOpts added in v1.0.19

type BatchUpdateOpts struct {
	Name    string   `json:"name" required:"true"`
	DryRun  bool     `json:"dry_run,omitempty"`
	Servers []Server `json:"servers" required:"true"`
}

BatchUpdateOpts defining the configuration to batch update servers

func (BatchUpdateOpts) ToServerBatchUpdateMap added in v1.0.19

func (opts BatchUpdateOpts) ToServerBatchUpdateMap() (map[string]interface{}, error)

ToServerBatchUpdateMap builds a request body from BatchUpdateOpts.

type BatchUpdateOptsBuilder added in v1.0.19

type BatchUpdateOptsBuilder interface {
	// Returns value that can be passed to json.Marshal
	ToServerBatchUpdateMap() (map[string]interface{}, error)
}

BatchUpdateOptsBuilder allows extensions to add additional parameters to the BatchUpdateOpts request.

type BatchUpdateResp added in v1.0.19

type BatchUpdateResp struct {
	Response []ServerID `json:"response"`
}

BatchUpdateResp defines struct of batch update response.

type BatchUpdateResult added in v1.0.19

type BatchUpdateResult struct {
	gophercloud.Result
}

BatchUpdateResult defining the result struct of batch updating.

func BatchUpdate added in v1.0.19

func BatchUpdate(client *gophercloud.ServiceClient, opts BatchUpdateOpts) (r BatchUpdateResult)

BatchUpdate makes a request against the API to batch update servers.

func (BatchUpdateResult) ExtractBatchUpdate added in v1.0.19

func (r BatchUpdateResult) ExtractBatchUpdate() (BatchUpdateResp, error)

ExtractBatchUpdate defining the result by extracting response.

type CloudServer

type CloudServer struct {
	Status              string               `json:"status"`
	Updated             time.Time            `json:"updated"`
	HostID              string               `json:"hostId"`
	Addresses           map[string][]Address `json:"addresses"`
	ID                  string               `json:"id"`
	Name                string               `json:"name"`
	AccessIPv4          string               `json:"accessIPv4"`
	AccessIPv6          string               `json:"accessIPv6"`
	Created             time.Time            `json:"created"`
	Tags                []string             `json:"tags"`
	Description         string               `json:"description"`
	Locked              *bool                `json:"locked"`
	ConfigDrive         string               `json:"config_drive"`
	TenantID            string               `json:"tenant_id"`
	UserID              string               `json:"user_id"`
	HostStatus          string               `json:"host_status"`
	EnterpriseProjectID string               `json:"enterprise_project_id"`
	SysTags             []SysTags            `json:"sys_tags"`
	Flavor              Flavor               `json:"flavor"`
	Metadata            Metadata             `json:"metadata"`
	SecurityGroups      []SecurityGroups     `json:"security_groups"`
	KeyName             string               `json:"key_name"`
	Image               Image                `json:"image"`
	Progress            *int                 `json:"progress"`
	PowerState          *int                 `json:"OS-EXT-STS:power_state"`
	VMState             string               `json:"OS-EXT-STS:vm_state"`
	TaskState           string               `json:"OS-EXT-STS:task_state"`
	DiskConfig          string               `json:"OS-DCF:diskConfig"`
	AvailabilityZone    string               `json:"OS-EXT-AZ:availability_zone"`
	LaunchedAt          string               `json:"OS-SRV-USG:launched_at"`
	TerminatedAt        string               `json:"OS-SRV-USG:terminated_at"`
	RootDeviceName      string               `json:"OS-EXT-SRV-ATTR:root_device_name"`
	RamdiskID           string               `json:"OS-EXT-SRV-ATTR:ramdisk_id"`
	KernelID            string               `json:"OS-EXT-SRV-ATTR:kernel_id"`
	LaunchIndex         *int                 `json:"OS-EXT-SRV-ATTR:launch_index"`
	ReservationID       string               `json:"OS-EXT-SRV-ATTR:reservation_id"`
	Hostname            string               `json:"OS-EXT-SRV-ATTR:hostname"`
	UserData            string               `json:"OS-EXT-SRV-ATTR:user_data"`
	Host                string               `json:"OS-EXT-SRV-ATTR:host"`
	InstanceName        string               `json:"OS-EXT-SRV-ATTR:instance_name"`
	HypervisorHostname  string               `json:"OS-EXT-SRV-ATTR:hypervisor_hostname"`
	VolumeAttached      []VolumeAttached     `json:"os-extended-volumes:volumes_attached"`
	OsSchedulerHints    OsSchedulerHints     `json:"os:scheduler_hints"`
}

CloudServer is only used for method that requests details on a single server, by ID. Because metadata struct must be a map.

type CloudServerDetail

type CloudServerDetail struct {
	Servers []NewCloudServer `json:"servers"`
	Count   int              `json:"count"`
}

CloudServerDetail defines struct of server detail list result.

func ExtractCloudServers

func ExtractCloudServers(r pagination.Page) (CloudServerDetail, error)

ExtractCloudServers is a function that takes a ListResult and returns the services' information.

type CloudServerPage

type CloudServerPage struct {
	pagination.OffsetPage
}

CloudServerPage is a pagination.Pager that is returned from a call to the List function.

func (CloudServerPage) IsEmpty

func (r CloudServerPage) IsEmpty() (bool, error)

IsEmpty returns true if a ListResult contains no services.

type CreateOpts added in v1.0.25

type CreateOpts struct {
	//待创建云服务器的系统镜像,需要指定已创建镜像的ID。
	ImageRef string `json:"imageRef" required:"true"`

	//待创建云服务器的系统规格的ID。
	FlavorRef string `json:"flavorRef" required:"true"`

	//云服务器名称。
	Name string `json:"name" required:"true"`

	//创建云服务器过程中注入用户数据。支持注入文本、文本文件或gzip文件。更多关于待注入用户数据的信息,请参见用户数据注入。
	UserData []byte `json:"-"`

	// AdminPass sets the root user password. If not set, a randomly-generated
	// password will be created and returned in the response.
	AdminPass string `json:"adminPass,omitempty"`

	//如果需要使用SSH密钥方式登录云服务器,请指定已创建密钥的名称。
	KeyName string `json:"key_name,omitempty"`

	//待创建云服务器所属虚拟私有云(简称VPC),需要指定已创建VPC的ID。
	VpcId string `json:"vpcid" required:"true"`

	//待创建云服务器的网卡信息。
	Nics []Nic `json:"nics" required:"true"`

	//配置云服务器的弹性IP信息,弹性IP有三种配置方式。
	PublicIp *PublicIp `json:"publicip,omitempty"`

	//创建云服务器数量。
	Count int `json:"count,omitempty"`

	//云服务器名称是否允许重名。
	IsAutoRename *bool `json:"isAutoRename,omitempty"`

	//云服务器对应系统盘相关配置。
	RootVolume RootVolume `json:"root_volume" required:"true"`

	//云服务器对应数据盘相关配置。每一个数据结构代表一块待创建的数据盘。
	DataVolumes []DataVolume `json:"data_volumes,omitempty"`

	//云服务器对应安全组信息。
	SecurityGroups []SecurityGroup `json:"security_groups,omitempty"`

	//待创建云服务器所在的可用分区,需要指定可用分区(AZ)的名称。
	AvailabilityZone string `json:"availability_zone"`

	//创建云服务器附加信息。
	ExtendParam *ServerExtendParam `json:"extendparam,omitempty"`

	//创建云服务器元数据。
	MetaData *MetaData `json:"metadata,omitempty"`

	//云服务器调度信息。
	SchedulerHints *SchedulerHints `json:"os:scheduler_hints,omitempty"`

	//弹性云服务器的标签。
	Tags []string `json:"tags,omitempty"`

	//弹性云服务器的标签。
	ServerTags []ServerTags `json:"server_tags,omitempty"`
}

func (CreateOpts) ToServerCreateMap added in v1.0.25

func (opts CreateOpts) ToServerCreateMap() (map[string]interface{}, error)

type CreateOptsBuilder added in v1.0.25

type CreateOptsBuilder interface {
	ToServerCreateMap() (map[string]interface{}, error)
}

type CreateResult added in v1.0.25

type CreateResult struct {
	// contains filtered or unexported fields
}

func (CreateResult) ExtractJob added in v1.0.25

func (r CreateResult) ExtractJob() (Job, error)

func (CreateResult) ExtractServer added in v1.0.25

func (r CreateResult) ExtractServer() (Servers, error)

ExtractServer is used to extract server struct in response

type DataVolume added in v1.0.25

type DataVolume struct {
	//云服务器数据盘对应的磁盘类型,需要与系统所提供的磁盘类型相匹配。
	VolumeType string `json:"volumetype" required:"true"`

	//数据盘大小,容量单位为GB,输入大小范围为[10,32768]。
	Size int `json:"size" required:"true"`

	//创建共享磁盘的信息。
	MultiAttach *bool `json:"multiattach,omitempty"`

	//数据卷是否使用SCSI锁。
	PassThrough *bool `json:"hw:passthrough,omitempty"`

	//磁盘的产品信息。
	Extendparam *VolumeExtendParam `json:"extendparam,omitempty"`
}

type Eip added in v1.0.25

type Eip struct {
	//弹性IP地址类型。
	IpType string `json:"iptype" required:"true"`

	//弹性IP地址带宽参数。
	BandWidth *BandWidth `json:"bandwidth" required:"true"`

	//创建弹性IP的附加信息。
	ExtendParam *EipExtendParam `json:"extendparam,omitempty"`
}

type EipExtendParam added in v1.0.25

type EipExtendParam struct {
	//公网IP的计费模式。prePaid-预付费,即包年包月;postPaid-后付费,即按需付费;
	ChargingMode string `json:"chargingMode,omitempty"`
}

type ErrResult

type ErrResult struct {
	gophercloud.ErrResult
}

func BatchCreateServerTags added in v1.0.19

func BatchCreateServerTags(client *gophercloud.ServiceClient, serverID string, opts BatchTagCreateOptsBuilder) (r ErrResult)

BatchCreateServerTags requests to batch create server tags

func BatchDeleteServerTags added in v1.0.19

func BatchDeleteServerTags(client *gophercloud.ServiceClient, serverID string, opts BatchTagDeleteOptsBuilder) (r ErrResult)

BatchDeleteServerTags requests to batch delete server tags

func ConfigServerRecovery

func ConfigServerRecovery(client *gophercloud.ServiceClient, serverID string, opts string) (r ErrResult)

type Flavor

type Flavor struct {
	Disk  string `json:"disk"`
	Vcpus string `json:"vcpus"`
	RAM   string `json:"ram"`
	ID    string `json:"id"`
	Name  string `json:"name"`
}

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 *gophercloud.ServiceClient, serverID string) (r GetResult)

Get requests details on a single server, by ID.

func (GetResult) Extract

func (r GetResult) Extract() (*CloudServer, error)

type Image

type Image struct {
	ID string `json:"id"`
}

Image defines a image struct in details of a server.

type Job

type Job struct {
	ID string `json:"job_id"`
}

Job defining the struct of job.

type JobResult added in v1.0.19

type JobResult struct {
	gophercloud.Result
}

JobResult defining the result struct of job.

func BatchReboot added in v1.0.19

func BatchReboot(client *gophercloud.ServiceClient, opts BatchRebootOpts) (r JobResult)

BatchReboot makes a request against the API to batch reboot servers.

func BatchStart added in v1.0.19

func BatchStart(client *gophercloud.ServiceClient, opts BatchStartOpts) (r JobResult)

BatchStart makes a request against the API to batch start servers.

func BatchStop added in v1.0.19

func BatchStop(client *gophercloud.ServiceClient, opts BatchStopOpts) (r JobResult)

BatchStop makes a request against the API to batch stop servers.

func (JobResult) ExtractJob added in v1.0.19

func (r JobResult) ExtractJob() (Job, error)

ExtractJob defining the result by extracting job.

type ListOpts

type ListOpts struct {
	// Offset is the current page number.
	Offset int `q:"offset"`

	// Flavor is the ID of the flavor.
	Flavor string `q:"flavor"`

	// Name is the name of the server.
	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"`

	// Limit is an integer value for the limit of values to return.
	Limit int `q:"limit"`

	// Tags is used to filter out the servers with the specified tags
	Tags string `q:"tags"`

	// NotTags queries the cloud server that does not contain this value in the tag field.
	NotTags string `q:"not-tags"`

	// When you create an elastic cloud server in batches, you can specify the returned ID to query the elastic cloud server created in batches.
	ReservationID string `q:"reservation_id"`

	// EnterpriseProjectID specifies the server that is bound to an enterprise project.
	EnterpriseProjectID string `q:"enterprise_project_id"`

	// ipv4 address filtering results
	Ip string `q:"ip"`
}

ListOpts allows the filtering and sorting of collections through the API. Filtering is achieved by passing in struct field values that map to the server attributes you want to see returned.

func (ListOpts) ToServerListDetailQuery

func (opts ListOpts) ToServerListDetailQuery() (string, error)

ToServerListDetailQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToServerListDetailQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

type MetaData

type MetaData struct {
	UserData string `json:"user_data,omitempty"`
}

MetaData defining the metadata configuration in BatchChangeOpts struct.

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"`
	EcmResStatus      string `json:"EcmResStatus"`
	ImageID           string `json:"metering.image_id"`
	Imagetype         string `json:"metering.imagetype"`
	Resourcespeccode  string `json:"metering.resourcespeccode"`
	ImageName         string `json:"image_name"`
	OsBit             string `json:"os_bit"`
	LockCheckEndpoint string `json:"lock_check_endpoint"`
	LockSource        string `json:"lock_source"`
	LockSourceID      string `json:"lock_source_id"`
	LockScene         string `json:"lock_scene"`
	VirtualEnvType    string `json:"virtual_env_type"`
}

Metadata is only used for method that requests details on a single server, by ID. Because metadata struct must be a map.

type NewCloudServer

type NewCloudServer struct {
	CloudServer
	Metadata map[string]string `json:"metadata"`
}

NewCloudServer defines the response from details on a single server, by ID.

type Nic added in v1.0.25

type Nic struct {
	//待创建云服务器的网卡信息。
	SubnetId string `json:"subnet_id" required:"true"`

	//待创建云服务器网卡的IP地址,IPv4格式。
	IpAddress string `json:"ip_address,omitempty"`
}

type OsSchedulerHints

type OsSchedulerHints struct {
	Group []string `json:"group"`
}

type ProjectTagsResult added in v1.0.19

type ProjectTagsResult struct {
	gophercloud.Result
}

ProjectTagsResult defining the result struct of project tags.

func ListProjectTags added in v1.0.19

func ListProjectTags(client *gophercloud.ServiceClient) (r ProjectTagsResult)

ListProjectTags makes a request against the API to list project tags accessible to you.

func (ProjectTagsResult) Extract added in v1.0.19

func (r ProjectTagsResult) Extract() (Tags, error)

Extract defining the result of listing tags by extracting

type PublicIp added in v1.0.25

type PublicIp struct {
	//为待创建云服务器分配已有弹性IP时,分配的弹性IP的ID,UUID格式。
	Id string `json:"id,omitempty"`

	//配置云服务器自动分配弹性IP时,创建弹性IP的配置参数。
	Eip *Eip `json:"eip,omitempty"`
}

type Recovery

type Recovery struct {
	SupportAutoRecovery string `json:"support_auto_recovery"`
}

type RecoveryResult

type RecoveryResult struct {
	gophercloud.Result
}

func GetServerRecoveryStatus

func GetServerRecoveryStatus(client *gophercloud.ServiceClient, serverID string) (r RecoveryResult)

func (RecoveryResult) Extract

func (r RecoveryResult) Extract() (*Recovery, error)

type ResourceTag added in v1.0.19

type ResourceTag struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

ResourceTag defining the struct of server tag element.

type RootVolume added in v1.0.25

type RootVolume struct {
	//云服务器系统盘对应的磁盘类型,需要与系统所提供的磁盘类型相匹配。
	VolumeType string `json:"volumetype" required:"true"`

	//系统盘大小,容量单位为GB, 输入大小范围为[1,1024]。
	Size int `json:"size,omitempty"`

	//磁盘的产品信息。
	ExtendParam *VolumeExtendParam `json:"extendparam,omitempty"`
}

type SchedulerHints added in v1.0.25

type SchedulerHints struct {
	//云服务器组ID,UUID格式。
	Group string `json:"group,omitempty"`
}

type SecurityGroup added in v1.0.25

type SecurityGroup struct {
	//云服务器组ID,UUID格式。
	ID string `json:"id" required:"true"`
}

type SecurityGroups

type SecurityGroups struct {
	Name string `json:"name"`
	ID   string `json:"id"`
}

type Server

type Server struct {
	ID string `json:"id" required:"true"`
}

Server defining the server configuration in BatchChangeOpts struct.

type ServerExtendParam added in v1.0.25

type ServerExtendParam struct {
	//计费模式。
	ChargingMode int `json:"chargingMode,omitempty"`

	//云服务器所在区域ID。
	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"`

	//企业项目ID。
	EnterpriseProjectID string `json:"enterprise_project_id,omitempty"`

	//是否配置虚拟机自动恢复的功能。
	SupportAutoRecovery string `json:"support_auto_recovery,omitempty"`

	// 创建竞价实例时,需指定该参数的值为“spot”。
	MarketType string `json:"marketType,omitempty"`

	// 用户愿意为竞价实例每小时支付的最高价格。
	SpotPrice string `json:"spotPrice,omitempty"`

	// 购买的竞价实例时长。
	SpotDurationHours int `json:"spot_duration_hours,omitempty"`

	// 表示购买的“竞价实例时长”的个数。
	SpotDurationCount int `json:"spot_duration_count,omitempty"`

	// 竞价实例中断策略,当前支持immediate。
	InterruptionPolicy string `json:"interruption_policy,omitempty"`
}

type ServerID added in v1.0.19

type ServerID struct {
	ID string `json:"id"`
}

ServerID defines struct of batch update response element.

type ServerTags added in v1.0.19

type ServerTags struct {
	Tags []ResourceTag `json:"tags"`
}

ServerTags defining the struct of tags.

type ServerTagsResult added in v1.0.19

type ServerTagsResult struct {
	gophercloud.Result
}

ServerTagsResult defining the result struct of server tags.

func ListServerTags added in v1.0.19

func ListServerTags(client *gophercloud.ServiceClient, serverID string) (r ServerTagsResult)

ListServerTags makes a request against the API to list server tags accessible to you.

func (ServerTagsResult) Extract added in v1.0.19

func (r ServerTagsResult) Extract() (ServerTags, error)

Extract defining the result of listing tags by extracting

type Servers added in v1.0.25

type Servers struct {
	IDs []string `json:"serverIds"`
}

type SysTags

type SysTags struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Tag added in v1.0.19

type Tag struct {
	Key    string   `json:"key"`
	Values []string `json:"values"`
}

Tag defining the struct of tag element.

type TagCreate added in v1.0.19

type TagCreate struct {
	Key   string `json:"key" required:"true"`
	Value string `json:"value" required:"true"`
}

TagCreate defining the key and value of a tag for creating

type TagDelete added in v1.0.19

type TagDelete struct {
	Key   string `json:"key" required:"true"`
	Value string `json:"value,omitempty"`
}

TagDelete defining the key and value of a tag for deleting

type Tags added in v1.0.19

type Tags struct {
	Tags []Tag `json:"tags"`
}

Tags defining the struct of tags.

type Type added in v1.0.19

type Type string

Type describes the mechanisms by which a server reboot or stop can be requested.

const (
	Soft Type = "SOFT"
	Hard Type = "HARD"
)

These constants determine how a server should be rebooted or stopped.

type VolumeAttached

type VolumeAttached struct {
	ID                  string `json:"id"`
	DeleteOnTermination string `json:"delete_on_termination"`
	BootIndex           string `json:"bootIndex"`
	Device              string `json:"device"`
}

type VolumeExtendParam added in v1.0.25

type VolumeExtendParam struct {
	//整机镜像中自带的原始数据盘ID,用于指定整机镜像自带的数据盘信息。
	SnapshotId string `json:"snapshotId,omitempty"`
}

Jump to

Keyboard shortcuts

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