Skip to content

Commit 2b22aff

Browse files
author
fengyikai
committed
epc:查询物理机配置信息增加套餐组子机型信息及vpc,rdma网卡信息;RunSoInstances接口展示;
1 parent b2c4a39 commit 2b22aff

7 files changed

Lines changed: 1338 additions & 181 deletions

File tree

ksyun/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
# limitations under the License.
1515

1616

17-
__version__ = '1.5.8.12'
17+
__version__ = '1.5.8.13'

ksyun/client/epc/v20151101/client.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,29 @@ def DescribeXidDetails(self, request):
16641664
raise KsyunSDKException(e.message, e.message)
16651665

16661666

1667+
def RunSoInstances(self, request):
1668+
"""创建星海实例
1669+
:param request: Request instance for RunSoInstances.
1670+
:type request: :class:`ksyun.client.epc.v20151101.models.RunSoInstancesRequest`
1671+
"""
1672+
try:
1673+
params = request._serialize()
1674+
body = self.call_judge("RunSoInstances", params, "application/x-www-form-urlencoded")
1675+
response = json.loads(body)
1676+
if "Error" not in response:
1677+
return body
1678+
else:
1679+
code = response["Error"]["Code"]
1680+
message = response["Error"]["Message"]
1681+
req_id = response["RequestId"]
1682+
raise KsyunSDKException(code, message, req_id)
1683+
except Exception as e:
1684+
if isinstance(e, KsyunSDKException):
1685+
raise
1686+
else:
1687+
raise KsyunSDKException(e.message, e.message)
1688+
1689+
16671690
def DescribeSoImages(self, request):
16681691
"""查询星海镜像
16691692
:param request: Request instance for DescribeSoImages.

ksyun/client/epc/v20151101/models.py

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2835,6 +2835,129 @@ def _deserialize(self, params):
28352835
self.NextToken = params.get("NextToken")
28362836

28372837

2838+
class RunSoInstancesRequest(AbstractModel):
2839+
"""RunSoInstances请求参数结构体
2840+
"""
2841+
2842+
def __init__(self):
2843+
r"""创建星海实例
2844+
:param ImageId: 镜像ID
2845+
:type PathPrefix: String
2846+
:param InstanceName: 实例名称
2847+
:type PathPrefix: String
2848+
:param InstanceTypeId: 机型
2849+
:type PathPrefix: String
2850+
:param SecurityGroupId: 安全组
2851+
:type PathPrefix: Filter
2852+
:param SubnetId: 子网ID
2853+
:type PathPrefix: String
2854+
:param Volumes:
2855+
:type PathPrefix: Object
2856+
:param ZoneId: 可用区
2857+
:type PathPrefix: String
2858+
:param Description: 实例的描述,默认为空字符串。
2859+
◦ 必须以字母或中文开头。
2860+
◦ 只能包含中文、字母、数字、点号“.”、空格、下划线“_”、中划线“-”、等号“=”、英文逗号“,”、中文逗号“,”和中文句号“。”
2861+
◦ 长度限制在255个字符以内。
2862+
示例值:用于测试的云服务器实例
2863+
:type PathPrefix: String
2864+
:param HostName: 实例主机名,即实例操作系统内部的计算机名。
2865+
◦ Linux实例:
2866+
◦ 允许使用字母、数字、点号“.”或中划线“-”。
2867+
◦ 不能以中划线、点号开头或结尾,且不能连续使用中划线和点号。
2868+
◦ Linux系统长度限制在2~63个字符之间。
2869+
:type PathPrefix: String
2870+
:param InstanceChargeType: 实例和云盘的计费类型,取值:
2871+
◦ 包年包月Monthly
2872+
◦ 按量付费(按日月结)Daily(默认)
2873+
:type PathPrefix: String
2874+
:param KeepImageCredential: 是否保留镜像设置,取值:
2875+
◦ true:保留镜像设置,保留后将使用镜像预设的密码或密钥对登录实例。
2876+
◦ false(默认):不保留镜像设置。
2877+
说明
2878+
◦ 仅自定义镜像支持该功能。
2879+
◦ 该参数取值为true时,请勿传入PassWord和KeyPairName。
2880+
示例值:true
2881+
:type PathPrefix: Boolean
2882+
:param KeyPairName: 如需使用“SSH密钥”方式登录实例,请指定已创建密钥对的名称。
2883+
说明
2884+
◦ Windows实例不支持SSH密钥方式,即使传入了该参数,仍旧只生效密码Password。
2885+
◦ Linux实例支持密码或密钥对登录。调用该接口时如果同时设置了密钥对KeyPairName和密码Password,则仅生效密钥对KeyPairName。
2886+
示例值:kp-test-123
2887+
:type PathPrefix: String
2888+
:param Password: 如需使用“密码”方式登录实例,请通过该参数指定实例的管理员账号初始登录密码。其中Linux管理员账号为root,Windows管理员账号为Administrator。
2889+
密码复杂度要求如下:
2890+
◦ 长度限制在8~30之间。
2891+
◦ 密码只能由大写字母、小写字母、数字和特殊字符组成,且必须包含至少三项。
2892+
◦ 特殊字符可以使用:`~!@#$%^&*()_-+=|{}[]:;'<>,.?/
2893+
◦ 不能以“/”和“$6$”开头。
2894+
说明:登录凭证支持“密码”、“密钥对”、“保留镜像设置”三种方式,使用“密码”方式登录实例时,建议增加密码复杂度以提高安全性。
2895+
:type PathPrefix: String
2896+
:param Period: 购买资源的时长(月)。
2897+
◦ 取值:1、2、3、4、5、6、7、8、9、12、24、36、48、60
2898+
◦ 默认值:1
2899+
说明:仅当参数InstanceChargeType取值为Monthly时,该参数生效且为必选值
2900+
:type PathPrefix: Int
2901+
:param SuffixIndex: 有序后缀的起始序号,取值:1~999,默认值为1。
2902+
示例值:1
2903+
:type PathPrefix: Int
2904+
:param UniqueSuffix: 表示当创建多台实例时,是否为Hostname和InstanceName自动添加有序后缀,取值:
2905+
◦ true:开启有序后缀。
2906+
◦ false(默认):关闭有序后缀。
2907+
:type PathPrefix: Boolean
2908+
"""
2909+
self.ImageId = None
2910+
self.InstanceName = None
2911+
self.InstanceTypeId = None
2912+
self.SecurityGroupId = None
2913+
self.SubnetId = None
2914+
self.Volumes = None
2915+
self.ZoneId = None
2916+
self.Description = None
2917+
self.HostName = None
2918+
self.InstanceChargeType = None
2919+
self.KeepImageCredential = None
2920+
self.KeyPairName = None
2921+
self.Password = None
2922+
self.Period = None
2923+
self.SuffixIndex = None
2924+
self.UniqueSuffix = None
2925+
2926+
def _deserialize(self, params):
2927+
if params.get("ImageId"):
2928+
self.ImageId = params.get("ImageId")
2929+
if params.get("InstanceName"):
2930+
self.InstanceName = params.get("InstanceName")
2931+
if params.get("InstanceTypeId"):
2932+
self.InstanceTypeId = params.get("InstanceTypeId")
2933+
if params.get("SecurityGroupId"):
2934+
self.SecurityGroupId = params.get("SecurityGroupId")
2935+
if params.get("SubnetId"):
2936+
self.SubnetId = params.get("SubnetId")
2937+
if params.get("Volumes"):
2938+
self.Volumes = params.get("Volumes")
2939+
if params.get("ZoneId"):
2940+
self.ZoneId = params.get("ZoneId")
2941+
if params.get("Description"):
2942+
self.Description = params.get("Description")
2943+
if params.get("HostName"):
2944+
self.HostName = params.get("HostName")
2945+
if params.get("InstanceChargeType"):
2946+
self.InstanceChargeType = params.get("InstanceChargeType")
2947+
if params.get("KeepImageCredential"):
2948+
self.KeepImageCredential = params.get("KeepImageCredential")
2949+
if params.get("KeyPairName"):
2950+
self.KeyPairName = params.get("KeyPairName")
2951+
if params.get("Password"):
2952+
self.Password = params.get("Password")
2953+
if params.get("Period"):
2954+
self.Period = params.get("Period")
2955+
if params.get("SuffixIndex"):
2956+
self.SuffixIndex = params.get("SuffixIndex")
2957+
if params.get("UniqueSuffix"):
2958+
self.UniqueSuffix = params.get("UniqueSuffix")
2959+
2960+
28382961
class DescribeSoImagesRequest(AbstractModel):
28392962
"""DescribeSoImages请求参数结构体
28402963
"""

0 commit comments

Comments
 (0)