Skip to content

Commit 29d93a3

Browse files
committed
publish jdcloud-sdk-python 1.6.57
1 parent 6ea2914 commit 29d93a3

24 files changed

Lines changed: 384 additions & 15 deletions

jdcloud_sdk/services/vm/ChangeLog.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# 更新历史 #
2-
API版本:1.2.7
2+
API版本:1.3.0
33

44
|发布时间|版本号|更新|说明|
55
|---|---|---|---|
6+
|2020-04-20 |1.3.0 |新增接口 |* 增加查询云主机列表轻量接口 |
7+
|2020-04-20 |1.2.8 |新增参数 |* 创建、停止虚机,创建模板的接口增加chargeOnStopped参数 |
68
|2020-01-16 |1.2.7 |新增接口 |* 新增镜像导出接口 |
79
|2019-10-25 |1.2.5 |新增参数 |* 支持创建虚机时指定标签 |
810
|2019-10-21 |1.2.4 |升级 |* 升级Charge模块版本 */

jdcloud_sdk/services/vm/apis/CreateInstancesRequest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ class CreateInstancesRequest(JDCloudRequest):
5858
- 自动删除
5959
- 默认自动删除,如果是包年包月的云硬盘,此参数不生效
6060
- 可以从快照创建磁盘
61+
- iops
62+
- 仅当云盘类型为ssd.io1时,可指定iops值,范围为【200, min(32000,size * 50 )】,步长为10,若不指定则按此公式计算默认值
6163
- local类型系统的云主机可以挂载8块云硬盘
6264
- cloud类型系统的云主机可以挂载7块云硬盘
6365
- 计费
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# coding=utf8
2+
3+
# Copyright 2018 JDCLOUD.COM
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# NOTE: This class is auto generated by the jdcloud code generator program.
18+
19+
from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest
20+
21+
22+
class DescribeBriefInstancesRequest(JDCloudRequest):
23+
"""
24+
批量查询云主机信息的轻量接口,不返回云盘、网络、计费、标签等信息。如果不需要关联资源属性,尽量选择使用该接口。<br>
25+
此接口支持分页查询,默认每页20条。
26+
27+
"""
28+
29+
def __init__(self, parameters, header=None, version="v1"):
30+
super(DescribeBriefInstancesRequest, self).__init__(
31+
'/regions/{regionId}/instances:describeBriefInstances', 'POST', header, version)
32+
self.parameters = parameters
33+
34+
35+
class DescribeBriefInstancesParameters(object):
36+
37+
def __init__(self, regionId, ):
38+
"""
39+
:param regionId: 地域ID
40+
"""
41+
42+
self.regionId = regionId
43+
self.pageNumber = None
44+
self.pageSize = None
45+
self.tags = None
46+
self.filters = None
47+
48+
def setPageNumber(self, pageNumber):
49+
"""
50+
:param pageNumber: (Optional) 页码;默认为1
51+
"""
52+
self.pageNumber = pageNumber
53+
54+
def setPageSize(self, pageSize):
55+
"""
56+
:param pageSize: (Optional) 分页大小;默认为20;取值范围[10, 100]
57+
"""
58+
self.pageSize = pageSize
59+
60+
def setTags(self, tags):
61+
"""
62+
:param tags: (Optional) Tag筛选条件
63+
"""
64+
self.tags = tags
65+
66+
def setFilters(self, filters):
67+
"""
68+
:param filters: (Optional) instanceId - 云主机ID,精确匹配,支持多个
69+
privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个
70+
az - 可用区,精确匹配,支持多个
71+
vpcId - 私有网络ID,精确匹配,支持多个
72+
status - 云主机状态,精确匹配,支持多个,<a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a>
73+
name - 云主机名称,模糊匹配,支持单个
74+
imageId - 镜像ID,精确匹配,支持多个
75+
networkInterfaceId - 弹性网卡ID,精确匹配,支持多个
76+
subnetId - 子网ID,精确匹配,支持多个
77+
agId - 使用可用组id,支持单个
78+
faultDomain - 错误域,支持多个
79+
dedicatedHostId - 专有宿主机ID,精确匹配,支持多个
80+
dedicatedPoolId - 专有宿主机池ID,精确匹配,支持多个
81+
instanceType - 实例规格,精确匹配,支持多个
82+
elasticIpAddress - 公网IP地址,精确匹配,支持单个
83+
84+
"""
85+
self.filters = filters
86+

