v2

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause Imports: 5 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EcsClientBuilder

func EcsClientBuilder() *http_client.HcHttpClientBuilder

func GenReqDefForAddServerGroupMember

func GenReqDefForAddServerGroupMember() *def.HttpRequestDef

func GenReqDefForAssociateServerVirtualIp added in v0.0.64

func GenReqDefForAssociateServerVirtualIp() *def.HttpRequestDef

func GenReqDefForAttachServerVolume

func GenReqDefForAttachServerVolume() *def.HttpRequestDef

func GenReqDefForBatchAddServerNics

func GenReqDefForBatchAddServerNics() *def.HttpRequestDef

func GenReqDefForBatchAttachSharableVolumes added in v0.0.64

func GenReqDefForBatchAttachSharableVolumes() *def.HttpRequestDef

func GenReqDefForBatchCreateServerTags

func GenReqDefForBatchCreateServerTags() *def.HttpRequestDef

func GenReqDefForBatchDeleteServerNics

func GenReqDefForBatchDeleteServerNics() *def.HttpRequestDef

func GenReqDefForBatchDeleteServerTags

func GenReqDefForBatchDeleteServerTags() *def.HttpRequestDef

func GenReqDefForBatchRebootServers

func GenReqDefForBatchRebootServers() *def.HttpRequestDef

func GenReqDefForBatchResetServersPassword added in v0.0.64

func GenReqDefForBatchResetServersPassword() *def.HttpRequestDef

func GenReqDefForBatchStartServers

func GenReqDefForBatchStartServers() *def.HttpRequestDef

func GenReqDefForBatchStopServers

func GenReqDefForBatchStopServers() *def.HttpRequestDef

func GenReqDefForBatchUpdateServersName added in v0.0.64

func GenReqDefForBatchUpdateServersName() *def.HttpRequestDef

func GenReqDefForChangeServerOsWithCloudInit

func GenReqDefForChangeServerOsWithCloudInit() *def.HttpRequestDef

func GenReqDefForChangeServerOsWithoutCloudInit added in v0.0.64

func GenReqDefForChangeServerOsWithoutCloudInit() *def.HttpRequestDef

func GenReqDefForCreatePostPaidServers

func GenReqDefForCreatePostPaidServers() *def.HttpRequestDef

func GenReqDefForCreateServerGroup

func GenReqDefForCreateServerGroup() *def.HttpRequestDef

func GenReqDefForCreateServers

func GenReqDefForCreateServers() *def.HttpRequestDef

func GenReqDefForDeleteServerGroup

func GenReqDefForDeleteServerGroup() *def.HttpRequestDef

func GenReqDefForDeleteServerGroupMember

func GenReqDefForDeleteServerGroupMember() *def.HttpRequestDef

func GenReqDefForDeleteServerMetadata

func GenReqDefForDeleteServerMetadata() *def.HttpRequestDef

func GenReqDefForDeleteServerPassword added in v0.0.64

func GenReqDefForDeleteServerPassword() *def.HttpRequestDef

func GenReqDefForDeleteServers

func GenReqDefForDeleteServers() *def.HttpRequestDef

func GenReqDefForDetachServerVolume

func GenReqDefForDetachServerVolume() *def.HttpRequestDef

func GenReqDefForDisassociateServerVirtualIp added in v0.0.64

func GenReqDefForDisassociateServerVirtualIp() *def.HttpRequestDef

func GenReqDefForListFlavors

func GenReqDefForListFlavors() *def.HttpRequestDef

func GenReqDefForListResizeFlavors

func GenReqDefForListResizeFlavors() *def.HttpRequestDef

func GenReqDefForListServerBlockDevices

func GenReqDefForListServerBlockDevices() *def.HttpRequestDef

func GenReqDefForListServerGroups

func GenReqDefForListServerGroups() *def.HttpRequestDef

func GenReqDefForListServerInterfaces

func GenReqDefForListServerInterfaces() *def.HttpRequestDef

func GenReqDefForListServerTags added in v0.0.64

func GenReqDefForListServerTags() *def.HttpRequestDef

func GenReqDefForListServersByTag added in v0.0.104

func GenReqDefForListServersByTag() *def.HttpRequestDef

func GenReqDefForListServersDetails

func GenReqDefForListServersDetails() *def.HttpRequestDef

func GenReqDefForMigrateServer added in v0.0.64

func GenReqDefForMigrateServer() *def.HttpRequestDef

func GenReqDefForNovaAssociateSecurityGroup

func GenReqDefForNovaAssociateSecurityGroup() *def.HttpRequestDef

func GenReqDefForNovaCreateKeypair

func GenReqDefForNovaCreateKeypair() *def.HttpRequestDef

func GenReqDefForNovaCreateServers

func GenReqDefForNovaCreateServers() *def.HttpRequestDef

func GenReqDefForNovaDeleteKeypair

func GenReqDefForNovaDeleteKeypair() *def.HttpRequestDef

func GenReqDefForNovaDeleteServer

func GenReqDefForNovaDeleteServer() *def.HttpRequestDef

func GenReqDefForNovaDisassociateSecurityGroup

func GenReqDefForNovaDisassociateSecurityGroup() *def.HttpRequestDef

func GenReqDefForNovaListAvailabilityZones

func GenReqDefForNovaListAvailabilityZones() *def.HttpRequestDef

func GenReqDefForNovaListKeypairs

func GenReqDefForNovaListKeypairs() *def.HttpRequestDef

func GenReqDefForNovaListServerSecurityGroups

func GenReqDefForNovaListServerSecurityGroups() *def.HttpRequestDef

func GenReqDefForNovaListServersDetails

func GenReqDefForNovaListServersDetails() *def.HttpRequestDef

func GenReqDefForNovaShowKeypair

func GenReqDefForNovaShowKeypair() *def.HttpRequestDef

func GenReqDefForNovaShowServer

func GenReqDefForNovaShowServer() *def.HttpRequestDef

func GenReqDefForRegisterServerAutoRecovery added in v0.0.64

func GenReqDefForRegisterServerAutoRecovery() *def.HttpRequestDef

func GenReqDefForRegisterServerMonitor added in v0.1.7

func GenReqDefForRegisterServerMonitor() *def.HttpRequestDef

func GenReqDefForReinstallServerWithCloudInit

func GenReqDefForReinstallServerWithCloudInit() *def.HttpRequestDef

func GenReqDefForReinstallServerWithoutCloudInit added in v0.0.64

func GenReqDefForReinstallServerWithoutCloudInit() *def.HttpRequestDef

func GenReqDefForResetServerPassword

func GenReqDefForResetServerPassword() *def.HttpRequestDef

func GenReqDefForResizePostPaidServer

func GenReqDefForResizePostPaidServer() *def.HttpRequestDef

func GenReqDefForResizeServer

func GenReqDefForResizeServer() *def.HttpRequestDef

func GenReqDefForShowJob

func GenReqDefForShowJob() *def.HttpRequestDef

func GenReqDefForShowResetPasswordFlag

func GenReqDefForShowResetPasswordFlag() *def.HttpRequestDef

func GenReqDefForShowServer

func GenReqDefForShowServer() *def.HttpRequestDef

func GenReqDefForShowServerAutoRecovery added in v0.0.64

func GenReqDefForShowServerAutoRecovery() *def.HttpRequestDef

func GenReqDefForShowServerBlockDevice added in v0.0.64

func GenReqDefForShowServerBlockDevice() *def.HttpRequestDef

func GenReqDefForShowServerGroup

func GenReqDefForShowServerGroup() *def.HttpRequestDef

func GenReqDefForShowServerLimits

func GenReqDefForShowServerLimits() *def.HttpRequestDef

func GenReqDefForShowServerPassword added in v0.0.64

func GenReqDefForShowServerPassword() *def.HttpRequestDef

func GenReqDefForShowServerRemoteConsole

func GenReqDefForShowServerRemoteConsole() *def.HttpRequestDef

func GenReqDefForShowServerTags

func GenReqDefForShowServerTags() *def.HttpRequestDef

func GenReqDefForUpdateServer

func GenReqDefForUpdateServer() *def.HttpRequestDef

func GenReqDefForUpdateServerAutoTerminateTime

