• 文档
  • 控制台
  • 登录
  • 立即注册
    目前不支持用户自主注册,如需注册账号,请联系400-080-1100
弹性裸金属服务器EBMS API参考手册
最近更新时间:2023-04-16 17:00:00

1 裸金属服务器管理

1.1 GetFlavorDetail

调用 GetFlavorDetail 接口查询指定规格信息,不涉及 IAM 鉴权。

1.1.1 使用说明

GET https://{Endpoint}/ebms/v1.0/flavor/{FlavorId}

1.1.2 请求参数

image.png

1.1.3 返回数据

image.png

表1-1 Flavor 结构体

image.png

image.png

image.png

表1-2 Tag 结构体

image.png

表1-3 StockSpec 结构体

image.png

1.1.4 示例

1. 请求示例

GET https://{Endpoint}/ebms/v1.0/flavor/4acadc89-4fb8-4edb-b390-93506ff8c829

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json 

{

"RequestId": "GetFlavorDetail",

"Data": {

"Flavor": {

"Id": "00000000-0000-0000-0000-000000000009",

"Name": "bms.g1i.xlarge",

"ZoneId": "kf-1",

"Title": "40C|192G|X86 通用型 g1i 裸金属服务器计费",

"FlavorClassId": "x86_g1i",

"Description": "40C|192G|X86 通用型 g1i 裸金属服务器计费",

"Arch": "x86",

"Ram": 196608,

"Vcpus": 40,

"CpuBaseHz": 0,

"CpuPeakHz": 0,

"CpuModel": "Intel",

"SmartnicManufactory": "",

"IntranetBandwidth": 0,

"IntranetPps": 0,

"StorageBaseIops": 0,

"StoragePeakIops": 0,

"Ipv6": 0

"Status": "",

"CreatedAt": "0001-01-01 00:00:00",

"UpdatedAt": "0001-01-01 00:00:00",

"Stock": {

"Total": 1,

"Usage": 0,

"Remain": 1

},

"Baremetal": 0,

"BmType": 2,

"Disk": 0,

"Tags": []

}

}

}


1.2 CreateBMInstance

调用 CreateBMInstance 接口创建弹性裸金属服务器实例。

1.2.1 使用说明

POST https://{Endpoint}/ebms/v1.0/server

1.2.2 请求参数

image.png

image.png

image.png

image.png

image.png

image.png

表1-4 VolumeList 结构体

image.png

1.2.3 返回数据

image.png

1.2.4 示例

        1. 请求示例

POST https://{Endpoint}/ebms/v1.0/server

{

"ChargingMode": "1",

"PeriodType": "month",

"Duration": 1,

"Hostname": "daiTest01",

"RegionId": "wgjdjs-01",

"ZoneId": "kf-1",

"SysDiskTypeId": "vtype-wg6as9cz7b577b",

"Disk": 20,

"VpcId": "vpc-zgxyvjcnvk",

"ImageId": "img-wgadjuutx9xlys",

"SubnetId": "snet-1czg2xdi0s",

"DefaultPass": "dai88CESTC",

"CpuArch": "x86",

"SecurityGroupList": ["sg-2v4lqpwd72"],

"FlavorId": "00000000-0000-0000-0000-000000000009"

}

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json 

{

"RequestId": "GetBmsList",

"Data": ["ebms-wgzko2l8d2qpum7rqcyca"]

}


1.3 DeleteBMInstance

调用 DeleteBMInstance 接口退还一台弹性裸金属服务器实例。

1.3.1 使用说明

DELETE https://{Endpoint}/ebms/v1.0/server/{BmsId}

1.3.2 请求参数

image.png

1.3.3 返回数据

image.png

1.3.4 示例

       1. 请求示例

DELETE https://{Endpoint}/ebms/v1.0/server/{BmsId}

2. 返回示例

{

"RequestId": "RebootBms",

"Data": "Success"

}


1.4 RenewOrder

调用 RenewOrder 接口续费一台弹性裸金属服务器实例。

1.4.1 使用说明

POST https://{Endpoint}/ebms/v1.0/server/reneworder

1.4.2 请求参数

image.png

1.4.3 返回数据

image.png

1.4.4 示例

       1. 请求示例

POST https://{Endpoint}/v1.0/instance/reneworder

{

"Duration": 1,

"ChargingMode": "1",

"PeriodType": "month",

"InstanceList": ["ebms-wgw8fj4k9bvh043gbf5hf"]

}