jdcloud_sdk/services/vm/apis/DescribeImagesRequest.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def __init__(self, regionId, ):
4242

4343
self.regionId = regionId
4444
self.imageSource = None
45+
self.serviceCode = None
46+
self.offline = None
4547
self.platform = None
4648
self.ids = None
4749
self.rootDeviceType = None
@@ -56,6 +58,18 @@ def setImageSource(self, imageSource):
5658
"""
5759
self.imageSource = imageSource
5860

61+
def setServiceCode(self, serviceCode):
62+
"""
63+
:param serviceCode: (Optional) 产品线标识,非必传,不传的时候返回全部产品线镜像
64+
"""
65+
self.serviceCode = serviceCode
66+
67+
def setOffline(self, offline):
68+
"""
69+
:param offline: (Optional) 是否下线,默认值为false;imageSource为public或者thirdparty时,此参数才有意义,其它情况下此参数无效;指定镜像ID查询时,此参数无效
70+
"""
71+
self.offline = offline
72+
5973
def setPlatform(self, platform):
6074
"""
6175
:param platform: (Optional) 操作系统平台,取值范围:Windows Server、CentOS、Ubuntu

jdcloud_sdk/services/vm/apis/DescribeInstancePrivateIpAddressRequest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def setFilters(self, filters):
6464
imageId - 镜像ID,精确匹配,支持多个
6565
networkInterfaceId - 弹性网卡ID,精确匹配,支持多个
6666
subnetId - 子网ID,精确匹配,支持多个
67+
chargeOnStopped - 停机不计费标志,keepCharging、stopCharging 或者 notApplicable
6768
6869
"""
6970
self.filters = filters

jdcloud_sdk/services/vm/apis/DescribeInstancesRequest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ def setFilters(self, filters):
6969
subnetId - 子网ID,精确匹配,支持多个
7070
agId - 使用可用组id,支持单个
7171
faultDomain - 错误域,支持多个
72+
dedicatedHostId - 专有宿主机ID,精确匹配,支持多个
73+
dedicatedPoolId - 专有宿主机池ID,精确匹配,支持多个
74+
instanceType - 实例规格,精确匹配,支持多个
75+
elasticIpAddress - 公网IP地址,精确匹配,支持单个
7276
7377
"""
7478
self.filters = filters

jdcloud_sdk/services/vm/apis/StopInstanceRequest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,11 @@ def __init__(self, regionId, instanceId, ):
4141

4242
self.regionId = regionId
4343
self.instanceId = instanceId
44+
self.chargeOnStopped = None
45+
46+
def setChargeOnStopped(self, chargeOnStopped):
47+
"""
48+
:param chargeOnStopped: (Optional) 关机模式,只支持云盘做系统盘的按配置计费云主机keepCharging:关机后继续计费;stopCharging:关机后停止计费。
49+
"""
50+
self.chargeOnStopped = chargeOnStopped
4451

jdcloud_sdk/services/vm/client/VmClient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ def __init__(self, credential, config=None, logger=None):
2626
if config is None:
2727
config = Config('vm.jdcloud-api.com')
2828