func GenReqDefForUpdateServerAutoTerminateTime() *def.HttpRequestDef

func GenReqDefForUpdateServerBlockDevice added in v0.1.7

func GenReqDefForUpdateServerBlockDevice() *def.HttpRequestDef

func GenReqDefForUpdateServerMetadata

func GenReqDefForUpdateServerMetadata() *def.HttpRequestDef

Types

type AddServerGroupMemberInvoker added in v0.0.90

type AddServerGroupMemberInvoker struct {
	*invoker.BaseInvoker
}

func (*AddServerGroupMemberInvoker) Invoke added in v0.0.90

type AssociateServerVirtualIpInvoker added in v0.0.90

type AssociateServerVirtualIpInvoker struct {
	*invoker.BaseInvoker
}

func (*AssociateServerVirtualIpInvoker) Invoke added in v0.0.90

type AttachServerVolumeInvoker added in v0.0.90

type AttachServerVolumeInvoker struct {
	*invoker.BaseInvoker
}

func (*AttachServerVolumeInvoker) Invoke added in v0.0.90

type BatchAddServerNicsInvoker added in v0.0.90

type BatchAddServerNicsInvoker struct {
	*invoker.BaseInvoker
}

func (*BatchAddServerNicsInvoker) Invoke added in v0.0.90

type BatchAttachSharableVolumesInvoker added in v0.0.90

type BatchAttachSharableVolumesInvoker struct {
	*invoker.BaseInvoker
}

func (*BatchAttachSharableVolumesInvoker) Invoke added in v0.0.90

type BatchCreateServerTagsInvoker added in v0.0.90

type BatchCreateServerTagsInvoker struct {
	*invoker.BaseInvoker
}

func (*BatchCreateServerTagsInvoker) Invoke added in v0.0.90

type BatchDeleteServerNicsInvoker added in v0.0.90

type BatchDeleteServerNicsInvoker struct {
	*invoker.BaseInvoker
}

func (*BatchDeleteServerNicsInvoker) Invoke added in v0.0.90

type BatchDeleteServerTagsInvoker added in v0.0.90

type BatchDeleteServerTagsInvoker struct {
	*invoker.BaseInvoker
}

func (*BatchDeleteServerTagsInvoker) Invoke added in v0.0.90

type BatchRebootServersInvoker added in v0.0.90

type BatchRebootServersInvoker struct {
	*invoker.BaseInvoker
}

func (*BatchRebootServersInvoker) Invoke added in v0.0.90

type BatchResetServersPasswordInvoker added in v0.0.90

type BatchResetServersPasswordInvoker struct {
	*invoker.BaseInvoker
}

func (*BatchResetServersPasswordInvoker) Invoke added in v0.0.90

type BatchStartServersInvoker added in v0.0.90

type BatchStartServersInvoker struct {
	*invoker.BaseInvoker
}

func (*BatchStartServersInvoker) Invoke added in v0.0.90

type BatchStopServersInvoker added in v0.0.90

type BatchStopServersInvoker struct {
	*invoker.BaseInvoker
}

func (*BatchStopServersInvoker) Invoke added in v0.0.90

type BatchUpdateServersNameInvoker added in v0.0.90

type BatchUpdateServersNameInvoker struct {
	*invoker.BaseInvoker
}

func (*BatchUpdateServersNameInvoker) Invoke added in v0.0.90

type ChangeServerOsWithCloudInitInvoker added in v0.0.90

type ChangeServerOsWithCloudInitInvoker struct {
	*invoker.BaseInvoker
}

func (*ChangeServerOsWithCloudInitInvoker) Invoke added in v0.0.90

type ChangeServerOsWithoutCloudInitInvoker added in v0.0.90

type ChangeServerOsWithoutCloudInitInvoker struct {
	*invoker.BaseInvoker
}

func (*ChangeServerOsWithoutCloudInitInvoker) Invoke added in v0.0.90

type CreatePostPaidServersInvoker added in v0.0.90

type CreatePostPaidServersInvoker struct {
	*invoker.BaseInvoker
}

func (*CreatePostPaidServersInvoker) Invoke added in v0.0.90

type CreateServerGroupInvoker added in v0.0.90

type CreateServerGroupInvoker struct {
	*invoker.BaseInvoker
}

func (*CreateServerGroupInvoker) Invoke added in v0.0.90

type CreateServersInvoker added in v0.0.90

type CreateServersInvoker struct {
	*invoker.BaseInvoker
}

func (*CreateServersInvoker) Invoke added in v0.0.90

type DeleteServerGroupInvoker added in v0.0.90

type DeleteServerGroupInvoker struct {
	*invoker.BaseInvoker
}

func (*DeleteServerGroupInvoker) Invoke added in v0.0.90

type DeleteServerGroupMemberInvoker added in v0.0.90

type DeleteServerGroupMemberInvoker struct {
	*invoker.BaseInvoker
}

func (*DeleteServerGroupMemberInvoker) Invoke added in v0.0.90

type DeleteServerMetadataInvoker added in v0.0.90

type DeleteServerMetadataInvoker struct {
	*invoker.BaseInvoker
}

func (*DeleteServerMetadataInvoker) Invoke added in v0.0.90

type DeleteServerPasswordInvoker added in v0.0.90

type DeleteServerPasswordInvoker struct {
	*invoker.BaseInvoker
}

func (*DeleteServerPasswordInvoker) Invoke added in v0.0.90

type DeleteServersInvoker added in v0.0.90

type DeleteServersInvoker struct {
	*invoker.BaseInvoker
}

func (*DeleteServersInvoker) Invoke added in v0.0.90

type DetachServerVolumeInvoker added in v0.0.90

type DetachServerVolumeInvoker struct {
	*invoker.BaseInvoker
}

func (*DetachServerVolumeInvoker) Invoke added in v0.0.90

type DisassociateServerVirtualIpInvoker added in v0.0.90

type DisassociateServerVirtualIpInvoker struct {
	*invoker.BaseInvoker
}

func (*DisassociateServerVirtualIpInvoker) Invoke added in v0.0.90

type EcsClient

type EcsClient struct {
	HcClient *http_client.HcHttpClient
}

func NewEcsClient

func NewEcsClient(hcClient *http_client.HcHttpClient) *EcsClient

func (*EcsClient) AddServerGroupMember

AddServerGroupMember 添加云服务器组成员

将云服务器加入云服务器组。添加成功后,如果该云服务器组是反亲和性策略的,则该云服务器与云服务器组中的其他成员尽量分散地创建在不同主机上。如果该云服务器时故障域类型的,则该云服务器会拥有故障域属性。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) AddServerGroupMemberInvoker added in v0.0.90

func (c *EcsClient) AddServerGroupMemberInvoker(request *model.AddServerGroupMemberRequest) *AddServerGroupMemberInvoker

AddServerGroupMemberInvoker 添加云服务器组成员

func (*EcsClient) AssociateServerVirtualIp added in v0.0.64

AssociateServerVirtualIp 云服务器网卡配置虚拟IP地址

虚拟IP地址用于为网卡提供第二个IP地址,同时支持与多个弹性云服务器的网卡绑定,从而实现多个弹性云服务器之间的高可用性。

该接口用于给云服务器网卡配置虚拟IP地址:

- 当指定的IP地址是一个不存在的虚拟IP地址时,系统会创建该虚拟IP,并绑定至对应网卡。

- 当指定的IP地址是一个已经创建好的私有IP时,系统会将指定的网卡和虚拟IP绑定。如果该IP的device_owner为空,则仅支持VPC内二三层通信;如果该IP的device_owner为neutron:VIP_PORT,则支持VPC内二三层通信、VPC之间对等连接访问,以及弹性公网IP、VPN、云专线等Internet接入。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) AssociateServerVirtualIpInvoker added in v0.0.90

func (c *EcsClient) AssociateServerVirtualIpInvoker(request *model.AssociateServerVirtualIpRequest) *AssociateServerVirtualIpInvoker

AssociateServerVirtualIpInvoker 云服务器网卡配置虚拟IP地址

func (*EcsClient) AttachServerVolume

func (c *EcsClient) AttachServerVolume(request *model.AttachServerVolumeRequest) (*model.AttachServerVolumeResponse, error)

