|
| 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 CreateBandwidthPackageRequest(JDCloudRequest): |
| 23 | + """ |
| 24 | + 指定地域创建共享带宽包实例。 |
| 25 | +
|
| 26 | +## 接口说明 |
| 27 | +
|
| 28 | +- 需要接口完成实名认证、支付方式确认、计费类型选择等准备工作。 |
| 29 | +
|
| 30 | +- 各地域下包年包月和按配置计费的共享带宽包不受配额限制,按用量计费的共享带宽包可创建数量受配额限制,创建前请通过 [DescribeQuotas](https://docs.jdcloud.com/cn/shared-bandwidth-package/api/describequotas?content=API) 确认配额,如须提升请[提交工单](https://ticket.jdcloud.com/applyorder/submit)或联系京东云客服。 |
| 31 | +
|
| 32 | +- 通过本接口创建包年包月资源时将自动从账户扣款(代金券优先),如需使用第三方支付方式请通过控制台创建。 |
| 33 | +
|
| 34 | +- 按用量计费模式需提工单申请使用权限,默认支持增强95消峰计费。 |
| 35 | +
|
| 36 | + """ |
| 37 | + |
| 38 | + def __init__(self, parameters, header=None, version="v1"): |
| 39 | + super(CreateBandwidthPackageRequest, self).__init__( |
| 40 | + '/regions/{regionId}/bandwidthPackages/', 'POST', header, version) |
| 41 | + self.parameters = parameters |
| 42 | + |
| 43 | + |
| 44 | +class CreateBandwidthPackageParameters(object): |
| 45 | + |
| 46 | + def __init__(self, regionId,name, bandwidthMbps, ): |
| 47 | + """ |
| 48 | + :param regionId: Region ID |
| 49 | + :param name: 名称,只支持中文、数字、大小写字母、英文下划线“_”及中划线“-”,且长度不超过32个字符 |
| 50 | + :param bandwidthMbps: 共享带宽包带宽上限,取值范围200-5000,单位为Mbps,保底带宽 = 共享带宽包带宽上限 * 20% |
| 51 | + """ |
| 52 | + |
| 53 | + self.regionId = regionId |
| 54 | + self.name = name |
| 55 | + self.description = None |
| 56 | + self.bandwidthMbps = bandwidthMbps |
| 57 | + self.provider = None |
| 58 | + self.chargeSpec = None |
| 59 | + self.userTags = None |
| 60 | + self.resourceGroupId = None |
| 61 | + |
| 62 | + def setDescription(self, description): |
| 63 | + """ |
| 64 | + :param description: (Optional) 描述,长度不超过256个字符 |
| 65 | + """ |
| 66 | + self.description = description |
| 67 | + |
| 68 | + def setProvider(self, provider): |
| 69 | + """ |
| 70 | + :param provider: (Optional) 线路信息,默认bgp,目前只支持中心节点的BGP线路 |
| 71 | + """ |
| 72 | + self.provider = provider |
| 73 | + |
| 74 | + def setChargeSpec(self, chargeSpec): |
| 75 | + """ |
| 76 | + :param chargeSpec: (Optional) 计费配置。支持包年包月、按配置、按用量计费模式 |
| 77 | + """ |
| 78 | + self.chargeSpec = chargeSpec |
| 79 | + |
| 80 | + def setUserTags(self, userTags): |
| 81 | + """ |
| 82 | + :param userTags: (Optional) 用户标签 |
| 83 | + """ |
| 84 | + self.userTags = userTags |
| 85 | + |
| 86 | + def setResourceGroupId(self, resourceGroupId): |
| 87 | + """ |
| 88 | + :param resourceGroupId: (Optional) 资源所属资源组ID |
| 89 | + """ |
| 90 | + self.resourceGroupId = resourceGroupId |
| 91 | + |
0 commit comments