|
| 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 CreateInstancesRequest(JDCloudRequest): |
| 23 | + """ |
| 24 | + 创建一台或多台指定配置的实例。批量创建多台实例时系统将尽可能完成目标创建数量,但受底层资源、配额等因素影响,可能存在部分成功部分失败的情况,还请关注最终完成数量,如有失败情况请尝试重新申请或联系客服。 |
| 25 | +
|
| 26 | + """ |
| 27 | + |
| 28 | + def __init__(self, parameters, header=None, version="v1"): |
| 29 | + super(CreateInstancesRequest, self).__init__( |
| 30 | + '/regions/{regionId}/baremetals', 'POST', header, version) |
| 31 | + self.parameters = parameters |
| 32 | + |
| 33 | + |
| 34 | +class CreateInstancesParameters(object): |
| 35 | + |
| 36 | + def __init__(self,regionId, instanceSpec, ): |
| 37 | + """ |
| 38 | + :param regionId: 地域ID。 |
| 39 | + :param instanceSpec: 实例配置 |
| 40 | + """ |
| 41 | + |
| 42 | + self.regionId = regionId |
| 43 | + self.instanceSpec = instanceSpec |
| 44 | + self.maxCount = None |
| 45 | + self.dryRun = None |
| 46 | + self.clientToken = None |
| 47 | + |
| 48 | + def setMaxCount(self, maxCount): |
| 49 | + """ |
| 50 | + :param maxCount: (Optional) 创建节点的数量,调用商业平台配额查询接口结合已购买数量,判断最大可购买数量,不可超出配额。默认值:1。 |
| 51 | +
|
| 52 | + """ |
| 53 | + self.maxCount = maxCount |
| 54 | + |
| 55 | + def setDryRun(self, dryRun): |
| 56 | + """ |
| 57 | + :param dryRun: (Optional) 预先验证创建请求 |
| 58 | + """ |
| 59 | + self.dryRun = dryRun |
| 60 | + |
| 61 | + def setClientToken(self, clientToken): |
| 62 | + """ |
| 63 | + :param clientToken: (Optional) 用于保证请求的幂等性。由客户端生成,并确保不同请求中该参数唯一,长度不能超过64个字符。 |
| 64 | + """ |
| 65 | + self.clientToken = clientToken |
| 66 | + |
0 commit comments