AttachServerVolume 弹性云服务器挂载磁盘

把磁盘挂载到弹性云服务器上。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) AttachServerVolumeInvoker added in v0.0.90

func (c *EcsClient) AttachServerVolumeInvoker(request *model.AttachServerVolumeRequest) *AttachServerVolumeInvoker

AttachServerVolumeInvoker 弹性云服务器挂载磁盘

func (*EcsClient) BatchAddServerNics

func (c *EcsClient) BatchAddServerNics(request *model.BatchAddServerNicsRequest) (*model.BatchAddServerNicsResponse, error)

BatchAddServerNics 批量添加云服务器网卡

给云服务器添加一张或多张网卡。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) BatchAddServerNicsInvoker added in v0.0.90

func (c *EcsClient) BatchAddServerNicsInvoker(request *model.BatchAddServerNicsRequest) *BatchAddServerNicsInvoker

BatchAddServerNicsInvoker 批量添加云服务器网卡

func (*EcsClient) BatchAttachSharableVolumes added in v0.0.64

BatchAttachSharableVolumes 批量挂载指定共享盘

将指定的共享磁盘一次性挂载到多个弹性云服务器,实现批量挂载。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) BatchAttachSharableVolumesInvoker added in v0.0.90

func (c *EcsClient) BatchAttachSharableVolumesInvoker(request *model.BatchAttachSharableVolumesRequest) *BatchAttachSharableVolumesInvoker

BatchAttachSharableVolumesInvoker 批量挂载指定共享盘

func (*EcsClient) BatchCreateServerTags

BatchCreateServerTags 批量添加云服务器标签

- 为指定云服务器批量添加标签。

- 标签管理服务TMS使用该接口批量管理云服务器的标签。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) BatchCreateServerTagsInvoker added in v0.0.90

func (c *EcsClient) BatchCreateServerTagsInvoker(request *model.BatchCreateServerTagsRequest) *BatchCreateServerTagsInvoker

BatchCreateServerTagsInvoker 批量添加云服务器标签

func (*EcsClient) BatchDeleteServerNics

BatchDeleteServerNics 批量删除云服务器网卡

卸载并删除云服务器中的一张或多张网卡。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) BatchDeleteServerNicsInvoker added in v0.0.90

func (c *EcsClient) BatchDeleteServerNicsInvoker(request *model.BatchDeleteServerNicsRequest) *BatchDeleteServerNicsInvoker

BatchDeleteServerNicsInvoker 批量删除云服务器网卡

func (*EcsClient) BatchDeleteServerTags

BatchDeleteServerTags 批量删除云服务器标签

- 为指定云服务器批量删除标签。

- 标签管理服务TMS使用该接口批量管理云服务器的标签。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) BatchDeleteServerTagsInvoker added in v0.0.90

func (c *EcsClient) BatchDeleteServerTagsInvoker(request *model.BatchDeleteServerTagsRequest) *BatchDeleteServerTagsInvoker

BatchDeleteServerTagsInvoker 批量删除云服务器标签

func (*EcsClient) BatchRebootServers

func (c *EcsClient) BatchRebootServers(request *model.BatchRebootServersRequest) (*model.BatchRebootServersResponse, error)

BatchRebootServers 批量重启云服务器

根据给定的云服务器ID列表,批量重启云服务器,一次最多可以重启1000台。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) BatchRebootServersInvoker added in v0.0.90

func (c *EcsClient) BatchRebootServersInvoker(request *model.BatchRebootServersRequest) *BatchRebootServersInvoker

BatchRebootServersInvoker 批量重启云服务器

func (*EcsClient) BatchResetServersPassword added in v0.0.64

BatchResetServersPassword 批量重置弹性云服务器密码

批量重置弹性云服务器管理帐号(root用户或Administrator用户)的密码。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) BatchResetServersPasswordInvoker added in v0.0.90

func (c *EcsClient) BatchResetServersPasswordInvoker(request *model.BatchResetServersPasswordRequest) *BatchResetServersPasswordInvoker

BatchResetServersPasswordInvoker 批量重置弹性云服务器密码

func (*EcsClient) BatchStartServers

func (c *EcsClient) BatchStartServers(request *model.BatchStartServersRequest) (*model.BatchStartServersResponse, error)

BatchStartServers 批量启动云服务器

根据给定的云服务器ID列表,批量启动云服务器,一次最多可以启动1000台。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) BatchStartServersInvoker added in v0.0.90

func (c *EcsClient) BatchStartServersInvoker(request *model.BatchStartServersRequest) *BatchStartServersInvoker

BatchStartServersInvoker 批量启动云服务器

func (*EcsClient) BatchStopServers

func (c *EcsClient) BatchStopServers(request *model.BatchStopServersRequest) (*model.BatchStopServersResponse, error)

BatchStopServers 批量关闭云服务器

根据给定的云服务器ID列表,批量关闭云服务器,一次最多可以关闭1000台。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) BatchStopServersInvoker added in v0.0.90

func (c *EcsClient) BatchStopServersInvoker(request *model.BatchStopServersRequest) *BatchStopServersInvoker

BatchStopServersInvoker 批量关闭云服务器

func (*EcsClient) BatchUpdateServersName added in v0.0.64

BatchUpdateServersName 批量修改弹性云服务器

批量修改弹性云服务器信息。 当前仅支持批量修改云服务器名称,一次最多可以修改1000台。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) BatchUpdateServersNameInvoker added in v0.0.90

func (c *EcsClient) BatchUpdateServersNameInvoker(request *model.BatchUpdateServersNameRequest) *BatchUpdateServersNameInvoker

BatchUpdateServersNameInvoker 批量修改弹性云服务器

func (*EcsClient) ChangeServerOsWithCloudInit

ChangeServerOsWithCloudInit 切换弹性云服务器操作系统(安装Cloud init)

切换弹性云服务器操作系统。支持弹性云服务器数据盘不变的情况下,使用新镜像重装系统盘。

调用该接口后,系统将卸载系统盘,然后使用新镜像重新创建系统盘,并挂载至弹性云服务器,实现切换操作系统功能。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ChangeServerOsWithCloudInitInvoker added in v0.0.90

func (c *EcsClient) ChangeServerOsWithCloudInitInvoker(request *model.ChangeServerOsWithCloudInitRequest) *ChangeServerOsWithCloudInitInvoker

ChangeServerOsWithCloudInitInvoker 切换弹性云服务器操作系统(安装Cloud init)

func (*EcsClient) ChangeServerOsWithoutCloudInit added in v0.0.64

ChangeServerOsWithoutCloudInit 切换弹性云服务器操作系统(未安装Cloud init)

切换弹性云服务器操作系统。

该接口支持未安装Cloud-init或Cloudbase-init的镜像使用。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ChangeServerOsWithoutCloudInitInvoker added in v0.0.90

func (c *EcsClient) ChangeServerOsWithoutCloudInitInvoker(request *model.ChangeServerOsWithoutCloudInitRequest) *ChangeServerOsWithoutCloudInitInvoker

ChangeServerOsWithoutCloudInitInvoker 切换弹性云服务器操作系统(未安装Cloud init)

func (*EcsClient) CreatePostPaidServers

CreatePostPaidServers 创建云服务器(按需)

创建一台或多台[按需付费](https://support.huaweicloud.com/productdesc-ecs/ecs_01_0065.html)方式的云服务器。

弹性云服务器的登录鉴权方式包括两种:密钥对、密码。为安全起见,推荐使用密钥对方式。

- 密钥对 密钥对指使用密钥对作为弹性云服务器的鉴权方式。 接口调用方法:使用key_name字段,指定弹性云服务器登录时使用的密钥文件。

- 密码 密码指使用设置初始密码方式作为弹性云服务器的鉴权方式,此时,您可以通过用户名密码方式登录弹性云服务器,Linux操作系统时为root用户的初始密码,Windows操作系统时为Administrator用户的初始密码。

接口调用方法:使用adminPass字段,指定管理员帐号的初始登录密码。对于镜像已安装Cloud-init的Linux云服务器,如果需要使用密文密码,可以使用user_data字段进行密码注入。

> 对于安装Cloud-init镜像的Linux云服务器云主机,若指定user_data字段,则adminPass字段无效。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) CreatePostPaidServersInvoker added in v0.0.90