2. 返回示例

{

"RequestId": "RenewBms",

"Data": "Success"

}


1.5 GetBMInstances

调用 GetBMInstances 接口获取弹性裸金属服务器实例列表。

1.5.1 使用说明

调用 GetBMInstances 接口获取弹性裸金属服务器实例列表。

1.5.2 请求参数

调用 GetBMInstances 接口获取弹性裸金属服务器实例列表。

image.png

1.5.3 返回数据

image.png

表1-5 裸金属列表对象结构体

 image.png

表1-6 Servers 数据参数说明

image.png

image.png

表1-7 VpcPorts 对象参数说明

image.png

1.5.4 示例

       1. 请求示例

GET https://{Endpoint}/ebms/v1.0/servers?PageSize=10&PageNumber=1

2. 返回示例

{

"RequestId": "GetBmsList",

"Data": {

"PageNumber": 1,

"PageSize": 10,

"Servers": [

{

"InstanceId": "ebms-habi8oljdgwkvtvjes8ng",

"Description": "",

"FlavorId": "00000000-0000-0000-0000-000000000013",

"CpuModel": "FT2000+",

"CpuArch": "arm",

"RegionId": "hanmei03",

"ZoneId": "zone-1",

"Name": "cecloud-bms-39325",

"ImageId": "img-haok7jlyhfpg0p",

"Protected": true,

"TenantId": "220103001600410",

"NodeId": "",

"VpcPorts": [

{

"PortId": "",

"VpcId": "vpc-cg8hij8ccd"

"MacAddr": "",

"Status": ""

}

],

"Status": "deleting",

"TransitionStatus": "",

"DefaultPasswd": "Admin123",

"Ip": "192.168.1.4",

"UserData": "",

"PayModel": "1",

"OrderId": "220510000025596",

"BmType": 2,

"CreatedAt": "2022-05-10 14:57:38",

"UpdatedAt": "2022-05-11 10:23:32",

"ExpireTime": "2022-06-10 23:59:59",

"FreezedTime": "2022-06-17 23:59:59",

"ReleaseTime": "2022-07-02 23:59:59",

"EipUid": "",

"Eip": ""

}

],

"TotalCount": 1

}

}


1.6 GetBMInstance

调用 GetBMInstance 接口查询弹性裸金属服务器实例详情信息。

1.6.1 使用说明

GET https://{Endpoint}/ebms/v1.0/server/{serverId}

1.6.2 请求参数

image.png

1.6.3 返回数据

image.png

表1-8 Instance 详情信息

image.png

表1-9 Server 详情信息

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

表1-10 Flavor 详情信息

image.png

image.png

image.png

表1-11 Vpc 详情信息

image.png

表1-12 Subnet 详情信息

image.png

表1-13 Port 详情信息

image.png



1.6.4 示例

       1. 请求示例

GET https://{Endpoint}/ebms/v1.0/server/{ServerId}

2. 返回示例