29-
super(VmClient, self).__init__(credential, config, 'vm', '1.2.7', logger)
29+
super(VmClient, self).__init__(credential, config, 'vm', '1.3.0', logger)
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# coding=utf8
2+
3+
# Copyright 2018 JDCLOUD.COM
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# NOTE: This class is auto generated by the jdcloud code generator program.
18+
19+
20+
class BriefInstance(object):
21+
22+
def __init__(self, instanceId=None, instanceName=None, instanceType=None, vpcId=None, subnetId=None, privateIpAddress=None, status=None, description=None, imageId=None, systemDisk=None, dataDisks=None, primaryNetworkInterface=None, secondaryNetworkInterfaces=None, launchTime=None, az=None, keyNames=None, faultDomain=None, chargeOnStopped=None, dedicatedPoolId=None, dedicatedHostId=None):
23+
"""
24+
:param instanceId: (Optional) 云主机ID
25+
:param instanceName: (Optional) 云主机名称
26+
:param instanceType: (Optional) 实例规格
27+
:param vpcId: (Optional) 主网卡所属VPC的ID
28+
:param subnetId: (Optional) 主网卡所属子网的ID
29+
:param privateIpAddress: (Optional) 主网卡主IP地址
30+
:param status: (Optional) 云主机状态,<a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a>
31+
:param description: (Optional) 云主机描述
32+
:param imageId: (Optional) 镜像ID
33+
:param systemDisk: (Optional) 系统盘配置
34+
:param dataDisks: (Optional) 数据盘配置
35+
:param primaryNetworkInterface: (Optional) 主网卡配置
36+
:param secondaryNetworkInterfaces: (Optional) 辅助网卡配置
37+
:param launchTime: (Optional) 创建时间
38+
:param az: (Optional) 云主机所在可用区
39+
:param keyNames: (Optional) 密钥对名称
40+
:param faultDomain: (Optional) 高可用组中的错误域
41+
:param chargeOnStopped: (Optional) 关机模式,只支持云盘做系统盘的按配置计费云主机。KeepCharging:关机后继续计费;StopCharging:关机后停止计费。
42+
:param dedicatedPoolId: (Optional) 实例所属的专有宿主机池
43+
:param dedicatedHostId: (Optional) 专有宿主机ID
44+
"""
45+
46+
self.instanceId = instanceId
47+
self.instanceName = instanceName
48+
self.instanceType = instanceType
49+
self.vpcId = vpcId
50+
self.subnetId = subnetId
51+
self.privateIpAddress = privateIpAddress
52+
self.status = status
53+
self.description = description
54+
self.imageId = imageId
55+
self.systemDisk = systemDisk
56+
self.dataDisks = dataDisks
57+
self.primaryNetworkInterface = primaryNetworkInterface
58+
self.secondaryNetworkInterfaces = secondaryNetworkInterfaces
59+
self.launchTime = launchTime
60+
self.az = az
61+
self.keyNames = keyNames
62+
self.faultDomain = faultDomain
63+
self.chargeOnStopped = chargeOnStopped
64+
self.dedicatedPoolId = dedicatedPoolId
65+
self.dedicatedHostId = dedicatedHostId
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# coding=utf8
2+
3+
# Copyright 2018 JDCLOUD.COM
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# NOTE: This class is auto generated by the jdcloud code generator program.
18+
19+
20+
class BriefInstanceDiskAttachment(object):
21+
22+
def __init__(self, diskCategory=None, autoDelete=None, localDisk=None, deviceName=None, status=None):
23+
"""
24+
:param diskCategory: (Optional) 磁盘分类,取值为本地盘(local)或者数据盘(cloud)。
25+
系统盘支持本地盘(local)或者云硬盘(cloud)。系统盘选择local类型,必须使用localDisk类型的镜像;同理系统盘选择cloud类型,必须使用cloudDisk类型的镜像。
26+
数据盘仅支持云硬盘(cloud)。
27+
28+
:param autoDelete: (Optional) 随云主机一起删除,删除主机时自动删除此磁盘,默认为true,本地盘(local)不能更改此值。
29+
如果云主机中的数据盘(cloud)是包年包月计费方式,此参数不生效。
30+
如果云主机中的数据盘(cloud)是共享型数据盘,此参数不生效。
31+
32+
:param localDisk: (Optional) 本地磁盘配置
33+
:param deviceName: (Optional) 数据盘逻辑挂载点,取值范围:vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi,vmj,vdk,vdl,vdm
34+
:param status: (Optional) 数据盘挂载状态,取值范围:attaching,detaching,attached,detached,error_attach,error_detach
35+
"""
36+
37+
self.diskCategory = diskCategory
38+
self.autoDelete = autoDelete
39+
self.localDisk = localDisk
40+
self.deviceName = deviceName
41+
self.status = status

0 commit comments

Comments
 (0)