func (c *EcsClient) CreatePostPaidServersInvoker(request *model.CreatePostPaidServersRequest) *CreatePostPaidServersInvoker

CreatePostPaidServersInvoker 创建云服务器(按需)

func (*EcsClient) CreateServerGroup

func (c *EcsClient) CreateServerGroup(request *model.CreateServerGroupRequest) (*model.CreateServerGroupResponse, error)

CreateServerGroup 创建云服务器组

创建弹性云服务器组。

与原生的创建云服务器组接口不同之处在于该接口支持企业项目细粒度权限的校验。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) CreateServerGroupInvoker added in v0.0.90

func (c *EcsClient) CreateServerGroupInvoker(request *model.CreateServerGroupRequest) *CreateServerGroupInvoker

CreateServerGroupInvoker 创建云服务器组

func (*EcsClient) CreateServers

func (c *EcsClient) CreateServers(request *model.CreateServersRequest) (*model.CreateServersResponse, error)

CreateServers 创建云服务器

创建一台或多台云服务器。

指该接口兼容《弹性云服务器接口参考》创建云服务器v1的功能,同时合入新功能,支持创建[包年/包月](https://support.huaweicloud.com/productdesc-ecs/ecs_01_0065.html)的弹性云服务器。

弹性云服务器的登录鉴权方式包括两种:密钥对、密码。为安全起见,推荐使用密钥对方式。

- 密钥对

指使用密钥对作为弹性云服务器的鉴权方式。

接口调用方法:使用key_name字段,指定弹性云服务器登录时使用的密钥文件。

- 密码

指使用设置初始密码方式作为弹性云服务器的鉴权方式,此时,您可以通过用户名密码方式登录弹性云服务器,Linux操作系统时为root用户的初始密码,Windows操作系统时为Administrator用户的初始密码。

接口调用方法:使用adminPass字段,指定管理员帐号的初始登录密码。对于镜像已安装Cloud-init的Linux云服务器,如果需要使用密文密码,可以使用user_data字段进行密码注入。

> 对于安装Cloud-init镜像的Linux云服务器云主机,若指定user_data字段,则adminPass字段无效。

购买操作示例: - [使用API购买ECS过程中常见问题及处理方法](https://support.huaweicloud.com/api-ecs/ecs_04_0007.html) - [获取Token并检验Token的有效期 ](https://support.huaweicloud.com/api-ecs/ecs_04_0008.html)

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) CreateServersInvoker added in v0.0.90

func (c *EcsClient) CreateServersInvoker(request *model.CreateServersRequest) *CreateServersInvoker

CreateServersInvoker 创建云服务器

func (*EcsClient) DeleteServerGroup

func (c *EcsClient) DeleteServerGroup(request *model.DeleteServerGroupRequest) (*model.DeleteServerGroupResponse, error)

DeleteServerGroup 删除云服务器组

删除云服务器组。

与原生的删除云服务器组接口不同之处在于该接口支持企业项目细粒度权限的校验。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) DeleteServerGroupInvoker added in v0.0.90

func (c *EcsClient) DeleteServerGroupInvoker(request *model.DeleteServerGroupRequest) *DeleteServerGroupInvoker

DeleteServerGroupInvoker 删除云服务器组

func (*EcsClient) DeleteServerGroupMember

DeleteServerGroupMember 删除云服务器组成员

将弹性云服务器移出云服务器组。移出后,该云服务器与云服务器组中的成员不再遵从反亲和策略。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) DeleteServerGroupMemberInvoker added in v0.0.90

func (c *EcsClient) DeleteServerGroupMemberInvoker(request *model.DeleteServerGroupMemberRequest) *DeleteServerGroupMemberInvoker

DeleteServerGroupMemberInvoker 删除云服务器组成员

func (*EcsClient) DeleteServerMetadata

DeleteServerMetadata 删除云服务器指定元数据

删除云服务器指定元数据。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) DeleteServerMetadataInvoker added in v0.0.90

func (c *EcsClient) DeleteServerMetadataInvoker(request *model.DeleteServerMetadataRequest) *DeleteServerMetadataInvoker

DeleteServerMetadataInvoker 删除云服务器指定元数据

func (*EcsClient) DeleteServerPassword added in v0.0.64

DeleteServerPassword 云服务器清除密码(企业项目)

清除Windows云服务器初始安装时系统生成的密码记录。清除密码后,不影响云服务器密码登录功能,但不能再使用获取密码功能来查询该云服务器密码。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) DeleteServerPasswordInvoker added in v0.0.90

func (c *EcsClient) DeleteServerPasswordInvoker(request *model.DeleteServerPasswordRequest) *DeleteServerPasswordInvoker

DeleteServerPasswordInvoker 云服务器清除密码(企业项目)

func (*EcsClient) DeleteServers

func (c *EcsClient) DeleteServers(request *model.DeleteServersRequest) (*model.DeleteServersResponse, error)

DeleteServers 删除云服务器

根据指定的云服务器ID列表,删除云服务器。

系统支持删除单台云服务器和批量删除多台云服务器操作,批量删除云服务器时,一次最多可以删除1000台。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) DeleteServersInvoker added in v0.0.90

func (c *EcsClient) DeleteServersInvoker(request *model.DeleteServersRequest) *DeleteServersInvoker

DeleteServersInvoker 删除云服务器

func (*EcsClient) DetachServerVolume

func (c *EcsClient) DetachServerVolume(request *model.DetachServerVolumeRequest) (*model.DetachServerVolumeResponse, error)

DetachServerVolume 弹性云服务器卸载磁盘

从弹性云服务器中卸载磁盘。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) DetachServerVolumeInvoker added in v0.0.90

func (c *EcsClient) DetachServerVolumeInvoker(request *model.DetachServerVolumeRequest) *DetachServerVolumeInvoker

DetachServerVolumeInvoker 弹性云服务器卸载磁盘

func (*EcsClient) DisassociateServerVirtualIp added in v0.0.64

DisassociateServerVirtualIp 云服务器网卡解绑虚拟IP地址

虚拟IP地址用于为网卡提供第二个IP地址,同时支持与多个弹性云服务器的网卡绑定,从而实现多个弹性云服务器之间的高可用性。

该接口用于解绑定弹性云服务器网卡的虚拟IP地址。解绑后,网卡不会被删除。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) DisassociateServerVirtualIpInvoker added in v0.0.90

func (c *EcsClient) DisassociateServerVirtualIpInvoker(request *model.DisassociateServerVirtualIpRequest) *DisassociateServerVirtualIpInvoker

DisassociateServerVirtualIpInvoker 云服务器网卡解绑虚拟IP地址

func (*EcsClient) ListFlavors

func (c *EcsClient) ListFlavors(request *model.ListFlavorsRequest) (*model.ListFlavorsResponse, error)

ListFlavors 查询规格详情和规格扩展信息列表

查询云服务器规格详情信息和规格扩展信息列表。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ListFlavorsInvoker added in v0.0.90

func (c *EcsClient) ListFlavorsInvoker(request *model.ListFlavorsRequest) *ListFlavorsInvoker

ListFlavorsInvoker 查询规格详情和规格扩展信息列表

func (*EcsClient) ListResizeFlavors

func (c *EcsClient) ListResizeFlavors(request *model.ListResizeFlavorsRequest) (*model.ListResizeFlavorsResponse, error)

ListResizeFlavors 查询云服务器规格变更支持列表

变更规格时,部分规格的云服务器之间不能互相变更。您可以通过本接口,通过指定弹性云服务器规格,查询该规格可以变更的规格列表。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ListResizeFlavorsInvoker added in v0.0.90

func (c *EcsClient) ListResizeFlavorsInvoker(request *model.ListResizeFlavorsRequest) *ListResizeFlavorsInvoker

ListResizeFlavorsInvoker 查询云服务器规格变更支持列表

func (*EcsClient) ListServerBlockDevices

ListServerBlockDevices 查询弹性云服务器磁盘信息

查询弹性云服务器挂载的磁盘信息。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ListServerBlockDevicesInvoker added in v0.0.90

func (c *EcsClient) ListServerBlockDevicesInvoker(request *model.ListServerBlockDevicesRequest) *ListServerBlockDevicesInvoker