{

"RequestId": "GetBmsDetail",

"Data": {

"Server": {

"InstanceId": "ebms-habi8oljdgwkvtvjes8ng",

"Description": "",

"FlavorId": "00000000-0000-0000-0000-000000000013",

"CpuArch": "arm",

"RegionId": "hanmei03",

"ZoneId": "zone-1",

"Name": "cecloud-bms-39325",

"ImageId": "img-haok7jlyhfpg0p",

"Protected": false,

"TenantId": "220103001600410",

"NodeId": "",

"Status": "deleting",

"TransitionStatus": "",

"DefaultPasswd": "Admin123",

"Userdata": "",

"PayModel": "1",

"OrderId": "220510000025596",

"SubnetUid": "snet-r0ril8g2ql",

"NetworkUid": "vpc-cg8hij8ccd",

"BmType": 2,

"Ip": "192.168.1.4",

"ExpireTime": "2022-06-10 23:59:59",

"SecurityGroupIds": "",

"CreatedAt": "2022-05-10T14:57:38+08:00",

"UpdatedAt": "2022-05-11T10:23:32+08:00"

},

"Flavor": {

"FlavorId": "00000000-0000-0000-0000-000000000013",

"Name": "bms.g1.xlarge",

"ZoneId": "zone-1",

"Title": "64C|256G|飞腾通用型 g1 裸金属服务器计费",

"ClassId": "ft_arm64_g1",

"Description": "64C|256G|飞腾通用型 g1 裸金属服务器计费",

"Arch": "arm",

"Ram": 262144,

"Cpus": 64,

"CpuBaseHz": "0",

"CpuPeakHz": "0",

"CpuModel": "FT2000+",

"IntranetBandwidth": "0",

"IntranetPps": "0",

"StorageBaseIops": "0",

"StoragePeakIops": "0",

"Ipv6": 0,

"Status": "",

"CreatedAt": "0001-01-01T00:00:00Z",

"UpdatedAt": "0001-01-01T00:00:00Z",

"Baremetal": 1,

"BmType": 2,

"Stock": {

"Total": 0,

"Usage": 0,

"Remain": 0,

"Offline": 0

},

"OsDiskSize": 0,

"Disk": 0

},

"Vpc": {

"Id": "vpc-cg8hij8ccd",

"Name": "bare-vpc",

"Cidr": "192.168.0.0/16",

"Status": "RUNNING",

"TenantId": "220103001600410",

"InstanceId": "",

"Type": "tenant",

"CreatedAt": "2022-04-06T14:45:05+08:00",

"UpdatedAt": "2022-04-06T14:45:06+08:00"

},

"Subnet": {

"Id": "snet-r0ril8g2ql",

"Name": "bare-subnet",

"VpcId": "vpc-cg8hij8ccd",

"Cidr": "192.168.1.0/24",

"Status": "RUNNING",

"AvailableIps": 245,

"GatewayIp": "192.168.1.1",

"CreatedAt": "2022-04-06T14:45:34+08:00"

},

"Port": {

"SubnetId": "snet-r0ril8g2ql",

"IpAddress": "192.168.1.4",

"PortId": "port-d2q5jef9zk",

"VpcId": "vpc-cg8hij8ccd",

"MacAddr": "06:B4:63:FE:81:24",

"Uuid": "port-d2q5jef9zk",

"QosPolicyId": "",

"DnsList": "",

"DhcpEnable": true,

"BmsId": "ebms-habi8oljdgwkvtvjes8ng",

"DeviceOwner": "baremetal",

"Status": "hard_deleted",

"CreatedAt": "0001-01-01 00:00:00",

"UpdatedAt": "0001-01-01 00:00:00"

}

}

}


1.7 StartBMInstance/StopBMInstance

 调用 StartBMInstance 接口开启一台弹性裸金属服务器实例,或调用 StoptBMInstance 接口关闭一台弹性裸金属服务器实例。


1.7.1 使用说明

POST https://{Endpoint}/ebms/v1.0/server/{ServerId}/start

POST https://{Endpoint}/ebms/v1.0/server/{ServerId}/stop


1.7.2 请求参数

image.png

1.7.3 返回数据

image.png

1.7.4 示例

1. 请求示例

POST https://{Endpoint}/ebms/v1.0/server/{ServerId}/start

POST https://{Endpoint}/ebms/v1.0/server/{ServerId}/stop

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json 

{

"RequestId": "StartBms",

"Data": "Success"

}


1.8 AttachEIP/DetachEIP

调用 AttachEIP 接口绑定一个弹性公网 IP,或调用 DetachEIP 接口解绑一个弹性公网 IP。

1.8.1 使用说明

POST https://{Endpoint}/ebms/v1.0/server/bindeip

POST https://{Endpoint}/ebms/v1.0/server/unbindeip


1.8.2 请求参数

image.png

1.8.3 返回数据

image.png

1.8.4 示例

1. 请求示例

POST https://{Endpoint}/ebms/v1.0/server/bindeip 

POST https://{Endpoint}/ebms/v1.0/server/unbindeip

{

"InstanceId": "ebms-wgw8fj4k9bvh043gbf5hf",

"EipId": "eip-2ilogbjqvsky"

}

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json

{

"RequestId": "BindBms",

"Data": "Success"

}


1.9 AttachVolume/DetachVolume

调用 AttachVolume 接口挂载数据盘,或调用 DetachVolume 接口卸载数据盘。

1.9.1 使用说明

POST https://{Endpoint}/ebms/v1.0/server/{ServerId}/attachvolume

POST https://{Endpoint}/ebms/v1.0/server/{ServerId}/detachvolume


1.9.2 请求参数

image.png

1.9.3 返回数据

image.png

image.png

1.9.4 示例

1. 请求示例

POST https://{Endpoint}/ebms/v1.0/server/{ServerId}/attachvolume

POST https://{Endpoint}/ebms/v1.0/server/{ServerId}/detachvolume 

