Skip to content

Commit bff2fed

Browse files
author
tencentcloudapi
committed
release 3.0.48
1 parent 6506d45 commit bff2fed

File tree

17 files changed

+4333
-167
lines changed

17 files changed

+4333
-167
lines changed

tencentcloud/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
__version__ = '3.0.47'
16+
__version__ = '3.0.48'

tencentcloud/autoscaling/v20180419/autoscaling_client.py

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,36 @@ def CreateAutoScalingGroup(self, request):
111111
raise TencentCloudSDKException(e.message, e.message)
112112

113113

114+
def CreateAutoScalingGroupFromInstance(self, request):
115+
"""This API is used to create launch configurations and scaling groups from an instance.
116+
117+
Note: the pay-as-you-go instance in the scaling group that is created from a monthly-subscribed instance can be expanded.
118+
119+
:param request: Request instance for CreateAutoScalingGroupFromInstance.
120+
:type request: :class:`tencentcloud.autoscaling.v20180419.models.CreateAutoScalingGroupFromInstanceRequest`
121+
:rtype: :class:`tencentcloud.autoscaling.v20180419.models.CreateAutoScalingGroupFromInstanceResponse`
122+
123+
"""
124+
try:
125+
params = request._serialize()
126+
body = self.call("CreateAutoScalingGroupFromInstance", params)
127+
response = json.loads(body)
128+
if "Error" not in response["Response"]:
129+
model = models.CreateAutoScalingGroupFromInstanceResponse()
130+
model._deserialize(response["Response"])
131+
return model
132+
else:
133+
code = response["Response"]["Error"]["Code"]
134+
message = response["Response"]["Error"]["Message"]
135+
reqid = response["Response"]["RequestId"]
136+
raise TencentCloudSDKException(code, message, reqid)
137+
except Exception as e:
138+
if isinstance(e, TencentCloudSDKException):
139+
raise
140+
else:
141+
raise TencentCloudSDKException(e.message, e.message)
142+
143+
114144
def CreateLaunchConfiguration(self, request):
115145
"""This API (CreateLaunchConfiguration) is used to create a launch configuration.
116146
@@ -1203,6 +1233,68 @@ def SetInstancesProtection(self, request):
12031233
raise TencentCloudSDKException(e.message, e.message)
12041234

12051235

1236+
def StartAutoScalingInstances(self, request):
1237+
"""This API is used to launch CVM instances in the scaling group.
1238+
* After the instance is launched and in the `IN_SERVICE` status, the desired capacity increases, but the desired capacity cannot exceed the maximum value.
1239+
* This API supports batch operation. Up to 100 instances can be launched in each request.
1240+
1241+
:param request: Request instance for StartAutoScalingInstances.
1242+
:type request: :class:`tencentcloud.autoscaling.v20180419.models.StartAutoScalingInstancesRequest`
1243+
:rtype: :class:`tencentcloud.autoscaling.v20180419.models.StartAutoScalingInstancesResponse`
1244+
1245+
"""
1246+
try:
1247+
params = request._serialize()
1248+
body = self.call("StartAutoScalingInstances", params)
1249+
response = json.loads(body)
1250+
if "Error" not in response["Response"]:
1251+
model = models.StartAutoScalingInstancesResponse()
1252+
model._deserialize(response["Response"])
1253+
return model
1254+
else:
1255+
code = response["Response"]["Error"]["Code"]
1256+
message = response["Response"]["Error"]["Message"]
1257+
reqid = response["Response"]["RequestId"]
1258+
raise TencentCloudSDKException(code, message, reqid)
1259+
except Exception as e:
1260+
if isinstance(e, TencentCloudSDKException):
1261+
raise
1262+
else:
1263+
raise TencentCloudSDKException(e.message, e.message)
1264+
1265+
1266+
def StopAutoScalingInstances(self, request):
1267+
"""This API is used to shut down CVM instances in the scaling group.
1268+
* Use the `SOFT_FIRST` shutdown, which means the CVM will be forcibly shut down if the soft shutdown fails.
1269+
* Shutting down instances in the `IN_SERVICE` status will reduce the desired capacity, but the desired capacity cannot be less than the minimum value.
1270+
* To use the `STOP_CHARGING` shutdown, the instances you want to shut down must satisfy the conditions of [no charges when shut down](https://cloud.tencent.com/document/product/213/19918).
1271+
* This API supports batch operation. Up to 100 instances can be shut down in each request.
1272+
1273+
:param request: Request instance for StopAutoScalingInstances.
1274+
:type request: :class:`tencentcloud.autoscaling.v20180419.models.StopAutoScalingInstancesRequest`
1275+
:rtype: :class:`tencentcloud.autoscaling.v20180419.models.StopAutoScalingInstancesResponse`
1276+
1277+
"""
1278+
try:
1279+
params = request._serialize()
1280+
body = self.call("StopAutoScalingInstances", params)
1281+
response = json.loads(body)
1282+
if "Error" not in response["Response"]:
1283+
model = models.StopAutoScalingInstancesResponse()
1284+
model._deserialize(response["Response"])
1285+
return model
1286+
else:
1287+
code = response["Response"]["Error"]["Code"]
1288+
message = response["Response"]["Error"]["Message"]
1289+
reqid = response["Response"]["RequestId"]
1290+
raise TencentCloudSDKException(code, message, reqid)
1291+
except Exception as e:
1292+
if isinstance(e, TencentCloudSDKException):
1293+
raise
1294+
else:
1295+
raise TencentCloudSDKException(e.message, e.message)
1296+
1297+
12061298
def UpgradeLaunchConfiguration(self, request):
12071299
"""This API (UpgradeLaunchConfiguration) is used to upgrade a launch configuration.
12081300

tencentcloud/autoscaling/v20180419/models.py

Lines changed: 163 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,64 @@ def _deserialize(self, params):
390390
self.RequestId = params.get("RequestId")
391391

392392

393+
class CreateAutoScalingGroupFromInstanceRequest(AbstractModel):
394+
"""CreateAutoScalingGroupFromInstance request structure.
395+
396+
"""
397+
398+
def __init__(self):
399+
"""
400+
:param AutoScalingGroupName: The scaling group name. It must be unique under your account. The name can only contain Chinese characters, English letters, numbers, underscore, hyphen “-” and periods. It cannot exceed 55 bytes.
401+
:type AutoScalingGroupName: str
402+
:param InstanceId: The instance ID.
403+
:type InstanceId: str
404+
:param MinSize: The maximum number of instances. Value range: 0-2000.
405+
:type MinSize: int
406+
:param MaxSize: The minimum number of instances. Value range: 0-2000.
407+
:type MaxSize: int
408+
:param DesiredCapacity: The desired capacity. Its value must be greater than the minimum and smaller than the maximum.
409+
:type DesiredCapacity: int
410+
:param InheritInstanceTag: Whether to inherit the instance tag. Default value: False
411+
:type InheritInstanceTag: bool
412+
"""
413+
self.AutoScalingGroupName = None
414+
self.InstanceId = None
415+
self.MinSize = None
416+
self.MaxSize = None
417+
self.DesiredCapacity = None
418+
self.InheritInstanceTag = None
419+
420+
421+
def _deserialize(self, params):
422+
self.AutoScalingGroupName = params.get("AutoScalingGroupName")
423+
self.InstanceId = params.get("InstanceId")
424+
self.MinSize = params.get("MinSize")
425+
self.MaxSize = params.get("MaxSize")
426+
self.DesiredCapacity = params.get("DesiredCapacity")
427+
self.InheritInstanceTag = params.get("InheritInstanceTag")
428+
429+
430+
class CreateAutoScalingGroupFromInstanceResponse(AbstractModel):
431+
"""CreateAutoScalingGroupFromInstance response structure.
432+
433+
"""
434+
435+
def __init__(self):
436+
"""
437+
:param AutoScalingGroupId: The scaling group ID.
438+
:type AutoScalingGroupId: str
439+
:param RequestId: The unique request ID, which is returned for each request. RequestId is required for locating a problem.
440+
:type RequestId: str
441+
"""
442+
self.AutoScalingGroupId = None
443+
self.RequestId = None
444+
445+
446+
def _deserialize(self, params):
447+
self.AutoScalingGroupId = params.get("AutoScalingGroupId")
448+
self.RequestId = params.get("RequestId")
449+
450+
393451
class CreateAutoScalingGroupRequest(AbstractModel):
394452
"""CreateAutoScalingGroup request structure.
395453
@@ -437,12 +495,14 @@ def __init__(self):
437495
Common reasons why an availability zone or subnet is unavailable include stock-out of CVM instances or CBS cloud disks in the availability zone, insufficient quota in the availability zone, or insufficient IPs in the subnet.
438496
If an availability zone or subnet in Zones/SubnetIds does not exist, a verification error will be reported regardless of the value of ZonesCheckPolicy.
439497
:type ZonesCheckPolicy: str
440-
:param Tags: List of tag descriptions. This parameter is used to bind a tag to an auto scaling group as well as the corresponding resource instances.
498+
:param Tags: List of tag descriptions. This parameter is used to bind a tag to a scaling group as well as corresponding resource instances. Each scaling group can have up to 30 tags.
441499
:type Tags: list of Tag
442500
:param ServiceSettings: Service settings such as unhealthy instance replacement.
443501
:type ServiceSettings: :class:`tencentcloud.autoscaling.v20180419.models.ServiceSettings`
444502
:param Ipv6AddressCount:
445503
:type Ipv6AddressCount: int
504+
:param MultiZoneSubnetPolicy:
505+
:type MultiZoneSubnetPolicy: str
446506
"""
447507
self.AutoScalingGroupName = None
448508
self.LaunchConfigurationId = None
@@ -462,6 +522,7 @@ def __init__(self):
462522
self.Tags = None
463523
self.ServiceSettings = None
464524
self.Ipv6AddressCount = None
525+
self.MultiZoneSubnetPolicy = None
465526

466527

467528
def _deserialize(self, params):
@@ -495,6 +556,7 @@ def _deserialize(self, params):
495556
self.ServiceSettings = ServiceSettings()
496557
self.ServiceSettings._deserialize(params.get("ServiceSettings"))
497558
self.Ipv6AddressCount = params.get("Ipv6AddressCount")
559+
self.MultiZoneSubnetPolicy = params.get("MultiZoneSubnetPolicy")
498560

499561

500562
class CreateAutoScalingGroupResponse(AbstractModel):
@@ -2069,14 +2131,18 @@ def __init__(self):
20692131
:type AutoScalingPolicyId: str
20702132
:param HonorCooldown: Whether to check if the auto scaling group is in the cooldown period. Default value: false
20712133
:type HonorCooldown: bool
2134+
:param TriggerSource: Trigger source that executes a scaling policy. Valid values: API and CLOUD_MONITOR. Default value: API. The value `CLOUD_MONITOR` is specific to the Cloud Monitor service.
2135+
:type TriggerSource: str
20722136
"""
20732137
self.AutoScalingPolicyId = None
20742138
self.HonorCooldown = None
2139+
self.TriggerSource = None
20752140

20762141

20772142
def _deserialize(self, params):
20782143
self.AutoScalingPolicyId = params.get("AutoScalingPolicyId")
20792144
self.HonorCooldown = params.get("HonorCooldown")
2145+
self.TriggerSource = params.get("TriggerSource")
20802146

20812147

20822148
class ExecuteScalingPolicyResponse(AbstractModel):
@@ -2336,16 +2402,21 @@ def __init__(self):
23362402
:param PublicIpAssigned: Whether to assign a public IP. Value range: <br><li>TRUE: Assign a public IP <br><li>FALSE: Do not assign a public IP <br><br>If the public network bandwidth is greater than 0 Mbps, you are free to choose whether to enable the public IP (which is enabled by default). If the public network bandwidth is 0 Mbps, no public IP will be allowed to be assigned.
23372403
Note: This field may return null, indicating that no valid values can be obtained.
23382404
:type PublicIpAssigned: bool
2405+
:param BandwidthPackageId: Bandwidth package ID. You can obtain the parameter value from the `BandwidthPackageId` field in the response of the [DescribeBandwidthPackages](https://cloud.tencent.com/document/api/215/19209) API.
2406+
Note: this field may return null, indicating that no valid value was found.
2407+
:type BandwidthPackageId: str
23392408
"""
23402409
self.InternetChargeType = None
23412410
self.InternetMaxBandwidthOut = None
23422411
self.PublicIpAssigned = None
2412+
self.BandwidthPackageId = None
23432413

23442414

23452415
def _deserialize(self, params):
23462416
self.InternetChargeType = params.get("InternetChargeType")
23472417
self.InternetMaxBandwidthOut = params.get("InternetMaxBandwidthOut")
23482418
self.PublicIpAssigned = params.get("PublicIpAssigned")
2419+
self.BandwidthPackageId = params.get("BandwidthPackageId")
23492420

23502421

23512422
class LaunchConfiguration(AbstractModel):
@@ -3438,6 +3509,97 @@ def _deserialize(self, params):
34383509
self.SpotInstanceType = params.get("SpotInstanceType")
34393510

34403511

3512+
class StartAutoScalingInstancesRequest(AbstractModel):
3513+
"""StartAutoScalingInstances request structure.
3514+
3515+
"""
3516+
3517+
def __init__(self):
3518+
"""
3519+
:param AutoScalingGroupId: The scaling group ID.
3520+
:type AutoScalingGroupId: str
3521+
:param InstanceIds: The list of the CVM instances you want to launch.
3522+
:type InstanceIds: list of str
3523+
"""
3524+
self.AutoScalingGroupId = None
3525+
self.InstanceIds = None
3526+
3527+
3528+
def _deserialize(self, params):
3529+
self.AutoScalingGroupId = params.get("AutoScalingGroupId")
3530+
self.InstanceIds = params.get("InstanceIds")
3531+
3532+
3533+
class StartAutoScalingInstancesResponse(AbstractModel):
3534+
"""StartAutoScalingInstances response structure.
3535+
3536+
"""
3537+
3538+
def __init__(self):
3539+
"""
3540+
:param ActivityId: The scaling activity ID.
3541+
:type ActivityId: str
3542+
:param RequestId: The unique request ID, which is returned for each request. RequestId is required for locating a problem.
3543+
:type RequestId: str
3544+
"""
3545+
self.ActivityId = None
3546+
self.RequestId = None
3547+
3548+
3549+
def _deserialize(self, params):
3550+
self.ActivityId = params.get("ActivityId")
3551+
self.RequestId = params.get("RequestId")
3552+
3553+
3554+
class StopAutoScalingInstancesRequest(AbstractModel):
3555+
"""StopAutoScalingInstances request structure.
3556+
3557+
"""
3558+
3559+
def __init__(self):
3560+
"""
3561+
:param AutoScalingGroupId: The scaling group ID.
3562+
:type AutoScalingGroupId: str
3563+
:param InstanceIds: The list of the CVM instances you want to shut down.
3564+
:type InstanceIds: list of str
3565+
:param StoppedMode: Whether the shutdown instances will be charged. Valid values:
3566+
KEEP_CHARGING: keep charging after shutdown.
3567+
STOP_CHARGING: stop charging after shutdown.
3568+
Default value: KEEP_CHARGING.
3569+
:type StoppedMode: str
3570+
"""
3571+
self.AutoScalingGroupId = None
3572+
self.InstanceIds = None
3573+
self.StoppedMode = None
3574+
3575+
3576+
def _deserialize(self, params):
3577+
self.AutoScalingGroupId = params.get("AutoScalingGroupId")
3578+
self.InstanceIds = params.get("InstanceIds")
3579+
self.StoppedMode = params.get("StoppedMode")
3580+
3581+
3582+
class StopAutoScalingInstancesResponse(AbstractModel):
3583+
"""StopAutoScalingInstances response structure.
3584+
3585+
"""
3586+
3587+
def __init__(self):
3588+
"""
3589+
:param ActivityId: The scaling activity ID.
3590+
:type ActivityId: str
3591+
:param RequestId: The unique request ID, which is returned for each request. RequestId is required for locating a problem.
3592+
:type RequestId: str
3593+
"""
3594+
self.ActivityId = None
3595+
self.RequestId = None
3596+
3597+
3598+
def _deserialize(self, params):
3599+
self.ActivityId = params.get("ActivityId")
3600+
self.RequestId = params.get("RequestId")
3601+
3602+
34413603
class SystemDisk(AbstractModel):
34423604
"""System disk configuration of the launch configuration. If this parameter is not specified, the default value is assigned to it.
34433605

0 commit comments

Comments
 (0)