ListServerBlockDevicesInvoker 查询弹性云服务器磁盘信息

func (*EcsClient) ListServerGroups

func (c *EcsClient) ListServerGroups(request *model.ListServerGroupsRequest) (*model.ListServerGroupsResponse, error)

ListServerGroups 查询云服务器组列表

查询弹性云服务器组。

与原生的创建云服务器组接口不同之处在于该接口支持企业项目细粒度权限的校验。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ListServerGroupsInvoker added in v0.0.90

func (c *EcsClient) ListServerGroupsInvoker(request *model.ListServerGroupsRequest) *ListServerGroupsInvoker

ListServerGroupsInvoker 查询云服务器组列表

func (*EcsClient) ListServerInterfaces

ListServerInterfaces 查询云服务器网卡信息

查询云服务器网卡信息。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ListServerInterfacesInvoker added in v0.0.90

func (c *EcsClient) ListServerInterfacesInvoker(request *model.ListServerInterfacesRequest) *ListServerInterfacesInvoker

ListServerInterfacesInvoker 查询云服务器网卡信息

func (*EcsClient) ListServerTags added in v0.0.64

func (c *EcsClient) ListServerTags(request *model.ListServerTagsRequest) (*model.ListServerTagsResponse, error)

ListServerTags 查询项目标签

项目(Project)用于将OpenStack的资源(计算资源、存储资源和网络资源)进行分组和隔离。项目可以是一个部门或者一个项目组。一个帐户中可以创建多个项目。

该接口用于查询用户在指定项目所使用的全部标签。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ListServerTagsInvoker added in v0.0.90

func (c *EcsClient) ListServerTagsInvoker(request *model.ListServerTagsRequest) *ListServerTagsInvoker

ListServerTagsInvoker 查询项目标签

func (*EcsClient) ListServersByTag added in v0.0.104

func (c *EcsClient) ListServersByTag(request *model.ListServersByTagRequest) (*model.ListServersByTagResponse, error)

ListServersByTag 按标签查询云服务器列表

使用标签过滤弹性云服务器,并返回云服务器使用的所有标签和资源列表。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ListServersByTagInvoker added in v0.0.104

func (c *EcsClient) ListServersByTagInvoker(request *model.ListServersByTagRequest) *ListServersByTagInvoker

ListServersByTagInvoker 按标签查询云服务器列表

func (*EcsClient) ListServersDetails

func (c *EcsClient) ListServersDetails(request *model.ListServersDetailsRequest) (*model.ListServersDetailsResponse, error)

ListServersDetails 查询云服务器详情列表

根据用户请求条件从数据库筛选、查询所有的弹性云服务器,并关联相关表获取到弹性云服务器的详细信息。

该接口支持查询弹性云服务器计费方式,以及是否被冻结。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ListServersDetailsInvoker added in v0.0.90

func (c *EcsClient) ListServersDetailsInvoker(request *model.ListServersDetailsRequest) *ListServersDetailsInvoker

ListServersDetailsInvoker 查询云服务器详情列表

func (*EcsClient) MigrateServer added in v0.0.64

func (c *EcsClient) MigrateServer(request *model.MigrateServerRequest) (*model.MigrateServerResponse, error)

MigrateServer 冷迁移云服务器

- 将部署在专属主机上的弹性云服务器迁移至其他专属主机。 - 将部署在专属主机上的弹性云服务器迁移至公共资源池,即不再部署在专属主机上。 - 将公共资源池的弹性云服务器迁移至专属主机上,成为专属主机上部署的弹性云服务器。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) MigrateServerInvoker added in v0.0.90

func (c *EcsClient) MigrateServerInvoker(request *model.MigrateServerRequest) *MigrateServerInvoker

MigrateServerInvoker 冷迁移云服务器

func (*EcsClient) NovaAssociateSecurityGroup

NovaAssociateSecurityGroup 添加安全组

为弹性云服务器添加一个安全组。

添加多个安全组时,建议最多为弹性云服务器添加5个安全组。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) NovaAssociateSecurityGroupInvoker added in v0.0.90

func (c *EcsClient) NovaAssociateSecurityGroupInvoker(request *model.NovaAssociateSecurityGroupRequest) *NovaAssociateSecurityGroupInvoker

NovaAssociateSecurityGroupInvoker 添加安全组

func (*EcsClient) NovaCreateKeypair

func (c *EcsClient) NovaCreateKeypair(request *model.NovaCreateKeypairRequest) (*model.NovaCreateKeypairResponse, error)

NovaCreateKeypair 创建和导入SSH密钥

创建SSH密钥,或把公钥导入系统,生成密钥对。

创建SSH密钥成功后,请把响应数据中的私钥内容保存到本地文件,用户使用该私钥登录云服务器云主机。为保证云服务器云主机器安全,私钥数据只能读取一次,请妥善保管。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) NovaCreateKeypairInvoker added in v0.0.90

func (c *EcsClient) NovaCreateKeypairInvoker(request *model.NovaCreateKeypairRequest) *NovaCreateKeypairInvoker

NovaCreateKeypairInvoker 创建和导入SSH密钥

func (*EcsClient) NovaCreateServers

func (c *EcsClient) NovaCreateServers(request *model.NovaCreateServersRequest) (*model.NovaCreateServersResponse, error)

NovaCreateServers 创建云服务器

创建一台弹性云服务器。

弹性云服务器创建完成后,如需开启自动恢复功能,可以调用配置云服务器自动恢复的接口,具体使用请参见管理云服务器自动恢复动作。

该接口在云服务器创建失败后不支持自动回滚。若需要自动回滚能力,可以调用POST /v1/{project_id}/cloudservers接口,具体使用请参见创建云服务器(按需)。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) NovaCreateServersInvoker added in v0.0.90

func (c *EcsClient) NovaCreateServersInvoker(request *model.NovaCreateServersRequest) *NovaCreateServersInvoker

NovaCreateServersInvoker 创建云服务器

func (*EcsClient) NovaDeleteKeypair

func (c *EcsClient) NovaDeleteKeypair(request *model.NovaDeleteKeypairRequest) (*model.NovaDeleteKeypairResponse, error)

NovaDeleteKeypair 删除SSH密钥

根据SSH密钥的名称,删除指定SSH密钥。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) NovaDeleteKeypairInvoker added in v0.0.90

func (c *EcsClient) NovaDeleteKeypairInvoker(request *model.NovaDeleteKeypairRequest) *NovaDeleteKeypairInvoker

NovaDeleteKeypairInvoker 删除SSH密钥

func (*EcsClient) NovaDeleteServer

func (c *EcsClient) NovaDeleteServer(request *model.NovaDeleteServerRequest) (*model.NovaDeleteServerResponse, error)

NovaDeleteServer 删除云服务器

删除一台云服务器。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) NovaDeleteServerInvoker added in v0.0.90

func (c *EcsClient) NovaDeleteServerInvoker(request *model.NovaDeleteServerRequest) *NovaDeleteServerInvoker

NovaDeleteServerInvoker 删除云服务器

func (*EcsClient) NovaDisassociateSecurityGroup

NovaDisassociateSecurityGroup 移除安全组

移除弹性云服务器中的安全组。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) NovaDisassociateSecurityGroupInvoker added in v0.0.90

func (c *EcsClient) NovaDisassociateSecurityGroupInvoker(request *model.NovaDisassociateSecurityGroupRequest) *NovaDisassociateSecurityGroupInvoker

NovaDisassociateSecurityGroupInvoker 移除安全组

func (*EcsClient) NovaListAvailabilityZones

NovaListAvailabilityZones 查询可用区列表

查询可用域列表。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) NovaListAvailabilityZonesInvoker added in v0.0.90

func (c *EcsClient) NovaListAvailabilityZonesInvoker(request *model.NovaListAvailabilityZonesRequest) *NovaListAvailabilityZonesInvoker

NovaListAvailabilityZonesInvoker 查询可用区列表

func (*EcsClient) NovaListKeypairs

func (c *EcsClient) NovaListKeypairs(request *model.NovaListKeypairsRequest) (*model.NovaListKeypairsResponse, error)

NovaListKeypairs 查询SSH密钥列表

查询SSH密钥信息列表。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) NovaListKeypairsInvoker added in v0.0.90