{

"VolumeIdList": ["vol-wgxtdn2slzjjyr"]

}

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json

{

"RequestId": "DetachVolume",

"Data": "Success"

}


1.10 GetZones

调用 GetZones 接口获取可用区列表信息。

1.10.1 使用说明

GET https://{Endpoint}/ebms/v1.0/zones

1.10.2 请求参数

查询参数:是可选部分,并不是每个查询参数都要传入。查询参数前面需要带一个“?”,形式为“参数名=参数取值”,例如“?PageSize=10”,表示查询不超过 10 条数据。

 image.png

   image.png

  表1-14 判断条件字段信息

    image.png



1.10.3 返回数据

image.png

表1-15 可用区信息详情

  image.png

表1-16 Zones 详情信息

     image.png

      image.png


1.10.4 示例

       1. 请求示例

GET https://{Endpoint}/ebms/v1.0/zones 

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json

{

"RequestId": "GetZones",

"Data": {

"PageNumber": 0,

"PageSize": 0,

"TotalCount": 1,

"Zones": [

{

"Name": "可用区 01",

"ZoneId": "kf-1",

"CreatedAt": 1648611250,

"UpdatedAt": 1648611250

}

]

}

}


1.11 GetImageList

调用 GetZones 接口获取可用区列表信息。

1.11.1 使用说明

GET https://{Endpoint}/ebms/v1.0/images

1.11.2 请求参数

       查询参数:是可选部分,并不是每个查询参数都要传入。查询参数前面需要带一个“?”,形式为“参数名=参数取值”,例如“?PageSize=10”,表示查询不超过 10 条数据。

image.png


1.11.3 返回数据

image.png

      表1-17 Image 列表详情信息

      image.png

表1-18 镜像信息详情

        image.png

        image.png


1.11.4 示例

        1. 请求示例

GET https://{Endpoint}/ebms/v1.0/images 

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json

{

"RequestId": "GetImages",

"Data": {

"Images": [

{

"ArchType": 1,

"CreateTime": "2022-05-24T13:37:19+08:00",

"Id": "img-wghnkd4keb7b61",

"MaxRam": "",

"MinDisk": 20,

"MinRam": 1024,

"Name": "ebms-centos-0524.raw",

"OsType": "linux",

"OsVersion": "",

"RegionCode": "",

"Remark": "",

"ResourceCode": "",

"Status": 4,

"Type": 0,

"Uid": "img-wghnkd4keb7b61",

"UpdateTime": "2022-05-24T14:14:42+08:00",

"Visibility": "public",

"BmType": 2

},

{

"ArchType": 2,

"CreateTime": "2022-05-24T12:16:48+08:00",

"Id": "img-wg3navcaf94u6v",

"MaxRam": "",

"MinDisk": 20,

"MinRam": 10240,

"Name": "os-bf2-new",

"OsType": "linux",

"OsVersion": "",

"RegionCode": "",

"Remark": "",

"ResourceCode": "",

"Status": 4,

"Type": 0,

"Uid": "img-wg3navcaf94u6v",

"UpdateTime": "2022-05-24T13:53:49+08:00",

"Visibility": "public",

"BmType": 2

}

]

"PageNumber": 0,

"PageSize": 0,

"TotalCount": 2

}

}



1.12 RebootBMInstance

调用 RebootBMInstance 接口重启弹性裸金属服务器实例。

1.12.1 使用说明

POST https://{Endpoint}/ebms/v1.0/server/{ServerId}/reboot

1.12.2 请求参数

image.png

1.12.3 返回数据

image.png

1.12.4 示例

    1. 请求示例

POST https://{Endpoint}/ebms/v1.0/server/{ServerId}/reboot

{

"HardAction": false

}

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json

{

"RequestId": "RebootBms",

"Data": "Success"

}


1.13 GetFlavorClass

调用 GetFlavorClass 接口获取规格族列表信息。

1.13.1 使用说明

1.13.2 请求参数

      查询参数:是可选部分,并不是每个查询参数都要传入。查询参数前面需要带一个“?”,形式为“参数名=参数取值”,例如“?PageSize=10”,表示查询不超过 10 条数据。

image.png

1.13.3 返回数据

image.png

表1-19 Zones 详情信息

image.png

image.png

表1-20 规格族信息详情

image.png

1.13.4 示例

       1. 请求示例

GET https://{Endpoint}/ebms/v1.0/flavorclass

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json