func (c *EcsClient) NovaListKeypairsInvoker(request *model.NovaListKeypairsRequest) *NovaListKeypairsInvoker

NovaListKeypairsInvoker 查询SSH密钥列表

func (*EcsClient) NovaListServerSecurityGroups

NovaListServerSecurityGroups 查询指定云服务器安全组列表

查询指定弹性云服务器的安全组。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) NovaListServerSecurityGroupsInvoker added in v0.0.90

func (c *EcsClient) NovaListServerSecurityGroupsInvoker(request *model.NovaListServerSecurityGroupsRequest) *NovaListServerSecurityGroupsInvoker

NovaListServerSecurityGroupsInvoker 查询指定云服务器安全组列表

func (*EcsClient) NovaListServersDetails

NovaListServersDetails 查询云服务器详情列表

查询云服务器详情信息列表。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) NovaListServersDetailsInvoker added in v0.0.90

func (c *EcsClient) NovaListServersDetailsInvoker(request *model.NovaListServersDetailsRequest) *NovaListServersDetailsInvoker

NovaListServersDetailsInvoker 查询云服务器详情列表

func (*EcsClient) NovaShowKeypair

func (c *EcsClient) NovaShowKeypair(request *model.NovaShowKeypairRequest) (*model.NovaShowKeypairResponse, error)

NovaShowKeypair 查询SSH密钥详情

根据SSH密钥名称查询指定SSH密钥。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) NovaShowKeypairInvoker added in v0.0.90

func (c *EcsClient) NovaShowKeypairInvoker(request *model.NovaShowKeypairRequest) *NovaShowKeypairInvoker

NovaShowKeypairInvoker 查询SSH密钥详情

func (*EcsClient) NovaShowServer

func (c *EcsClient) NovaShowServer(request *model.NovaShowServerRequest) (*model.NovaShowServerResponse, error)

NovaShowServer 查询云服务器详情

根据云服务器ID,查询云服务器的详细信息。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) NovaShowServerInvoker added in v0.0.90

func (c *EcsClient) NovaShowServerInvoker(request *model.NovaShowServerRequest) *NovaShowServerInvoker

NovaShowServerInvoker 查询云服务器详情

func (*EcsClient) RegisterServerAutoRecovery added in v0.0.64

RegisterServerAutoRecovery 管理云服务器自动恢复动作

配置、删除云服务器自动恢复动作。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) RegisterServerAutoRecoveryInvoker added in v0.0.90

func (c *EcsClient) RegisterServerAutoRecoveryInvoker(request *model.RegisterServerAutoRecoveryRequest) *RegisterServerAutoRecoveryInvoker

RegisterServerAutoRecoveryInvoker 管理云服务器自动恢复动作

func (*EcsClient) RegisterServerMonitor added in v0.1.7

RegisterServerMonitor 注册云服务器监控

将云服务器添加到监控表中。

注册到监控表中的云服务会被ceilometer周期性采集监控数据,包括平台的版本、cpu信息、内存、网卡、磁盘、硬件平台等信息,这些数据上报给云监控。例如SAP云服务器内部的插件会周期性从云监控中查询监控数据,以报表形式呈现给SAP。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) RegisterServerMonitorInvoker added in v0.1.7

func (c *EcsClient) RegisterServerMonitorInvoker(request *model.RegisterServerMonitorRequest) *RegisterServerMonitorInvoker

RegisterServerMonitorInvoker 注册云服务器监控

func (*EcsClient) ReinstallServerWithCloudInit

ReinstallServerWithCloudInit 重装弹性云服务器操作系统(安装Cloud-init)

重装弹性云服务器的操作系统。支持弹性云服务器数据盘不变的情况下,使用原镜像重装系统盘。

调用该接口后,系统将卸载系统盘,然后使用原镜像重新创建系统盘,并挂载至弹性云服务器,实现重装操作系统功能。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ReinstallServerWithCloudInitInvoker added in v0.0.90

func (c *EcsClient) ReinstallServerWithCloudInitInvoker(request *model.ReinstallServerWithCloudInitRequest) *ReinstallServerWithCloudInitInvoker

ReinstallServerWithCloudInitInvoker 重装弹性云服务器操作系统(安装Cloud-init)

func (*EcsClient) ReinstallServerWithoutCloudInit added in v0.0.64

ReinstallServerWithoutCloudInit 重装弹性云服务器操作系统(未安装Cloud init)

重装弹性云服务器的操作系统。

该接口支持未安装Cloud-init或Cloudbase-init的镜像。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ReinstallServerWithoutCloudInitInvoker added in v0.0.90

func (c *EcsClient) ReinstallServerWithoutCloudInitInvoker(request *model.ReinstallServerWithoutCloudInitRequest) *ReinstallServerWithoutCloudInitInvoker

ReinstallServerWithoutCloudInitInvoker 重装弹性云服务器操作系统(未安装Cloud init)

func (*EcsClient) ResetServerPassword

ResetServerPassword 一键重置弹性云服务器密码(企业项目)

重置弹性云服务器管理帐号(root用户或Administrator用户)的密码。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ResetServerPasswordInvoker added in v0.0.90

func (c *EcsClient) ResetServerPasswordInvoker(request *model.ResetServerPasswordRequest) *ResetServerPasswordInvoker

ResetServerPasswordInvoker 一键重置弹性云服务器密码(企业项目)

func (*EcsClient) ResizePostPaidServer

ResizePostPaidServer 变更云服务器规格(按需)

当您创建的弹性云服务器规格无法满足业务需要时,可以变更云服务器规格,升级vCPU、内存。具体接口的使用,请参见本节内容。

变更规格时,部分规格的云服务器之间不能互相变更。

您可以通过接口“/v1/{project_id}/cloudservers/resize_flavors?{instance_uuid,source_flavor_id,source_flavor_name}”查询支持列表。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ResizePostPaidServerInvoker added in v0.0.90

func (c *EcsClient) ResizePostPaidServerInvoker(request *model.ResizePostPaidServerRequest) *ResizePostPaidServerInvoker

ResizePostPaidServerInvoker 变更云服务器规格(按需)

func (*EcsClient) ResizeServer

func (c *EcsClient) ResizeServer(request *model.ResizeServerRequest) (*model.ResizeServerResponse, error)

ResizeServer 变更云服务器规格

变更云服务器规格。

v1.1版本:指该接口兼容v1接口的功能,同时合入新功能,支持变更包年/包月弹性云服务器的规格。

注意事项:

- 该接口可以使用合作伙伴自身的AK/SK或者token调用,也可以用合作伙伴子客户的AK/SK或者token来调用。 - 如果使用AK/SK认证方式,示例代码中region请参考[地区和终端节点](https://developer.huaweicloud.com/endpoint)中“弹性云服务 ECS”下“区域”的内容,,serviceName(英文服务名称缩写)请指定为ECS。 - Endpoint请参考[地区和终端节点](https://developer.huaweicloud.com/endpoint)中“弹性云服务 ECS”下“终端节点(Endpoint)”的内容。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ResizeServerInvoker added in v0.0.90

func (c *EcsClient) ResizeServerInvoker(request *model.ResizeServerRequest) *ResizeServerInvoker

ResizeServerInvoker 变更云服务器规格

func (*EcsClient) ShowJob

func (c *EcsClient) ShowJob(request *model.ShowJobRequest) (*model.ShowJobResponse, error)

ShowJob 查询任务的执行状态

查询Job的执行状态。

对于创建云服务器、删除云服务器、云服务器批量操作和网卡操作等异步API,命令下发后,会返回job_id,通过job_id可以查询任务的执行状态。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ShowJobInvoker added in v0.0.90

func (c *EcsClient) ShowJobInvoker(request *model.ShowJobRequest) *ShowJobInvoker

ShowJobInvoker 查询任务的执行状态

func (*EcsClient) ShowResetPasswordFlag

ShowResetPasswordFlag 查询是否支持一键重置密码

查询弹性云服务器是否支持一键重置密码。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ShowResetPasswordFlagInvoker added in v0.0.90

func (c *EcsClient) ShowResetPasswordFlagInvoker(request *model.ShowResetPasswordFlagRequest) *ShowResetPasswordFlagInvoker

ShowResetPasswordFlagInvoker 查询是否支持一键重置密码

func (*EcsClient) ShowServer

func (c *EcsClient) ShowServer(request *model.ShowServerRequest) (*model.ShowServerResponse, error)

ShowServer 查询云服务器详情

查询弹性云服务器的详细信息。

该接口支持查询弹性云服务器的计费方式,以及是否被冻结。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ShowServerAutoRecovery added in v0.0.64

ShowServerAutoRecovery 查询云服务器是否配置了自动恢复动作

查询云服务器是否配置了自动恢复动作。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ShowServerAutoRecoveryInvoker added in v0.0.90

func (c *EcsClient) ShowServerAutoRecoveryInvoker(request *model.ShowServerAutoRecoveryRequest) *ShowServerAutoRecoveryInvoker

ShowServerAutoRecoveryInvoker 查询云服务器是否配置了自动恢复动作

func (*EcsClient) ShowServerBlockDevice added in v0.0.64

ShowServerBlockDevice 查询弹性云服务器单个磁盘信息

查询弹性云服务器挂载的单个磁盘信息。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ShowServerBlockDeviceInvoker added in v0.0.90

func (c *EcsClient) ShowServerBlockDeviceInvoker(request *model.ShowServerBlockDeviceRequest) *ShowServerBlockDeviceInvoker

ShowServerBlockDeviceInvoker 查询弹性云服务器单个磁盘信息

func (*EcsClient) ShowServerGroup

func (c *EcsClient) ShowServerGroup(request *model.ShowServerGroupRequest) (*model.ShowServerGroupResponse, error)

ShowServerGroup 查询云服务器组详情

查询弹性云服务器组详情。

与原生的创建云服务器组接口不同之处在于该接口支持企业项目细粒度权限的校验。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ShowServerGroupInvoker added in v0.0.90

func (c *EcsClient) ShowServerGroupInvoker(request *model.ShowServerGroupRequest) *ShowServerGroupInvoker

ShowServerGroupInvoker 查询云服务器组详情

func (*EcsClient) ShowServerInvoker added in v0.0.90

func (c *EcsClient) ShowServerInvoker(request *model.ShowServerRequest) *ShowServerInvoker

ShowServerInvoker 查询云服务器详情

func (*EcsClient) ShowServerLimits

func (c *EcsClient) ShowServerLimits(request *model.ShowServerLimitsRequest) (*model.ShowServerLimitsResponse, error)

ShowServerLimits 查询租户配额

查询租户配额信息。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ShowServerLimitsInvoker added in v0.0.90

func (c *EcsClient) ShowServerLimitsInvoker(request *model.ShowServerLimitsRequest) *ShowServerLimitsInvoker

ShowServerLimitsInvoker 查询租户配额

func (*EcsClient) ShowServerPassword added in v0.0.64

func (c *EcsClient) ShowServerPassword(request *model.ShowServerPasswordRequest) (*model.ShowServerPasswordResponse, error)

ShowServerPassword 云服务器获取密码(企业项目)

当通过支持Cloudbase-init功能的镜像创建Windows云服务器时,获取云服务器初始安装时系统生成的管理员帐户(Administrator帐户或Cloudbase-init设置的帐户)随机密码。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ShowServerPasswordInvoker added in v0.0.90

func (c *EcsClient) ShowServerPasswordInvoker(request *model.ShowServerPasswordRequest) *ShowServerPasswordInvoker

ShowServerPasswordInvoker 云服务器获取密码(企业项目)

func (*EcsClient) ShowServerRemoteConsole

ShowServerRemoteConsole 获取VNC远程登录地址

获取弹性云服务器VNC远程登录地址。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ShowServerRemoteConsoleInvoker added in v0.0.90

func (c *EcsClient) ShowServerRemoteConsoleInvoker(request *model.ShowServerRemoteConsoleRequest) *ShowServerRemoteConsoleInvoker

ShowServerRemoteConsoleInvoker 获取VNC远程登录地址

func (*EcsClient) ShowServerTags

func (c *EcsClient) ShowServerTags(request *model.ShowServerTagsRequest) (*model.ShowServerTagsResponse, error)

ShowServerTags 查询云服务器标签

- 查询指定云服务器的标签信息。

- 标签管理服务TMS使用该接口查询指定云服务器的全部标签数据。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) ShowServerTagsInvoker added in v0.0.90

func (c *EcsClient) ShowServerTagsInvoker(request *model.ShowServerTagsRequest) *ShowServerTagsInvoker

ShowServerTagsInvoker 查询云服务器标签

func (*EcsClient) UpdateServer

func (c *EcsClient) UpdateServer(request *model.UpdateServerRequest) (*model.UpdateServerResponse, error)

UpdateServer 修改云服务器

修改云服务器信息,目前支持修改云服务器名称及描述和hostname。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) UpdateServerAutoTerminateTime

UpdateServerAutoTerminateTime 修改云服务器销毁时间

修改按需服务器,设置定时销毁时间。如果设置的销毁时间为空,表示取消销毁时间。

该接口支持企业项目细粒度权限的校验,具体细粒度请参见 ecs:cloudServers:put。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) UpdateServerAutoTerminateTimeInvoker added in v0.0.90

func (c *EcsClient) UpdateServerAutoTerminateTimeInvoker(request *model.UpdateServerAutoTerminateTimeRequest) *UpdateServerAutoTerminateTimeInvoker

UpdateServerAutoTerminateTimeInvoker 修改云服务器销毁时间

func (*EcsClient) UpdateServerBlockDevice added in v0.1.7

UpdateServerBlockDevice 修改云服务器挂载的单个磁盘信息

修改云服务器云主机挂载的单个磁盘信息。'当前仅支持修改delete_on_termination字段。

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) UpdateServerBlockDeviceInvoker added in v0.1.7

func (c *EcsClient) UpdateServerBlockDeviceInvoker(request *model.UpdateServerBlockDeviceRequest) *UpdateServerBlockDeviceInvoker

UpdateServerBlockDeviceInvoker 修改云服务器挂载的单个磁盘信息

func (*EcsClient) UpdateServerInvoker added in v0.0.90

func (c *EcsClient) UpdateServerInvoker(request *model.UpdateServerRequest) *UpdateServerInvoker

UpdateServerInvoker 修改云服务器

func (*EcsClient) UpdateServerMetadata

UpdateServerMetadata 更新云服务器元数据

更新云服务器元数据。

- 如果元数据中没有待更新字段,则自动添加该字段。

- 如果元数据中已存在待更新字段,则直接更新字段值。

- 如果元数据中的字段不再请求参数中,则保持不变

Please refer to HUAWEI cloud API Explorer for details.

func (*EcsClient) UpdateServerMetadataInvoker added in v0.0.90

func (c *EcsClient) UpdateServerMetadataInvoker(request *model.UpdateServerMetadataRequest) *UpdateServerMetadataInvoker

UpdateServerMetadataInvoker 更新云服务器元数据

type ListFlavorsInvoker added in v0.0.90

type ListFlavorsInvoker struct {
	*invoker.BaseInvoker
}

func (*ListFlavorsInvoker) Invoke added in v0.0.90

type ListResizeFlavorsInvoker added in v0.0.90

type ListResizeFlavorsInvoker struct {
	*invoker.BaseInvoker
}

func (*ListResizeFlavorsInvoker) Invoke added in v0.0.90

type ListServerBlockDevicesInvoker added in v0.0.90

type ListServerBlockDevicesInvoker struct {
	*invoker.BaseInvoker
}

func (*ListServerBlockDevicesInvoker) Invoke added in v0.0.90

type ListServerGroupsInvoker added in v0.0.90

type ListServerGroupsInvoker struct {
	*invoker.BaseInvoker
}

func (*ListServerGroupsInvoker) Invoke added in v0.0.90

type ListServerInterfacesInvoker added in v0.0.90

type ListServerInterfacesInvoker struct {
	*invoker.BaseInvoker
}

func (*ListServerInterfacesInvoker) Invoke added in v0.0.90

type ListServerTagsInvoker added in v0.0.90

type ListServerTagsInvoker struct {
	*invoker.BaseInvoker
}

func (*ListServerTagsInvoker) Invoke added in v0.0.90