{

"RequestId": "GetFlavorClass",

"Data": {

"FlavorClass": [

{

"Id": 1,

"ClassId": "",

"Name": "通用型",

"CreatedAt": 1648619190,

"UpdatedAt": 1648619190

},

{

"Id": 4,

"ClassId": "x86_d1i",

"Name": "X86 存储型 d1i",

36

"CreatedAt": 0,

"UpdatedAt": 0

},

{

"Id": 3,

"ClassId": "x86_c1i",

"Name": "X86 计算型 c1i",

"CreatedAt": 0,

"UpdatedAt": 0

},

{

"Id": 2,

"ClassId": "x86_g1i",

"Name": "X86 通用型 g1i",

"CreatedAt": 0,

"UpdatedAt": 0

}

],

"PageNumber": 0,

"PageSize": 0,

"TotalCount": 22

}

}


1.14 RenameInstance

调用 RenameInstance 接口重命名弹性裸金属服务器实例。

1.14.1 使用说明

PUT https://{Endpoint}/ebms/v1.0/server/rename

1.14.2 请求参数

image.png

1.14.3 返回数据

image.png

1.14.4 示例

        1. 请求示例

POST https://{Endpoint}/ebms/v1.0/server/rename

{

"InstanceId": "ebms-wgw8fj4k9bvh043gbf5hf",

"Name": "yh-x86-makeimage"

}

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json

{

"RequestId": "RenameBms",

"Data": "Success"

}


1.15 GetFlavors

调用 GetFlavors 接口获取规格列表信息.

1.15.1 使用说明

GET https://{Endpoint}/ebms/v1.0/flavors

1.15.2 请求参数

      查询参数:是可选部分,并不是每个查询参数都要传入。查询参数前面需要带一个“?”,形式为“参数名=参数取值”,例如“?PageSize=10”,表示查询不超过 10 条数据.

   image.png


1.15.3 返回数据

image.png

表1-21 规格信息详情

image.png

1.15.4 示例

        1. 请求示例

GET https://{Endpoint}/ebms/v1.0/flavors

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json

{

"RequestId": "GetFlavors",

"Data": {

"Flavors": [

{

"Id": "00000000-0000-0000-0000-000000000009",

"Name": "bms.g1i.xlarge",

"ZoneId": "kf-1",

"Title": "40C|192G|X86 通用型 g1i 裸金属服务器计费",

"FlavorClassId": "x86_g1i",

"Description": "40C|192G|X86 通用型 g1i 裸金属服务器计费",

"Arch": "x86",

"Ram": 196608,

"Vcpus": 40,

"CpuBaseHz": 0,

"CpuPeakHz": 0,

"CpuModel": "Intel",

"SmartnicManufactory": "",

"IntranetBandwidth": 0,

"IntranetPps": 0,

"StorageBaseIops": 0,

"StoragePeakIops": 0,

"Ipv6": 0,

"Status": "",

"CreatedAt": "0001-01-01T00:00:00Z",

"UpdatedAt": "0001-01-01T00:00:00Z",

"Stock": {

"Total": 1,

"Usage": 0,

"Remain": 1

},

"Baremetal": 0,

"BmType": 2,

"Disk": 0,

"Tags": []

},

{

"Id": "00000000-0000-0000-0000-000000000010",

"Name": "bms.g1i.2xlarge",

"ZoneId": "kf-1",

"Title": "48C|384G|X86 通用型 g1i 裸金属服务器计费",

"FlavorClassId": "x86_g1i",

"Description": "48C|384G|X86 通用型 g1i 裸金属服务器计费",

"Arch": "x86",

"Ram": 393216,

"Vcpus": 48,

"CpuBaseHz": 0,

"CpuPeakHz": 0,

"CpuModel": "Intel",

"SmartnicManufactory": "",

"IntranetBandwidth": 0,

"IntranetPps": 0,

"StorageBaseIops": 0,

"StoragePeakIops": 0,

"Ipv6": 0,

"Status": "",

"CreatedAt": "0001-01-01T00:00:00Z",

"UpdatedAt": "0001-01-01T00:00:00Z",

"Stock": {

"Total": 0,

"Usage": 0,

"Remain": 0

},

"Baremetal": 0,

"BmType": 2,

"Disk": 0,

"Tags": []

}

],

"PageSize": 10,

"PageNumber": 1,

"TotalCount": 2

}

}


意见反馈

文档内容是否对您有帮助?

如您有其他疑问,您也可以通过在线客服来与我们联系探讨 在线客服

联系我们
回到顶部