type ListServersByTagInvoker added in v0.0.104

type ListServersByTagInvoker struct {
	*invoker.BaseInvoker
}

func (*ListServersByTagInvoker) Invoke added in v0.0.104

type ListServersDetailsInvoker added in v0.0.90

type ListServersDetailsInvoker struct {
	*invoker.BaseInvoker
}

func (*ListServersDetailsInvoker) Invoke added in v0.0.90

type MigrateServerInvoker added in v0.0.90

type MigrateServerInvoker struct {
	*invoker.BaseInvoker
}

func (*MigrateServerInvoker) Invoke added in v0.0.90

type NovaAssociateSecurityGroupInvoker added in v0.0.90

type NovaAssociateSecurityGroupInvoker struct {
	*invoker.BaseInvoker
}

func (*NovaAssociateSecurityGroupInvoker) Invoke added in v0.0.90

type NovaCreateKeypairInvoker added in v0.0.90

type NovaCreateKeypairInvoker struct {
	*invoker.BaseInvoker
}

func (*NovaCreateKeypairInvoker) Invoke added in v0.0.90

type NovaCreateServersInvoker added in v0.0.90

type NovaCreateServersInvoker struct {
	*invoker.BaseInvoker
}

func (*NovaCreateServersInvoker) Invoke added in v0.0.90

type NovaDeleteKeypairInvoker added in v0.0.90

type NovaDeleteKeypairInvoker struct {
	*invoker.BaseInvoker
}

func (*NovaDeleteKeypairInvoker) Invoke added in v0.0.90

type NovaDeleteServerInvoker added in v0.0.90

type NovaDeleteServerInvoker struct {
	*invoker.BaseInvoker
}

func (*NovaDeleteServerInvoker) Invoke added in v0.0.90

type NovaDisassociateSecurityGroupInvoker added in v0.0.90

type NovaDisassociateSecurityGroupInvoker struct {
	*invoker.BaseInvoker
}

func (*NovaDisassociateSecurityGroupInvoker) Invoke added in v0.0.90

type NovaListAvailabilityZonesInvoker added in v0.0.90

type NovaListAvailabilityZonesInvoker struct {
	*invoker.BaseInvoker
}

func (*NovaListAvailabilityZonesInvoker) Invoke added in v0.0.90

type NovaListKeypairsInvoker added in v0.0.90

type NovaListKeypairsInvoker struct {
	*invoker.BaseInvoker
}

func (*NovaListKeypairsInvoker) Invoke added in v0.0.90

type NovaListServerSecurityGroupsInvoker added in v0.0.90

type NovaListServerSecurityGroupsInvoker struct {
	*invoker.BaseInvoker
}

func (*NovaListServerSecurityGroupsInvoker) Invoke added in v0.0.90

type NovaListServersDetailsInvoker added in v0.0.90

type NovaListServersDetailsInvoker struct {
	*invoker.BaseInvoker
}

func (*NovaListServersDetailsInvoker) Invoke added in v0.0.90

type NovaShowKeypairInvoker added in v0.0.90

type NovaShowKeypairInvoker struct {
	*invoker.BaseInvoker
}

func (*NovaShowKeypairInvoker) Invoke added in v0.0.90

type NovaShowServerInvoker added in v0.0.90

type NovaShowServerInvoker struct {
	*invoker.BaseInvoker
}

func (*NovaShowServerInvoker) Invoke added in v0.0.90

type RegisterServerAutoRecoveryInvoker added in v0.0.90

type RegisterServerAutoRecoveryInvoker struct {
	*invoker.BaseInvoker
}

func (*RegisterServerAutoRecoveryInvoker) Invoke added in v0.0.90

type RegisterServerMonitorInvoker added in v0.1.7

type RegisterServerMonitorInvoker struct {
	*invoker.BaseInvoker
}

func (*RegisterServerMonitorInvoker) Invoke added in v0.1.7

type ReinstallServerWithCloudInitInvoker added in v0.0.90

type ReinstallServerWithCloudInitInvoker struct {
	*invoker.BaseInvoker
}

func (*ReinstallServerWithCloudInitInvoker) Invoke added in v0.0.90

type ReinstallServerWithoutCloudInitInvoker added in v0.0.90

type ReinstallServerWithoutCloudInitInvoker struct {
	*invoker.BaseInvoker
}

func (*ReinstallServerWithoutCloudInitInvoker) Invoke added in v0.0.90

type ResetServerPasswordInvoker added in v0.0.90

type ResetServerPasswordInvoker struct {
	*invoker.BaseInvoker
}

func (*ResetServerPasswordInvoker) Invoke added in v0.0.90

type ResizePostPaidServerInvoker added in v0.0.90

type ResizePostPaidServerInvoker struct {
	*invoker.BaseInvoker
}

func (*ResizePostPaidServerInvoker) Invoke added in v0.0.90

type ResizeServerInvoker added in v0.0.90

type ResizeServerInvoker struct {
	*invoker.BaseInvoker
}

func (*ResizeServerInvoker) Invoke added in v0.0.90

type ShowJobInvoker added in v0.0.90

type ShowJobInvoker struct {
	*invoker.BaseInvoker
}

func (*ShowJobInvoker) Invoke added in v0.0.90

func (i *ShowJobInvoker) Invoke() (*model.ShowJobResponse, error)

type ShowResetPasswordFlagInvoker added in v0.0.90

type ShowResetPasswordFlagInvoker struct {
	*invoker.BaseInvoker
}

func (*ShowResetPasswordFlagInvoker) Invoke added in v0.0.90

type ShowServerAutoRecoveryInvoker added in v0.0.90

type ShowServerAutoRecoveryInvoker struct {
	*invoker.BaseInvoker
}

func (*ShowServerAutoRecoveryInvoker) Invoke added in v0.0.90

type ShowServerBlockDeviceInvoker added in v0.0.90

type ShowServerBlockDeviceInvoker struct {
	*invoker.BaseInvoker
}

func (*ShowServerBlockDeviceInvoker) Invoke added in v0.0.90

type ShowServerGroupInvoker added in v0.0.90

type ShowServerGroupInvoker struct {
	*invoker.BaseInvoker
}

func (*ShowServerGroupInvoker) Invoke added in v0.0.90

type ShowServerInvoker added in v0.0.90

type ShowServerInvoker struct {
	*invoker.BaseInvoker
}

func (*ShowServerInvoker) Invoke added in v0.0.90

type ShowServerLimitsInvoker added in v0.0.90

type ShowServerLimitsInvoker struct {
	*invoker.BaseInvoker
}

func (*ShowServerLimitsInvoker) Invoke added in v0.0.90

type ShowServerPasswordInvoker added in v0.0.90

type ShowServerPasswordInvoker struct {
	*invoker.BaseInvoker
}

func (*ShowServerPasswordInvoker) Invoke added in v0.0.90

type ShowServerRemoteConsoleInvoker added in v0.0.90

type ShowServerRemoteConsoleInvoker struct {
	*invoker.BaseInvoker
}

func (*ShowServerRemoteConsoleInvoker) Invoke added in v0.0.90

type ShowServerTagsInvoker added in v0.0.90

type ShowServerTagsInvoker struct {
	*invoker.BaseInvoker
}

func (*ShowServerTagsInvoker) Invoke added in v0.0.90

type UpdateServerAutoTerminateTimeInvoker added in v0.0.90

type UpdateServerAutoTerminateTimeInvoker struct {
	*invoker.BaseInvoker
}

func (*UpdateServerAutoTerminateTimeInvoker) Invoke added in v0.0.90

type UpdateServerBlockDeviceInvoker added in v0.1.7

type UpdateServerBlockDeviceInvoker struct {
	*invoker.BaseInvoker
}

func (*UpdateServerBlockDeviceInvoker) Invoke added in v0.1.7

type UpdateServerInvoker added in v0.0.90

type UpdateServerInvoker struct {
	*invoker.BaseInvoker
}

func (*UpdateServerInvoker) Invoke added in v0.0.90

type UpdateServerMetadataInvoker added in v0.0.90

type UpdateServerMetadataInvoker struct {
	*invoker.BaseInvoker
}

func (*UpdateServerMetadataInvoker) Invoke added in v0.0.90

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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