// This file is auto-generated, don't edit it import * as $dara from '@darabonba/typescript'; import OpenApi from '@alicloud/openapi-core'; import { OpenApiUtil, $OpenApiUtil }from '@alicloud/openapi-core'; import * as $_model from './models/model'; export * from './models/model'; export default class Client extends OpenApi { constructor(config: $OpenApiUtil.Config) { super(config); this._endpointRule = "regional"; this._endpointMap = { 'cn-hangzhou': "ecs-cn-hangzhou.aliyuncs.com", 'cn-shanghai-finance-1': "ecs-cn-hangzhou.aliyuncs.com", 'cn-shenzhen-finance-1': "ecs-cn-hangzhou.aliyuncs.com", 'cn-north-2-gov-1': "ecs.aliyuncs.com", 'ap-northeast-2-pop': "ecs.aliyuncs.com", 'cn-beijing-finance-pop': "ecs.aliyuncs.com", 'cn-beijing-gov-1': "ecs.aliyuncs.com", 'cn-beijing-nu16-b01': "ecs-cn-hangzhou.aliyuncs.com", 'cn-edge-1': "ecs.cn-qingdao-nebula.aliyuncs.com", 'cn-fujian': "ecs-cn-hangzhou.aliyuncs.com", 'cn-haidian-cm12-c01': "ecs-cn-hangzhou.aliyuncs.com", 'cn-hangzhou-bj-b01': "ecs-cn-hangzhou.aliyuncs.com", 'cn-hangzhou-finance': "ecs.aliyuncs.com", 'cn-hangzhou-internal-prod-1': "ecs-cn-hangzhou.aliyuncs.com", 'cn-hangzhou-internal-test-1': "ecs-cn-hangzhou.aliyuncs.com", 'cn-hangzhou-internal-test-2': "ecs-cn-hangzhou.aliyuncs.com", 'cn-hangzhou-internal-test-3': "ecs-cn-hangzhou.aliyuncs.com", 'cn-hangzhou-test-306': "ecs-cn-hangzhou.aliyuncs.com", 'cn-hongkong-finance-pop': "ecs.aliyuncs.com", 'cn-huhehaote-nebula-1': "ecs.cn-qingdao-nebula.aliyuncs.com", 'cn-shanghai-et15-b01': "ecs-cn-hangzhou.aliyuncs.com", 'cn-shanghai-et2-b01': "ecs-cn-hangzhou.aliyuncs.com", 'cn-shanghai-inner': "ecs.aliyuncs.com", 'cn-shanghai-internal-test-1': "ecs-cn-hangzhou.aliyuncs.com", 'cn-shenzhen-inner': "ecs.aliyuncs.com", 'cn-shenzhen-st4-d01': "ecs-cn-hangzhou.aliyuncs.com", 'cn-shenzhen-su18-b01': "ecs-cn-hangzhou.aliyuncs.com", 'cn-wuhan': "ecs.aliyuncs.com", 'cn-yushanfang': "ecs.aliyuncs.com", 'cn-zhangbei': "ecs.aliyuncs.com", 'cn-zhangbei-na61-b01': "ecs-cn-hangzhou.aliyuncs.com", 'cn-zhangjiakou-na62-a01': "ecs.cn-zhangjiakou.aliyuncs.com", 'cn-zhengzhou-nebula-1': "ecs.cn-qingdao-nebula.aliyuncs.com", 'eu-west-1-oxs': "ecs.cn-shenzhen-cloudstone.aliyuncs.com", 'rus-west-1-pop': "ecs.aliyuncs.com", 'us-west-1': "ecs.us-west-1.aliyuncs.com", 'us-southeast-1': "ecs.us-southeast-1.aliyuncs.com", 'us-east-1': "ecs.us-east-1.aliyuncs.com", 'na-south-1': "ecs.na-south-1.aliyuncs.com", 'me-east-1': "ecs.me-east-1.aliyuncs.com", 'me-central-1': "ecs.me-central-1.aliyuncs.com", 'eu-west-2': "ecs.eu-west-2.aliyuncs.com", 'eu-west-1': "ecs.eu-west-1.aliyuncs.com", 'eu-central-1': "ecs.eu-central-1.aliyuncs.com", 'cn-zhongwei': "ecs.cn-zhongwei.aliyuncs.com", 'cn-zhengzhou-jva': "ecs.cn-zhengzhou-jva.aliyuncs.com", 'cn-zhangjiakou': "ecs.cn-zhangjiakou.aliyuncs.com", 'cn-wulanchabu-gic-1': "ecs.cn-wulanchabu-gic-1.aliyuncs.com", 'cn-wulanchabu': "ecs.cn-wulanchabu.aliyuncs.com", 'cn-wuhan-lr': "ecs.cn-wuhan-lr.aliyuncs.com", 'cn-shenzhen': "ecs.cn-shenzhen.aliyuncs.com", 'cn-shanghai': "ecs.cn-shanghai.aliyuncs.com", 'cn-qingdao': "ecs.cn-qingdao.aliyuncs.com", 'cn-nanjing': "ecs.cn-nanjing.aliyuncs.com", 'cn-huhehaote': "ecs.cn-huhehaote.aliyuncs.com", 'cn-hongkong': "ecs.cn-hongkong.aliyuncs.com", 'cn-heyuan-acdr-1': "ecs.cn-heyuan-acdr-1.aliyuncs.com", 'cn-heyuan': "ecs.cn-heyuan.aliyuncs.com", 'cn-guangzhou': "ecs.cn-guangzhou.aliyuncs.com", 'cn-fuzhou': "ecs.cn-fuzhou.aliyuncs.com", 'cn-chengdu': "ecs.cn-chengdu.aliyuncs.com", 'cn-beijing-finance-1': "ecs.cn-beijing-finance-1.aliyuncs.com", 'cn-beijing': "ecs.cn-beijing.aliyuncs.com", 'ap-southeast-8': "ecs.ap-southeast-8.aliyuncs.com", 'ap-southeast-7': "ecs.ap-southeast-7.aliyuncs.com", 'ap-southeast-6': "ecs.ap-southeast-6.aliyuncs.com", 'ap-southeast-5': "ecs.ap-southeast-5.aliyuncs.com", 'ap-southeast-3': "ecs.ap-southeast-3.aliyuncs.com", 'ap-southeast-2': "ecs.ap-southeast-2.aliyuncs.com", 'ap-southeast-1': "ecs.ap-southeast-1.aliyuncs.com", 'ap-south-1': "ecs.ap-south-1.aliyuncs.com", 'ap-northeast-2': "ecs.ap-northeast-2.aliyuncs.com", 'ap-northeast-1': "ecs.ap-northeast-1.aliyuncs.com", }; this.checkConfig(config); this._endpoint = this.getEndpoint("ecs", this._regionId, this._endpointRule, this._network, this._suffix, this._endpointMap, this._endpoint); } getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: {[key: string ]: string}, endpoint: string): string { if (!$dara.isNull(endpoint)) { return endpoint; } if (!$dara.isNull(endpointMap) && !$dara.isNull(endpointMap[regionId])) { return endpointMap[regionId]; } return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix); } /** * Accepts and authorizes the execution of a system event operation. For system events in the Inquiring state, this operation accepts the default action of the system event and authorizes the system to execute the default action. * * @param request - AcceptInquiredSystemEventRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AcceptInquiredSystemEventResponse */ async acceptInquiredSystemEventWithOptions(request: $_model.AcceptInquiredSystemEventRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AcceptInquiredSystemEventResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.choice)) { query["Choice"] = request.choice; } if (!$dara.isNull(request.eventId)) { query["EventId"] = request.eventId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AcceptInquiredSystemEvent", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AcceptInquiredSystemEventResponse>(await this.callApi(params, req, runtime), new $_model.AcceptInquiredSystemEventResponse({})); } /** * Accepts and authorizes the execution of a system event operation. For system events in the Inquiring state, this operation accepts the default action of the system event and authorizes the system to execute the default action. * * @param request - AcceptInquiredSystemEventRequest * @returns AcceptInquiredSystemEventResponse */ async acceptInquiredSystemEvent(request: $_model.AcceptInquiredSystemEventRequest): Promise<$_model.AcceptInquiredSystemEventResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.acceptInquiredSystemEventWithOptions(request, runtime); } /** * Activates a router interface. * * @deprecated OpenAPI ActivateRouterInterface is deprecated, please use Vpc::2016-04-28::ActivateRouterInterface instead. * * @param request - ActivateRouterInterfaceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ActivateRouterInterfaceResponse */ async activateRouterInterfaceWithOptions(request: $_model.ActivateRouterInterfaceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ActivateRouterInterfaceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.routerInterfaceId)) { query["RouterInterfaceId"] = request.routerInterfaceId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ActivateRouterInterface", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ActivateRouterInterfaceResponse>(await this.callApi(params, req, runtime), new $_model.ActivateRouterInterfaceResponse({})); } /** * Activates a router interface. * * @deprecated OpenAPI ActivateRouterInterface is deprecated, please use Vpc::2016-04-28::ActivateRouterInterface instead. * * @param request - ActivateRouterInterfaceRequest * @returns ActivateRouterInterfaceResponse */ // Deprecated async activateRouterInterface(request: $_model.ActivateRouterInterfaceRequest): Promise<$_model.ActivateRouterInterfaceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.activateRouterInterfaceWithOptions(request, runtime); } /** * AddBandwidthPackageIps. * * @deprecated OpenAPI AddBandwidthPackageIps is deprecated * * @param request - AddBandwidthPackageIpsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AddBandwidthPackageIpsResponse */ async addBandwidthPackageIpsWithOptions(request: $_model.AddBandwidthPackageIpsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AddBandwidthPackageIpsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.bandwidthPackageId)) { query["BandwidthPackageId"] = request.bandwidthPackageId; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ipCount)) { query["IpCount"] = request.ipCount; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AddBandwidthPackageIps", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AddBandwidthPackageIpsResponse>(await this.callApi(params, req, runtime), new $_model.AddBandwidthPackageIpsResponse({})); } /** * AddBandwidthPackageIps. * * @deprecated OpenAPI AddBandwidthPackageIps is deprecated * * @param request - AddBandwidthPackageIpsRequest * @returns AddBandwidthPackageIpsResponse */ // Deprecated async addBandwidthPackageIps(request: $_model.AddBandwidthPackageIpsRequest): Promise<$_model.AddBandwidthPackageIpsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.addBandwidthPackageIpsWithOptions(request, runtime); } /** * Adds or overwrites one or more tags on various Elastic Compute Service (ECS) resources. You can add tags to instances, cloud disks, snapshots, images, security groups, and other resources for easier management. * * @remarks * When you invoke this operation, take note of the following items: * - You can add up to 20 tags to each Elastic Compute Service (ECS) resource. * - The tag key (Tag.N.Key) and tag value (Tag.N.Value) must be specified as a key-value pair. * - If the tag key (Tag.N.Key) already exists on the specified resource, the original tag value is automatically overwritten with the new tag value (Tag.N.Value). * * @deprecated OpenAPI AddTags is deprecated, please use Ecs::2014-05-26::TagResources instead. * * @param request - AddTagsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AddTagsResponse */ async addTagsWithOptions(request: $_model.AddTagsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AddTagsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceId)) { query["ResourceId"] = request.resourceId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AddTags", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AddTagsResponse>(await this.callApi(params, req, runtime), new $_model.AddTagsResponse({})); } /** * Adds or overwrites one or more tags on various Elastic Compute Service (ECS) resources. You can add tags to instances, cloud disks, snapshots, images, security groups, and other resources for easier management. * * @remarks * When you invoke this operation, take note of the following items: * - You can add up to 20 tags to each Elastic Compute Service (ECS) resource. * - The tag key (Tag.N.Key) and tag value (Tag.N.Value) must be specified as a key-value pair. * - If the tag key (Tag.N.Key) already exists on the specified resource, the original tag value is automatically overwritten with the new tag value (Tag.N.Value). * * @deprecated OpenAPI AddTags is deprecated, please use Ecs::2014-05-26::TagResources instead. * * @param request - AddTagsRequest * @returns AddTagsResponse */ // Deprecated async addTags(request: $_model.AddTagsRequest): Promise<$_model.AddTagsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.addTagsWithOptions(request, runtime); } /** * Creates pay-as-you-go or subscription dedicated hosts. A dedicated host is a physical server dedicated to a single tenant. You can create Elastic Compute Service (ECS) instances on a dedicated host and view the attributes of a dedicated host. * * @remarks * Before you create a dedicated host, you can call the [DescribeAvailableResource](https://help.aliyun.com/document_detail/66186.html) operation to query the resources available in a specific region or zone. * We recommend that you understand the billing methods of resources before you create a dedicated host. You are charged for resources used by the created dedicated host. For more information, see [Billing overview](https://help.aliyun.com/document_detail/68978.html). * - You can create up to 100 pay-as-you-go or subscription dedicated hosts at a time. * - After a dedicated host is created, you can use the returned dedicated host ID as the value of a request parameter to call the [DescribeDedicatedHosts](https://help.aliyun.com/document_detail/134242.html) operation to query the state of the dedicated host. * - After you submit a request to create a dedicated host, an error is returned if a specific parameter is invalid or if the requested resources are insufficient. For more information about error causes, see the "Error codes" section of this topic. * - After a dedicated host is created, you can call the [ModifyInstanceDeployment](https://help.aliyun.com/document_detail/134248.html) operation to migrate ECS instances from a shared host to the dedicated host. You can also migrate ECS instances from another dedicated host to the created dedicated host. * * @param request - AllocateDedicatedHostsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AllocateDedicatedHostsResponse */ async allocateDedicatedHostsWithOptions(request: $_model.AllocateDedicatedHostsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AllocateDedicatedHostsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.actionOnMaintenance)) { query["ActionOnMaintenance"] = request.actionOnMaintenance; } if (!$dara.isNull(request.autoPlacement)) { query["AutoPlacement"] = request.autoPlacement; } if (!$dara.isNull(request.autoReleaseTime)) { query["AutoReleaseTime"] = request.autoReleaseTime; } if (!$dara.isNull(request.autoRenew)) { query["AutoRenew"] = request.autoRenew; } if (!$dara.isNull(request.autoRenewPeriod)) { query["AutoRenewPeriod"] = request.autoRenewPeriod; } if (!$dara.isNull(request.chargeType)) { query["ChargeType"] = request.chargeType; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.cpuOverCommitRatio)) { query["CpuOverCommitRatio"] = request.cpuOverCommitRatio; } if (!$dara.isNull(request.dedicatedHostClusterId)) { query["DedicatedHostClusterId"] = request.dedicatedHostClusterId; } if (!$dara.isNull(request.dedicatedHostName)) { query["DedicatedHostName"] = request.dedicatedHostName; } if (!$dara.isNull(request.dedicatedHostType)) { query["DedicatedHostType"] = request.dedicatedHostType; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.minQuantity)) { query["MinQuantity"] = request.minQuantity; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.quantity)) { query["Quantity"] = request.quantity; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } if (!$dara.isNull(request.networkAttributes)) { query["NetworkAttributes"] = request.networkAttributes; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AllocateDedicatedHosts", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AllocateDedicatedHostsResponse>(await this.callApi(params, req, runtime), new $_model.AllocateDedicatedHostsResponse({})); } /** * Creates pay-as-you-go or subscription dedicated hosts. A dedicated host is a physical server dedicated to a single tenant. You can create Elastic Compute Service (ECS) instances on a dedicated host and view the attributes of a dedicated host. * * @remarks * Before you create a dedicated host, you can call the [DescribeAvailableResource](https://help.aliyun.com/document_detail/66186.html) operation to query the resources available in a specific region or zone. * We recommend that you understand the billing methods of resources before you create a dedicated host. You are charged for resources used by the created dedicated host. For more information, see [Billing overview](https://help.aliyun.com/document_detail/68978.html). * - You can create up to 100 pay-as-you-go or subscription dedicated hosts at a time. * - After a dedicated host is created, you can use the returned dedicated host ID as the value of a request parameter to call the [DescribeDedicatedHosts](https://help.aliyun.com/document_detail/134242.html) operation to query the state of the dedicated host. * - After you submit a request to create a dedicated host, an error is returned if a specific parameter is invalid or if the requested resources are insufficient. For more information about error causes, see the "Error codes" section of this topic. * - After a dedicated host is created, you can call the [ModifyInstanceDeployment](https://help.aliyun.com/document_detail/134248.html) operation to migrate ECS instances from a shared host to the dedicated host. You can also migrate ECS instances from another dedicated host to the created dedicated host. * * @param request - AllocateDedicatedHostsRequest * @returns AllocateDedicatedHostsResponse */ async allocateDedicatedHosts(request: $_model.AllocateDedicatedHostsRequest): Promise<$_model.AllocateDedicatedHostsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.allocateDedicatedHostsWithOptions(request, runtime); } /** * AllocateEipAddress * * @remarks * > This API has been upgraded and is no longer recommended. For instructions on the new API, see [AllocateEipAddress](https://help.aliyun.com/document_detail/120192.html). * * @deprecated OpenAPI AllocateEipAddress is deprecated, please use Vpc::2016-04-28::AllocateEipAddress instead. * * @param request - AllocateEipAddressRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AllocateEipAddressResponse */ async allocateEipAddressWithOptions(request: $_model.AllocateEipAddressRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AllocateEipAddressResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.activityId)) { query["ActivityId"] = request.activityId; } if (!$dara.isNull(request.bandwidth)) { query["Bandwidth"] = request.bandwidth; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ISP)) { query["ISP"] = request.ISP; } if (!$dara.isNull(request.internetChargeType)) { query["InternetChargeType"] = request.internetChargeType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AllocateEipAddress", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AllocateEipAddressResponse>(await this.callApi(params, req, runtime), new $_model.AllocateEipAddressResponse({})); } /** * AllocateEipAddress * * @remarks * > This API has been upgraded and is no longer recommended. For instructions on the new API, see [AllocateEipAddress](https://help.aliyun.com/document_detail/120192.html). * * @deprecated OpenAPI AllocateEipAddress is deprecated, please use Vpc::2016-04-28::AllocateEipAddress instead. * * @param request - AllocateEipAddressRequest * @returns AllocateEipAddressResponse */ // Deprecated async allocateEipAddress(request: $_model.AllocateEipAddressRequest): Promise<$_model.AllocateEipAddressResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.allocateEipAddressWithOptions(request, runtime); } /** * Assigns a static public IP address (also called system-assigned public IP address or auto-assigned public IP address) to an Elastic Compute Service (ECS) instance. * * @remarks * ### [](#)Precautions * - The ECS instance to which you want to assign a static public IP address must be in the **Running** (`Running`) or **Stopped** (`Stopped`) state. * - If `OperationLocks` in the response of the DescribeInstances operation contains `"LockReason" : "security"` for an ECS instance, the instance is [locked for security reasons](https://help.aliyun.com/document_detail/25695.html) and cannot be assigned a static public IP address. * - When you call the AllocatePublicIpAddress operation for an ECS instance, make sure that the public bandwidth of the instance is greater than 0 Mbit/s. You can call the [ModifyInstanceNetworkSpec](https://help.aliyun.com/document_detail/2679879.html) operation to change the public bandwidth. * ### [](#)Considerations * - Only users in the whitelist can specify `IpAddress` in the AllocatePublicIpAddress operation. If the public bandwidth of your ECS instance is greater than 0 Mbit/s, you can specify the ID of the instance (`InstanceId`) to randomly assign a static public IP address to the instance. If the public bandwidth of your ECS instance is 0 Mbit/s, you must call the [ModifyInstanceNetworkSpec](https://help.aliyun.com/document_detail/2679879.html) operation to increase the public bandwidth of the instance before you call the AllocatePublicIpAddress operation. * - You can assign only one static public IP address to an ECS instance. If the instance already has a static public IP address, the static public IP address is returned for the `IpAddress` response parameter. * - After you assign a static public IP address to an ECS instance, you must restart the instance ([RebootInstance](https://help.aliyun.com/document_detail/25502.html)) or start the instance ([StartInstance](https://help.aliyun.com/document_detail/25500.html)) for the public IP address to take effect. * If an ECS instance resides in a virtual private cloud (VPC), you can assign a static public IP address to the instance or associate an elastic IP address (EIP) with the instance. For more information, see [AssociateEipAddress](https://help.aliyun.com/document_detail/2518064.html). * * @param request - AllocatePublicIpAddressRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AllocatePublicIpAddressResponse */ async allocatePublicIpAddressWithOptions(request: $_model.AllocatePublicIpAddressRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AllocatePublicIpAddressResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ipAddress)) { query["IpAddress"] = request.ipAddress; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.vlanId)) { query["VlanId"] = request.vlanId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AllocatePublicIpAddress", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AllocatePublicIpAddressResponse>(await this.callApi(params, req, runtime), new $_model.AllocatePublicIpAddressResponse({})); } /** * Assigns a static public IP address (also called system-assigned public IP address or auto-assigned public IP address) to an Elastic Compute Service (ECS) instance. * * @remarks * ### [](#)Precautions * - The ECS instance to which you want to assign a static public IP address must be in the **Running** (`Running`) or **Stopped** (`Stopped`) state. * - If `OperationLocks` in the response of the DescribeInstances operation contains `"LockReason" : "security"` for an ECS instance, the instance is [locked for security reasons](https://help.aliyun.com/document_detail/25695.html) and cannot be assigned a static public IP address. * - When you call the AllocatePublicIpAddress operation for an ECS instance, make sure that the public bandwidth of the instance is greater than 0 Mbit/s. You can call the [ModifyInstanceNetworkSpec](https://help.aliyun.com/document_detail/2679879.html) operation to change the public bandwidth. * ### [](#)Considerations * - Only users in the whitelist can specify `IpAddress` in the AllocatePublicIpAddress operation. If the public bandwidth of your ECS instance is greater than 0 Mbit/s, you can specify the ID of the instance (`InstanceId`) to randomly assign a static public IP address to the instance. If the public bandwidth of your ECS instance is 0 Mbit/s, you must call the [ModifyInstanceNetworkSpec](https://help.aliyun.com/document_detail/2679879.html) operation to increase the public bandwidth of the instance before you call the AllocatePublicIpAddress operation. * - You can assign only one static public IP address to an ECS instance. If the instance already has a static public IP address, the static public IP address is returned for the `IpAddress` response parameter. * - After you assign a static public IP address to an ECS instance, you must restart the instance ([RebootInstance](https://help.aliyun.com/document_detail/25502.html)) or start the instance ([StartInstance](https://help.aliyun.com/document_detail/25500.html)) for the public IP address to take effect. * If an ECS instance resides in a virtual private cloud (VPC), you can assign a static public IP address to the instance or associate an elastic IP address (EIP) with the instance. For more information, see [AssociateEipAddress](https://help.aliyun.com/document_detail/2518064.html). * * @param request - AllocatePublicIpAddressRequest * @returns AllocatePublicIpAddressResponse */ async allocatePublicIpAddress(request: $_model.AllocatePublicIpAddressRequest): Promise<$_model.AllocatePublicIpAddressResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.allocatePublicIpAddressWithOptions(request, runtime); } /** * Applies an automatic snapshot policy to one or more disks. * * @remarks * - Each disk supports up to 10 automatic snapshot policies. * - If a target disk already has an automatic snapshot policy, this operation adds the new policy without replacing the existing ones. * > To avoid unexpected charges, make sure to cancel any automatic snapshot policies that you no longer need. * * @param request - ApplyAutoSnapshotPolicyRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ApplyAutoSnapshotPolicyResponse */ async applyAutoSnapshotPolicyWithOptions(request: $_model.ApplyAutoSnapshotPolicyRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ApplyAutoSnapshotPolicyResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.autoSnapshotPolicyId)) { query["autoSnapshotPolicyId"] = request.autoSnapshotPolicyId; } if (!$dara.isNull(request.diskIds)) { query["diskIds"] = request.diskIds; } if (!$dara.isNull(request.regionId)) { query["regionId"] = request.regionId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ApplyAutoSnapshotPolicy", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ApplyAutoSnapshotPolicyResponse>(await this.callApi(params, req, runtime), new $_model.ApplyAutoSnapshotPolicyResponse({})); } /** * Applies an automatic snapshot policy to one or more disks. * * @remarks * - Each disk supports up to 10 automatic snapshot policies. * - If a target disk already has an automatic snapshot policy, this operation adds the new policy without replacing the existing ones. * > To avoid unexpected charges, make sure to cancel any automatic snapshot policies that you no longer need. * * @param request - ApplyAutoSnapshotPolicyRequest * @returns ApplyAutoSnapshotPolicyResponse */ async applyAutoSnapshotPolicy(request: $_model.ApplyAutoSnapshotPolicyRequest): Promise<$_model.ApplyAutoSnapshotPolicyResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.applyAutoSnapshotPolicyWithOptions(request, runtime); } /** * Assigns one or more IPv6 addresses to an Elastic Network Interface (ENI). * * @remarks * ## Operation description * You can specify IPv6 addresses from the CIDR block of the vSwitch to which the Elastic Network Interface (ENI) belongs, or specify the number of IPv6 addresses for automatic creation. Note the following items: * - The vSwitch to which the ENI belongs must have IPv6 enabled. For more information, see [Enable an IPv6 CIDR block for an existing vSwitch](https://help.aliyun.com/document_detail/98923.html). * - The ENI must be in the Active (Available) or InUse state. * - When you operate a primary ENI, the instance to which the network interface controller (NIC) is attached must be in the Running or Stopped state. * - The number of IPv6 addresses that can be allocated to a single network interface controller (NIC) depends on the instance type of the instance to which the ENI is attached. * - If the ENI is in the Active (Available) state, you can allocate up to 10 IPv6 addresses to it. * - If the ENI is attached to an instance, the number of IPv6 addresses that can be allocated is limited by the instance type. For more information, see [Instance family](https://help.aliyun.com/document_detail/25378.html). * - After you successfully invoke this operation, you can obtain the allocated IPv6 address information from the response. * * @param request - AssignIpv6AddressesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AssignIpv6AddressesResponse */ async assignIpv6AddressesWithOptions(request: $_model.AssignIpv6AddressesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AssignIpv6AddressesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ipv6Address)) { query["Ipv6Address"] = request.ipv6Address; } if (!$dara.isNull(request.ipv6AddressCount)) { query["Ipv6AddressCount"] = request.ipv6AddressCount; } if (!$dara.isNull(request.ipv6Prefix)) { query["Ipv6Prefix"] = request.ipv6Prefix; } if (!$dara.isNull(request.ipv6PrefixCount)) { query["Ipv6PrefixCount"] = request.ipv6PrefixCount; } if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AssignIpv6Addresses", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AssignIpv6AddressesResponse>(await this.callApi(params, req, runtime), new $_model.AssignIpv6AddressesResponse({})); } /** * Assigns one or more IPv6 addresses to an Elastic Network Interface (ENI). * * @remarks * ## Operation description * You can specify IPv6 addresses from the CIDR block of the vSwitch to which the Elastic Network Interface (ENI) belongs, or specify the number of IPv6 addresses for automatic creation. Note the following items: * - The vSwitch to which the ENI belongs must have IPv6 enabled. For more information, see [Enable an IPv6 CIDR block for an existing vSwitch](https://help.aliyun.com/document_detail/98923.html). * - The ENI must be in the Active (Available) or InUse state. * - When you operate a primary ENI, the instance to which the network interface controller (NIC) is attached must be in the Running or Stopped state. * - The number of IPv6 addresses that can be allocated to a single network interface controller (NIC) depends on the instance type of the instance to which the ENI is attached. * - If the ENI is in the Active (Available) state, you can allocate up to 10 IPv6 addresses to it. * - If the ENI is attached to an instance, the number of IPv6 addresses that can be allocated is limited by the instance type. For more information, see [Instance family](https://help.aliyun.com/document_detail/25378.html). * - After you successfully invoke this operation, you can obtain the allocated IPv6 address information from the response. * * @param request - AssignIpv6AddressesRequest * @returns AssignIpv6AddressesResponse */ async assignIpv6Addresses(request: $_model.AssignIpv6AddressesRequest): Promise<$_model.AssignIpv6AddressesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.assignIpv6AddressesWithOptions(request, runtime); } /** * Allocates one or more secondary private IP addresses to an Elastic Network Interface (ENI). You can specify available private IP addresses from the vSwitch to which the ENI belongs, or automatically allocate private IP addresses by specifying the number of private endpoint addresses. * * @remarks * ## Operation description * - Only ENIs in the Available or InUse state are supported. * - When you operate a primary ENI, the instance to which the ENI is attached must be in the Running or Stopped state. * - When an ENI is in the Available state, you can allocate up to 49 secondary private IP addresses to it. After the ENI is attached to an instance, the number of secondary private IP addresses that can be allocated is limited by the instance type. For more information, see [Instance families](https://help.aliyun.com/document_detail/25378.html). * - After you call this operation, you can obtain the allocated secondary private IP address information from the response. * * @param request - AssignPrivateIpAddressesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AssignPrivateIpAddressesResponse */ async assignPrivateIpAddressesWithOptions(request: $_model.AssignPrivateIpAddressesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AssignPrivateIpAddressesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ipv4Prefix)) { query["Ipv4Prefix"] = request.ipv4Prefix; } if (!$dara.isNull(request.ipv4PrefixCount)) { query["Ipv4PrefixCount"] = request.ipv4PrefixCount; } if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.privateIpAddress)) { query["PrivateIpAddress"] = request.privateIpAddress; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.secondaryPrivateIpAddressCount)) { query["SecondaryPrivateIpAddressCount"] = request.secondaryPrivateIpAddressCount; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AssignPrivateIpAddresses", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AssignPrivateIpAddressesResponse>(await this.callApi(params, req, runtime), new $_model.AssignPrivateIpAddressesResponse({})); } /** * Allocates one or more secondary private IP addresses to an Elastic Network Interface (ENI). You can specify available private IP addresses from the vSwitch to which the ENI belongs, or automatically allocate private IP addresses by specifying the number of private endpoint addresses. * * @remarks * ## Operation description * - Only ENIs in the Available or InUse state are supported. * - When you operate a primary ENI, the instance to which the ENI is attached must be in the Running or Stopped state. * - When an ENI is in the Available state, you can allocate up to 49 secondary private IP addresses to it. After the ENI is attached to an instance, the number of secondary private IP addresses that can be allocated is limited by the instance type. For more information, see [Instance families](https://help.aliyun.com/document_detail/25378.html). * - After you call this operation, you can obtain the allocated secondary private IP address information from the response. * * @param request - AssignPrivateIpAddressesRequest * @returns AssignPrivateIpAddressesResponse */ async assignPrivateIpAddresses(request: $_model.AssignPrivateIpAddressesRequest): Promise<$_model.AssignPrivateIpAddressesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.assignPrivateIpAddressesWithOptions(request, runtime); } /** * AssociateEipAddress * * @deprecated OpenAPI AssociateEipAddress is deprecated, please use Vpc::2016-04-28::AssociateEipAddress instead. * * @param request - AssociateEipAddressRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AssociateEipAddressResponse */ async associateEipAddressWithOptions(request: $_model.AssociateEipAddressRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AssociateEipAddressResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.allocationId)) { query["AllocationId"] = request.allocationId; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AssociateEipAddress", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AssociateEipAddressResponse>(await this.callApi(params, req, runtime), new $_model.AssociateEipAddressResponse({})); } /** * AssociateEipAddress * * @deprecated OpenAPI AssociateEipAddress is deprecated, please use Vpc::2016-04-28::AssociateEipAddress instead. * * @param request - AssociateEipAddressRequest * @returns AssociateEipAddressResponse */ // Deprecated async associateEipAddress(request: $_model.AssociateEipAddressRequest): Promise<$_model.AssociateEipAddressResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.associateEipAddressWithOptions(request, runtime); } /** * Associates a high-availability virtual IP address (HaVip) with a specified instance. * * @deprecated OpenAPI AssociateHaVip is deprecated, please use Vpc::2016-04-28::AssociateHaVip instead. * * @param request - AssociateHaVipRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AssociateHaVipResponse */ async associateHaVipWithOptions(request: $_model.AssociateHaVipRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AssociateHaVipResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.haVipId)) { query["HaVipId"] = request.haVipId; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AssociateHaVip", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AssociateHaVipResponse>(await this.callApi(params, req, runtime), new $_model.AssociateHaVipResponse({})); } /** * Associates a high-availability virtual IP address (HaVip) with a specified instance. * * @deprecated OpenAPI AssociateHaVip is deprecated, please use Vpc::2016-04-28::AssociateHaVip instead. * * @param request - AssociateHaVipRequest * @returns AssociateHaVipResponse */ // Deprecated async associateHaVip(request: $_model.AssociateHaVipRequest): Promise<$_model.AssociateHaVipResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.associateHaVipWithOptions(request, runtime); } /** * Links an instance that is deployed in the classic network to a virtual private cloud (VPC) by establishing a ClassicLink connection between the instance and the VPC. This way, the instance can communicate with cloud resources in the VPC over the internal network. * * @remarks * When you call this operation, take note of the following items: * - The instance that you want to connect to a VPC must be in the **Running** or **Stopped** state. * - The ClassicLink feature must be enabled for the destination VPC. For more information, see [Create a ClassicLink connection](https://help.aliyun.com/document_detail/65413.html). * - The instance and the VPC must reside in the same region. * * @param request - AttachClassicLinkVpcRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AttachClassicLinkVpcResponse */ async attachClassicLinkVpcWithOptions(request: $_model.AttachClassicLinkVpcRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AttachClassicLinkVpcResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AttachClassicLinkVpc", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AttachClassicLinkVpcResponse>(await this.callApi(params, req, runtime), new $_model.AttachClassicLinkVpcResponse({})); } /** * Links an instance that is deployed in the classic network to a virtual private cloud (VPC) by establishing a ClassicLink connection between the instance and the VPC. This way, the instance can communicate with cloud resources in the VPC over the internal network. * * @remarks * When you call this operation, take note of the following items: * - The instance that you want to connect to a VPC must be in the **Running** or **Stopped** state. * - The ClassicLink feature must be enabled for the destination VPC. For more information, see [Create a ClassicLink connection](https://help.aliyun.com/document_detail/65413.html). * - The instance and the VPC must reside in the same region. * * @param request - AttachClassicLinkVpcRequest * @returns AttachClassicLinkVpcResponse */ async attachClassicLinkVpc(request: $_model.AttachClassicLinkVpcRequest): Promise<$_model.AttachClassicLinkVpcResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.attachClassicLinkVpcWithOptions(request, runtime); } /** * Attaches a data disk or system disk to an ECS instance. * * @remarks * When you call this operation, take note of the following items: * - The instance and the disk must be in the same zone. * - The disk must be in the **Available** (`Available`) state. * - When you attach a data disk: * - The destination ECS instance must be in the **Running** (`Running`) or **Stopped** (`Stopped`) state. * - If the disk is separately purchased, the billing method must be pay-as-you-go. * - A system disk that was uninstalled from an ECS instance can be attached as a data disk without billable methods restrictions. * - An elastic ephemeral disk that has been detached can only be re-attached to its original instance. * - When you attach a system disk: * - The destination ECS instance must be the original instance from which the system disk was detached. * - The destination ECS instance must be in the **Stopped** (`Stopped`) state. * - You must specify the logon credential for the instance. * - Elastic ephemeral disks cannot be attached as system disks. * - For more information about attaching system disks, see [Detach or attach a system disk](https://help.aliyun.com/document_detail/146752.html). * - When you query ECS instance information, if the response contains `{"OperationLocks": {"LockReason" : "security"}}`, all operations are prohibited. * * - A disk with the multi-attach attribute enabled can only be attached to instances that support the NVMe protocol. * For more information, see [Standard SSDs that support NVMe](https://help.aliyun.com/document_detail/256487.html) and [Use the multi-attach feature](https://help.aliyun.com/document_detail/262105.html). * * @param request - AttachDiskRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AttachDiskResponse */ async attachDiskWithOptions(request: $_model.AttachDiskRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AttachDiskResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.bootable)) { query["Bootable"] = request.bootable; } if (!$dara.isNull(request.deleteWithInstance)) { query["DeleteWithInstance"] = request.deleteWithInstance; } if (!$dara.isNull(request.device)) { query["Device"] = request.device; } if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.force)) { query["Force"] = request.force; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.keyPairName)) { query["KeyPairName"] = request.keyPairName; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.password)) { query["Password"] = request.password; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AttachDisk", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AttachDiskResponse>(await this.callApi(params, req, runtime), new $_model.AttachDiskResponse({})); } /** * Attaches a data disk or system disk to an ECS instance. * * @remarks * When you call this operation, take note of the following items: * - The instance and the disk must be in the same zone. * - The disk must be in the **Available** (`Available`) state. * - When you attach a data disk: * - The destination ECS instance must be in the **Running** (`Running`) or **Stopped** (`Stopped`) state. * - If the disk is separately purchased, the billing method must be pay-as-you-go. * - A system disk that was uninstalled from an ECS instance can be attached as a data disk without billable methods restrictions. * - An elastic ephemeral disk that has been detached can only be re-attached to its original instance. * - When you attach a system disk: * - The destination ECS instance must be the original instance from which the system disk was detached. * - The destination ECS instance must be in the **Stopped** (`Stopped`) state. * - You must specify the logon credential for the instance. * - Elastic ephemeral disks cannot be attached as system disks. * - For more information about attaching system disks, see [Detach or attach a system disk](https://help.aliyun.com/document_detail/146752.html). * - When you query ECS instance information, if the response contains `{"OperationLocks": {"LockReason" : "security"}}`, all operations are prohibited. * * - A disk with the multi-attach attribute enabled can only be attached to instances that support the NVMe protocol. * For more information, see [Standard SSDs that support NVMe](https://help.aliyun.com/document_detail/256487.html) and [Use the multi-attach feature](https://help.aliyun.com/document_detail/262105.html). * * @param request - AttachDiskRequest * @returns AttachDiskResponse */ async attachDisk(request: $_model.AttachDiskRequest): Promise<$_model.AttachDiskResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.attachDiskWithOptions(request, runtime); } /** * Attaches an instance Resource Access Management (RAM) role to Elastic Compute Service (ECS) instances. * * @remarks * You can call the [DescribeInstanceRamRole](https://help.aliyun.com/document_detail/2679686.html) operation to query the [instance RAM roles](https://help.aliyun.com/document_detail/61175.html) that are attached to ECS instances. * > If an ECS instance already has an instance RAM role, an error is returned when you attach another instance RAM role to the instance. * * @param request - AttachInstanceRamRoleRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AttachInstanceRamRoleResponse */ async attachInstanceRamRoleWithOptions(request: $_model.AttachInstanceRamRoleRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AttachInstanceRamRoleResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceIds)) { query["InstanceIds"] = request.instanceIds; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.policy)) { query["Policy"] = request.policy; } if (!$dara.isNull(request.ramRoleName)) { query["RamRoleName"] = request.ramRoleName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AttachInstanceRamRole", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AttachInstanceRamRoleResponse>(await this.callApi(params, req, runtime), new $_model.AttachInstanceRamRoleResponse({})); } /** * Attaches an instance Resource Access Management (RAM) role to Elastic Compute Service (ECS) instances. * * @remarks * You can call the [DescribeInstanceRamRole](https://help.aliyun.com/document_detail/2679686.html) operation to query the [instance RAM roles](https://help.aliyun.com/document_detail/61175.html) that are attached to ECS instances. * > If an ECS instance already has an instance RAM role, an error is returned when you attach another instance RAM role to the instance. * * @param request - AttachInstanceRamRoleRequest * @returns AttachInstanceRamRoleResponse */ async attachInstanceRamRole(request: $_model.AttachInstanceRamRoleRequest): Promise<$_model.AttachInstanceRamRoleResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.attachInstanceRamRoleWithOptions(request, runtime); } /** * Bind an SSH key pair to one or more Linux instances. * * @remarks * When you call this operation, take note of the following items: * - Windows instances do not support SSH key pairs. * - After you bind an SSH key pair to an instance, authentication by using a username and password is disabled. * - If the instance is in the **Running** state, restart the instance ([RebootInstance](https://help.aliyun.com/document_detail/25502.html)) for the SSH key pair to take effect. * - If the instance is in the **Stopped** state, start the instance ([StartInstance](https://help.aliyun.com/document_detail/25500.html)) for the SSH key pair to take effect. * - If an SSH key pair is already bound to the instance, the new SSH key pair automatically replaces the original one. * * @param request - AttachKeyPairRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AttachKeyPairResponse */ async attachKeyPairWithOptions(request: $_model.AttachKeyPairRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AttachKeyPairResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceIds)) { query["InstanceIds"] = request.instanceIds; } if (!$dara.isNull(request.keyPairName)) { query["KeyPairName"] = request.keyPairName; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AttachKeyPair", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AttachKeyPairResponse>(await this.callApi(params, req, runtime), new $_model.AttachKeyPairResponse({})); } /** * Bind an SSH key pair to one or more Linux instances. * * @remarks * When you call this operation, take note of the following items: * - Windows instances do not support SSH key pairs. * - After you bind an SSH key pair to an instance, authentication by using a username and password is disabled. * - If the instance is in the **Running** state, restart the instance ([RebootInstance](https://help.aliyun.com/document_detail/25502.html)) for the SSH key pair to take effect. * - If the instance is in the **Stopped** state, start the instance ([StartInstance](https://help.aliyun.com/document_detail/25500.html)) for the SSH key pair to take effect. * - If an SSH key pair is already bound to the instance, the new SSH key pair automatically replaces the original one. * * @param request - AttachKeyPairRequest * @returns AttachKeyPairResponse */ async attachKeyPair(request: $_model.AttachKeyPairRequest): Promise<$_model.AttachKeyPairResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.attachKeyPairWithOptions(request, runtime); } /** * Calls the AttachNetworkInterface operation to attach an Elastic Network Interface (ENI) to a VPC-connected ECS instance. You can specify parameters such as NetworkInterfaceId, InstanceId, and NetworkCardIndex. * * @remarks * When you call this operation, take note of the following items: * - The Elastic Network Interface (ENI) must be in the **active** (`Available`) state. An ENI can be attached to only one instance that resides in the same zone and VPC as the network interface controller (NIC). * - The ECS instance must be in the Running or Stopped state. Some ECS instance types require the ECS instance to be in the Stopped state when you attach an Elastic Network Interface (ENI). For more information, see the section about ECS instance types that require the ECS instance to be stopped in [Attach an ENI](https://help.aliyun.com/document_detail/58503.html). * > If the instance was last started before April 1, 2018 (including but not limited to starting a newly purchased instance, restarting, or powering on), you must invoke RebootInstance to restart the instance that has been in the Running state. Otherwise, the network interface controller (NIC) cannot be attached. * - Multiple Elastic Network Interfaces (ENIs) can be attached to a single instance at the same time. For more information, see [ENI overview](https://help.aliyun.com/document_detail/58496.html). * * - The vSwitch to which the network interface controller (NIC) belongs must be in the same zone and VPC as the instance. * - This is an asynchronous operation. After a successful invocation, you can check the Elastic Network Interface (ENI) status or listen for network interface controller (NIC) operation events to obtain the result. The ENI state machine is shown in the following figure: * ![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20221124/esgu/AttachNetworkInterface.jpg) * - Attaching indicates that the request to attach the ENI was sent successfully and the ENI is being attached to the ECS instance. * - InUse indicates that the ENI has been attached to the ECS instance. * - Available indicates that the ENI failed to be attached to the ECS instance. * **For details, see** [Attach a network interface controller (NIC)](https://help.aliyun.com/document_detail/471550.html). * * @param request - AttachNetworkInterfaceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AttachNetworkInterfaceResponse */ async attachNetworkInterfaceWithOptions(request: $_model.AttachNetworkInterfaceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AttachNetworkInterfaceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.networkCardIndex)) { query["NetworkCardIndex"] = request.networkCardIndex; } if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.trunkNetworkInstanceId)) { query["TrunkNetworkInstanceId"] = request.trunkNetworkInstanceId; } if (!$dara.isNull(request.waitForNetworkConfigurationReady)) { query["WaitForNetworkConfigurationReady"] = request.waitForNetworkConfigurationReady; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AttachNetworkInterface", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AttachNetworkInterfaceResponse>(await this.callApi(params, req, runtime), new $_model.AttachNetworkInterfaceResponse({})); } /** * Calls the AttachNetworkInterface operation to attach an Elastic Network Interface (ENI) to a VPC-connected ECS instance. You can specify parameters such as NetworkInterfaceId, InstanceId, and NetworkCardIndex. * * @remarks * When you call this operation, take note of the following items: * - The Elastic Network Interface (ENI) must be in the **active** (`Available`) state. An ENI can be attached to only one instance that resides in the same zone and VPC as the network interface controller (NIC). * - The ECS instance must be in the Running or Stopped state. Some ECS instance types require the ECS instance to be in the Stopped state when you attach an Elastic Network Interface (ENI). For more information, see the section about ECS instance types that require the ECS instance to be stopped in [Attach an ENI](https://help.aliyun.com/document_detail/58503.html). * > If the instance was last started before April 1, 2018 (including but not limited to starting a newly purchased instance, restarting, or powering on), you must invoke RebootInstance to restart the instance that has been in the Running state. Otherwise, the network interface controller (NIC) cannot be attached. * - Multiple Elastic Network Interfaces (ENIs) can be attached to a single instance at the same time. For more information, see [ENI overview](https://help.aliyun.com/document_detail/58496.html). * * - The vSwitch to which the network interface controller (NIC) belongs must be in the same zone and VPC as the instance. * - This is an asynchronous operation. After a successful invocation, you can check the Elastic Network Interface (ENI) status or listen for network interface controller (NIC) operation events to obtain the result. The ENI state machine is shown in the following figure: * ![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20221124/esgu/AttachNetworkInterface.jpg) * - Attaching indicates that the request to attach the ENI was sent successfully and the ENI is being attached to the ECS instance. * - InUse indicates that the ENI has been attached to the ECS instance. * - Available indicates that the ENI failed to be attached to the ECS instance. * **For details, see** [Attach a network interface controller (NIC)](https://help.aliyun.com/document_detail/471550.html). * * @param request - AttachNetworkInterfaceRequest * @returns AttachNetworkInterfaceResponse */ async attachNetworkInterface(request: $_model.AttachNetworkInterfaceRequest): Promise<$_model.AttachNetworkInterfaceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.attachNetworkInterfaceWithOptions(request, runtime); } /** * Adds one or more inbound rules to a security group. You can use this operation to specify inbound access permissions for a security group, allowing or denying other devices from sending inbound traffic to instances in the security group, which enables fine-grained network access control. * * @remarks * ### Before you begin * - **Quantity limit:** The total number of security group rules (including inbound rules and outbound rules) across all security groups associated with a single network interface controller (NIC) cannot exceed 1,000. For more information, see [Security group limits](~~25412#SecurityGroupQuota1~~). * - **Priority settings:** The priority (Priority) of inbound security group rules ranges from 1 to 100. A smaller number indicates a higher priority. If two security group rules have the same priority, the deny (drop) rule takes precedence. Access is denied first. * ### Notes * If the specified security group rule already exists, the call succeeds but no rule is added. * ### How to determine a rule * The following parameters are required to determine an inbound security group rule: * - Source settings: Specify one of the following: SourceCidrIp (IPv4 address), Ipv6SourceCidrIp (IPv6 address), SourcePrefixListId (prefix list ID), or SourceGroupId (source security group). * - Destination port range: PortRange. * - Protocol type: IpProtocol. * - Access policy: Policy. * > Advanced security groups do not support authorization for access from other security groups. Basic security groups support a maximum of 20 authorized security groups. * ### Request examples * The following examples show how to add inbound rules with different sources to a security group in the China (Hangzhou) region: * - Add access permissions for a specified IP address range. * ``` * "RegionId":"cn-hangzhou", // Specify the region. * "SecurityGroupId":"sg-bp67acfmxazb4p****", // Specify the security group. * "Permissions":[ * { * "SourceCidrIp":"10.0.0.0/8", // Specify the source IPv4 address. * "PortRange":"22/22", // Specify the port range. * "IpProtocol":"TCP", // Specify the protocol type. * "Policy":"Accept" // Specify the access policy. * } * ] * ``` * - Add access permissions for another security group and a prefix list. * ``` * "RegionId":"cn-hangzhou", * "SecurityGroupId":"sg-bp67acfmxazb4p****", * "Permissions":[ * { * "SourceGroupId":"sg-bp17vs63txqxbd****", // Specify the source security group. * "PortRange":"22/22", * "IpProtocol":"TCP", * "Policy":"Drop" * },{ * "SourcePrefixListId":"pl-x1j1k5ykzqlixdcy****", // Specify the source prefix list. * "PortRange":"22/22", * "IpProtocol":"TCP", * "Policy":"Drop" * } * ] * ``` * * @param request - AuthorizeSecurityGroupRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AuthorizeSecurityGroupResponse */ async authorizeSecurityGroupWithOptions(request: $_model.AuthorizeSecurityGroupRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AuthorizeSecurityGroupResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.destCidrIp)) { query["DestCidrIp"] = request.destCidrIp; } if (!$dara.isNull(request.ipProtocol)) { query["IpProtocol"] = request.ipProtocol; } if (!$dara.isNull(request.ipv6DestCidrIp)) { query["Ipv6DestCidrIp"] = request.ipv6DestCidrIp; } if (!$dara.isNull(request.ipv6SourceCidrIp)) { query["Ipv6SourceCidrIp"] = request.ipv6SourceCidrIp; } if (!$dara.isNull(request.nicType)) { query["NicType"] = request.nicType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.permissions)) { query["Permissions"] = request.permissions; } if (!$dara.isNull(request.policy)) { query["Policy"] = request.policy; } if (!$dara.isNull(request.portRange)) { query["PortRange"] = request.portRange; } if (!$dara.isNull(request.priority)) { query["Priority"] = request.priority; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.sourceCidrIp)) { query["SourceCidrIp"] = request.sourceCidrIp; } if (!$dara.isNull(request.sourceGroupId)) { query["SourceGroupId"] = request.sourceGroupId; } if (!$dara.isNull(request.sourceGroupOwnerAccount)) { query["SourceGroupOwnerAccount"] = request.sourceGroupOwnerAccount; } if (!$dara.isNull(request.sourceGroupOwnerId)) { query["SourceGroupOwnerId"] = request.sourceGroupOwnerId; } if (!$dara.isNull(request.sourcePortRange)) { query["SourcePortRange"] = request.sourcePortRange; } if (!$dara.isNull(request.sourcePrefixListId)) { query["SourcePrefixListId"] = request.sourcePrefixListId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AuthorizeSecurityGroup", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AuthorizeSecurityGroupResponse>(await this.callApi(params, req, runtime), new $_model.AuthorizeSecurityGroupResponse({})); } /** * Adds one or more inbound rules to a security group. You can use this operation to specify inbound access permissions for a security group, allowing or denying other devices from sending inbound traffic to instances in the security group, which enables fine-grained network access control. * * @remarks * ### Before you begin * - **Quantity limit:** The total number of security group rules (including inbound rules and outbound rules) across all security groups associated with a single network interface controller (NIC) cannot exceed 1,000. For more information, see [Security group limits](~~25412#SecurityGroupQuota1~~). * - **Priority settings:** The priority (Priority) of inbound security group rules ranges from 1 to 100. A smaller number indicates a higher priority. If two security group rules have the same priority, the deny (drop) rule takes precedence. Access is denied first. * ### Notes * If the specified security group rule already exists, the call succeeds but no rule is added. * ### How to determine a rule * The following parameters are required to determine an inbound security group rule: * - Source settings: Specify one of the following: SourceCidrIp (IPv4 address), Ipv6SourceCidrIp (IPv6 address), SourcePrefixListId (prefix list ID), or SourceGroupId (source security group). * - Destination port range: PortRange. * - Protocol type: IpProtocol. * - Access policy: Policy. * > Advanced security groups do not support authorization for access from other security groups. Basic security groups support a maximum of 20 authorized security groups. * ### Request examples * The following examples show how to add inbound rules with different sources to a security group in the China (Hangzhou) region: * - Add access permissions for a specified IP address range. * ``` * "RegionId":"cn-hangzhou", // Specify the region. * "SecurityGroupId":"sg-bp67acfmxazb4p****", // Specify the security group. * "Permissions":[ * { * "SourceCidrIp":"10.0.0.0/8", // Specify the source IPv4 address. * "PortRange":"22/22", // Specify the port range. * "IpProtocol":"TCP", // Specify the protocol type. * "Policy":"Accept" // Specify the access policy. * } * ] * ``` * - Add access permissions for another security group and a prefix list. * ``` * "RegionId":"cn-hangzhou", * "SecurityGroupId":"sg-bp67acfmxazb4p****", * "Permissions":[ * { * "SourceGroupId":"sg-bp17vs63txqxbd****", // Specify the source security group. * "PortRange":"22/22", * "IpProtocol":"TCP", * "Policy":"Drop" * },{ * "SourcePrefixListId":"pl-x1j1k5ykzqlixdcy****", // Specify the source prefix list. * "PortRange":"22/22", * "IpProtocol":"TCP", * "Policy":"Drop" * } * ] * ``` * * @param request - AuthorizeSecurityGroupRequest * @returns AuthorizeSecurityGroupResponse */ async authorizeSecurityGroup(request: $_model.AuthorizeSecurityGroupRequest): Promise<$_model.AuthorizeSecurityGroupResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.authorizeSecurityGroupWithOptions(request, runtime); } /** * Adds one or more outbound rules to a security group. You can use this operation to specify outbound access permissions for a security group, allowing or denying instances in the security group from sending outbound traffic to other devices, which enables fine-grained network access control. * * @remarks * ### Before you begin * - **Quantity limit:** The total number of rules (including both inbound rules and outbound rules) across all security groups associated with a single network interface controller (NIC) cannot exceed 1,000. For more information, see [Security group limits](~~25412#SecurityGroupQuota1~~). * - **Priority settings:** The priority (Priority) of outbound security group rules ranges from 1 to 100. A smaller number indicates a higher priority. If two security group rules have the same priority, the deny (drop) rule takes precedence. * ### Notes * If the specified security group rule already exists, the call succeeds but no rule is added. * ### How to determine a rule * The following parameters are required to determine an outbound rule: * - Destination settings: Specify one of the following: DestCidrIp (IPv4 address), Ipv6DestCidrIp (IPv6 address), DestPrefixListId (prefix list ID), or DestGroupId (destination security group). * - Destination port range: PortRange. * - Protocol type: IpProtocol. * - Access policy: Policy. * > Advanced security groups do not support authorization of other security groups for access. Custom security groups support a maximum of 20 authorized security groups. * ### Request examples * The following examples show how to add outbound rules with different destinations to a security group in the China (Hangzhou) region: * - Add access permissions for a specified IP address range. * ``` * "RegionId":"ap-southeast-1", // Specify the region. * "SecurityGroupId":"sg-bp17vs63txqxbds9***", // Specify the security group. * "Permissions":[ * { * "DestCidrIp":"10.0.0.0/8", // Specify the destination IPv4 address. * "PortRange":"-1/-1", // Specify the port range. * "IpProtocol":"ICMP", // Specify the protocol type. * "Policy":"Accept" // Specify the access policy. * } * ] * ``` * - Add access permissions for another security group and a prefix list. * ``` * "RegionId":"ap-southeast-1", * "SecurityGroupId":"sg-bp17vs63txqxbds9***", * "Permissions":[ * { * "DestGroupId":"sg-bp67acfmxazb4pi***", // Specify the destination security group. * "PortRange":"22/22", * "IpProtocol":"TCP", * "Policy":"Drop" * },{ * "DestPrefixListId":"pl-x1j1k5ykzqlixdcy****", // Specify the destination prefix list. * "PortRange":"22/22", * "IpProtocol":"TCP", * "Policy":"Drop" * } * ] * ``` * * @param request - AuthorizeSecurityGroupEgressRequest * @param runtime - runtime options for this request RuntimeOptions * @returns AuthorizeSecurityGroupEgressResponse */ async authorizeSecurityGroupEgressWithOptions(request: $_model.AuthorizeSecurityGroupEgressRequest, runtime: $dara.RuntimeOptions): Promise<$_model.AuthorizeSecurityGroupEgressResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.destCidrIp)) { query["DestCidrIp"] = request.destCidrIp; } if (!$dara.isNull(request.destGroupId)) { query["DestGroupId"] = request.destGroupId; } if (!$dara.isNull(request.destGroupOwnerAccount)) { query["DestGroupOwnerAccount"] = request.destGroupOwnerAccount; } if (!$dara.isNull(request.destGroupOwnerId)) { query["DestGroupOwnerId"] = request.destGroupOwnerId; } if (!$dara.isNull(request.destPrefixListId)) { query["DestPrefixListId"] = request.destPrefixListId; } if (!$dara.isNull(request.ipProtocol)) { query["IpProtocol"] = request.ipProtocol; } if (!$dara.isNull(request.ipv6DestCidrIp)) { query["Ipv6DestCidrIp"] = request.ipv6DestCidrIp; } if (!$dara.isNull(request.ipv6SourceCidrIp)) { query["Ipv6SourceCidrIp"] = request.ipv6SourceCidrIp; } if (!$dara.isNull(request.nicType)) { query["NicType"] = request.nicType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.permissions)) { query["Permissions"] = request.permissions; } if (!$dara.isNull(request.policy)) { query["Policy"] = request.policy; } if (!$dara.isNull(request.portRange)) { query["PortRange"] = request.portRange; } if (!$dara.isNull(request.priority)) { query["Priority"] = request.priority; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.sourceCidrIp)) { query["SourceCidrIp"] = request.sourceCidrIp; } if (!$dara.isNull(request.sourcePortRange)) { query["SourcePortRange"] = request.sourcePortRange; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "AuthorizeSecurityGroupEgress", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.AuthorizeSecurityGroupEgressResponse>(await this.callApi(params, req, runtime), new $_model.AuthorizeSecurityGroupEgressResponse({})); } /** * Adds one or more outbound rules to a security group. You can use this operation to specify outbound access permissions for a security group, allowing or denying instances in the security group from sending outbound traffic to other devices, which enables fine-grained network access control. * * @remarks * ### Before you begin * - **Quantity limit:** The total number of rules (including both inbound rules and outbound rules) across all security groups associated with a single network interface controller (NIC) cannot exceed 1,000. For more information, see [Security group limits](~~25412#SecurityGroupQuota1~~). * - **Priority settings:** The priority (Priority) of outbound security group rules ranges from 1 to 100. A smaller number indicates a higher priority. If two security group rules have the same priority, the deny (drop) rule takes precedence. * ### Notes * If the specified security group rule already exists, the call succeeds but no rule is added. * ### How to determine a rule * The following parameters are required to determine an outbound rule: * - Destination settings: Specify one of the following: DestCidrIp (IPv4 address), Ipv6DestCidrIp (IPv6 address), DestPrefixListId (prefix list ID), or DestGroupId (destination security group). * - Destination port range: PortRange. * - Protocol type: IpProtocol. * - Access policy: Policy. * > Advanced security groups do not support authorization of other security groups for access. Custom security groups support a maximum of 20 authorized security groups. * ### Request examples * The following examples show how to add outbound rules with different destinations to a security group in the China (Hangzhou) region: * - Add access permissions for a specified IP address range. * ``` * "RegionId":"ap-southeast-1", // Specify the region. * "SecurityGroupId":"sg-bp17vs63txqxbds9***", // Specify the security group. * "Permissions":[ * { * "DestCidrIp":"10.0.0.0/8", // Specify the destination IPv4 address. * "PortRange":"-1/-1", // Specify the port range. * "IpProtocol":"ICMP", // Specify the protocol type. * "Policy":"Accept" // Specify the access policy. * } * ] * ``` * - Add access permissions for another security group and a prefix list. * ``` * "RegionId":"ap-southeast-1", * "SecurityGroupId":"sg-bp17vs63txqxbds9***", * "Permissions":[ * { * "DestGroupId":"sg-bp67acfmxazb4pi***", // Specify the destination security group. * "PortRange":"22/22", * "IpProtocol":"TCP", * "Policy":"Drop" * },{ * "DestPrefixListId":"pl-x1j1k5ykzqlixdcy****", // Specify the destination prefix list. * "PortRange":"22/22", * "IpProtocol":"TCP", * "Policy":"Drop" * } * ] * ``` * * @param request - AuthorizeSecurityGroupEgressRequest * @returns AuthorizeSecurityGroupEgressResponse */ async authorizeSecurityGroupEgress(request: $_model.AuthorizeSecurityGroupEgressRequest): Promise<$_model.AuthorizeSecurityGroupEgressResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.authorizeSecurityGroupEgressWithOptions(request, runtime); } /** * Cancels the automatic snapshot policy for one or more cloud disks. * * @param request - CancelAutoSnapshotPolicyRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CancelAutoSnapshotPolicyResponse */ async cancelAutoSnapshotPolicyWithOptions(request: $_model.CancelAutoSnapshotPolicyRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CancelAutoSnapshotPolicyResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.autoSnapshotPolicyId)) { query["autoSnapshotPolicyId"] = request.autoSnapshotPolicyId; } if (!$dara.isNull(request.diskIds)) { query["diskIds"] = request.diskIds; } if (!$dara.isNull(request.regionId)) { query["regionId"] = request.regionId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CancelAutoSnapshotPolicy", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CancelAutoSnapshotPolicyResponse>(await this.callApi(params, req, runtime), new $_model.CancelAutoSnapshotPolicyResponse({})); } /** * Cancels the automatic snapshot policy for one or more cloud disks. * * @param request - CancelAutoSnapshotPolicyRequest * @returns CancelAutoSnapshotPolicyResponse */ async cancelAutoSnapshotPolicy(request: $_model.CancelAutoSnapshotPolicyRequest): Promise<$_model.CancelAutoSnapshotPolicyResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.cancelAutoSnapshotPolicyWithOptions(request, runtime); } /** * Cancels an ongoing CopyImage task. * * @remarks * When you call this operation, take note of the following items: * - After you cancel the image copy task, the image that was being created in the destination region is automatically deleted. The source image remains unchanged. * - If the image copy task is already complete, the operation fails and an error message is returned. * * @param request - CancelCopyImageRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CancelCopyImageResponse */ async cancelCopyImageWithOptions(request: $_model.CancelCopyImageRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CancelCopyImageResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CancelCopyImage", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CancelCopyImageResponse>(await this.callApi(params, req, runtime), new $_model.CancelCopyImageResponse({})); } /** * Cancels an ongoing CopyImage task. * * @remarks * When you call this operation, take note of the following items: * - After you cancel the image copy task, the image that was being created in the destination region is automatically deleted. The source image remains unchanged. * - If the image copy task is already complete, the operation fails and an error message is returned. * * @param request - CancelCopyImageRequest * @returns CancelCopyImageResponse */ async cancelCopyImage(request: $_model.CancelCopyImageRequest): Promise<$_model.CancelCopyImageResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.cancelCopyImageWithOptions(request, runtime); } /** * Cancels an image building task. * * @remarks * Before you call this operation, make sure that the image building task you want to cancel is in the PREPARING, REPAIRING, or BUILDING state. * * @param request - CancelImagePipelineExecutionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CancelImagePipelineExecutionResponse */ async cancelImagePipelineExecutionWithOptions(request: $_model.CancelImagePipelineExecutionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CancelImagePipelineExecutionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.executionId)) { query["ExecutionId"] = request.executionId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.templateTag)) { query["TemplateTag"] = request.templateTag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CancelImagePipelineExecution", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CancelImagePipelineExecutionResponse>(await this.callApi(params, req, runtime), new $_model.CancelImagePipelineExecutionResponse({})); } /** * Cancels an image building task. * * @remarks * Before you call this operation, make sure that the image building task you want to cancel is in the PREPARING, REPAIRING, or BUILDING state. * * @param request - CancelImagePipelineExecutionRequest * @returns CancelImagePipelineExecutionResponse */ async cancelImagePipelineExecution(request: $_model.CancelImagePipelineExecutionRequest): Promise<$_model.CancelImagePipelineExecutionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.cancelImagePipelineExecutionWithOptions(request, runtime); } /** * Cancels an application for an Express Connect circuit. You can cancel an Express Connect circuit only when it is in the `Initial` or `Approved` state. * * @deprecated OpenAPI CancelPhysicalConnection is deprecated, please use Vpc::2016-04-28::CancelPhysicalConnection instead. * * @param request - CancelPhysicalConnectionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CancelPhysicalConnectionResponse */ async cancelPhysicalConnectionWithOptions(request: $_model.CancelPhysicalConnectionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CancelPhysicalConnectionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.physicalConnectionId)) { query["PhysicalConnectionId"] = request.physicalConnectionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CancelPhysicalConnection", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CancelPhysicalConnectionResponse>(await this.callApi(params, req, runtime), new $_model.CancelPhysicalConnectionResponse({})); } /** * Cancels an application for an Express Connect circuit. You can cancel an Express Connect circuit only when it is in the `Initial` or `Approved` state. * * @deprecated OpenAPI CancelPhysicalConnection is deprecated, please use Vpc::2016-04-28::CancelPhysicalConnection instead. * * @param request - CancelPhysicalConnectionRequest * @returns CancelPhysicalConnectionResponse */ // Deprecated async cancelPhysicalConnection(request: $_model.CancelPhysicalConnectionRequest): Promise<$_model.CancelPhysicalConnectionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.cancelPhysicalConnectionWithOptions(request, runtime); } /** * Cancels one or more simulated system events that are in the Scheduled or Executing state. After a system event is canceled, the simulated event enters the Canceled state. * * @param request - CancelSimulatedSystemEventsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CancelSimulatedSystemEventsResponse */ async cancelSimulatedSystemEventsWithOptions(request: $_model.CancelSimulatedSystemEventsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CancelSimulatedSystemEventsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.eventId)) { query["EventId"] = request.eventId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CancelSimulatedSystemEvents", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CancelSimulatedSystemEventsResponse>(await this.callApi(params, req, runtime), new $_model.CancelSimulatedSystemEventsResponse({})); } /** * Cancels one or more simulated system events that are in the Scheduled or Executing state. After a system event is canceled, the simulated event enters the Canceled state. * * @param request - CancelSimulatedSystemEventsRequest * @returns CancelSimulatedSystemEventsResponse */ async cancelSimulatedSystemEvents(request: $_model.CancelSimulatedSystemEventsRequest): Promise<$_model.CancelSimulatedSystemEventsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.cancelSimulatedSystemEventsWithOptions(request, runtime); } /** * Cancels a running task. You can cancel the running tasks generated by the ImportImage or ExportImage operation. * * @param request - CancelTaskRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CancelTaskResponse */ async cancelTaskWithOptions(request: $_model.CancelTaskRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CancelTaskResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.taskId)) { query["TaskId"] = request.taskId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CancelTask", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CancelTaskResponse>(await this.callApi(params, req, runtime), new $_model.CancelTaskResponse({})); } /** * Cancels a running task. You can cancel the running tasks generated by the ImportImage or ExportImage operation. * * @param request - CancelTaskRequest * @returns CancelTaskResponse */ async cancelTask(request: $_model.CancelTaskRequest): Promise<$_model.CancelTaskResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.cancelTaskWithOptions(request, runtime); } /** * Disk cloning allows you to quickly replicate a disk with the same data as the source disk in the same zone. The cloned disk supports custom capacity, type, and encryption attributes. After you attach the cloned disk to an instance, you can quickly replicate business data or horizontally scale services. * * @remarks * > The disk cloning feature itself is free of charge. However, the new disk generated by cloning is billed based on block storage billing rules. Billable items vary by disk type and include disk capacity fees, provisioned performance fees, and performance burst fees. Except for performance burst fees, which are billed after a burst occurs, other fees start to accrue after the disk is created, regardless of whether the disk is attached to an instance. * ### Usage notes * - This is an asynchronous operation. After a successful call, use the taskGroupId and call the DescribeTasks operation to query the execution result. * ### Features * - Cloning supports only ESSD series disks (cloud_essd, cloud_auto, cloud_essd_entry, cloud_regional_disk_auto) as the source, and the cloned `new disk` supports only ESSD series disk types. * - Non-regional disks can be cloned only to non-regional types. Regional disks can be cloned only to regional disk types. * - Local disks and elastic ephemeral disks cannot be cloned or used as clone sources. * - You can specify the `new disk` type and performance level during cloning. * - You can specify the `new disk` capacity during cloning. The new disk capacity must be greater than or equal to the `source disk` capacity. * - You can configure provisioned performance and performance burst for the `new disk` during cloning, provided that the destination disk type supports provisioned performance and performance burst. * - You can specify encryption or change the encryption key for the `new disk` during cloning. If the `source disk` is encrypted, you cannot clone it into an unencrypted disk, but you can change the encryption key. * - You can use a subscription disk as the `source disk` for cloning, even if the subscription disk has expired. * - The cloned `new disk` does not support reinitialization. * - Cloning does not support storage sets or dedicated block storage clusters. However, disks in these resources can be used as the `source disk`. The cloned disk will not be in the storage set or dedicated block storage cluster. * - `Source disk` status restrictions: * - The `source disk` status is "In Use" and the corresponding instance status is "Running" or "Stopped". * - The `source disk` status is "Available" and the disk has been previously attached. * - Disks undergoing specification changes cannot be used as the `source disk`. * - Disks undergoing expansion cannot be used as the `source disk`. * - Disk cloning is not supported for instance hibernation scenarios. If a disk is on a hibernated instance, it cannot be used as the `source disk`. * * @param request - CloneDisksRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CloneDisksResponse */ async cloneDisksWithOptions(request: $_model.CloneDisksRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CloneDisksResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.arn)) { query["Arn"] = request.arn; } if (!$dara.isNull(request.burstingEnabled)) { query["BurstingEnabled"] = request.burstingEnabled; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.diskCategory)) { query["DiskCategory"] = request.diskCategory; } if (!$dara.isNull(request.diskName)) { query["DiskName"] = request.diskName; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.encrypted)) { query["Encrypted"] = request.encrypted; } if (!$dara.isNull(request.kmsKeyId)) { query["KmsKeyId"] = request.kmsKeyId; } if (!$dara.isNull(request.multiAttach)) { query["MultiAttach"] = request.multiAttach; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.performanceLevel)) { query["PerformanceLevel"] = request.performanceLevel; } if (!$dara.isNull(request.provisionedIops)) { query["ProvisionedIops"] = request.provisionedIops; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.size)) { query["Size"] = request.size; } if (!$dara.isNull(request.sourceDiskId)) { query["SourceDiskId"] = request.sourceDiskId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CloneDisks", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CloneDisksResponse>(await this.callApi(params, req, runtime), new $_model.CloneDisksResponse({})); } /** * Disk cloning allows you to quickly replicate a disk with the same data as the source disk in the same zone. The cloned disk supports custom capacity, type, and encryption attributes. After you attach the cloned disk to an instance, you can quickly replicate business data or horizontally scale services. * * @remarks * > The disk cloning feature itself is free of charge. However, the new disk generated by cloning is billed based on block storage billing rules. Billable items vary by disk type and include disk capacity fees, provisioned performance fees, and performance burst fees. Except for performance burst fees, which are billed after a burst occurs, other fees start to accrue after the disk is created, regardless of whether the disk is attached to an instance. * ### Usage notes * - This is an asynchronous operation. After a successful call, use the taskGroupId and call the DescribeTasks operation to query the execution result. * ### Features * - Cloning supports only ESSD series disks (cloud_essd, cloud_auto, cloud_essd_entry, cloud_regional_disk_auto) as the source, and the cloned `new disk` supports only ESSD series disk types. * - Non-regional disks can be cloned only to non-regional types. Regional disks can be cloned only to regional disk types. * - Local disks and elastic ephemeral disks cannot be cloned or used as clone sources. * - You can specify the `new disk` type and performance level during cloning. * - You can specify the `new disk` capacity during cloning. The new disk capacity must be greater than or equal to the `source disk` capacity. * - You can configure provisioned performance and performance burst for the `new disk` during cloning, provided that the destination disk type supports provisioned performance and performance burst. * - You can specify encryption or change the encryption key for the `new disk` during cloning. If the `source disk` is encrypted, you cannot clone it into an unencrypted disk, but you can change the encryption key. * - You can use a subscription disk as the `source disk` for cloning, even if the subscription disk has expired. * - The cloned `new disk` does not support reinitialization. * - Cloning does not support storage sets or dedicated block storage clusters. However, disks in these resources can be used as the `source disk`. The cloned disk will not be in the storage set or dedicated block storage cluster. * - `Source disk` status restrictions: * - The `source disk` status is "In Use" and the corresponding instance status is "Running" or "Stopped". * - The `source disk` status is "Available" and the disk has been previously attached. * - Disks undergoing specification changes cannot be used as the `source disk`. * - Disks undergoing expansion cannot be used as the `source disk`. * - Disk cloning is not supported for instance hibernation scenarios. If a disk is on a hibernated instance, it cannot be used as the `source disk`. * * @param request - CloneDisksRequest * @returns CloneDisksResponse */ async cloneDisks(request: $_model.CloneDisksRequest): Promise<$_model.CloneDisksResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.cloneDisksWithOptions(request, runtime); } /** * ConnectRouterInterface * * @deprecated OpenAPI ConnectRouterInterface is deprecated, please use Vpc::2016-04-28::ConnectRouterInterface instead. * * @param request - ConnectRouterInterfaceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ConnectRouterInterfaceResponse */ async connectRouterInterfaceWithOptions(request: $_model.ConnectRouterInterfaceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ConnectRouterInterfaceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.routerInterfaceId)) { query["RouterInterfaceId"] = request.routerInterfaceId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ConnectRouterInterface", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ConnectRouterInterfaceResponse>(await this.callApi(params, req, runtime), new $_model.ConnectRouterInterfaceResponse({})); } /** * ConnectRouterInterface * * @deprecated OpenAPI ConnectRouterInterface is deprecated, please use Vpc::2016-04-28::ConnectRouterInterface instead. * * @param request - ConnectRouterInterfaceRequest * @returns ConnectRouterInterfaceResponse */ // Deprecated async connectRouterInterface(request: $_model.ConnectRouterInterfaceRequest): Promise<$_model.ConnectRouterInterfaceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.connectRouterInterfaceWithOptions(request, runtime); } /** * Converts the static public IP address of an Elastic Compute Service (ECS) instance that resides in a virtual private cloud (VPC) into an elastic IP address (EIP). Static public IP addresses are the public IP addresses that are automatically assigned to ECS instances. * * @remarks * ## [](#)Usage notes * After a public IP address is converted into an EIP, the EIP is billed separately. Make sure that you fully understand the billing methods of EIPs. For more information, see [Billing overview](https://help.aliyun.com/document_detail/122035.html). * When you call this operation, make sure that the ECS instance meets the following requirements: * - The instance is in the **Stopped** (`Stopped`) or **Running** (`Running`) state. * - The instance has no EIPs associated. * - The instance has no configuration change tasks that have not taken effect. * - The public bandwidth of the instance is not 0 Mbit/s. * - If the instance is a subscription instance, the billing method for network usage of the instance must be `pay-by-traffic`. The public IP address of a subscription instance that uses the `pay-by-bandwidth` billing method for network usage cannot be converted into an EIP. This requirement does not apply to pay-as-you-go instances. For more information, see [Change the billing method for network usage](https://help.aliyun.com/document_detail/178883.html). * - If the instance is a subscription instance that resides in a VPC, the instance does not expire within 24 hours. * * @param request - ConvertNatPublicIpToEipRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ConvertNatPublicIpToEipResponse */ async convertNatPublicIpToEipWithOptions(request: $_model.ConvertNatPublicIpToEipRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ConvertNatPublicIpToEipResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ConvertNatPublicIpToEip", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ConvertNatPublicIpToEipResponse>(await this.callApi(params, req, runtime), new $_model.ConvertNatPublicIpToEipResponse({})); } /** * Converts the static public IP address of an Elastic Compute Service (ECS) instance that resides in a virtual private cloud (VPC) into an elastic IP address (EIP). Static public IP addresses are the public IP addresses that are automatically assigned to ECS instances. * * @remarks * ## [](#)Usage notes * After a public IP address is converted into an EIP, the EIP is billed separately. Make sure that you fully understand the billing methods of EIPs. For more information, see [Billing overview](https://help.aliyun.com/document_detail/122035.html). * When you call this operation, make sure that the ECS instance meets the following requirements: * - The instance is in the **Stopped** (`Stopped`) or **Running** (`Running`) state. * - The instance has no EIPs associated. * - The instance has no configuration change tasks that have not taken effect. * - The public bandwidth of the instance is not 0 Mbit/s. * - If the instance is a subscription instance, the billing method for network usage of the instance must be `pay-by-traffic`. The public IP address of a subscription instance that uses the `pay-by-bandwidth` billing method for network usage cannot be converted into an EIP. This requirement does not apply to pay-as-you-go instances. For more information, see [Change the billing method for network usage](https://help.aliyun.com/document_detail/178883.html). * - If the instance is a subscription instance that resides in a VPC, the instance does not expire within 24 hours. * * @param request - ConvertNatPublicIpToEipRequest * @returns ConvertNatPublicIpToEipResponse */ async convertNatPublicIpToEip(request: $_model.ConvertNatPublicIpToEipRequest): Promise<$_model.ConvertNatPublicIpToEipResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.convertNatPublicIpToEipWithOptions(request, runtime); } /** * Copies a custom image from one region to another region. You can copy custom images to deploy or copy Elastic Compute Service (ECS) instances across regions. * * @remarks * ## [](#)Usage notes * After you copy a custom image to the destination region, you can use the image copy (new image) to create ECS instances by calling the RunInstances operation or replace the system disks of instances by calling the ReplaceSystemDisk operation in the destination region. * Take note of the following items: * - Only custom images that are in the `Available` state can be copied. * - Custom images that belong to your Alibaba Cloud account can be copied across regions. Images that are shared with you by others can be copied only within the regions where the images reside. * - When an image is being copied, the new image cannot be deleted by calling the [DeleteImage](https://help.aliyun.com/document_detail/25537.html) operation. However, you can cancel the ongoing image copy task by calling the [CancelCopyImage](https://help.aliyun.com/document_detail/25539.html) operation. * - A region supports only up to five concurrent image copy tasks. Excess image copy tasks are queued for execution. * - You can configure `ResourceGroupId` to specify the resource group to which to assign the new image. If you do not configure `ResourceGroupId`, the new image is assigned to the default resource group. * * @param request - CopyImageRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CopyImageResponse */ async copyImageWithOptions(request: $_model.CopyImageRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CopyImageResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.destinationDescription)) { query["DestinationDescription"] = request.destinationDescription; } if (!$dara.isNull(request.destinationImageName)) { query["DestinationImageName"] = request.destinationImageName; } if (!$dara.isNull(request.destinationRegionId)) { query["DestinationRegionId"] = request.destinationRegionId; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.encryptAlgorithm)) { query["EncryptAlgorithm"] = request.encryptAlgorithm; } if (!$dara.isNull(request.encrypted)) { query["Encrypted"] = request.encrypted; } if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.KMSKeyId)) { query["KMSKeyId"] = request.KMSKeyId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CopyImage", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CopyImageResponse>(await this.callApi(params, req, runtime), new $_model.CopyImageResponse({})); } /** * Copies a custom image from one region to another region. You can copy custom images to deploy or copy Elastic Compute Service (ECS) instances across regions. * * @remarks * ## [](#)Usage notes * After you copy a custom image to the destination region, you can use the image copy (new image) to create ECS instances by calling the RunInstances operation or replace the system disks of instances by calling the ReplaceSystemDisk operation in the destination region. * Take note of the following items: * - Only custom images that are in the `Available` state can be copied. * - Custom images that belong to your Alibaba Cloud account can be copied across regions. Images that are shared with you by others can be copied only within the regions where the images reside. * - When an image is being copied, the new image cannot be deleted by calling the [DeleteImage](https://help.aliyun.com/document_detail/25537.html) operation. However, you can cancel the ongoing image copy task by calling the [CancelCopyImage](https://help.aliyun.com/document_detail/25539.html) operation. * - A region supports only up to five concurrent image copy tasks. Excess image copy tasks are queued for execution. * - You can configure `ResourceGroupId` to specify the resource group to which to assign the new image. If you do not configure `ResourceGroupId`, the new image is assigned to the default resource group. * * @param request - CopyImageRequest * @returns CopyImageResponse */ async copyImage(request: $_model.CopyImageRequest): Promise<$_model.CopyImageResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.copyImageWithOptions(request, runtime); } /** * Copies a standard snapshot or encrypted snapshot from one region to another. * * @remarks * When you call this operation, take note of the following items: * - The new snapshot cannot be used to roll back the cloud disk that is associated with the source snapshot. * - Local snapshots cannot be copied. * * @param request - CopySnapshotRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CopySnapshotResponse */ async copySnapshotWithOptions(request: $_model.CopySnapshotRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CopySnapshotResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.arn)) { query["Arn"] = request.arn; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.destinationRegionId)) { query["DestinationRegionId"] = request.destinationRegionId; } if (!$dara.isNull(request.destinationSnapshotDescription)) { query["DestinationSnapshotDescription"] = request.destinationSnapshotDescription; } if (!$dara.isNull(request.destinationSnapshotName)) { query["DestinationSnapshotName"] = request.destinationSnapshotName; } if (!$dara.isNull(request.destinationStorageLocationArn)) { query["DestinationStorageLocationArn"] = request.destinationStorageLocationArn; } if (!$dara.isNull(request.encrypted)) { query["Encrypted"] = request.encrypted; } if (!$dara.isNull(request.KMSKeyId)) { query["KMSKeyId"] = request.KMSKeyId; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.retentionDays)) { query["RetentionDays"] = request.retentionDays; } if (!$dara.isNull(request.snapshotId)) { query["SnapshotId"] = request.snapshotId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CopySnapshot", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CopySnapshotResponse>(await this.callApi(params, req, runtime), new $_model.CopySnapshotResponse({})); } /** * Copies a standard snapshot or encrypted snapshot from one region to another. * * @remarks * When you call this operation, take note of the following items: * - The new snapshot cannot be used to roll back the cloud disk that is associated with the source snapshot. * - Local snapshots cannot be copied. * * @param request - CopySnapshotRequest * @returns CopySnapshotResponse */ async copySnapshot(request: $_model.CopySnapshotRequest): Promise<$_model.CopySnapshotResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.copySnapshotWithOptions(request, runtime); } /** * Creates an activation code that is used to register non-Alibaba Cloud servers as Alibaba Cloud managed instances. * * @remarks * ## Operation description * After you use an activation code to register a non-Alibaba Cloud server as an Alibaba Cloud managed instance, you can use various online services provided by Alibaba Cloud in the managed instance, such as Cloud Assistant, CloudOps Orchestration Service, and Alibaba Cloud DevOps. * The operating system of the non-Elastic Compute Service (ECS) server must meet the following version requirements, and the server must have Internet access to be registered as an Alibaba Cloud managed instance. * - Alibaba Cloud Linux 2/3 and later * - CentOS 6/7/8 and later * - Debian 8/9/10 and later * - Ubuntu 12/14/16/18 and later * - CoreOS * - OpenSUSE * - RedHat 5/6/7 and later * - SUSE Linux Enterprise Server 11/12/15 and later * - Window Server 2012/2016/2019 and later * In each Alibaba Cloud region, you can have up to 10 managed instance activation codes. Each activation code can be used to register up to 10 instances, and each activation code is valid for up to 4 hours. * > On the **ECS Cloud Assistant** page, click the **Managed Instances** tab, and then click **Register New Instance** to view the usage data of activation codes. * * @param request - CreateActivationRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateActivationResponse */ async createActivationWithOptions(request: $_model.CreateActivationRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateActivationResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.instanceCount)) { query["InstanceCount"] = request.instanceCount; } if (!$dara.isNull(request.instanceName)) { query["InstanceName"] = request.instanceName; } if (!$dara.isNull(request.ipAddressRange)) { query["IpAddressRange"] = request.ipAddressRange; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.timeToLiveInHours)) { query["TimeToLiveInHours"] = request.timeToLiveInHours; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateActivation", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateActivationResponse>(await this.callApi(params, req, runtime), new $_model.CreateActivationResponse({})); } /** * Creates an activation code that is used to register non-Alibaba Cloud servers as Alibaba Cloud managed instances. * * @remarks * ## Operation description * After you use an activation code to register a non-Alibaba Cloud server as an Alibaba Cloud managed instance, you can use various online services provided by Alibaba Cloud in the managed instance, such as Cloud Assistant, CloudOps Orchestration Service, and Alibaba Cloud DevOps. * The operating system of the non-Elastic Compute Service (ECS) server must meet the following version requirements, and the server must have Internet access to be registered as an Alibaba Cloud managed instance. * - Alibaba Cloud Linux 2/3 and later * - CentOS 6/7/8 and later * - Debian 8/9/10 and later * - Ubuntu 12/14/16/18 and later * - CoreOS * - OpenSUSE * - RedHat 5/6/7 and later * - SUSE Linux Enterprise Server 11/12/15 and later * - Window Server 2012/2016/2019 and later * In each Alibaba Cloud region, you can have up to 10 managed instance activation codes. Each activation code can be used to register up to 10 instances, and each activation code is valid for up to 4 hours. * > On the **ECS Cloud Assistant** page, click the **Managed Instances** tab, and then click **Register New Instance** to view the usage data of activation codes. * * @param request - CreateActivationRequest * @returns CreateActivationResponse */ async createActivation(request: $_model.CreateActivationRequest): Promise<$_model.CreateActivationResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createActivationWithOptions(request, runtime); } /** * Creates an auto provisioning group. * * @remarks * - Auto provisioning is a solution that uses spot instances and pay-as-you-go instances to quickly deploy instance clusters. It supports one-click deployment of instance clusters across billing methods, zones, and instance families. For more information, see [Use the auto provisioning group API to create ECS instances in batches](https://help.aliyun.com/document_detail/200772.html). * - Auto provisioning uses provisioning groups to schedule and maintain compute resources. You can use an auto provisioning group to steadily provide computing power and mitigate the instability caused by the reclaim mechanism of spot instances. * - Auto provisioning is a free feature, but you are charged for the instance resources created by the auto provisioning group. For more information, see [Spot instance billing](https://help.aliyun.com/document_detail/52088.html) and [Pay-as-you-go](https://help.aliyun.com/document_detail/40653.html). * - If you specify both a launch template (`LaunchTemplateId`) and launch configuration information (`LaunchConfiguration.*`), the launch template takes precedence. * * @param tmpReq - CreateAutoProvisioningGroupRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateAutoProvisioningGroupResponse */ async createAutoProvisioningGroupWithOptions(tmpReq: $_model.CreateAutoProvisioningGroupRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateAutoProvisioningGroupResponse> { tmpReq.validate(); let request = new $_model.CreateAutoProvisioningGroupShrinkRequest({ }); OpenApiUtil.convert(tmpReq, request); if (!$dara.isNull(tmpReq.resourcePoolOptions)) { request.resourcePoolOptionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourcePoolOptions, "ResourcePoolOptions", "json"); } let query = { }; if (!$dara.isNull(request.autoProvisioningGroupName)) { query["AutoProvisioningGroupName"] = request.autoProvisioningGroupName; } if (!$dara.isNull(request.autoProvisioningGroupType)) { query["AutoProvisioningGroupType"] = request.autoProvisioningGroupType; } if (!$dara.isNull(request.candidateOptions)) { query["CandidateOptions"] = request.candidateOptions; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.dataDiskConfig)) { query["DataDiskConfig"] = request.dataDiskConfig; } if (!$dara.isNull(request.defaultTargetCapacityType)) { query["DefaultTargetCapacityType"] = request.defaultTargetCapacityType; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.excessCapacityTerminationPolicy)) { query["ExcessCapacityTerminationPolicy"] = request.excessCapacityTerminationPolicy; } if (!$dara.isNull(request.executionMode)) { query["ExecutionMode"] = request.executionMode; } if (!$dara.isNull(request.hibernationOptionsConfigured)) { query["HibernationOptionsConfigured"] = request.hibernationOptionsConfigured; } if (!$dara.isNull(request.launchTemplateConfig)) { query["LaunchTemplateConfig"] = request.launchTemplateConfig; } if (!$dara.isNull(request.launchTemplateId)) { query["LaunchTemplateId"] = request.launchTemplateId; } if (!$dara.isNull(request.launchTemplateVersion)) { query["LaunchTemplateVersion"] = request.launchTemplateVersion; } if (!$dara.isNull(request.maxSpotPrice)) { query["MaxSpotPrice"] = request.maxSpotPrice; } if (!$dara.isNull(request.minTargetCapacity)) { query["MinTargetCapacity"] = request.minTargetCapacity; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.payAsYouGoAllocationStrategy)) { query["PayAsYouGoAllocationStrategy"] = request.payAsYouGoAllocationStrategy; } if (!$dara.isNull(request.payAsYouGoTargetCapacity)) { query["PayAsYouGoTargetCapacity"] = request.payAsYouGoTargetCapacity; } if (!$dara.isNull(request.prePaidOptions)) { query["PrePaidOptions"] = request.prePaidOptions; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourcePoolOptionsShrink)) { query["ResourcePoolOptions"] = request.resourcePoolOptionsShrink; } if (!$dara.isNull(request.spotAllocationStrategy)) { query["SpotAllocationStrategy"] = request.spotAllocationStrategy; } if (!$dara.isNull(request.spotInstanceInterruptionBehavior)) { query["SpotInstanceInterruptionBehavior"] = request.spotInstanceInterruptionBehavior; } if (!$dara.isNull(request.spotInstancePoolsToUseCount)) { query["SpotInstancePoolsToUseCount"] = request.spotInstancePoolsToUseCount; } if (!$dara.isNull(request.spotTargetCapacity)) { query["SpotTargetCapacity"] = request.spotTargetCapacity; } if (!$dara.isNull(request.systemDiskConfig)) { query["SystemDiskConfig"] = request.systemDiskConfig; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.terminateInstances)) { query["TerminateInstances"] = request.terminateInstances; } if (!$dara.isNull(request.terminateInstancesWithExpiration)) { query["TerminateInstancesWithExpiration"] = request.terminateInstancesWithExpiration; } if (!$dara.isNull(request.totalTargetCapacity)) { query["TotalTargetCapacity"] = request.totalTargetCapacity; } if (!$dara.isNull(request.validFrom)) { query["ValidFrom"] = request.validFrom; } if (!$dara.isNull(request.validUntil)) { query["ValidUntil"] = request.validUntil; } if (!$dara.isNull(request.launchConfiguration)) { query["LaunchConfiguration"] = request.launchConfiguration; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateAutoProvisioningGroup", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateAutoProvisioningGroupResponse>(await this.callApi(params, req, runtime), new $_model.CreateAutoProvisioningGroupResponse({})); } /** * Creates an auto provisioning group. * * @remarks * - Auto provisioning is a solution that uses spot instances and pay-as-you-go instances to quickly deploy instance clusters. It supports one-click deployment of instance clusters across billing methods, zones, and instance families. For more information, see [Use the auto provisioning group API to create ECS instances in batches](https://help.aliyun.com/document_detail/200772.html). * - Auto provisioning uses provisioning groups to schedule and maintain compute resources. You can use an auto provisioning group to steadily provide computing power and mitigate the instability caused by the reclaim mechanism of spot instances. * - Auto provisioning is a free feature, but you are charged for the instance resources created by the auto provisioning group. For more information, see [Spot instance billing](https://help.aliyun.com/document_detail/52088.html) and [Pay-as-you-go](https://help.aliyun.com/document_detail/40653.html). * - If you specify both a launch template (`LaunchTemplateId`) and launch configuration information (`LaunchConfiguration.*`), the launch template takes precedence. * * @param request - CreateAutoProvisioningGroupRequest * @returns CreateAutoProvisioningGroupResponse */ async createAutoProvisioningGroup(request: $_model.CreateAutoProvisioningGroupRequest): Promise<$_model.CreateAutoProvisioningGroupResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createAutoProvisioningGroupWithOptions(request, runtime); } /** * Creates an automatic snapshot policy in a specified region. You can specify the repeat cycle, retention period, and cross-region backup settings for automatic snapshots to back up data on system disks or data disks. * * @remarks * Before you call this operation, read [Create an automatic snapshot policy](https://help.aliyun.com/document_detail/127767.html). * Take note of the following items: * - You can create a maximum of 100 automatic snapshot policies in a region for an Alibaba Cloud account. When the number of automatic snapshots for a disk reaches the quota limit, the system deletes the earliest automatic snapshot created by the automatic snapshot policy when a new snapshot task is initiated. * - The system does not execute automatic snapshot policies when an ECS instance has a pending stop or restart task. * - If cross-region snapshot replication is enabled and no encryption parameters are configured, encrypted snapshots are replicated to the destination region by using the service key of the destination region by default. For more information about cross-region snapshot replication, see [Copy a snapshot](https://help.aliyun.com/document_detail/159441.html). * After you create an automatic snapshot policy, call [ApplyAutoSnapshotPolicy](https://help.aliyun.com/document_detail/25531.html) to apply the policy to disks. To modify an automatic snapshot policy, call [ModifyAutoSnapshotPolicyEx](https://help.aliyun.com/document_detail/25529.html). * * @param request - CreateAutoSnapshotPolicyRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateAutoSnapshotPolicyResponse */ async createAutoSnapshotPolicyWithOptions(request: $_model.CreateAutoSnapshotPolicyRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateAutoSnapshotPolicyResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.copiedSnapshotsRetentionDays)) { query["CopiedSnapshotsRetentionDays"] = request.copiedSnapshotsRetentionDays; } if (!$dara.isNull(request.copyEncryptionConfiguration)) { query["CopyEncryptionConfiguration"] = request.copyEncryptionConfiguration; } if (!$dara.isNull(request.enableCrossRegionCopy)) { query["EnableCrossRegionCopy"] = request.enableCrossRegionCopy; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.storageLocationArn)) { query["StorageLocationArn"] = request.storageLocationArn; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.targetCopyRegions)) { query["TargetCopyRegions"] = request.targetCopyRegions; } if (!$dara.isNull(request.autoSnapshotPolicyName)) { query["autoSnapshotPolicyName"] = request.autoSnapshotPolicyName; } if (!$dara.isNull(request.regionId)) { query["regionId"] = request.regionId; } if (!$dara.isNull(request.repeatWeekdays)) { query["repeatWeekdays"] = request.repeatWeekdays; } if (!$dara.isNull(request.retentionDays)) { query["retentionDays"] = request.retentionDays; } if (!$dara.isNull(request.timePoints)) { query["timePoints"] = request.timePoints; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateAutoSnapshotPolicy", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateAutoSnapshotPolicyResponse>(await this.callApi(params, req, runtime), new $_model.CreateAutoSnapshotPolicyResponse({})); } /** * Creates an automatic snapshot policy in a specified region. You can specify the repeat cycle, retention period, and cross-region backup settings for automatic snapshots to back up data on system disks or data disks. * * @remarks * Before you call this operation, read [Create an automatic snapshot policy](https://help.aliyun.com/document_detail/127767.html). * Take note of the following items: * - You can create a maximum of 100 automatic snapshot policies in a region for an Alibaba Cloud account. When the number of automatic snapshots for a disk reaches the quota limit, the system deletes the earliest automatic snapshot created by the automatic snapshot policy when a new snapshot task is initiated. * - The system does not execute automatic snapshot policies when an ECS instance has a pending stop or restart task. * - If cross-region snapshot replication is enabled and no encryption parameters are configured, encrypted snapshots are replicated to the destination region by using the service key of the destination region by default. For more information about cross-region snapshot replication, see [Copy a snapshot](https://help.aliyun.com/document_detail/159441.html). * After you create an automatic snapshot policy, call [ApplyAutoSnapshotPolicy](https://help.aliyun.com/document_detail/25531.html) to apply the policy to disks. To modify an automatic snapshot policy, call [ModifyAutoSnapshotPolicyEx](https://help.aliyun.com/document_detail/25529.html). * * @param request - CreateAutoSnapshotPolicyRequest * @returns CreateAutoSnapshotPolicyResponse */ async createAutoSnapshotPolicy(request: $_model.CreateAutoSnapshotPolicyRequest): Promise<$_model.CreateAutoSnapshotPolicyResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createAutoSnapshotPolicyWithOptions(request, runtime); } /** * To create a Capacity Reservation, specify the instance type, total quantity, start time, and availability zone. * * @remarks * ## API * The Capacity Reservation service lets you reserve compute resources by specifying attributes such as the availability zone and instance type. The system then reserves matching resources in a private pool. For more information, see [Overview of immediate capacity reservations](https://help.aliyun.com/document_detail/193633.html). * - This service currently supports only the immediate start mode. After you purchase an immediate capacity reservation, you are billed for the reserved instance type at the standard Pay-As-You-Go rate. This billing applies regardless of whether you launch any Pay-As-You-Go instances and continues until you release the reservation or it expires. * - You can specify the private pool option when creating an instance by calling the [CreateInstance](https://help.aliyun.com/document_detail/25499.html) or [RunInstances](https://help.aliyun.com/document_detail/63440.html) operations. To change this setting for an existing instance, call the [ModifyInstanceAttachmentAttributes](https://help.aliyun.com/document_detail/190006.html) operation. After an instance matches a private pool, you are billed for its configured resources, such as the instance type, cloud disks, and public bandwidth. * - If you do not launch any Pay-As-You-Go instances into the reserved capacity, you are billed only for the reserved instance type. * - You can apply Savings Plans and Regional Reserved Instance Coupons to the hourly bills for both matched instances and unused capacity in your immediate capacity reservations. However, Zonal Reserved Instance Coupons are not supported. We recommend purchasing Savings Plans or Reserved Instance Coupons first. Using the Capacity Reservation service with coverage from these plans provides capacity assurance at no additional cost. * > You can use the API to create only immediate capacity reservations. To create either immediate or scheduled capacity reservations, use the ECS Console. For more information, see [Resource Reservation Service](~~193626#section-oil-qh5-xvx~~). * * @param request - CreateCapacityReservationRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateCapacityReservationResponse */ async createCapacityReservationWithOptions(request: $_model.CreateCapacityReservationRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateCapacityReservationResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.endTimeType)) { query["EndTimeType"] = request.endTimeType; } if (!$dara.isNull(request.instanceAmount)) { query["InstanceAmount"] = request.instanceAmount; } if (!$dara.isNull(request.instanceChargeType)) { query["InstanceChargeType"] = request.instanceChargeType; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.platform)) { query["Platform"] = request.platform; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateCapacityReservation", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateCapacityReservationResponse>(await this.callApi(params, req, runtime), new $_model.CreateCapacityReservationResponse({})); } /** * To create a Capacity Reservation, specify the instance type, total quantity, start time, and availability zone. * * @remarks * ## API * The Capacity Reservation service lets you reserve compute resources by specifying attributes such as the availability zone and instance type. The system then reserves matching resources in a private pool. For more information, see [Overview of immediate capacity reservations](https://help.aliyun.com/document_detail/193633.html). * - This service currently supports only the immediate start mode. After you purchase an immediate capacity reservation, you are billed for the reserved instance type at the standard Pay-As-You-Go rate. This billing applies regardless of whether you launch any Pay-As-You-Go instances and continues until you release the reservation or it expires. * - You can specify the private pool option when creating an instance by calling the [CreateInstance](https://help.aliyun.com/document_detail/25499.html) or [RunInstances](https://help.aliyun.com/document_detail/63440.html) operations. To change this setting for an existing instance, call the [ModifyInstanceAttachmentAttributes](https://help.aliyun.com/document_detail/190006.html) operation. After an instance matches a private pool, you are billed for its configured resources, such as the instance type, cloud disks, and public bandwidth. * - If you do not launch any Pay-As-You-Go instances into the reserved capacity, you are billed only for the reserved instance type. * - You can apply Savings Plans and Regional Reserved Instance Coupons to the hourly bills for both matched instances and unused capacity in your immediate capacity reservations. However, Zonal Reserved Instance Coupons are not supported. We recommend purchasing Savings Plans or Reserved Instance Coupons first. Using the Capacity Reservation service with coverage from these plans provides capacity assurance at no additional cost. * > You can use the API to create only immediate capacity reservations. To create either immediate or scheduled capacity reservations, use the ECS Console. For more information, see [Resource Reservation Service](~~193626#section-oil-qh5-xvx~~). * * @param request - CreateCapacityReservationRequest * @returns CreateCapacityReservationResponse */ async createCapacityReservation(request: $_model.CreateCapacityReservationRequest): Promise<$_model.CreateCapacityReservationResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createCapacityReservationWithOptions(request, runtime); } /** * Creates a Cloud Assistant command of the Shell, PowerShell, or Bat script type. * * @remarks * ## Operation description * - You can create the following types of commands: * - Bat scripts for Windows instances (RunBatScript). * - PowerShell scripts for Windows instances (RunPowerShellScript). * - Shell scripts for Linux instances (RunShellScript). * - You can specify the Timeout parameter to set the maximum timeout period for a command to run on an ECS instance. If the command times out, [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html) forcefully terminates the command process by canceling the PID of the command. * - For a one-time execution, after the command times out, the execution status ([InvokeRecordStatus](https://help.aliyun.com/document_detail/64845.html)) of the command on the specified ECS instance changes to Failed. * - For a scheduled execution: * - The timeout period takes effect for each execution record. * - After a specific execution times out, the status ([InvokeRecordStatus](https://help.aliyun.com/document_detail/64845.html)) of that execution record changes to Failed. * - The timeout of a previous execution does not affect the next execution. * - You can retain up to 500 to 50,000 Cloud Assistant commands in a region. You can also request a quota increase. For information about how to query and increase quotas, refer to [Quota management](https://help.aliyun.com/document_detail/184116.html). * - You can specify the WorkingDir parameter to set the execution path of a command. For Linux instances, the default path is the home directory of the root user, which is `/root`. For Windows instances, the default path is the directory where the Cloud Assistant Agent process is located, such as `C:\\Windows\\System32`. * - You can set EnableParameter to true to enable the custom parameter feature. When you set CommandContent, you can define custom parameters in the {{parameter}} format and pass in custom parameter key-value pairs when you run the command by calling [InvokeCommand](https://help.aliyun.com/document_detail/64841.html). For example, if you create the command `echo {{name}}` and pass in the key-value pair `` through the Parameters parameter when you call InvokeCommand, the custom parameter is automatically replaced. The resulting command `echo Jack` is then run on the instance. * * @param request - CreateCommandRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateCommandResponse */ async createCommandWithOptions(request: $_model.CreateCommandRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateCommandResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.commandContent)) { query["CommandContent"] = request.commandContent; } if (!$dara.isNull(request.contentEncoding)) { query["ContentEncoding"] = request.contentEncoding; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.enableParameter)) { query["EnableParameter"] = request.enableParameter; } if (!$dara.isNull(request.launcher)) { query["Launcher"] = request.launcher; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.timeout)) { query["Timeout"] = request.timeout; } if (!$dara.isNull(request.type)) { query["Type"] = request.type; } if (!$dara.isNull(request.workingDir)) { query["WorkingDir"] = request.workingDir; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateCommand", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateCommandResponse>(await this.callApi(params, req, runtime), new $_model.CreateCommandResponse({})); } /** * Creates a Cloud Assistant command of the Shell, PowerShell, or Bat script type. * * @remarks * ## Operation description * - You can create the following types of commands: * - Bat scripts for Windows instances (RunBatScript). * - PowerShell scripts for Windows instances (RunPowerShellScript). * - Shell scripts for Linux instances (RunShellScript). * - You can specify the Timeout parameter to set the maximum timeout period for a command to run on an ECS instance. If the command times out, [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html) forcefully terminates the command process by canceling the PID of the command. * - For a one-time execution, after the command times out, the execution status ([InvokeRecordStatus](https://help.aliyun.com/document_detail/64845.html)) of the command on the specified ECS instance changes to Failed. * - For a scheduled execution: * - The timeout period takes effect for each execution record. * - After a specific execution times out, the status ([InvokeRecordStatus](https://help.aliyun.com/document_detail/64845.html)) of that execution record changes to Failed. * - The timeout of a previous execution does not affect the next execution. * - You can retain up to 500 to 50,000 Cloud Assistant commands in a region. You can also request a quota increase. For information about how to query and increase quotas, refer to [Quota management](https://help.aliyun.com/document_detail/184116.html). * - You can specify the WorkingDir parameter to set the execution path of a command. For Linux instances, the default path is the home directory of the root user, which is `/root`. For Windows instances, the default path is the directory where the Cloud Assistant Agent process is located, such as `C:\\Windows\\System32`. * - You can set EnableParameter to true to enable the custom parameter feature. When you set CommandContent, you can define custom parameters in the {{parameter}} format and pass in custom parameter key-value pairs when you run the command by calling [InvokeCommand](https://help.aliyun.com/document_detail/64841.html). For example, if you create the command `echo {{name}}` and pass in the key-value pair `` through the Parameters parameter when you call InvokeCommand, the custom parameter is automatically replaced. The resulting command `echo Jack` is then run on the instance. * * @param request - CreateCommandRequest * @returns CreateCommandResponse */ async createCommand(request: $_model.CreateCommandRequest): Promise<$_model.CreateCommandResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createCommandWithOptions(request, runtime); } /** * Creates a dedicated host group. * * @param request - CreateDedicatedHostClusterRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateDedicatedHostClusterResponse */ async createDedicatedHostClusterWithOptions(request: $_model.CreateDedicatedHostClusterRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateDedicatedHostClusterResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dedicatedHostClusterName)) { query["DedicatedHostClusterName"] = request.dedicatedHostClusterName; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateDedicatedHostCluster", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateDedicatedHostClusterResponse>(await this.callApi(params, req, runtime), new $_model.CreateDedicatedHostClusterResponse({})); } /** * Creates a dedicated host group. * * @param request - CreateDedicatedHostClusterRequest * @returns CreateDedicatedHostClusterResponse */ async createDedicatedHostCluster(request: $_model.CreateDedicatedHostClusterRequest): Promise<$_model.CreateDedicatedHostClusterResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createDedicatedHostClusterWithOptions(request, runtime); } /** * Creates a deployment set in a specified region. * * @param request - CreateDeploymentSetRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateDeploymentSetResponse */ async createDeploymentSetWithOptions(request: $_model.CreateDeploymentSetRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateDeploymentSetResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.affinity)) { query["Affinity"] = request.affinity; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.deploymentSetName)) { query["DeploymentSetName"] = request.deploymentSetName; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.domain)) { query["Domain"] = request.domain; } if (!$dara.isNull(request.granularity)) { query["Granularity"] = request.granularity; } if (!$dara.isNull(request.groupCount)) { query["GroupCount"] = request.groupCount; } if (!$dara.isNull(request.onUnableToRedeployFailedInstance)) { query["OnUnableToRedeployFailedInstance"] = request.onUnableToRedeployFailedInstance; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.strategy)) { query["Strategy"] = request.strategy; } if (!$dara.isNull(request.type)) { query["Type"] = request.type; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateDeploymentSet", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateDeploymentSetResponse>(await this.callApi(params, req, runtime), new $_model.CreateDeploymentSetResponse({})); } /** * Creates a deployment set in a specified region. * * @param request - CreateDeploymentSetRequest * @returns CreateDeploymentSetResponse */ async createDeploymentSet(request: $_model.CreateDeploymentSetRequest): Promise<$_model.CreateDeploymentSetResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createDeploymentSetWithOptions(request, runtime); } /** * Creates a diagnostic metric set. You can group diagnostic metrics into diagnostic metric sets. * * @param request - CreateDiagnosticMetricSetRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateDiagnosticMetricSetResponse */ async createDiagnosticMetricSetWithOptions(request: $_model.CreateDiagnosticMetricSetRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateDiagnosticMetricSetResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.metricIds)) { query["MetricIds"] = request.metricIds; } if (!$dara.isNull(request.metricSetName)) { query["MetricSetName"] = request.metricSetName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateDiagnosticMetricSet", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateDiagnosticMetricSetResponse>(await this.callApi(params, req, runtime), new $_model.CreateDiagnosticMetricSetResponse({})); } /** * Creates a diagnostic metric set. You can group diagnostic metrics into diagnostic metric sets. * * @param request - CreateDiagnosticMetricSetRequest * @returns CreateDiagnosticMetricSetResponse */ async createDiagnosticMetricSet(request: $_model.CreateDiagnosticMetricSetRequest): Promise<$_model.CreateDiagnosticMetricSetResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createDiagnosticMetricSetWithOptions(request, runtime); } /** * Call `CreateDiagnosticReport` to create a diagnostic report for a resource. This operation uses the specified diagnostic metric set ID to generate a report with multiple diagnostic metrics. You can then call `DescribeDiagnosticReportAttributes` with the returned diagnostic report ID to query the report\\"s details. * * @param tmpReq - CreateDiagnosticReportRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateDiagnosticReportResponse */ async createDiagnosticReportWithOptions(tmpReq: $_model.CreateDiagnosticReportRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateDiagnosticReportResponse> { tmpReq.validate(); let request = new $_model.CreateDiagnosticReportShrinkRequest({ }); OpenApiUtil.convert(tmpReq, request); if (!$dara.isNull(tmpReq.additionalOptions)) { request.additionalOptionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.additionalOptions, "AdditionalOptions", "json"); } let query = { }; if (!$dara.isNull(request.additionalOptionsShrink)) { query["AdditionalOptions"] = request.additionalOptionsShrink; } if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.metricSetId)) { query["MetricSetId"] = request.metricSetId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceId)) { query["ResourceId"] = request.resourceId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateDiagnosticReport", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateDiagnosticReportResponse>(await this.callApi(params, req, runtime), new $_model.CreateDiagnosticReportResponse({})); } /** * Call `CreateDiagnosticReport` to create a diagnostic report for a resource. This operation uses the specified diagnostic metric set ID to generate a report with multiple diagnostic metrics. You can then call `DescribeDiagnosticReportAttributes` with the returned diagnostic report ID to query the report\\"s details. * * @param request - CreateDiagnosticReportRequest * @returns CreateDiagnosticReportResponse */ async createDiagnosticReport(request: $_model.CreateDiagnosticReportRequest): Promise<$_model.CreateDiagnosticReportResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createDiagnosticReportWithOptions(request, runtime); } /** * Creates a pay-as-you-go or subscription data disk. * * @remarks * - You can enable the multi-attach attribute (`MultiAttach`) when you create a disk. Learn about this attribute and its limits before you use it. For more information, see [ESSD cloud disks that support NVMe](https://help.aliyun.com/document_detail/256487.html) and [Use the multi-attach feature](https://help.aliyun.com/document_detail/262105.html). * - The following disk types can be created: basic disks, ultra disks, standard SSDs, enterprise SSDs, ESSD Entry disks, regional Enterprise SSDs (ESSDs), ESSD AutoPL disks, elastic ephemeral disks - Standard Edition, and elastic ephemeral disks - Premium Edition. * - Complete real-name registration before you create a disk. Go to [Real-name registration](https://account.console.aliyun.com/#/auth/home) in your account information. * - Creating a disk incurs charges. Learn about the billing methods of Elastic Compute Service (ECS) in advance. For more information, see [Billing overview](https://help.aliyun.com/document_detail/25398.html). * - Default settings when you create a disk: * - Automatic snapshots of the disk are deleted when the disk is deleted. That is, `DeleteAutoSnapshot` is set to `true`. You can invoke [DescribeDisks](https://help.aliyun.com/document_detail/2679767.html) to query the parameter settings, and invoke [ModifyDiskAttribute](https://help.aliyun.com/document_detail/25517.html) to modify the property. * - When you create an enterprise SSD, if you do not configure the performance level, the default level is PL1. You can invoke [ModifyDiskSpec](https://help.aliyun.com/document_detail/123780.html) to change the performance level. * - The billing method is pay-as-you-go. That is, the `Portable` property defaults to `true`. * * @param request - CreateDiskRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateDiskResponse */ async createDiskWithOptions(request: $_model.CreateDiskRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateDiskResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.advancedFeatures)) { query["AdvancedFeatures"] = request.advancedFeatures; } if (!$dara.isNull(request.arn)) { query["Arn"] = request.arn; } if (!$dara.isNull(request.burstingEnabled)) { query["BurstingEnabled"] = request.burstingEnabled; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.diskCategory)) { query["DiskCategory"] = request.diskCategory; } if (!$dara.isNull(request.diskName)) { query["DiskName"] = request.diskName; } if (!$dara.isNull(request.encryptAlgorithm)) { query["EncryptAlgorithm"] = request.encryptAlgorithm; } if (!$dara.isNull(request.encrypted)) { query["Encrypted"] = request.encrypted; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.KMSKeyId)) { query["KMSKeyId"] = request.KMSKeyId; } if (!$dara.isNull(request.multiAttach)) { query["MultiAttach"] = request.multiAttach; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.performanceLevel)) { query["PerformanceLevel"] = request.performanceLevel; } if (!$dara.isNull(request.provisionedIops)) { query["ProvisionedIops"] = request.provisionedIops; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.size)) { query["Size"] = request.size; } if (!$dara.isNull(request.snapshotId)) { query["SnapshotId"] = request.snapshotId; } if (!$dara.isNull(request.storageClusterId)) { query["StorageClusterId"] = request.storageClusterId; } if (!$dara.isNull(request.storageSetId)) { query["StorageSetId"] = request.storageSetId; } if (!$dara.isNull(request.storageSetPartitionNumber)) { query["StorageSetPartitionNumber"] = request.storageSetPartitionNumber; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateDisk", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateDiskResponse>(await this.callApi(params, req, runtime), new $_model.CreateDiskResponse({})); } /** * Creates a pay-as-you-go or subscription data disk. * * @remarks * - You can enable the multi-attach attribute (`MultiAttach`) when you create a disk. Learn about this attribute and its limits before you use it. For more information, see [ESSD cloud disks that support NVMe](https://help.aliyun.com/document_detail/256487.html) and [Use the multi-attach feature](https://help.aliyun.com/document_detail/262105.html). * - The following disk types can be created: basic disks, ultra disks, standard SSDs, enterprise SSDs, ESSD Entry disks, regional Enterprise SSDs (ESSDs), ESSD AutoPL disks, elastic ephemeral disks - Standard Edition, and elastic ephemeral disks - Premium Edition. * - Complete real-name registration before you create a disk. Go to [Real-name registration](https://account.console.aliyun.com/#/auth/home) in your account information. * - Creating a disk incurs charges. Learn about the billing methods of Elastic Compute Service (ECS) in advance. For more information, see [Billing overview](https://help.aliyun.com/document_detail/25398.html). * - Default settings when you create a disk: * - Automatic snapshots of the disk are deleted when the disk is deleted. That is, `DeleteAutoSnapshot` is set to `true`. You can invoke [DescribeDisks](https://help.aliyun.com/document_detail/2679767.html) to query the parameter settings, and invoke [ModifyDiskAttribute](https://help.aliyun.com/document_detail/25517.html) to modify the property. * - When you create an enterprise SSD, if you do not configure the performance level, the default level is PL1. You can invoke [ModifyDiskSpec](https://help.aliyun.com/document_detail/123780.html) to change the performance level. * - The billing method is pay-as-you-go. That is, the `Portable` property defaults to `true`. * * @param request - CreateDiskRequest * @returns CreateDiskResponse */ async createDisk(request: $_model.CreateDiskRequest): Promise<$_model.CreateDiskResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createDiskWithOptions(request, runtime); } /** * Creates an elasticity assurance in a region. When you call this operation, you can specify parameters, such as ZoneId, InstanceType, Period, PeriodUnit, and AutoRenew, in the request. * * @remarks * Elasticity Assurance provides a new method to purchase and use guaranteed resources in a flexible manner. Elasticity Assurance is a resource reservation service that provides assured access to resources for pay-as-you-go Elastic Compute Service (ECS) instances. For more information, see [Overview of Elasticity Assurance](https://help.aliyun.com/document_detail/193630.html). * - After you purchase an elasticity assurance, you cannot request a refund for the elasticity assurance. For information about the billing of elasticity assurances, see [Resource assurance](https://help.aliyun.com/document_detail/432502.html). * - Elasticity assurances can be used to create only pay-as-you-go ECS instances. * - Elasticity assurances only support the unlimited mode. You can set `AssuranceTimes` only to `Unlimited`. Elasticity assurances in unlimited mode can be used for an unlimited number of times within their terms. Elasticity assurances in unlimited mode take effect immediately after creation. * * @param request - CreateElasticityAssuranceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateElasticityAssuranceResponse */ async createElasticityAssuranceWithOptions(request: $_model.CreateElasticityAssuranceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateElasticityAssuranceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.assuranceTimes)) { query["AssuranceTimes"] = request.assuranceTimes; } if (!$dara.isNull(request.autoRenew)) { query["AutoRenew"] = request.autoRenew; } if (!$dara.isNull(request.autoRenewPeriod)) { query["AutoRenewPeriod"] = request.autoRenewPeriod; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.instanceAmount)) { query["InstanceAmount"] = request.instanceAmount; } if (!$dara.isNull(request.instanceCpuCoreCount)) { query["InstanceCpuCoreCount"] = request.instanceCpuCoreCount; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.recurrenceRules)) { query["RecurrenceRules"] = request.recurrenceRules; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateElasticityAssurance", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateElasticityAssuranceResponse>(await this.callApi(params, req, runtime), new $_model.CreateElasticityAssuranceResponse({})); } /** * Creates an elasticity assurance in a region. When you call this operation, you can specify parameters, such as ZoneId, InstanceType, Period, PeriodUnit, and AutoRenew, in the request. * * @remarks * Elasticity Assurance provides a new method to purchase and use guaranteed resources in a flexible manner. Elasticity Assurance is a resource reservation service that provides assured access to resources for pay-as-you-go Elastic Compute Service (ECS) instances. For more information, see [Overview of Elasticity Assurance](https://help.aliyun.com/document_detail/193630.html). * - After you purchase an elasticity assurance, you cannot request a refund for the elasticity assurance. For information about the billing of elasticity assurances, see [Resource assurance](https://help.aliyun.com/document_detail/432502.html). * - Elasticity assurances can be used to create only pay-as-you-go ECS instances. * - Elasticity assurances only support the unlimited mode. You can set `AssuranceTimes` only to `Unlimited`. Elasticity assurances in unlimited mode can be used for an unlimited number of times within their terms. Elasticity assurances in unlimited mode take effect immediately after creation. * * @param request - CreateElasticityAssuranceRequest * @returns CreateElasticityAssuranceResponse */ async createElasticityAssurance(request: $_model.CreateElasticityAssuranceRequest): Promise<$_model.CreateElasticityAssuranceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createElasticityAssuranceWithOptions(request, runtime); } /** * CreateForwardEntry * * @deprecated OpenAPI CreateForwardEntry is deprecated, please use Vpc::2016-04-28::CreateForwardEntry instead. * * @param request - CreateForwardEntryRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateForwardEntryResponse */ async createForwardEntryWithOptions(request: $_model.CreateForwardEntryRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateForwardEntryResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.externalIp)) { query["ExternalIp"] = request.externalIp; } if (!$dara.isNull(request.externalPort)) { query["ExternalPort"] = request.externalPort; } if (!$dara.isNull(request.forwardTableId)) { query["ForwardTableId"] = request.forwardTableId; } if (!$dara.isNull(request.internalIp)) { query["InternalIp"] = request.internalIp; } if (!$dara.isNull(request.internalPort)) { query["InternalPort"] = request.internalPort; } if (!$dara.isNull(request.ipProtocol)) { query["IpProtocol"] = request.ipProtocol; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateForwardEntry", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateForwardEntryResponse>(await this.callApi(params, req, runtime), new $_model.CreateForwardEntryResponse({})); } /** * CreateForwardEntry * * @deprecated OpenAPI CreateForwardEntry is deprecated, please use Vpc::2016-04-28::CreateForwardEntry instead. * * @param request - CreateForwardEntryRequest * @returns CreateForwardEntryResponse */ // Deprecated async createForwardEntry(request: $_model.CreateForwardEntryRequest): Promise<$_model.CreateForwardEntryResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createForwardEntryWithOptions(request, runtime); } /** * Creates a high-availability virtual IP address (HaVip). * * @deprecated OpenAPI CreateHaVip is deprecated, please use Vpc::2016-04-28::CreateHaVip instead. * * @param request - CreateHaVipRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateHaVipResponse */ async createHaVipWithOptions(request: $_model.CreateHaVipRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateHaVipResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.ipAddress)) { query["IpAddress"] = request.ipAddress; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.vSwitchId)) { query["VSwitchId"] = request.vSwitchId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateHaVip", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateHaVipResponse>(await this.callApi(params, req, runtime), new $_model.CreateHaVipResponse({})); } /** * Creates a high-availability virtual IP address (HaVip). * * @deprecated OpenAPI CreateHaVip is deprecated, please use Vpc::2016-04-28::CreateHaVip instead. * * @param request - CreateHaVipRequest * @returns CreateHaVipResponse */ // Deprecated async createHaVip(request: $_model.CreateHaVipRequest): Promise<$_model.CreateHaVipResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createHaVipWithOptions(request, runtime); } /** * Creates an HPC cluster by calling CreateHpcCluster. * * @param request - CreateHpcClusterRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateHpcClusterResponse */ async createHpcClusterWithOptions(request: $_model.CreateHpcClusterRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateHpcClusterResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateHpcCluster", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateHpcClusterResponse>(await this.callApi(params, req, runtime), new $_model.CreateHpcClusterResponse({})); } /** * Creates an HPC cluster by calling CreateHpcCluster. * * @param request - CreateHpcClusterRequest * @returns CreateHpcClusterResponse */ async createHpcCluster(request: $_model.CreateHpcClusterRequest): Promise<$_model.CreateHpcClusterResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createHpcClusterWithOptions(request, runtime); } /** * Creates a custom image. You can use the created custom image to create ECS instances (RunInstances) or replace the system disk of an instance (ReplaceSystemDisk). * * @remarks * ### Before you begin * - This is an asynchronous operation. After a request to create a custom image is sent, the image ID is returned. However, the image creation is not immediately complete. Call [DescribeImage](https://help.aliyun.com/document_detail/2679797.html) to query the image information. When the status in the response is `Available`, the image is created and ready for use. For more information, see [Custom image overview](https://help.aliyun.com/document_detail/172789.html). * - When you query ECS instance information, if the response contains {"OperationLocks": {"LockReason" : "security"}}, you cannot create a custom image. * - Configure the image detection parameter `DetectionStrategy` when creating an image to help the system optimize your image. For more information, see [Image detection overview](https://help.aliyun.com/document_detail/439819.html). * The following describes three methods to create a custom image by calling this operation. The priority of request parameters is: InstanceId > DiskDeviceMapping > SnapshotId. If your request contains two or more of these parameters, the image is created based on the parameter with the highest priority. * - **Create a custom image from an instance**: Specify the instance ID (`InstanceId`). * - The instance must be in the Running (`Running`) or Stopped (`Stopped`) state. * - After the operation is called, a new snapshot is created for each disk of the instance. * >Notice: Because a running instance may have cached data that has not been written to disks, the data of the created custom image may be inconsistent with the instance data. Stop the instance ([StopInstances](https://help.aliyun.com/document_detail/155372.html)) before creating the image. * - **Create a custom image from a snapshot (the specified snapshot cannot be one created on or before July 15, 2013.)** * - **Create a custom image from a system disk snapshot**: Specify only the snapshot ID of the instance system disk (`SnapshotId`). * - **Create a custom image from system disk and data disk snapshots**: Establish data associations among multiple disks (`DiskDeviceMapping`). * - Only one system disk snapshot can be specified. * - You can specify multiple data disk snapshots, up to a maximum of 16. If `DiskDeviceMapping.N.SnapshotId` is not specified, an empty data disk with the default capacity is created. * * > When an instance is released, the system disk is retained as a pay-as-you-go data disk. Snapshots created from this disk do not support creating custom images. Create a custom image before releasing the instance as needed. * * @param request - CreateImageRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateImageResponse */ async createImageWithOptions(request: $_model.CreateImageRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateImageResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.architecture)) { query["Architecture"] = request.architecture; } if (!$dara.isNull(request.bootMode)) { query["BootMode"] = request.bootMode; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.detectionStrategy)) { query["DetectionStrategy"] = request.detectionStrategy; } if (!$dara.isNull(request.diskDeviceMapping)) { query["DiskDeviceMapping"] = request.diskDeviceMapping; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.features)) { query["Features"] = request.features; } if (!$dara.isNull(request.imageFamily)) { query["ImageFamily"] = request.imageFamily; } if (!$dara.isNull(request.imageName)) { query["ImageName"] = request.imageName; } if (!$dara.isNull(request.imageVersion)) { query["ImageVersion"] = request.imageVersion; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.platform)) { query["Platform"] = request.platform; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.snapshotId)) { query["SnapshotId"] = request.snapshotId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateImage", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateImageResponse>(await this.callApi(params, req, runtime), new $_model.CreateImageResponse({})); } /** * Creates a custom image. You can use the created custom image to create ECS instances (RunInstances) or replace the system disk of an instance (ReplaceSystemDisk). * * @remarks * ### Before you begin * - This is an asynchronous operation. After a request to create a custom image is sent, the image ID is returned. However, the image creation is not immediately complete. Call [DescribeImage](https://help.aliyun.com/document_detail/2679797.html) to query the image information. When the status in the response is `Available`, the image is created and ready for use. For more information, see [Custom image overview](https://help.aliyun.com/document_detail/172789.html). * - When you query ECS instance information, if the response contains {"OperationLocks": {"LockReason" : "security"}}, you cannot create a custom image. * - Configure the image detection parameter `DetectionStrategy` when creating an image to help the system optimize your image. For more information, see [Image detection overview](https://help.aliyun.com/document_detail/439819.html). * The following describes three methods to create a custom image by calling this operation. The priority of request parameters is: InstanceId > DiskDeviceMapping > SnapshotId. If your request contains two or more of these parameters, the image is created based on the parameter with the highest priority. * - **Create a custom image from an instance**: Specify the instance ID (`InstanceId`). * - The instance must be in the Running (`Running`) or Stopped (`Stopped`) state. * - After the operation is called, a new snapshot is created for each disk of the instance. * >Notice: Because a running instance may have cached data that has not been written to disks, the data of the created custom image may be inconsistent with the instance data. Stop the instance ([StopInstances](https://help.aliyun.com/document_detail/155372.html)) before creating the image. * - **Create a custom image from a snapshot (the specified snapshot cannot be one created on or before July 15, 2013.)** * - **Create a custom image from a system disk snapshot**: Specify only the snapshot ID of the instance system disk (`SnapshotId`). * - **Create a custom image from system disk and data disk snapshots**: Establish data associations among multiple disks (`DiskDeviceMapping`). * - Only one system disk snapshot can be specified. * - You can specify multiple data disk snapshots, up to a maximum of 16. If `DiskDeviceMapping.N.SnapshotId` is not specified, an empty data disk with the default capacity is created. * * > When an instance is released, the system disk is retained as a pay-as-you-go data disk. Snapshots created from this disk do not support creating custom images. Create a custom image before releasing the instance as needed. * * @param request - CreateImageRequest * @returns CreateImageResponse */ async createImage(request: $_model.CreateImageRequest): Promise<$_model.CreateImageResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createImageWithOptions(request, runtime); } /** * Creates an image component. Image components are used to store commonly used build template commands for image building. * * @remarks * ## Operation description * Before you create an image component, take note of the following items: * - Only custom image components can be created. * - Component version numbers must be unique for the same component name. When using a component in a template, you can reference it by name and version number. * - The content size of an image component cannot exceed 16 KB. For details about supported commands, see [Commands supported by Image Builder](https://help.aliyun.com/document_detail/200206.html). * For more information, see [Image Builder overview](https://help.aliyun.com/document_detail/197410.html). * * @param request - CreateImageComponentRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateImageComponentResponse */ async createImageComponentWithOptions(request: $_model.CreateImageComponentRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateImageComponentResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.componentType)) { query["ComponentType"] = request.componentType; } if (!$dara.isNull(request.componentVersion)) { query["ComponentVersion"] = request.componentVersion; } if (!$dara.isNull(request.content)) { query["Content"] = request.content; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.systemType)) { query["SystemType"] = request.systemType; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateImageComponent", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateImageComponentResponse>(await this.callApi(params, req, runtime), new $_model.CreateImageComponentResponse({})); } /** * Creates an image component. Image components are used to store commonly used build template commands for image building. * * @remarks * ## Operation description * Before you create an image component, take note of the following items: * - Only custom image components can be created. * - Component version numbers must be unique for the same component name. When using a component in a template, you can reference it by name and version number. * - The content size of an image component cannot exceed 16 KB. For details about supported commands, see [Commands supported by Image Builder](https://help.aliyun.com/document_detail/200206.html). * For more information, see [Image Builder overview](https://help.aliyun.com/document_detail/197410.html). * * @param request - CreateImageComponentRequest * @returns CreateImageComponentResponse */ async createImageComponent(request: $_model.CreateImageComponentRequest): Promise<$_model.CreateImageComponentResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createImageComponentWithOptions(request, runtime); } /** * Create an image template to build images. * * @remarks * ## API * You can use an image template to customize image content and build images across regions and accounts. Before you create an image template, consider the following: * - You can create only custom image templates. * - You can use only public images, custom images, shared images, or image families as the source image. * - When you build an image using an image template, the system creates one or more transit instances to assist with the build. You are charged for these pay-as-you-go ECS instances. For more information, see [pay-as-you-go](https://help.aliyun.com/document_detail/40653.html). * Consider the following about the build content specified in `BuildContent`: * - The `FROM` command is deprecated. The system ignores the `FROM` command in `BuildContent` and instead uses the `BaseImageType` and `BaseImage` parameters to select the source image. * - The content of an image template cannot exceed 16 KB. For details about supported commands, see [Command reference for Image Builder](https://help.aliyun.com/document_detail/200206.html). * For more information, see [Image Builder overview](https://help.aliyun.com/document_detail/197410.html). * * @param request - CreateImagePipelineRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateImagePipelineResponse */ async createImagePipelineWithOptions(request: $_model.CreateImagePipelineRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateImagePipelineResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.addAccount)) { query["AddAccount"] = request.addAccount; } if (!$dara.isNull(request.advancedOptions)) { query["AdvancedOptions"] = request.advancedOptions; } if (!$dara.isNull(request.baseImage)) { query["BaseImage"] = request.baseImage; } if (!$dara.isNull(request.baseImageType)) { query["BaseImageType"] = request.baseImageType; } if (!$dara.isNull(request.buildContent)) { query["BuildContent"] = request.buildContent; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.deleteInstanceOnFailure)) { query["DeleteInstanceOnFailure"] = request.deleteInstanceOnFailure; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.imageFamily)) { query["ImageFamily"] = request.imageFamily; } if (!$dara.isNull(request.imageName)) { query["ImageName"] = request.imageName; } if (!$dara.isNull(request.imageOptions)) { query["ImageOptions"] = request.imageOptions; } if (!$dara.isNull(request.importImageOptions)) { query["ImportImageOptions"] = request.importImageOptions; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.internetMaxBandwidthOut)) { query["InternetMaxBandwidthOut"] = request.internetMaxBandwidthOut; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.nvmeSupport)) { query["NvmeSupport"] = request.nvmeSupport; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.repairMode)) { query["RepairMode"] = request.repairMode; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.systemDiskSize)) { query["SystemDiskSize"] = request.systemDiskSize; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.testContent)) { query["TestContent"] = request.testContent; } if (!$dara.isNull(request.toRegionId)) { query["ToRegionId"] = request.toRegionId; } if (!$dara.isNull(request.vSwitchId)) { query["VSwitchId"] = request.vSwitchId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateImagePipeline", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateImagePipelineResponse>(await this.callApi(params, req, runtime), new $_model.CreateImagePipelineResponse({})); } /** * Create an image template to build images. * * @remarks * ## API * You can use an image template to customize image content and build images across regions and accounts. Before you create an image template, consider the following: * - You can create only custom image templates. * - You can use only public images, custom images, shared images, or image families as the source image. * - When you build an image using an image template, the system creates one or more transit instances to assist with the build. You are charged for these pay-as-you-go ECS instances. For more information, see [pay-as-you-go](https://help.aliyun.com/document_detail/40653.html). * Consider the following about the build content specified in `BuildContent`: * - The `FROM` command is deprecated. The system ignores the `FROM` command in `BuildContent` and instead uses the `BaseImageType` and `BaseImage` parameters to select the source image. * - The content of an image template cannot exceed 16 KB. For details about supported commands, see [Command reference for Image Builder](https://help.aliyun.com/document_detail/200206.html). * For more information, see [Image Builder overview](https://help.aliyun.com/document_detail/197410.html). * * @param request - CreateImagePipelineRequest * @returns CreateImagePipelineResponse */ async createImagePipeline(request: $_model.CreateImagePipelineRequest): Promise<$_model.CreateImagePipelineResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createImagePipelineWithOptions(request, runtime); } /** * Creates a subscription or pay-as-you-go Elastic Compute Service (ECS) instance with customizable parameters. * * @remarks * > This operation is no longer maintained. Use [RunInstances](https://help.aliyun.com/document_detail/2679677.html) instead. * * **Before you call this operation, make sure that you fully understand the billing methods and [pricing](https://www.aliyun.com/price/product#/ecs/detail) of ECS.** * * **Before you call this operation, make sure that you fully understand the billing methods and [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl) of ECS.** * This is an asynchronous operation. After a request to create an instance is sent, the instance ID is returned. The instance is not immediately created. Call [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query the instance status. When the status is `Stopped`, the instance is created. Then you can call [StartInstance](https://help.aliyun.com/document_detail/2679679.html) to start the instance. * ### Before you begin * * - Make sure that your account has passed real-name registration. For more information, see [Real-name registration documentation](https://help.aliyun.com/document_detail/48263.html). * - Creating an instance incurs charges. Make sure that you understand the billable methods of Elastic Computing Service (ECS). For more information, see [Billing overview](https://help.aliyun.com/document_detail/25398.html). * * - Make sure that the total number of instances or the total number of vCPUs across all instance types does not exceed the quota. For more information, see [Quota Center](https://quotas.console.aliyun.com/products/ecs/quotas). * - Before creating a VPC-connected instance, create a VPC in the corresponding region. For more information, see [Create a VPC](https://help.aliyun.com/document_detail/65430.html). * ### Before you begin * - When you invoke this operation, the system does not send notifications (including text messages, emails, or internal messages) about instance creation. * - If the billable methods of the instance is subscription (`PrePaid`), active coupon in your account are used by default during payment. * - If the instance memory is 512 MiB, you cannot use Windows Server images except through the half-year channel. If the instance memory is 4 GiB or more, you cannot use 32-bit operating system images. * - Instances created by invoking this operation are not assigned Internet IP addresses. If the public bandwidth is greater than 0, invoke [AllocatePublicIpAddress](https://help.aliyun.com/document_detail/25544.html) to assign a public IP address. If the public bandwidth is 0, invoke [ModifyInstanceNetworkSpec](https://help.aliyun.com/document_detail/2679879.html) to adjust the bandwidth and then invoke [AllocatePublicIpAddress](https://help.aliyun.com/document_detail/25544.html) to assign a public IP address. * > In a single region, the total peak pay-by-bandwidth Internet bandwidth for a single Alibaba Cloud account is limited. For more information, see [Public bandwidth limits](~~25412#BandwidthQuota~~). * ### Recommendations * - **Instance type selection**: See [Instance family](https://help.aliyun.com/document_detail/25378.html) or invoke [DescribeInstanceTypes](https://help.aliyun.com/document_detail/25620.html) to query the performance data of the target instance type. You can also see [Settings for instance type selection](https://help.aliyun.com/document_detail/58291.html) to learn how to select an instance type. * - **Check active resources**: Invoke [DescribeAvailableResource](https://help.aliyun.com/document_detail/66186.html) to query active resources in a specific region or zone. * - **User data**: If the instance meets the requirements for [instance user data](https://help.aliyun.com/document_detail/49121.html), you can pass in UserData. The `UserData` data is not encrypted when the API request is sent. Do not send confidential information such as passwords or private keys in plaintext. If you must pass in such information, encrypt it and use Base64 encoding before passing it in. Then perform decryption inside the instance. * * @param request - CreateInstanceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateInstanceResponse */ async createInstanceWithOptions(request: $_model.CreateInstanceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateInstanceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.affinity)) { query["Affinity"] = request.affinity; } if (!$dara.isNull(request.arn)) { query["Arn"] = request.arn; } if (!$dara.isNull(request.autoRenew)) { query["AutoRenew"] = request.autoRenew; } if (!$dara.isNull(request.autoRenewPeriod)) { query["AutoRenewPeriod"] = request.autoRenewPeriod; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.clusterId)) { query["ClusterId"] = request.clusterId; } if (!$dara.isNull(request.creditSpecification)) { query["CreditSpecification"] = request.creditSpecification; } if (!$dara.isNull(request.dataDisk)) { query["DataDisk"] = request.dataDisk; } if (!$dara.isNull(request.dedicatedHostId)) { query["DedicatedHostId"] = request.dedicatedHostId; } if (!$dara.isNull(request.deletionProtection)) { query["DeletionProtection"] = request.deletionProtection; } if (!$dara.isNull(request.deploymentSetGroupNo)) { query["DeploymentSetGroupNo"] = request.deploymentSetGroupNo; } if (!$dara.isNull(request.deploymentSetId)) { query["DeploymentSetId"] = request.deploymentSetId; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.hostName)) { query["HostName"] = request.hostName; } if (!$dara.isNull(request.hpcClusterId)) { query["HpcClusterId"] = request.hpcClusterId; } if (!$dara.isNull(request.httpEndpoint)) { query["HttpEndpoint"] = request.httpEndpoint; } if (!$dara.isNull(request.httpPutResponseHopLimit)) { query["HttpPutResponseHopLimit"] = request.httpPutResponseHopLimit; } if (!$dara.isNull(request.httpTokens)) { query["HttpTokens"] = request.httpTokens; } if (!$dara.isNull(request.imageFamily)) { query["ImageFamily"] = request.imageFamily; } if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.innerIpAddress)) { query["InnerIpAddress"] = request.innerIpAddress; } if (!$dara.isNull(request.instanceChargeType)) { query["InstanceChargeType"] = request.instanceChargeType; } if (!$dara.isNull(request.instanceName)) { query["InstanceName"] = request.instanceName; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.internetChargeType)) { query["InternetChargeType"] = request.internetChargeType; } if (!$dara.isNull(request.internetMaxBandwidthIn)) { query["InternetMaxBandwidthIn"] = request.internetMaxBandwidthIn; } if (!$dara.isNull(request.internetMaxBandwidthOut)) { query["InternetMaxBandwidthOut"] = request.internetMaxBandwidthOut; } if (!$dara.isNull(request.ioOptimized)) { query["IoOptimized"] = request.ioOptimized; } if (!$dara.isNull(request.keyPairName)) { query["KeyPairName"] = request.keyPairName; } if (!$dara.isNull(request.nodeControllerId)) { query["NodeControllerId"] = request.nodeControllerId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.password)) { query["Password"] = request.password; } if (!$dara.isNull(request.passwordInherit)) { query["PasswordInherit"] = request.passwordInherit; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.privateIpAddress)) { query["PrivateIpAddress"] = request.privateIpAddress; } if (!$dara.isNull(request.ramRoleName)) { query["RamRoleName"] = request.ramRoleName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityEnhancementStrategy)) { query["SecurityEnhancementStrategy"] = request.securityEnhancementStrategy; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.spotDuration)) { query["SpotDuration"] = request.spotDuration; } if (!$dara.isNull(request.spotInterruptionBehavior)) { query["SpotInterruptionBehavior"] = request.spotInterruptionBehavior; } if (!$dara.isNull(request.spotPriceLimit)) { query["SpotPriceLimit"] = request.spotPriceLimit; } if (!$dara.isNull(request.spotStrategy)) { query["SpotStrategy"] = request.spotStrategy; } if (!$dara.isNull(request.storageSetId)) { query["StorageSetId"] = request.storageSetId; } if (!$dara.isNull(request.storageSetPartitionNumber)) { query["StorageSetPartitionNumber"] = request.storageSetPartitionNumber; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.tenancy)) { query["Tenancy"] = request.tenancy; } if (!$dara.isNull(request.useAdditionalService)) { query["UseAdditionalService"] = request.useAdditionalService; } if (!$dara.isNull(request.userData)) { query["UserData"] = request.userData; } if (!$dara.isNull(request.vSwitchId)) { query["VSwitchId"] = request.vSwitchId; } if (!$dara.isNull(request.vlanId)) { query["VlanId"] = request.vlanId; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } if (!$dara.isNull(request.hibernationOptions)) { query["HibernationOptions"] = request.hibernationOptions; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } if (!$dara.isNull(request.systemDisk)) { query["SystemDisk"] = request.systemDisk; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateInstance", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateInstanceResponse>(await this.callApi(params, req, runtime), new $_model.CreateInstanceResponse({})); } /** * Creates a subscription or pay-as-you-go Elastic Compute Service (ECS) instance with customizable parameters. * * @remarks * > This operation is no longer maintained. Use [RunInstances](https://help.aliyun.com/document_detail/2679677.html) instead. * * **Before you call this operation, make sure that you fully understand the billing methods and [pricing](https://www.aliyun.com/price/product#/ecs/detail) of ECS.** * * **Before you call this operation, make sure that you fully understand the billing methods and [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl) of ECS.** * This is an asynchronous operation. After a request to create an instance is sent, the instance ID is returned. The instance is not immediately created. Call [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query the instance status. When the status is `Stopped`, the instance is created. Then you can call [StartInstance](https://help.aliyun.com/document_detail/2679679.html) to start the instance. * ### Before you begin * * - Make sure that your account has passed real-name registration. For more information, see [Real-name registration documentation](https://help.aliyun.com/document_detail/48263.html). * - Creating an instance incurs charges. Make sure that you understand the billable methods of Elastic Computing Service (ECS). For more information, see [Billing overview](https://help.aliyun.com/document_detail/25398.html). * * - Make sure that the total number of instances or the total number of vCPUs across all instance types does not exceed the quota. For more information, see [Quota Center](https://quotas.console.aliyun.com/products/ecs/quotas). * - Before creating a VPC-connected instance, create a VPC in the corresponding region. For more information, see [Create a VPC](https://help.aliyun.com/document_detail/65430.html). * ### Before you begin * - When you invoke this operation, the system does not send notifications (including text messages, emails, or internal messages) about instance creation. * - If the billable methods of the instance is subscription (`PrePaid`), active coupon in your account are used by default during payment. * - If the instance memory is 512 MiB, you cannot use Windows Server images except through the half-year channel. If the instance memory is 4 GiB or more, you cannot use 32-bit operating system images. * - Instances created by invoking this operation are not assigned Internet IP addresses. If the public bandwidth is greater than 0, invoke [AllocatePublicIpAddress](https://help.aliyun.com/document_detail/25544.html) to assign a public IP address. If the public bandwidth is 0, invoke [ModifyInstanceNetworkSpec](https://help.aliyun.com/document_detail/2679879.html) to adjust the bandwidth and then invoke [AllocatePublicIpAddress](https://help.aliyun.com/document_detail/25544.html) to assign a public IP address. * > In a single region, the total peak pay-by-bandwidth Internet bandwidth for a single Alibaba Cloud account is limited. For more information, see [Public bandwidth limits](~~25412#BandwidthQuota~~). * ### Recommendations * - **Instance type selection**: See [Instance family](https://help.aliyun.com/document_detail/25378.html) or invoke [DescribeInstanceTypes](https://help.aliyun.com/document_detail/25620.html) to query the performance data of the target instance type. You can also see [Settings for instance type selection](https://help.aliyun.com/document_detail/58291.html) to learn how to select an instance type. * - **Check active resources**: Invoke [DescribeAvailableResource](https://help.aliyun.com/document_detail/66186.html) to query active resources in a specific region or zone. * - **User data**: If the instance meets the requirements for [instance user data](https://help.aliyun.com/document_detail/49121.html), you can pass in UserData. The `UserData` data is not encrypted when the API request is sent. Do not send confidential information such as passwords or private keys in plaintext. If you must pass in such information, encrypt it and use Base64 encoding before passing it in. Then perform decryption inside the instance. * * @param request - CreateInstanceRequest * @returns CreateInstanceResponse */ async createInstance(request: $_model.CreateInstanceRequest): Promise<$_model.CreateInstanceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createInstanceWithOptions(request, runtime); } /** * Calls CreateKeyPair to create an SSH key pair. The system stores the public key and returns the unencrypted PEM-encoded PKCS#8 format private key. You must securely store the private key on your own. * * @remarks * In addition to calling CreateKeyPair to create a key pair, you can use a third-party tool to create a key pair and then upload it ([ImportKeyPair](https://help.aliyun.com/document_detail/51774.html)) to a region. The usage of a key pair created by a third-party tool is the same as that of a key pair created by the system. * You can have up to 500 key pairs in each region. For more information, see [Limits](https://help.aliyun.com/document_detail/25412.html). * * @param request - CreateKeyPairRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateKeyPairResponse */ async createKeyPairWithOptions(request: $_model.CreateKeyPairRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateKeyPairResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.keyPairName)) { query["KeyPairName"] = request.keyPairName; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateKeyPair", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateKeyPairResponse>(await this.callApi(params, req, runtime), new $_model.CreateKeyPairResponse({})); } /** * Calls CreateKeyPair to create an SSH key pair. The system stores the public key and returns the unencrypted PEM-encoded PKCS#8 format private key. You must securely store the private key on your own. * * @remarks * In addition to calling CreateKeyPair to create a key pair, you can use a third-party tool to create a key pair and then upload it ([ImportKeyPair](https://help.aliyun.com/document_detail/51774.html)) to a region. The usage of a key pair created by a third-party tool is the same as that of a key pair created by the system. * You can have up to 500 key pairs in each region. For more information, see [Limits](https://help.aliyun.com/document_detail/25412.html). * * @param request - CreateKeyPairRequest * @returns CreateKeyPairResponse */ async createKeyPair(request: $_model.CreateKeyPairRequest): Promise<$_model.CreateKeyPairResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createKeyPairWithOptions(request, runtime); } /** * Creates an ECS instance launch template. A launch template eliminates the need to configure a large number of parameters every time you create an instance. * * @remarks * After you call CreateLaunchTemplate to create a template, a default version with version number 1 is automatically generated. You can then create multiple versions based on this template (`CreateLaunchTemplateVersion`), with version numbers incrementing sequentially from 1. If you do not specify a template version when creating instances ([RunInstances](https://help.aliyun.com/document_detail/63440.html)), the default version is used. * A launch template version contains the configurations for creating instances, such as the region, image ID, instance type, security group ID, and public bandwidth. If a specific configuration is not specified in the version, you must specify it when you create instances. * When you call this operation, take note of the following items: * - Each account can create up to 30 launch templates per region, and each template can have up to 30 versions. * - Most parameters in a launch template are optional. When you create a template, Alibaba Cloud does not verify the existence or validity of parameter values. The validity of parameter values is verified only when you create instances. * - If a configuration is specified in the launch template, it cannot be filtered out when you create instances ([RunInstances](https://help.aliyun.com/document_detail/63440.html)). For example, if the template specifies `HostName=LocalHost` and the `HostName` value is left empty in `RunInstances`, the hostname of the instance is still `LocalHost`. To override the `HostName=LocalHost` configuration, set `HostName=MyHost` or another value in `RunInstances`. * * @param request - CreateLaunchTemplateRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateLaunchTemplateResponse */ async createLaunchTemplateWithOptions(request: $_model.CreateLaunchTemplateRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateLaunchTemplateResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoReleaseTime)) { query["AutoReleaseTime"] = request.autoReleaseTime; } if (!$dara.isNull(request.autoRenew)) { query["AutoRenew"] = request.autoRenew; } if (!$dara.isNull(request.autoRenewPeriod)) { query["AutoRenewPeriod"] = request.autoRenewPeriod; } if (!$dara.isNull(request.creditSpecification)) { query["CreditSpecification"] = request.creditSpecification; } if (!$dara.isNull(request.dataDisk)) { query["DataDisk"] = request.dataDisk; } if (!$dara.isNull(request.deletionProtection)) { query["DeletionProtection"] = request.deletionProtection; } if (!$dara.isNull(request.deploymentSetId)) { query["DeploymentSetId"] = request.deploymentSetId; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.enableVmOsConfig)) { query["EnableVmOsConfig"] = request.enableVmOsConfig; } if (!$dara.isNull(request.hostName)) { query["HostName"] = request.hostName; } if (!$dara.isNull(request.httpEndpoint)) { query["HttpEndpoint"] = request.httpEndpoint; } if (!$dara.isNull(request.httpPutResponseHopLimit)) { query["HttpPutResponseHopLimit"] = request.httpPutResponseHopLimit; } if (!$dara.isNull(request.httpTokens)) { query["HttpTokens"] = request.httpTokens; } if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.imageOptions)) { query["ImageOptions"] = request.imageOptions; } if (!$dara.isNull(request.imageOwnerAlias)) { query["ImageOwnerAlias"] = request.imageOwnerAlias; } if (!$dara.isNull(request.instanceChargeType)) { query["InstanceChargeType"] = request.instanceChargeType; } if (!$dara.isNull(request.instanceName)) { query["InstanceName"] = request.instanceName; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.internetChargeType)) { query["InternetChargeType"] = request.internetChargeType; } if (!$dara.isNull(request.internetMaxBandwidthIn)) { query["InternetMaxBandwidthIn"] = request.internetMaxBandwidthIn; } if (!$dara.isNull(request.internetMaxBandwidthOut)) { query["InternetMaxBandwidthOut"] = request.internetMaxBandwidthOut; } if (!$dara.isNull(request.ioOptimized)) { query["IoOptimized"] = request.ioOptimized; } if (!$dara.isNull(request.ipv6AddressCount)) { query["Ipv6AddressCount"] = request.ipv6AddressCount; } if (!$dara.isNull(request.keyPairName)) { query["KeyPairName"] = request.keyPairName; } if (!$dara.isNull(request.launchTemplateName)) { query["LaunchTemplateName"] = request.launchTemplateName; } if (!$dara.isNull(request.networkInterface)) { query["NetworkInterface"] = request.networkInterface; } if (!$dara.isNull(request.networkType)) { query["NetworkType"] = request.networkType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.passwordInherit)) { query["PasswordInherit"] = request.passwordInherit; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.privateIpAddress)) { query["PrivateIpAddress"] = request.privateIpAddress; } if (!$dara.isNull(request.ramRoleName)) { query["RamRoleName"] = request.ramRoleName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityEnhancementStrategy)) { query["SecurityEnhancementStrategy"] = request.securityEnhancementStrategy; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.securityGroupIds)) { query["SecurityGroupIds"] = request.securityGroupIds; } if (!$dara.isNull(request.securityOptions)) { query["SecurityOptions"] = request.securityOptions; } if (!$dara.isNull(request.spotDuration)) { query["SpotDuration"] = request.spotDuration; } if (!$dara.isNull(request.spotPriceLimit)) { query["SpotPriceLimit"] = request.spotPriceLimit; } if (!$dara.isNull(request.spotStrategy)) { query["SpotStrategy"] = request.spotStrategy; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.templateResourceGroupId)) { query["TemplateResourceGroupId"] = request.templateResourceGroupId; } if (!$dara.isNull(request.templateTag)) { query["TemplateTag"] = request.templateTag; } if (!$dara.isNull(request.userData)) { query["UserData"] = request.userData; } if (!$dara.isNull(request.vSwitchId)) { query["VSwitchId"] = request.vSwitchId; } if (!$dara.isNull(request.versionDescription)) { query["VersionDescription"] = request.versionDescription; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } if (!$dara.isNull(request.systemDisk)) { query["SystemDisk"] = request.systemDisk; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateLaunchTemplate", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateLaunchTemplateResponse>(await this.callApi(params, req, runtime), new $_model.CreateLaunchTemplateResponse({})); } /** * Creates an ECS instance launch template. A launch template eliminates the need to configure a large number of parameters every time you create an instance. * * @remarks * After you call CreateLaunchTemplate to create a template, a default version with version number 1 is automatically generated. You can then create multiple versions based on this template (`CreateLaunchTemplateVersion`), with version numbers incrementing sequentially from 1. If you do not specify a template version when creating instances ([RunInstances](https://help.aliyun.com/document_detail/63440.html)), the default version is used. * A launch template version contains the configurations for creating instances, such as the region, image ID, instance type, security group ID, and public bandwidth. If a specific configuration is not specified in the version, you must specify it when you create instances. * When you call this operation, take note of the following items: * - Each account can create up to 30 launch templates per region, and each template can have up to 30 versions. * - Most parameters in a launch template are optional. When you create a template, Alibaba Cloud does not verify the existence or validity of parameter values. The validity of parameter values is verified only when you create instances. * - If a configuration is specified in the launch template, it cannot be filtered out when you create instances ([RunInstances](https://help.aliyun.com/document_detail/63440.html)). For example, if the template specifies `HostName=LocalHost` and the `HostName` value is left empty in `RunInstances`, the hostname of the instance is still `LocalHost`. To override the `HostName=LocalHost` configuration, set `HostName=MyHost` or another value in `RunInstances`. * * @param request - CreateLaunchTemplateRequest * @returns CreateLaunchTemplateResponse */ async createLaunchTemplate(request: $_model.CreateLaunchTemplateRequest): Promise<$_model.CreateLaunchTemplateResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createLaunchTemplateWithOptions(request, runtime); } /** * Creates a new version in a specified ECS launch template for subsequent creation of ECS instances, elastic scaling groups, or auto provisioning groups. * * @remarks * ## Operation description * To modify the parameters of a specific version, create a new template version. Each instance launch template supports a maximum of 30 versions. * * @param request - CreateLaunchTemplateVersionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateLaunchTemplateVersionResponse */ async createLaunchTemplateVersionWithOptions(request: $_model.CreateLaunchTemplateVersionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateLaunchTemplateVersionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoReleaseTime)) { query["AutoReleaseTime"] = request.autoReleaseTime; } if (!$dara.isNull(request.autoRenew)) { query["AutoRenew"] = request.autoRenew; } if (!$dara.isNull(request.autoRenewPeriod)) { query["AutoRenewPeriod"] = request.autoRenewPeriod; } if (!$dara.isNull(request.creditSpecification)) { query["CreditSpecification"] = request.creditSpecification; } if (!$dara.isNull(request.dataDisk)) { query["DataDisk"] = request.dataDisk; } if (!$dara.isNull(request.deletionProtection)) { query["DeletionProtection"] = request.deletionProtection; } if (!$dara.isNull(request.deploymentSetId)) { query["DeploymentSetId"] = request.deploymentSetId; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.enableVmOsConfig)) { query["EnableVmOsConfig"] = request.enableVmOsConfig; } if (!$dara.isNull(request.hostName)) { query["HostName"] = request.hostName; } if (!$dara.isNull(request.httpEndpoint)) { query["HttpEndpoint"] = request.httpEndpoint; } if (!$dara.isNull(request.httpPutResponseHopLimit)) { query["HttpPutResponseHopLimit"] = request.httpPutResponseHopLimit; } if (!$dara.isNull(request.httpTokens)) { query["HttpTokens"] = request.httpTokens; } if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.imageOptions)) { query["ImageOptions"] = request.imageOptions; } if (!$dara.isNull(request.imageOwnerAlias)) { query["ImageOwnerAlias"] = request.imageOwnerAlias; } if (!$dara.isNull(request.instanceChargeType)) { query["InstanceChargeType"] = request.instanceChargeType; } if (!$dara.isNull(request.instanceName)) { query["InstanceName"] = request.instanceName; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.internetChargeType)) { query["InternetChargeType"] = request.internetChargeType; } if (!$dara.isNull(request.internetMaxBandwidthIn)) { query["InternetMaxBandwidthIn"] = request.internetMaxBandwidthIn; } if (!$dara.isNull(request.internetMaxBandwidthOut)) { query["InternetMaxBandwidthOut"] = request.internetMaxBandwidthOut; } if (!$dara.isNull(request.ioOptimized)) { query["IoOptimized"] = request.ioOptimized; } if (!$dara.isNull(request.ipv6AddressCount)) { query["Ipv6AddressCount"] = request.ipv6AddressCount; } if (!$dara.isNull(request.keyPairName)) { query["KeyPairName"] = request.keyPairName; } if (!$dara.isNull(request.launchTemplateId)) { query["LaunchTemplateId"] = request.launchTemplateId; } if (!$dara.isNull(request.launchTemplateName)) { query["LaunchTemplateName"] = request.launchTemplateName; } if (!$dara.isNull(request.networkInterface)) { query["NetworkInterface"] = request.networkInterface; } if (!$dara.isNull(request.networkType)) { query["NetworkType"] = request.networkType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.passwordInherit)) { query["PasswordInherit"] = request.passwordInherit; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.privateIpAddress)) { query["PrivateIpAddress"] = request.privateIpAddress; } if (!$dara.isNull(request.ramRoleName)) { query["RamRoleName"] = request.ramRoleName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityEnhancementStrategy)) { query["SecurityEnhancementStrategy"] = request.securityEnhancementStrategy; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.securityGroupIds)) { query["SecurityGroupIds"] = request.securityGroupIds; } if (!$dara.isNull(request.securityOptions)) { query["SecurityOptions"] = request.securityOptions; } if (!$dara.isNull(request.spotDuration)) { query["SpotDuration"] = request.spotDuration; } if (!$dara.isNull(request.spotPriceLimit)) { query["SpotPriceLimit"] = request.spotPriceLimit; } if (!$dara.isNull(request.spotStrategy)) { query["SpotStrategy"] = request.spotStrategy; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.userData)) { query["UserData"] = request.userData; } if (!$dara.isNull(request.vSwitchId)) { query["VSwitchId"] = request.vSwitchId; } if (!$dara.isNull(request.versionDescription)) { query["VersionDescription"] = request.versionDescription; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } if (!$dara.isNull(request.systemDisk)) { query["SystemDisk"] = request.systemDisk; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateLaunchTemplateVersion", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateLaunchTemplateVersionResponse>(await this.callApi(params, req, runtime), new $_model.CreateLaunchTemplateVersionResponse({})); } /** * Creates a new version in a specified ECS launch template for subsequent creation of ECS instances, elastic scaling groups, or auto provisioning groups. * * @remarks * ## Operation description * To modify the parameters of a specific version, create a new template version. Each instance launch template supports a maximum of 30 versions. * * @param request - CreateLaunchTemplateVersionRequest * @returns CreateLaunchTemplateVersionResponse */ async createLaunchTemplateVersion(request: $_model.CreateLaunchTemplateVersionRequest): Promise<$_model.CreateLaunchTemplateVersionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createLaunchTemplateVersionWithOptions(request, runtime); } /** * CreateNatGateway * * @deprecated OpenAPI CreateNatGateway is deprecated, please use Vpc::2016-04-28::CreateNatGateway instead. * * @param request - CreateNatGatewayRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateNatGatewayResponse */ async createNatGatewayWithOptions(request: $_model.CreateNatGatewayRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateNatGatewayResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.bandwidthPackage)) { query["BandwidthPackage"] = request.bandwidthPackage; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateNatGateway", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateNatGatewayResponse>(await this.callApi(params, req, runtime), new $_model.CreateNatGatewayResponse({})); } /** * CreateNatGateway * * @deprecated OpenAPI CreateNatGateway is deprecated, please use Vpc::2016-04-28::CreateNatGateway instead. * * @param request - CreateNatGatewayRequest * @returns CreateNatGatewayResponse */ // Deprecated async createNatGateway(request: $_model.CreateNatGatewayRequest): Promise<$_model.CreateNatGatewayResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createNatGatewayWithOptions(request, runtime); } /** * You can create an elastic network interface (ENI) and specify its primary private IP address. * * @remarks * When you call this operation, note the following: * - This is a synchronous operation. A newly created elastic network interface is in the `Available` state and can be attached to an instance immediately. * - If the response does not contain a `NetworkInterfaceId`, try creating the elastic network interface again. * - An elastic network interface can be attached to only one instance in a VPC. * - When you reattach an elastic network interface to another instance, its properties remain unchanged and network traffic is redirected to the new instance. * - You can assign up to 49 secondary private IP addresses when you create an elastic network interface. * - To assign an IPv6 address when creating an elastic network interface, ensure that IPv6 is enabled for the specified VSwitch. For more information, see [What is an IPv6 gateway](https://help.aliyun.com/document_detail/98896.html). * - Each account has a resource quota that limits the number of elastic network interfaces you can create in an Alibaba Cloud region. You can view your resource quotas in the ECS console. For more information, see [View and increase resource quotas](https://help.aliyun.com/document_detail/184115.html). * ### Request examples *
* * Create an elastic network interface * * ``` * RegionId: cn-hangzhou, // China (Hangzhou) region. * SecurityGroupId: sg-bp10jztp6b0sdsyl****, // The security group ID. * VSwitchId: vsw-bp19wo63nleroq22g****, // The VSwitch ID. * ``` *
*
* * Create an elastic network interface and specify a primary private IP address * * ``` * RegionId: cn-hangzhou, // China (Hangzhou) region. * SecurityGroupId: sg-bp10jztp6b0sdsyl****, // security group ID. * VSwitchId: vsw-bp19wo63nleroq22g****, // VSwitch ID. * PrimaryIpAddress: 192.168.0.*, // primary private IP address. * ``` *
* * @param request - CreateNetworkInterfaceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateNetworkInterfaceResponse */ async createNetworkInterfaceWithOptions(request: $_model.CreateNetworkInterfaceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateNetworkInterfaceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.businessType)) { query["BusinessType"] = request.businessType; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.connectionTrackingConfiguration)) { query["ConnectionTrackingConfiguration"] = request.connectionTrackingConfiguration; } if (!$dara.isNull(request.deleteOnRelease)) { query["DeleteOnRelease"] = request.deleteOnRelease; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.enhancedNetwork)) { query["EnhancedNetwork"] = request.enhancedNetwork; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.ipv4Prefix)) { query["Ipv4Prefix"] = request.ipv4Prefix; } if (!$dara.isNull(request.ipv4PrefixCount)) { query["Ipv4PrefixCount"] = request.ipv4PrefixCount; } if (!$dara.isNull(request.ipv6Address)) { query["Ipv6Address"] = request.ipv6Address; } if (!$dara.isNull(request.ipv6AddressCount)) { query["Ipv6AddressCount"] = request.ipv6AddressCount; } if (!$dara.isNull(request.ipv6Prefix)) { query["Ipv6Prefix"] = request.ipv6Prefix; } if (!$dara.isNull(request.ipv6PrefixCount)) { query["Ipv6PrefixCount"] = request.ipv6PrefixCount; } if (!$dara.isNull(request.networkInterfaceName)) { query["NetworkInterfaceName"] = request.networkInterfaceName; } if (!$dara.isNull(request.networkInterfaceTrafficConfig)) { query["NetworkInterfaceTrafficConfig"] = request.networkInterfaceTrafficConfig; } if (!$dara.isNull(request.networkInterfaceTrafficMode)) { query["NetworkInterfaceTrafficMode"] = request.networkInterfaceTrafficMode; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.primaryIpAddress)) { query["PrimaryIpAddress"] = request.primaryIpAddress; } if (!$dara.isNull(request.privateIpAddress)) { query["PrivateIpAddress"] = request.privateIpAddress; } if (!$dara.isNull(request.queueNumber)) { query["QueueNumber"] = request.queueNumber; } if (!$dara.isNull(request.queuePairNumber)) { query["QueuePairNumber"] = request.queuePairNumber; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.rxQueueSize)) { query["RxQueueSize"] = request.rxQueueSize; } if (!$dara.isNull(request.secondaryPrivateIpAddressCount)) { query["SecondaryPrivateIpAddressCount"] = request.secondaryPrivateIpAddressCount; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.securityGroupIds)) { query["SecurityGroupIds"] = request.securityGroupIds; } if (!$dara.isNull(request.sourceDestCheck)) { query["SourceDestCheck"] = request.sourceDestCheck; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.txQueueSize)) { query["TxQueueSize"] = request.txQueueSize; } if (!$dara.isNull(request.vSwitchId)) { query["VSwitchId"] = request.vSwitchId; } if (!$dara.isNull(request.visible)) { query["Visible"] = request.visible; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateNetworkInterface", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateNetworkInterfaceResponse>(await this.callApi(params, req, runtime), new $_model.CreateNetworkInterfaceResponse({})); } /** * You can create an elastic network interface (ENI) and specify its primary private IP address. * * @remarks * When you call this operation, note the following: * - This is a synchronous operation. A newly created elastic network interface is in the `Available` state and can be attached to an instance immediately. * - If the response does not contain a `NetworkInterfaceId`, try creating the elastic network interface again. * - An elastic network interface can be attached to only one instance in a VPC. * - When you reattach an elastic network interface to another instance, its properties remain unchanged and network traffic is redirected to the new instance. * - You can assign up to 49 secondary private IP addresses when you create an elastic network interface. * - To assign an IPv6 address when creating an elastic network interface, ensure that IPv6 is enabled for the specified VSwitch. For more information, see [What is an IPv6 gateway](https://help.aliyun.com/document_detail/98896.html). * - Each account has a resource quota that limits the number of elastic network interfaces you can create in an Alibaba Cloud region. You can view your resource quotas in the ECS console. For more information, see [View and increase resource quotas](https://help.aliyun.com/document_detail/184115.html). * ### Request examples *
* * Create an elastic network interface * * ``` * RegionId: cn-hangzhou, // China (Hangzhou) region. * SecurityGroupId: sg-bp10jztp6b0sdsyl****, // The security group ID. * VSwitchId: vsw-bp19wo63nleroq22g****, // The VSwitch ID. * ``` *
*
* * Create an elastic network interface and specify a primary private IP address * * ``` * RegionId: cn-hangzhou, // China (Hangzhou) region. * SecurityGroupId: sg-bp10jztp6b0sdsyl****, // security group ID. * VSwitchId: vsw-bp19wo63nleroq22g****, // VSwitch ID. * PrimaryIpAddress: 192.168.0.*, // primary private IP address. * ``` *
* * @param request - CreateNetworkInterfaceRequest * @returns CreateNetworkInterfaceResponse */ async createNetworkInterface(request: $_model.CreateNetworkInterfaceRequest): Promise<$_model.CreateNetworkInterfaceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createNetworkInterfaceWithOptions(request, runtime); } /** * Grants elastic network interface (ENI) permissions to an Alibaba Cloud partner (certified ISV) or an individual user. * * @param request - CreateNetworkInterfacePermissionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateNetworkInterfacePermissionResponse */ async createNetworkInterfacePermissionWithOptions(request: $_model.CreateNetworkInterfacePermissionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateNetworkInterfacePermissionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.accountId)) { query["AccountId"] = request.accountId; } if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.permission)) { query["Permission"] = request.permission; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateNetworkInterfacePermission", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateNetworkInterfacePermissionResponse>(await this.callApi(params, req, runtime), new $_model.CreateNetworkInterfacePermissionResponse({})); } /** * Grants elastic network interface (ENI) permissions to an Alibaba Cloud partner (certified ISV) or an individual user. * * @param request - CreateNetworkInterfacePermissionRequest * @returns CreateNetworkInterfacePermissionResponse */ async createNetworkInterfacePermission(request: $_model.CreateNetworkInterfacePermissionRequest): Promise<$_model.CreateNetworkInterfacePermissionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createNetworkInterfacePermissionWithOptions(request, runtime); } /** * CreatePhysicalConnection * * @deprecated OpenAPI CreatePhysicalConnection is deprecated, please use Vpc::2016-04-28::CreatePhysicalConnection instead. * * @param request - CreatePhysicalConnectionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreatePhysicalConnectionResponse */ async createPhysicalConnectionWithOptions(request: $_model.CreatePhysicalConnectionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreatePhysicalConnectionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.accessPointId)) { query["AccessPointId"] = request.accessPointId; } if (!$dara.isNull(request.circuitCode)) { query["CircuitCode"] = request.circuitCode; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.lineOperator)) { query["LineOperator"] = request.lineOperator; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.peerLocation)) { query["PeerLocation"] = request.peerLocation; } if (!$dara.isNull(request.portType)) { query["PortType"] = request.portType; } if (!$dara.isNull(request.redundantPhysicalConnectionId)) { query["RedundantPhysicalConnectionId"] = request.redundantPhysicalConnectionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.type)) { query["Type"] = request.type; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } if (!$dara.isNull(request.bandwidth)) { query["bandwidth"] = request.bandwidth; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreatePhysicalConnection", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreatePhysicalConnectionResponse>(await this.callApi(params, req, runtime), new $_model.CreatePhysicalConnectionResponse({})); } /** * CreatePhysicalConnection * * @deprecated OpenAPI CreatePhysicalConnection is deprecated, please use Vpc::2016-04-28::CreatePhysicalConnection instead. * * @param request - CreatePhysicalConnectionRequest * @returns CreatePhysicalConnectionResponse */ // Deprecated async createPhysicalConnection(request: $_model.CreatePhysicalConnectionRequest): Promise<$_model.CreatePhysicalConnectionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createPhysicalConnectionWithOptions(request, runtime); } /** * Creates an O&M window. When the TargetResource parameter of the O&M window is set to associate with ECS instances and a hardware risk is detected at the underlying layer that requires scheduled O&M to mitigate, the execution time of the scheduled O&M is determined based on the time range specified by the TimePeriod parameter. When the execution time of the O&M event is reached, the platform automatically performs the corresponding O&M operation based on the event type. * * @param tmpReq - CreatePlanMaintenanceWindowRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreatePlanMaintenanceWindowResponse */ async createPlanMaintenanceWindowWithOptions(tmpReq: $_model.CreatePlanMaintenanceWindowRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreatePlanMaintenanceWindowResponse> { tmpReq.validate(); let request = new $_model.CreatePlanMaintenanceWindowShrinkRequest({ }); OpenApiUtil.convert(tmpReq, request); if (!$dara.isNull(tmpReq.targetResource)) { request.targetResourceShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.targetResource, "TargetResource", "json"); } if (!$dara.isNull(tmpReq.timePeriod)) { request.timePeriodShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.timePeriod, "TimePeriod", "json"); } let query = { }; if (!$dara.isNull(request.enable)) { query["Enable"] = request.enable; } if (!$dara.isNull(request.minMaintenanceInterval)) { query["MinMaintenanceInterval"] = request.minMaintenanceInterval; } if (!$dara.isNull(request.planWindowName)) { query["PlanWindowName"] = request.planWindowName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.supportMaintenanceAction)) { query["SupportMaintenanceAction"] = request.supportMaintenanceAction; } if (!$dara.isNull(request.targetResourceShrink)) { query["TargetResource"] = request.targetResourceShrink; } if (!$dara.isNull(request.timePeriodShrink)) { query["TimePeriod"] = request.timePeriodShrink; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreatePlanMaintenanceWindow", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreatePlanMaintenanceWindowResponse>(await this.callApi(params, req, runtime), new $_model.CreatePlanMaintenanceWindowResponse({})); } /** * Creates an O&M window. When the TargetResource parameter of the O&M window is set to associate with ECS instances and a hardware risk is detected at the underlying layer that requires scheduled O&M to mitigate, the execution time of the scheduled O&M is determined based on the time range specified by the TimePeriod parameter. When the execution time of the O&M event is reached, the platform automatically performs the corresponding O&M operation based on the event type. * * @param request - CreatePlanMaintenanceWindowRequest * @returns CreatePlanMaintenanceWindowResponse */ async createPlanMaintenanceWindow(request: $_model.CreatePlanMaintenanceWindowRequest): Promise<$_model.CreatePlanMaintenanceWindowResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createPlanMaintenanceWindowWithOptions(request, runtime); } /** * Creates a port list. You can associate a port list with resources, such as security groups. * * @param request - CreatePortRangeListRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreatePortRangeListResponse */ async createPortRangeListWithOptions(request: $_model.CreatePortRangeListRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreatePortRangeListResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.entry)) { query["Entry"] = request.entry; } if (!$dara.isNull(request.maxEntries)) { query["MaxEntries"] = request.maxEntries; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.portRangeListName)) { query["PortRangeListName"] = request.portRangeListName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreatePortRangeList", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreatePortRangeListResponse>(await this.callApi(params, req, runtime), new $_model.CreatePortRangeListResponse({})); } /** * Creates a port list. You can associate a port list with resources, such as security groups. * * @param request - CreatePortRangeListRequest * @returns CreatePortRangeListResponse */ async createPortRangeList(request: $_model.CreatePortRangeListRequest): Promise<$_model.CreatePortRangeListResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createPortRangeListWithOptions(request, runtime); } /** * Creates a prefix list. * * @remarks * ## [](#)Usage notes * - A prefix list is a collection of network prefixes (CIDR blocks) and can be referenced to configure network rules for other resources. For more information, see [Overview](https://help.aliyun.com/document_detail/206223.html). * - When you create a prefix list, take note of the following items: * - You must specify an IP address family (IPv4 or IPv6) for the prefix list, and cannot change the IP address family after the prefix list is created. You cannot combine IPv4 and IPv6 CIDR blocks in a single prefix list. * - You must specify the maximum number of entries that the prefix list can contain. You cannot modify the maximum number of entries after the prefix list is created. * - You can specify entries for the prefix list. Each entry consists of a CIDR block and the description for the CIDR block. The total number of entries cannot exceed the maximum number of entries that you specified. * - For more information about the limits on prefix lists and other resources, see [Limits](https://help.aliyun.com/document_detail/25412.html). * - You can create Resource Access Management (RAM) users and grant them minimum permissions. This eliminates the need to share the AccessKey pair of your Alibaba Cloud account with other users and reduces security risks for your enterprises. For information about how to grant permissions on prefix lists to RAM users, see [Grant a RAM user permissions on prefix lists](https://help.aliyun.com/document_detail/206175.html) * * @param request - CreatePrefixListRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreatePrefixListResponse */ async createPrefixListWithOptions(request: $_model.CreatePrefixListRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreatePrefixListResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.addressFamily)) { query["AddressFamily"] = request.addressFamily; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.entry)) { query["Entry"] = request.entry; } if (!$dara.isNull(request.maxEntries)) { query["MaxEntries"] = request.maxEntries; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.prefixListName)) { query["PrefixListName"] = request.prefixListName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreatePrefixList", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreatePrefixListResponse>(await this.callApi(params, req, runtime), new $_model.CreatePrefixListResponse({})); } /** * Creates a prefix list. * * @remarks * ## [](#)Usage notes * - A prefix list is a collection of network prefixes (CIDR blocks) and can be referenced to configure network rules for other resources. For more information, see [Overview](https://help.aliyun.com/document_detail/206223.html). * - When you create a prefix list, take note of the following items: * - You must specify an IP address family (IPv4 or IPv6) for the prefix list, and cannot change the IP address family after the prefix list is created. You cannot combine IPv4 and IPv6 CIDR blocks in a single prefix list. * - You must specify the maximum number of entries that the prefix list can contain. You cannot modify the maximum number of entries after the prefix list is created. * - You can specify entries for the prefix list. Each entry consists of a CIDR block and the description for the CIDR block. The total number of entries cannot exceed the maximum number of entries that you specified. * - For more information about the limits on prefix lists and other resources, see [Limits](https://help.aliyun.com/document_detail/25412.html). * - You can create Resource Access Management (RAM) users and grant them minimum permissions. This eliminates the need to share the AccessKey pair of your Alibaba Cloud account with other users and reduces security risks for your enterprises. For information about how to grant permissions on prefix lists to RAM users, see [Grant a RAM user permissions on prefix lists](https://help.aliyun.com/document_detail/206175.html) * * @param request - CreatePrefixListRequest * @returns CreatePrefixListResponse */ async createPrefixList(request: $_model.CreatePrefixListRequest): Promise<$_model.CreatePrefixListResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createPrefixListWithOptions(request, runtime); } /** * CreateRouteEntry * * @deprecated OpenAPI CreateRouteEntry is deprecated, please use Vpc::2016-04-28::CreateRouteEntry instead. * * @param request - CreateRouteEntryRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateRouteEntryResponse */ async createRouteEntryWithOptions(request: $_model.CreateRouteEntryRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateRouteEntryResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.destinationCidrBlock)) { query["DestinationCidrBlock"] = request.destinationCidrBlock; } if (!$dara.isNull(request.nextHopId)) { query["NextHopId"] = request.nextHopId; } if (!$dara.isNull(request.nextHopList)) { query["NextHopList"] = request.nextHopList; } if (!$dara.isNull(request.nextHopType)) { query["NextHopType"] = request.nextHopType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.routeTableId)) { query["RouteTableId"] = request.routeTableId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateRouteEntry", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateRouteEntryResponse>(await this.callApi(params, req, runtime), new $_model.CreateRouteEntryResponse({})); } /** * CreateRouteEntry * * @deprecated OpenAPI CreateRouteEntry is deprecated, please use Vpc::2016-04-28::CreateRouteEntry instead. * * @param request - CreateRouteEntryRequest * @returns CreateRouteEntryResponse */ // Deprecated async createRouteEntry(request: $_model.CreateRouteEntryRequest): Promise<$_model.CreateRouteEntryResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createRouteEntryWithOptions(request, runtime); } /** * CreateRouterInterface. * * @deprecated OpenAPI CreateRouterInterface is deprecated, please use Vpc::2016-04-28::CreateRouterInterface instead. * * @param request - CreateRouterInterfaceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateRouterInterfaceResponse */ async createRouterInterfaceWithOptions(request: $_model.CreateRouterInterfaceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateRouterInterfaceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.accessPointId)) { query["AccessPointId"] = request.accessPointId; } if (!$dara.isNull(request.autoPay)) { query["AutoPay"] = request.autoPay; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.healthCheckSourceIp)) { query["HealthCheckSourceIp"] = request.healthCheckSourceIp; } if (!$dara.isNull(request.healthCheckTargetIp)) { query["HealthCheckTargetIp"] = request.healthCheckTargetIp; } if (!$dara.isNull(request.instanceChargeType)) { query["InstanceChargeType"] = request.instanceChargeType; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.oppositeAccessPointId)) { query["OppositeAccessPointId"] = request.oppositeAccessPointId; } if (!$dara.isNull(request.oppositeInterfaceId)) { query["OppositeInterfaceId"] = request.oppositeInterfaceId; } if (!$dara.isNull(request.oppositeInterfaceOwnerId)) { query["OppositeInterfaceOwnerId"] = request.oppositeInterfaceOwnerId; } if (!$dara.isNull(request.oppositeRegionId)) { query["OppositeRegionId"] = request.oppositeRegionId; } if (!$dara.isNull(request.oppositeRouterId)) { query["OppositeRouterId"] = request.oppositeRouterId; } if (!$dara.isNull(request.oppositeRouterType)) { query["OppositeRouterType"] = request.oppositeRouterType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.pricingCycle)) { query["PricingCycle"] = request.pricingCycle; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.role)) { query["Role"] = request.role; } if (!$dara.isNull(request.routerId)) { query["RouterId"] = request.routerId; } if (!$dara.isNull(request.routerType)) { query["RouterType"] = request.routerType; } if (!$dara.isNull(request.spec)) { query["Spec"] = request.spec; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateRouterInterface", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateRouterInterfaceResponse>(await this.callApi(params, req, runtime), new $_model.CreateRouterInterfaceResponse({})); } /** * CreateRouterInterface. * * @deprecated OpenAPI CreateRouterInterface is deprecated, please use Vpc::2016-04-28::CreateRouterInterface instead. * * @param request - CreateRouterInterfaceRequest * @returns CreateRouterInterfaceResponse */ // Deprecated async createRouterInterface(request: $_model.CreateRouterInterfaceRequest): Promise<$_model.CreateRouterInterfaceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createRouterInterfaceWithOptions(request, runtime); } /** * 购买节省计划并预付费换购按量付费 * * @param request - CreateSavingsPlanRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateSavingsPlanResponse */ async createSavingsPlanWithOptions(request: $_model.CreateSavingsPlanRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateSavingsPlanResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.chargeType)) { query["ChargeType"] = request.chargeType; } if (!$dara.isNull(request.committedAmount)) { query["CommittedAmount"] = request.committedAmount; } if (!$dara.isNull(request.instanceTypeFamily)) { query["InstanceTypeFamily"] = request.instanceTypeFamily; } if (!$dara.isNull(request.instanceTypeFamilyGroup)) { query["InstanceTypeFamilyGroup"] = request.instanceTypeFamilyGroup; } if (!$dara.isNull(request.offeringType)) { query["OfferingType"] = request.offeringType; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.planType)) { query["PlanType"] = request.planType; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceId)) { query["ResourceId"] = request.resourceId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateSavingsPlan", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateSavingsPlanResponse>(await this.callApi(params, req, runtime), new $_model.CreateSavingsPlanResponse({})); } /** * 购买节省计划并预付费换购按量付费 * * @param request - CreateSavingsPlanRequest * @returns CreateSavingsPlanResponse */ async createSavingsPlan(request: $_model.CreateSavingsPlanRequest): Promise<$_model.CreateSavingsPlanResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createSavingsPlanWithOptions(request, runtime); } /** * Creates a security group. * * @remarks * - The default internal connectivity policy for a basic security group created by this operation is **intra-group connectivity**. You can modify this policy by calling [ModifySecurityGroupPolicy](https://help.aliyun.com/document_detail/2679846.html). * - The default internal connectivity policy for an advanced security group created by this operation is **internal isolation**, and this policy cannot be modified. * - The number of security groups in a single region is limited. You can create a minimum of 100 security groups. For more information, see [Security group limits](~~25412#SecurityGroupQuota1~~). * - To create a security group of the VPC type, you must specify the VpcId parameter. * * @param request - CreateSecurityGroupRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateSecurityGroupResponse */ async createSecurityGroupWithOptions(request: $_model.CreateSecurityGroupRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateSecurityGroupResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupName)) { query["SecurityGroupName"] = request.securityGroupName; } if (!$dara.isNull(request.securityGroupType)) { query["SecurityGroupType"] = request.securityGroupType; } if (!$dara.isNull(request.serviceManaged)) { query["ServiceManaged"] = request.serviceManaged; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateSecurityGroup", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateSecurityGroupResponse>(await this.callApi(params, req, runtime), new $_model.CreateSecurityGroupResponse({})); } /** * Creates a security group. * * @remarks * - The default internal connectivity policy for a basic security group created by this operation is **intra-group connectivity**. You can modify this policy by calling [ModifySecurityGroupPolicy](https://help.aliyun.com/document_detail/2679846.html). * - The default internal connectivity policy for an advanced security group created by this operation is **internal isolation**, and this policy cannot be modified. * - The number of security groups in a single region is limited. You can create a minimum of 100 security groups. For more information, see [Security group limits](~~25412#SecurityGroupQuota1~~). * - To create a security group of the VPC type, you must specify the VpcId parameter. * * @param request - CreateSecurityGroupRequest * @returns CreateSecurityGroupResponse */ async createSecurityGroup(request: $_model.CreateSecurityGroupRequest): Promise<$_model.CreateSecurityGroupResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createSecurityGroupWithOptions(request, runtime); } /** * Schedules simulated system events for one or more ECS instances. Simulated system events are equivalent to event drills. They do not actually execute the events or affect ECS instances. * * @remarks * After you schedule simulated events, you can view the scheduled simulated system events in the ECS console, by calling [ECS API](https://help.aliyun.com/document_detail/63962.html) operations, or by using CloudMonitor. * The following list describes the lifecycle of simulated system events: * - Scheduled: After the simulated system event is scheduled, it automatically enters the Scheduled state. * - Executed: If no manual intervention is performed, the simulated system event automatically enters the Executed state at the specified point in time (NotBefore). * - Canceled: After you call [CancelSimulatedSystemEvents](https://help.aliyun.com/document_detail/88808.html) to cancel the simulated system event, the event enters the Canceled state. * - Avoided: For simulated system events of the SystemMaintenance.Reboot type, you can [restart the instance](https://help.aliyun.com/document_detail/25502.html) before the scheduled time to change the event to the Avoided state. * * @param request - CreateSimulatedSystemEventsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateSimulatedSystemEventsResponse */ async createSimulatedSystemEventsWithOptions(request: $_model.CreateSimulatedSystemEventsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateSimulatedSystemEventsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.eventType)) { query["EventType"] = request.eventType; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.notBefore)) { query["NotBefore"] = request.notBefore; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateSimulatedSystemEvents", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateSimulatedSystemEventsResponse>(await this.callApi(params, req, runtime), new $_model.CreateSimulatedSystemEventsResponse({})); } /** * Schedules simulated system events for one or more ECS instances. Simulated system events are equivalent to event drills. They do not actually execute the events or affect ECS instances. * * @remarks * After you schedule simulated events, you can view the scheduled simulated system events in the ECS console, by calling [ECS API](https://help.aliyun.com/document_detail/63962.html) operations, or by using CloudMonitor. * The following list describes the lifecycle of simulated system events: * - Scheduled: After the simulated system event is scheduled, it automatically enters the Scheduled state. * - Executed: If no manual intervention is performed, the simulated system event automatically enters the Executed state at the specified point in time (NotBefore). * - Canceled: After you call [CancelSimulatedSystemEvents](https://help.aliyun.com/document_detail/88808.html) to cancel the simulated system event, the event enters the Canceled state. * - Avoided: For simulated system events of the SystemMaintenance.Reboot type, you can [restart the instance](https://help.aliyun.com/document_detail/25502.html) before the scheduled time to change the event to the Avoided state. * * @param request - CreateSimulatedSystemEventsRequest * @returns CreateSimulatedSystemEventsResponse */ async createSimulatedSystemEvents(request: $_model.CreateSimulatedSystemEventsRequest): Promise<$_model.CreateSimulatedSystemEventsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createSimulatedSystemEventsWithOptions(request, runtime); } /** * Creates a snapshot for a disk. * * @remarks * The local snapshot feature has been replaced by the snapshot instant access feature. Metric description is as follows: * - If you used local snapshots before December 14, 2020, you can use the `Category` parameter as Normal. * - If you did not use local snapshots before December 14, 2020, no additional configuration is required. New snapshots created for ESSD series disks (ESSD, ESSD AutoPL, ESSD Entry, and regional ESSD) are instantly active by default, and both manual snapshots and automatic snapshots are supported. The three snapshot instant access-related parameters `InstantAccess`, `InstantAccessRetentionDays`, and `DisableInstantAccess` in API operations no longer take effect. The `DescribeSnapshots` and `DescribeSnapshotGroups` API operations will include a new response parameter named Available to describe the active status of snapshots. * Before you begin: * - Activate the snapshot feature. For more information, see [Activate snapshots](https://help.aliyun.com/document_detail/108381.html). * - The disk must be in the **In Use** or **Unattached** state. Note the following items for different states: * - If the disk is in the **In Use** state, the instance must be in the **Running** or **Stopped** state. * - If the disk is in the **Unattached** state, the disk must have been previously attached to an ECS instance. Snapshots cannot be created for disks that have never been attached to an ECS instance. * - When a disk is used to create a dynamic extended volume or a RAID array, use a snapshot-consistent group and enable application-consistent snapshots to back up data. Snapshot-consistent groups ensure write order consistency and crash consistency for data written to multiple disks in a business system. For more information, see [Create a snapshot-consistent group](https://help.aliyun.com/document_detail/199625.html) and [Create an application-consistent snapshot](https://help.aliyun.com/document_detail/208589.html). * When you create a snapshot, take note of the following items: * - Avoid creating snapshots during peak business hours. When a snapshot is being created, the I/O performance of the disk decreases by up to 10%, and read and write performance may be briefly affected. * - If the snapshot has not been created, it cannot be used to create a custom image ([CreateImage](https://help.aliyun.com/document_detail/25535.html)). * - Incremental data generated by disk operations during snapshot creation is not backup to the snapshot. * - If the disk is attached to an ECS instance, do not change the instance status during snapshot creation, such as stopping or restarting the ECS instance. Otherwise, the snapshot creation is failed. * - A disk for which a snapshot is being created does not support scale-out. Wait until the snapshot is created before you execute the scale-out operation. * - You can create snapshots for disks in the **Expired** (`Expired`) state. If the disk reaches its expiration release time during snapshot creation, the disk is released and the snapshot in the **Creating** (`Creating`) state is also deleted. * - After a snapshot is created, the system calculates fees based on the snapshot size in each region separately. For more information, see [Snapshot billing](https://help.aliyun.com/document_detail/56159.html). * - In the following scenarios, you cannot create a snapshot for the specified disk: * - The number of manual snapshots retained for the disk has reached the upper limit. For more information, see [Snapshot limits](~~25412#SnapshotQuota1~~). * - Snapshot creation has concurrency limits. Exceeding the limits causes creation failures. For more information, see [Snapshot limits](~~25412#SnapshotQuota1~~). * - When you query ECS instance information, if the returned data contains `{"OperationLocks": {"LockReason" : "security"}}`, all operations are prohibited. * * @param request - CreateSnapshotRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateSnapshotResponse */ async createSnapshotWithOptions(request: $_model.CreateSnapshotRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateSnapshotResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.category)) { query["Category"] = request.category; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.instantAccess)) { query["InstantAccess"] = request.instantAccess; } if (!$dara.isNull(request.instantAccessRetentionDays)) { query["InstantAccessRetentionDays"] = request.instantAccessRetentionDays; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.retentionDays)) { query["RetentionDays"] = request.retentionDays; } if (!$dara.isNull(request.snapshotName)) { query["SnapshotName"] = request.snapshotName; } if (!$dara.isNull(request.storageLocationArn)) { query["StorageLocationArn"] = request.storageLocationArn; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateSnapshot", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateSnapshotResponse>(await this.callApi(params, req, runtime), new $_model.CreateSnapshotResponse({})); } /** * Creates a snapshot for a disk. * * @remarks * The local snapshot feature has been replaced by the snapshot instant access feature. Metric description is as follows: * - If you used local snapshots before December 14, 2020, you can use the `Category` parameter as Normal. * - If you did not use local snapshots before December 14, 2020, no additional configuration is required. New snapshots created for ESSD series disks (ESSD, ESSD AutoPL, ESSD Entry, and regional ESSD) are instantly active by default, and both manual snapshots and automatic snapshots are supported. The three snapshot instant access-related parameters `InstantAccess`, `InstantAccessRetentionDays`, and `DisableInstantAccess` in API operations no longer take effect. The `DescribeSnapshots` and `DescribeSnapshotGroups` API operations will include a new response parameter named Available to describe the active status of snapshots. * Before you begin: * - Activate the snapshot feature. For more information, see [Activate snapshots](https://help.aliyun.com/document_detail/108381.html). * - The disk must be in the **In Use** or **Unattached** state. Note the following items for different states: * - If the disk is in the **In Use** state, the instance must be in the **Running** or **Stopped** state. * - If the disk is in the **Unattached** state, the disk must have been previously attached to an ECS instance. Snapshots cannot be created for disks that have never been attached to an ECS instance. * - When a disk is used to create a dynamic extended volume or a RAID array, use a snapshot-consistent group and enable application-consistent snapshots to back up data. Snapshot-consistent groups ensure write order consistency and crash consistency for data written to multiple disks in a business system. For more information, see [Create a snapshot-consistent group](https://help.aliyun.com/document_detail/199625.html) and [Create an application-consistent snapshot](https://help.aliyun.com/document_detail/208589.html). * When you create a snapshot, take note of the following items: * - Avoid creating snapshots during peak business hours. When a snapshot is being created, the I/O performance of the disk decreases by up to 10%, and read and write performance may be briefly affected. * - If the snapshot has not been created, it cannot be used to create a custom image ([CreateImage](https://help.aliyun.com/document_detail/25535.html)). * - Incremental data generated by disk operations during snapshot creation is not backup to the snapshot. * - If the disk is attached to an ECS instance, do not change the instance status during snapshot creation, such as stopping or restarting the ECS instance. Otherwise, the snapshot creation is failed. * - A disk for which a snapshot is being created does not support scale-out. Wait until the snapshot is created before you execute the scale-out operation. * - You can create snapshots for disks in the **Expired** (`Expired`) state. If the disk reaches its expiration release time during snapshot creation, the disk is released and the snapshot in the **Creating** (`Creating`) state is also deleted. * - After a snapshot is created, the system calculates fees based on the snapshot size in each region separately. For more information, see [Snapshot billing](https://help.aliyun.com/document_detail/56159.html). * - In the following scenarios, you cannot create a snapshot for the specified disk: * - The number of manual snapshots retained for the disk has reached the upper limit. For more information, see [Snapshot limits](~~25412#SnapshotQuota1~~). * - Snapshot creation has concurrency limits. Exceeding the limits causes creation failures. For more information, see [Snapshot limits](~~25412#SnapshotQuota1~~). * - When you query ECS instance information, if the returned data contains `{"OperationLocks": {"LockReason" : "security"}}`, all operations are prohibited. * * @param request - CreateSnapshotRequest * @returns CreateSnapshotResponse */ async createSnapshot(request: $_model.CreateSnapshotRequest): Promise<$_model.CreateSnapshotResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createSnapshotWithOptions(request, runtime); } /** * Creates a snapshot-consistent group for disks attached to a specified ECS instance. A snapshot-consistent group contains snapshots of one or more disks. * * @remarks * You can set `InstanceId` to create a snapshot-consistent group for specified disks within an instance. Alternatively, you can use only `DiskId.N` to create a snapshot-consistent group for multiple disks attached to multiple ECS instances in the same zone. * > `DiskId.N` and `ExcludeDiskId.N` cannot be specified at the same time. If `InstanceId` is specified, `DiskId.N` can only be set to disks attached to the specified instance and no longer supports specifying disk IDs across multiple instances. * When you create a snapshot-consistent group, take note of the following items: * - The disks for which you want to create snapshots must be in the **In Use** (`In_use`) or **Available** (`Available`) state. * - If a disk is in the **In Use** (`In_use`) state, the ECS instance status must be **Running** (`Running`) or **Stopped** (`Stopped`). * - If a disk is in the **Available** (`Available`) state, the disk must have been previously attached to an ECS instance. Disks that have never been attached to an ECS instance do not support snapshot creation. * - Snapshot-consistent groups support only ESSD series disks (ESSD, ESSD AutoPL, and ESSD Entry). * - A single snapshot-consistent group can contain up to 16 disks (including system disks and data disks), and the total capacity cannot exceed 32 TiB. * - Snapshots that you manually create are retained until you delete them. Delete unnecessary snapshots on a regular basis to avoid incurring ongoing snapshot size fees. * - Disks with the multi-attach attribute enabled do not support snapshot-consistent groups. If an instance has a multi-attach disk attached, set the `ExcludeDiskId.N` parameter to exclude the disk. * For more information about the features and billing of snapshot-consistent groups, see [Snapshot-consistent groups](https://help.aliyun.com/document_detail/199625.html). * * @param request - CreateSnapshotGroupRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateSnapshotGroupResponse */ async createSnapshotGroupWithOptions(request: $_model.CreateSnapshotGroupRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateSnapshotGroupResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.excludeDiskId)) { query["ExcludeDiskId"] = request.excludeDiskId; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.instantAccess)) { query["InstantAccess"] = request.instantAccess; } if (!$dara.isNull(request.instantAccessRetentionDays)) { query["InstantAccessRetentionDays"] = request.instantAccessRetentionDays; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.storageLocationArn)) { query["StorageLocationArn"] = request.storageLocationArn; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateSnapshotGroup", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateSnapshotGroupResponse>(await this.callApi(params, req, runtime), new $_model.CreateSnapshotGroupResponse({})); } /** * Creates a snapshot-consistent group for disks attached to a specified ECS instance. A snapshot-consistent group contains snapshots of one or more disks. * * @remarks * You can set `InstanceId` to create a snapshot-consistent group for specified disks within an instance. Alternatively, you can use only `DiskId.N` to create a snapshot-consistent group for multiple disks attached to multiple ECS instances in the same zone. * > `DiskId.N` and `ExcludeDiskId.N` cannot be specified at the same time. If `InstanceId` is specified, `DiskId.N` can only be set to disks attached to the specified instance and no longer supports specifying disk IDs across multiple instances. * When you create a snapshot-consistent group, take note of the following items: * - The disks for which you want to create snapshots must be in the **In Use** (`In_use`) or **Available** (`Available`) state. * - If a disk is in the **In Use** (`In_use`) state, the ECS instance status must be **Running** (`Running`) or **Stopped** (`Stopped`). * - If a disk is in the **Available** (`Available`) state, the disk must have been previously attached to an ECS instance. Disks that have never been attached to an ECS instance do not support snapshot creation. * - Snapshot-consistent groups support only ESSD series disks (ESSD, ESSD AutoPL, and ESSD Entry). * - A single snapshot-consistent group can contain up to 16 disks (including system disks and data disks), and the total capacity cannot exceed 32 TiB. * - Snapshots that you manually create are retained until you delete them. Delete unnecessary snapshots on a regular basis to avoid incurring ongoing snapshot size fees. * - Disks with the multi-attach attribute enabled do not support snapshot-consistent groups. If an instance has a multi-attach disk attached, set the `ExcludeDiskId.N` parameter to exclude the disk. * For more information about the features and billing of snapshot-consistent groups, see [Snapshot-consistent groups](https://help.aliyun.com/document_detail/199625.html). * * @param request - CreateSnapshotGroupRequest * @returns CreateSnapshotGroupResponse */ async createSnapshotGroup(request: $_model.CreateSnapshotGroupRequest): Promise<$_model.CreateSnapshotGroupResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createSnapshotGroupWithOptions(request, runtime); } /** * 创建一个存储集,用于在创建磁盘时打散磁盘的分布 * * @param request - CreateStorageSetRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateStorageSetResponse */ async createStorageSetWithOptions(request: $_model.CreateStorageSetRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateStorageSetResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.maxPartitionNumber)) { query["MaxPartitionNumber"] = request.maxPartitionNumber; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.storageSetName)) { query["StorageSetName"] = request.storageSetName; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateStorageSet", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateStorageSetResponse>(await this.callApi(params, req, runtime), new $_model.CreateStorageSetResponse({})); } /** * 创建一个存储集,用于在创建磁盘时打散磁盘的分布 * * @param request - CreateStorageSetRequest * @returns CreateStorageSetResponse */ async createStorageSet(request: $_model.CreateStorageSetRequest): Promise<$_model.CreateStorageSetResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createStorageSetWithOptions(request, runtime); } /** * CreateVSwitch * * @deprecated OpenAPI CreateVSwitch is deprecated, please use Vpc::2016-04-28::CreateVSwitch instead. * * @param request - CreateVSwitchRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateVSwitchResponse */ async createVSwitchWithOptions(request: $_model.CreateVSwitchRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateVSwitchResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.cidrBlock)) { query["CidrBlock"] = request.cidrBlock; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.vSwitchName)) { query["VSwitchName"] = request.vSwitchName; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateVSwitch", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateVSwitchResponse>(await this.callApi(params, req, runtime), new $_model.CreateVSwitchResponse({})); } /** * CreateVSwitch * * @deprecated OpenAPI CreateVSwitch is deprecated, please use Vpc::2016-04-28::CreateVSwitch instead. * * @param request - CreateVSwitchRequest * @returns CreateVSwitchResponse */ // Deprecated async createVSwitch(request: $_model.CreateVSwitchRequest): Promise<$_model.CreateVSwitchResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createVSwitchWithOptions(request, runtime); } /** * CreateVirtualBorderRouter * * @deprecated OpenAPI CreateVirtualBorderRouter is deprecated, please use Vpc::2016-04-28::CreateVirtualBorderRouter instead. * * @param request - CreateVirtualBorderRouterRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateVirtualBorderRouterResponse */ async createVirtualBorderRouterWithOptions(request: $_model.CreateVirtualBorderRouterRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateVirtualBorderRouterResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.circuitCode)) { query["CircuitCode"] = request.circuitCode; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.localGatewayIp)) { query["LocalGatewayIp"] = request.localGatewayIp; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.peerGatewayIp)) { query["PeerGatewayIp"] = request.peerGatewayIp; } if (!$dara.isNull(request.peeringSubnetMask)) { query["PeeringSubnetMask"] = request.peeringSubnetMask; } if (!$dara.isNull(request.physicalConnectionId)) { query["PhysicalConnectionId"] = request.physicalConnectionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } if (!$dara.isNull(request.vbrOwnerId)) { query["VbrOwnerId"] = request.vbrOwnerId; } if (!$dara.isNull(request.vlanId)) { query["VlanId"] = request.vlanId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateVirtualBorderRouter", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateVirtualBorderRouterResponse>(await this.callApi(params, req, runtime), new $_model.CreateVirtualBorderRouterResponse({})); } /** * CreateVirtualBorderRouter * * @deprecated OpenAPI CreateVirtualBorderRouter is deprecated, please use Vpc::2016-04-28::CreateVirtualBorderRouter instead. * * @param request - CreateVirtualBorderRouterRequest * @returns CreateVirtualBorderRouterResponse */ // Deprecated async createVirtualBorderRouter(request: $_model.CreateVirtualBorderRouterRequest): Promise<$_model.CreateVirtualBorderRouterResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createVirtualBorderRouterWithOptions(request, runtime); } /** * CreateVpc * * @deprecated OpenAPI CreateVpc is deprecated, please use Vpc::2016-04-28::CreateVpc instead. * * @param request - CreateVpcRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateVpcResponse */ async createVpcWithOptions(request: $_model.CreateVpcRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateVpcResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.cidrBlock)) { query["CidrBlock"] = request.cidrBlock; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } if (!$dara.isNull(request.vpcName)) { query["VpcName"] = request.vpcName; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateVpc", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateVpcResponse>(await this.callApi(params, req, runtime), new $_model.CreateVpcResponse({})); } /** * CreateVpc * * @deprecated OpenAPI CreateVpc is deprecated, please use Vpc::2016-04-28::CreateVpc instead. * * @param request - CreateVpcRequest * @returns CreateVpcResponse */ // Deprecated async createVpc(request: $_model.CreateVpcRequest): Promise<$_model.CreateVpcResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createVpcWithOptions(request, runtime); } /** * 创建Vsc * * @remarks * - 创建VSC时,需要实例规格支持,并且实例已开启VSC。 * - 单个实例上VSC Primary类型只能创建1个。 * * @param request - CreateVscRequest * @param runtime - runtime options for this request RuntimeOptions * @returns CreateVscResponse */ async createVscWithOptions(request: $_model.CreateVscRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateVscResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.vscName)) { query["VscName"] = request.vscName; } if (!$dara.isNull(request.vscType)) { query["VscType"] = request.vscType; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "CreateVsc", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.CreateVscResponse>(await this.callApi(params, req, runtime), new $_model.CreateVscResponse({})); } /** * 创建Vsc * * @remarks * - 创建VSC时,需要实例规格支持,并且实例已开启VSC。 * - 单个实例上VSC Primary类型只能创建1个。 * * @param request - CreateVscRequest * @returns CreateVscResponse */ async createVsc(request: $_model.CreateVscRequest): Promise<$_model.CreateVscResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createVscWithOptions(request, runtime); } /** * DeactivateRouterInterface * * @deprecated OpenAPI DeactivateRouterInterface is deprecated, please use Vpc::2016-04-28::DeactivateRouterInterface instead. * * @param request - DeactivateRouterInterfaceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeactivateRouterInterfaceResponse */ async deactivateRouterInterfaceWithOptions(request: $_model.DeactivateRouterInterfaceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeactivateRouterInterfaceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.routerInterfaceId)) { query["RouterInterfaceId"] = request.routerInterfaceId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeactivateRouterInterface", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeactivateRouterInterfaceResponse>(await this.callApi(params, req, runtime), new $_model.DeactivateRouterInterfaceResponse({})); } /** * DeactivateRouterInterface * * @deprecated OpenAPI DeactivateRouterInterface is deprecated, please use Vpc::2016-04-28::DeactivateRouterInterface instead. * * @param request - DeactivateRouterInterfaceRequest * @returns DeactivateRouterInterfaceResponse */ // Deprecated async deactivateRouterInterface(request: $_model.DeactivateRouterInterfaceRequest): Promise<$_model.DeactivateRouterInterfaceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deactivateRouterInterfaceWithOptions(request, runtime); } /** * Deletes an unused activation code. * * @remarks * ## [](#)Usage notes * Before you call this operation to delete an activation code, make sure that no managed instances are registered with the activation code. * * @param request - DeleteActivationRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteActivationResponse */ async deleteActivationWithOptions(request: $_model.DeleteActivationRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteActivationResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.activationId)) { query["ActivationId"] = request.activationId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteActivation", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteActivationResponse>(await this.callApi(params, req, runtime), new $_model.DeleteActivationResponse({})); } /** * Deletes an unused activation code. * * @remarks * ## [](#)Usage notes * Before you call this operation to delete an activation code, make sure that no managed instances are registered with the activation code. * * @param request - DeleteActivationRequest * @returns DeleteActivationResponse */ async deleteActivation(request: $_model.DeleteActivationRequest): Promise<$_model.DeleteActivationResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteActivationWithOptions(request, runtime); } /** * Deletes an auto provisioning group. When you call this operation, you can specify AutoProvisioningGroupId and TerminateInstances in the request. * * @param request - DeleteAutoProvisioningGroupRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteAutoProvisioningGroupResponse */ async deleteAutoProvisioningGroupWithOptions(request: $_model.DeleteAutoProvisioningGroupRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteAutoProvisioningGroupResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoProvisioningGroupId)) { query["AutoProvisioningGroupId"] = request.autoProvisioningGroupId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.terminateInstances)) { query["TerminateInstances"] = request.terminateInstances; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteAutoProvisioningGroup", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteAutoProvisioningGroupResponse>(await this.callApi(params, req, runtime), new $_model.DeleteAutoProvisioningGroupResponse({})); } /** * Deletes an auto provisioning group. When you call this operation, you can specify AutoProvisioningGroupId and TerminateInstances in the request. * * @param request - DeleteAutoProvisioningGroupRequest * @returns DeleteAutoProvisioningGroupResponse */ async deleteAutoProvisioningGroup(request: $_model.DeleteAutoProvisioningGroupRequest): Promise<$_model.DeleteAutoProvisioningGroupResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteAutoProvisioningGroupWithOptions(request, runtime); } /** * Deletes an automatic snapshot policy. After you delete an automatic snapshot policy, the policy is no longer applied to the disks on which it previously took effect. * * @param request - DeleteAutoSnapshotPolicyRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteAutoSnapshotPolicyResponse */ async deleteAutoSnapshotPolicyWithOptions(request: $_model.DeleteAutoSnapshotPolicyRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteAutoSnapshotPolicyResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.autoSnapshotPolicyId)) { query["autoSnapshotPolicyId"] = request.autoSnapshotPolicyId; } if (!$dara.isNull(request.regionId)) { query["regionId"] = request.regionId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteAutoSnapshotPolicy", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteAutoSnapshotPolicyResponse>(await this.callApi(params, req, runtime), new $_model.DeleteAutoSnapshotPolicyResponse({})); } /** * Deletes an automatic snapshot policy. After you delete an automatic snapshot policy, the policy is no longer applied to the disks on which it previously took effect. * * @param request - DeleteAutoSnapshotPolicyRequest * @returns DeleteAutoSnapshotPolicyResponse */ async deleteAutoSnapshotPolicy(request: $_model.DeleteAutoSnapshotPolicyRequest): Promise<$_model.DeleteAutoSnapshotPolicyResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteAutoSnapshotPolicyWithOptions(request, runtime); } /** * Deletes a bandwidth package. * * @param request - DeleteBandwidthPackageRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteBandwidthPackageResponse */ async deleteBandwidthPackageWithOptions(request: $_model.DeleteBandwidthPackageRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteBandwidthPackageResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.bandwidthPackageId)) { query["BandwidthPackageId"] = request.bandwidthPackageId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteBandwidthPackage", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteBandwidthPackageResponse>(await this.callApi(params, req, runtime), new $_model.DeleteBandwidthPackageResponse({})); } /** * Deletes a bandwidth package. * * @param request - DeleteBandwidthPackageRequest * @returns DeleteBandwidthPackageResponse */ async deleteBandwidthPackage(request: $_model.DeleteBandwidthPackageRequest): Promise<$_model.DeleteBandwidthPackageResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteBandwidthPackageWithOptions(request, runtime); } /** * Deletes a Cloud Assistant command in a region. This operation cannot delete Cloud Assistant commands that are being run. * * @param request - DeleteCommandRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteCommandResponse */ async deleteCommandWithOptions(request: $_model.DeleteCommandRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteCommandResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.commandId)) { query["CommandId"] = request.commandId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteCommand", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteCommandResponse>(await this.callApi(params, req, runtime), new $_model.DeleteCommandResponse({})); } /** * Deletes a Cloud Assistant command in a region. This operation cannot delete Cloud Assistant commands that are being run. * * @param request - DeleteCommandRequest * @returns DeleteCommandResponse */ async deleteCommand(request: $_model.DeleteCommandRequest): Promise<$_model.DeleteCommandResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteCommandWithOptions(request, runtime); } /** * Deletes a dedicated host group. Before you call the API operation, you must migrate the dedicated hosts in the host group to another host group. * * @param request - DeleteDedicatedHostClusterRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteDedicatedHostClusterResponse */ async deleteDedicatedHostClusterWithOptions(request: $_model.DeleteDedicatedHostClusterRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteDedicatedHostClusterResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dedicatedHostClusterId)) { query["DedicatedHostClusterId"] = request.dedicatedHostClusterId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteDedicatedHostCluster", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteDedicatedHostClusterResponse>(await this.callApi(params, req, runtime), new $_model.DeleteDedicatedHostClusterResponse({})); } /** * Deletes a dedicated host group. Before you call the API operation, you must migrate the dedicated hosts in the host group to another host group. * * @param request - DeleteDedicatedHostClusterRequest * @returns DeleteDedicatedHostClusterResponse */ async deleteDedicatedHostCluster(request: $_model.DeleteDedicatedHostClusterRequest): Promise<$_model.DeleteDedicatedHostClusterResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteDedicatedHostClusterWithOptions(request, runtime); } /** * Deletes a deployment set. * * @remarks * Before you delete a deployment set, make sure that no instances are in the deployment set. If instances exist, you must remove or release the instances before you can delete the deployment set. For more information, see [Change the deployment set of an instance](https://help.aliyun.com/document_detail/108407.html) and [Release an ECS instance](https://help.aliyun.com/document_detail/25442.html). * * @param request - DeleteDeploymentSetRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteDeploymentSetResponse */ async deleteDeploymentSetWithOptions(request: $_model.DeleteDeploymentSetRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteDeploymentSetResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.deploymentSetId)) { query["DeploymentSetId"] = request.deploymentSetId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteDeploymentSet", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteDeploymentSetResponse>(await this.callApi(params, req, runtime), new $_model.DeleteDeploymentSetResponse({})); } /** * Deletes a deployment set. * * @remarks * Before you delete a deployment set, make sure that no instances are in the deployment set. If instances exist, you must remove or release the instances before you can delete the deployment set. For more information, see [Change the deployment set of an instance](https://help.aliyun.com/document_detail/108407.html) and [Release an ECS instance](https://help.aliyun.com/document_detail/25442.html). * * @param request - DeleteDeploymentSetRequest * @returns DeleteDeploymentSetResponse */ async deleteDeploymentSet(request: $_model.DeleteDeploymentSetRequest): Promise<$_model.DeleteDeploymentSetResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteDeploymentSetWithOptions(request, runtime); } /** * Deletes diagnostic metric sets. * * @param request - DeleteDiagnosticMetricSetsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteDiagnosticMetricSetsResponse */ async deleteDiagnosticMetricSetsWithOptions(request: $_model.DeleteDiagnosticMetricSetsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteDiagnosticMetricSetsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.metricSetIds)) { query["MetricSetIds"] = request.metricSetIds; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteDiagnosticMetricSets", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteDiagnosticMetricSetsResponse>(await this.callApi(params, req, runtime), new $_model.DeleteDiagnosticMetricSetsResponse({})); } /** * Deletes diagnostic metric sets. * * @param request - DeleteDiagnosticMetricSetsRequest * @returns DeleteDiagnosticMetricSetsResponse */ async deleteDiagnosticMetricSets(request: $_model.DeleteDiagnosticMetricSetsRequest): Promise<$_model.DeleteDiagnosticMetricSetsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteDiagnosticMetricSetsWithOptions(request, runtime); } /** * Deletes diagnostic reports. * * @remarks * You can call this operation to delete the diagnostic reports that are no longer needed. * * @param request - DeleteDiagnosticReportsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteDiagnosticReportsResponse */ async deleteDiagnosticReportsWithOptions(request: $_model.DeleteDiagnosticReportsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteDiagnosticReportsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.reportIds)) { query["ReportIds"] = request.reportIds; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteDiagnosticReports", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteDiagnosticReportsResponse>(await this.callApi(params, req, runtime), new $_model.DeleteDiagnosticReportsResponse({})); } /** * Deletes diagnostic reports. * * @remarks * You can call this operation to delete the diagnostic reports that are no longer needed. * * @param request - DeleteDiagnosticReportsRequest * @returns DeleteDiagnosticReportsResponse */ async deleteDiagnosticReports(request: $_model.DeleteDiagnosticReportsRequest): Promise<$_model.DeleteDiagnosticReportsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteDiagnosticReportsWithOptions(request, runtime); } /** * Releases a pay-as-you-go data disk. Disk types include basic disks, ultra disks, standard SSDs, and enterprise SSDs. * * @remarks * When you invoke this operation, take note of the following items: * - Manual snapshots of the disk are retained. * - You can invoke [ModifyDiskAttribute](https://help.aliyun.com/document_detail/25517.html) to configure the Settings for whether to retain or release automatic snapshots together with the disk. Delete unnecessary snapshots promptly to maintain sufficient snapshot quota for epoch-based automatic snapshot policy. * - The disk must be in the Pending Attach (Available) state when you release it. * - If the disk with the specified ID does not exist, the request is ignored. * * @param request - DeleteDiskRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteDiskResponse */ async deleteDiskWithOptions(request: $_model.DeleteDiskRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteDiskResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteDisk", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteDiskResponse>(await this.callApi(params, req, runtime), new $_model.DeleteDiskResponse({})); } /** * Releases a pay-as-you-go data disk. Disk types include basic disks, ultra disks, standard SSDs, and enterprise SSDs. * * @remarks * When you invoke this operation, take note of the following items: * - Manual snapshots of the disk are retained. * - You can invoke [ModifyDiskAttribute](https://help.aliyun.com/document_detail/25517.html) to configure the Settings for whether to retain or release automatic snapshots together with the disk. Delete unnecessary snapshots promptly to maintain sufficient snapshot quota for epoch-based automatic snapshot policy. * - The disk must be in the Pending Attach (Available) state when you release it. * - If the disk with the specified ID does not exist, the request is ignored. * * @param request - DeleteDiskRequest * @returns DeleteDiskResponse */ async deleteDisk(request: $_model.DeleteDiskRequest): Promise<$_model.DeleteDiskResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteDiskWithOptions(request, runtime); } /** * Deletes a DNAT entry. * * @deprecated OpenAPI DeleteForwardEntry is deprecated, please use Vpc::2016-04-28::DeleteForwardEntry instead. * * @param request - DeleteForwardEntryRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteForwardEntryResponse */ async deleteForwardEntryWithOptions(request: $_model.DeleteForwardEntryRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteForwardEntryResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.forwardEntryId)) { query["ForwardEntryId"] = request.forwardEntryId; } if (!$dara.isNull(request.forwardTableId)) { query["ForwardTableId"] = request.forwardTableId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteForwardEntry", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteForwardEntryResponse>(await this.callApi(params, req, runtime), new $_model.DeleteForwardEntryResponse({})); } /** * Deletes a DNAT entry. * * @deprecated OpenAPI DeleteForwardEntry is deprecated, please use Vpc::2016-04-28::DeleteForwardEntry instead. * * @param request - DeleteForwardEntryRequest * @returns DeleteForwardEntryResponse */ // Deprecated async deleteForwardEntry(request: $_model.DeleteForwardEntryRequest): Promise<$_model.DeleteForwardEntryResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteForwardEntryWithOptions(request, runtime); } /** * DeleteHaVip * * @deprecated OpenAPI DeleteHaVip is deprecated, please use Vpc::2016-04-28::DeleteHaVip instead. * * @param request - DeleteHaVipRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteHaVipResponse */ async deleteHaVipWithOptions(request: $_model.DeleteHaVipRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteHaVipResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.haVipId)) { query["HaVipId"] = request.haVipId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteHaVip", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteHaVipResponse>(await this.callApi(params, req, runtime), new $_model.DeleteHaVipResponse({})); } /** * DeleteHaVip * * @deprecated OpenAPI DeleteHaVip is deprecated, please use Vpc::2016-04-28::DeleteHaVip instead. * * @param request - DeleteHaVipRequest * @returns DeleteHaVipResponse */ // Deprecated async deleteHaVip(request: $_model.DeleteHaVipRequest): Promise<$_model.DeleteHaVipResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteHaVipWithOptions(request, runtime); } /** * Calls DeleteHpcCluster to delete an HPC cluster. * * @param request - DeleteHpcClusterRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteHpcClusterResponse */ async deleteHpcClusterWithOptions(request: $_model.DeleteHpcClusterRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteHpcClusterResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.hpcClusterId)) { query["HpcClusterId"] = request.hpcClusterId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteHpcCluster", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteHpcClusterResponse>(await this.callApi(params, req, runtime), new $_model.DeleteHpcClusterResponse({})); } /** * Calls DeleteHpcCluster to delete an HPC cluster. * * @param request - DeleteHpcClusterRequest * @returns DeleteHpcClusterResponse */ async deleteHpcCluster(request: $_model.DeleteHpcClusterRequest): Promise<$_model.DeleteHpcClusterResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteHpcClusterWithOptions(request, runtime); } /** * Calls the DeleteImage operation. You can specify the ImageId and Force parameters to delete a custom image. * * @remarks * For scenarios where deleting a custom image is not allowed and precautions after an image is deleted, see [Delete a custom image](https://help.aliyun.com/document_detail/25466.html). * * @param request - DeleteImageRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteImageResponse */ async deleteImageWithOptions(request: $_model.DeleteImageRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteImageResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.force)) { query["Force"] = request.force; } if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteImage", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteImageResponse>(await this.callApi(params, req, runtime), new $_model.DeleteImageResponse({})); } /** * Calls the DeleteImage operation. You can specify the ImageId and Force parameters to delete a custom image. * * @remarks * For scenarios where deleting a custom image is not allowed and precautions after an image is deleted, see [Delete a custom image](https://help.aliyun.com/document_detail/25466.html). * * @param request - DeleteImageRequest * @returns DeleteImageResponse */ async deleteImage(request: $_model.DeleteImageRequest): Promise<$_model.DeleteImageResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteImageWithOptions(request, runtime); } /** * Deletes an image component by specifying the RegionId and ImageComponentId parameters. * * @remarks * - Only custom image components that you have created can be deleted. * - Before deleting a component, make sure that the component is not used in any template. Otherwise, the deletion fails. * * @param request - DeleteImageComponentRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteImageComponentResponse */ async deleteImageComponentWithOptions(request: $_model.DeleteImageComponentRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteImageComponentResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.imageComponentId)) { query["ImageComponentId"] = request.imageComponentId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteImageComponent", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteImageComponentResponse>(await this.callApi(params, req, runtime), new $_model.DeleteImageComponentResponse({})); } /** * Deletes an image component by specifying the RegionId and ImageComponentId parameters. * * @remarks * - Only custom image components that you have created can be deleted. * - Before deleting a component, make sure that the component is not used in any template. Otherwise, the deletion fails. * * @param request - DeleteImageComponentRequest * @returns DeleteImageComponentResponse */ async deleteImageComponent(request: $_model.DeleteImageComponentRequest): Promise<$_model.DeleteImageComponentResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteImageComponentWithOptions(request, runtime); } /** * Deletes an image template. * * @remarks * If a build task is currently running, you cannot directly delete the template. Wait until the build task reaches a desired state: SUCCESS, FAILED, TEST_FAILED, PARTITION_SUCCESS, or CANCELLED. You can call [DescribeImagePipelineExecutions](https://help.aliyun.com/document_detail/25609.html) to query the details of build tasks. * * @param request - DeleteImagePipelineRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteImagePipelineResponse */ async deleteImagePipelineWithOptions(request: $_model.DeleteImagePipelineRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteImagePipelineResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.imagePipelineId)) { query["ImagePipelineId"] = request.imagePipelineId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteImagePipeline", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteImagePipelineResponse>(await this.callApi(params, req, runtime), new $_model.DeleteImagePipelineResponse({})); } /** * Deletes an image template. * * @remarks * If a build task is currently running, you cannot directly delete the template. Wait until the build task reaches a desired state: SUCCESS, FAILED, TEST_FAILED, PARTITION_SUCCESS, or CANCELLED. You can call [DescribeImagePipelineExecutions](https://help.aliyun.com/document_detail/25609.html) to query the details of build tasks. * * @param request - DeleteImagePipelineRequest * @returns DeleteImagePipelineResponse */ async deleteImagePipeline(request: $_model.DeleteImagePipelineRequest): Promise<$_model.DeleteImagePipelineResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteImagePipelineWithOptions(request, runtime); } /** * Deletes or releases a specified ECS instance. * * @remarks * >Warning: * After an instance is released, all physical resources used by the instance are reclaimed. All related data is permanently lost and cannot be recovered. * . * - Manual snapshots of disks are retained and continue to incur charges. You can delete them by calling [DeleteSnapshot](https://help.aliyun.com/document_detail/2679824.html). * - Whether disks attached to the instance and automatic snapshots are released depends on the parameter settings specified when they were created. Before you release an instance, you can call [DescribeDisks](https://help.aliyun.com/document_detail/2679767.html) and [ModifyDiskAttribute](https://help.aliyun.com/document_detail/2679770.html) to query and modify the related parameter settings: * - If `DeleteWithInstance=false`, the disk is converted to a pay-as-you-go disk and retained. Otherwise, the disk is released along with the instance. * - If `DeleteAutoSnapshot=false`, automatic snapshots are retained. Otherwise, they are released along with the instance. * - Elastic IP addresses (EIPs) are not released along with the instance. You can call [ReleaseEipAddress](https://help.aliyun.com/document_detail/448702.html) to release them. * >Notice: For a security-locked instance, even if the `DeleteWithInstance` parameter of a disk is set to `false`, this attribute is ignored and the disk is released along with the instance.. * * @param request - DeleteInstanceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteInstanceResponse */ async deleteInstanceWithOptions(request: $_model.DeleteInstanceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteInstanceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.force)) { query["Force"] = request.force; } if (!$dara.isNull(request.forceStop)) { query["ForceStop"] = request.forceStop; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.terminateSubscription)) { query["TerminateSubscription"] = request.terminateSubscription; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteInstance", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteInstanceResponse>(await this.callApi(params, req, runtime), new $_model.DeleteInstanceResponse({})); } /** * Deletes or releases a specified ECS instance. * * @remarks * >Warning: * After an instance is released, all physical resources used by the instance are reclaimed. All related data is permanently lost and cannot be recovered. * . * - Manual snapshots of disks are retained and continue to incur charges. You can delete them by calling [DeleteSnapshot](https://help.aliyun.com/document_detail/2679824.html). * - Whether disks attached to the instance and automatic snapshots are released depends on the parameter settings specified when they were created. Before you release an instance, you can call [DescribeDisks](https://help.aliyun.com/document_detail/2679767.html) and [ModifyDiskAttribute](https://help.aliyun.com/document_detail/2679770.html) to query and modify the related parameter settings: * - If `DeleteWithInstance=false`, the disk is converted to a pay-as-you-go disk and retained. Otherwise, the disk is released along with the instance. * - If `DeleteAutoSnapshot=false`, automatic snapshots are retained. Otherwise, they are released along with the instance. * - Elastic IP addresses (EIPs) are not released along with the instance. You can call [ReleaseEipAddress](https://help.aliyun.com/document_detail/448702.html) to release them. * >Notice: For a security-locked instance, even if the `DeleteWithInstance` parameter of a disk is set to `false`, this attribute is ignored and the disk is released along with the instance.. * * @param request - DeleteInstanceRequest * @returns DeleteInstanceResponse */ async deleteInstance(request: $_model.DeleteInstanceRequest): Promise<$_model.DeleteInstanceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteInstanceWithOptions(request, runtime); } /** * Deletes or releases multiple pay-as-you-go instances or expired subscription instances in a batch. You can use parameters to specify whether to release or convert cloud disks to pay-as-you-go disks and retain them. * * @remarks * >Warning: * After an instance is released, all physical resources used by the instance are reclaimed. All related data is permanently lost and cannot be recovered. * . * - Manual snapshots of cloud disks are retained and continue to incur charges. You can call [DeleteSnapshot](https://help.aliyun.com/document_detail/2679824.html) to delete them. * - Whether cloud disks and automatic snapshots attached to the instance are released depends on the parameter settings specified when they were created. Before you release an instance, you can call [DescribeDisks](https://help.aliyun.com/document_detail/2679767.html) and [ModifyDiskAttribute](https://help.aliyun.com/document_detail/2679770.html) to query and modify the related parameter settings: * - If `DeleteWithInstance=false`, the cloud disk is converted to a pay-as-you-go cloud disk and retained. Otherwise, the cloud disk is released along with the instance. * - If `DeleteAutoSnapshot=false`, the automatic snapshots are retained. Otherwise, the automatic snapshots are released along with the instance. * - Elastic IP addresses (EIPs) are not released along with the instance. You can call [ReleaseEipAddress](https://help.aliyun.com/document_detail/448702.html) to release them. * >Notice: For security-locked instances, even if the `DeleteWithInstance` parameter of a cloud disk is set to `false`, this attribute is ignored and the cloud disk is released along with the instance.. * * @param request - DeleteInstancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteInstancesResponse */ async deleteInstancesWithOptions(request: $_model.DeleteInstancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteInstancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.force)) { query["Force"] = request.force; } if (!$dara.isNull(request.forceStop)) { query["ForceStop"] = request.forceStop; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.terminateSubscription)) { query["TerminateSubscription"] = request.terminateSubscription; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteInstances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteInstancesResponse>(await this.callApi(params, req, runtime), new $_model.DeleteInstancesResponse({})); } /** * Deletes or releases multiple pay-as-you-go instances or expired subscription instances in a batch. You can use parameters to specify whether to release or convert cloud disks to pay-as-you-go disks and retain them. * * @remarks * >Warning: * After an instance is released, all physical resources used by the instance are reclaimed. All related data is permanently lost and cannot be recovered. * . * - Manual snapshots of cloud disks are retained and continue to incur charges. You can call [DeleteSnapshot](https://help.aliyun.com/document_detail/2679824.html) to delete them. * - Whether cloud disks and automatic snapshots attached to the instance are released depends on the parameter settings specified when they were created. Before you release an instance, you can call [DescribeDisks](https://help.aliyun.com/document_detail/2679767.html) and [ModifyDiskAttribute](https://help.aliyun.com/document_detail/2679770.html) to query and modify the related parameter settings: * - If `DeleteWithInstance=false`, the cloud disk is converted to a pay-as-you-go cloud disk and retained. Otherwise, the cloud disk is released along with the instance. * - If `DeleteAutoSnapshot=false`, the automatic snapshots are retained. Otherwise, the automatic snapshots are released along with the instance. * - Elastic IP addresses (EIPs) are not released along with the instance. You can call [ReleaseEipAddress](https://help.aliyun.com/document_detail/448702.html) to release them. * >Notice: For security-locked instances, even if the `DeleteWithInstance` parameter of a cloud disk is set to `false`, this attribute is ignored and the cloud disk is released along with the instance.. * * @param request - DeleteInstancesRequest * @returns DeleteInstancesResponse */ async deleteInstances(request: $_model.DeleteInstancesRequest): Promise<$_model.DeleteInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteInstancesWithOptions(request, runtime); } /** * Call DeleteKeyPairs to delete one or more SSH key pairs. * * @remarks * After you delete an SSH key pair, take note of the following items: * - You cannot query the SSH key pair by calling [DescribeKeyPairs](https://help.aliyun.com/document_detail/51773.html). * - If an ECS instance is bound to the SSH key pair, the SSH key pair cannot be deleted. * * @param request - DeleteKeyPairsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteKeyPairsResponse */ async deleteKeyPairsWithOptions(request: $_model.DeleteKeyPairsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteKeyPairsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.keyPairNames)) { query["KeyPairNames"] = request.keyPairNames; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteKeyPairs", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteKeyPairsResponse>(await this.callApi(params, req, runtime), new $_model.DeleteKeyPairsResponse({})); } /** * Call DeleteKeyPairs to delete one or more SSH key pairs. * * @remarks * After you delete an SSH key pair, take note of the following items: * - You cannot query the SSH key pair by calling [DescribeKeyPairs](https://help.aliyun.com/document_detail/51773.html). * - If an ECS instance is bound to the SSH key pair, the SSH key pair cannot be deleted. * * @param request - DeleteKeyPairsRequest * @returns DeleteKeyPairsResponse */ async deleteKeyPairs(request: $_model.DeleteKeyPairsRequest): Promise<$_model.DeleteKeyPairsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteKeyPairsWithOptions(request, runtime); } /** * Deletes a launch template in a specified region by specifying the LaunchTemplateId or LaunchTemplateName parameter. * * @remarks * Take note of the following items: * - After you delete a launch template, ECS instances that were created by using the launch template are not affected. * - After you delete a launch template, all versions of the template are also deleted and cannot be recovered. If you want to delete only a specific version of a launch template, see [DeleteLaunchTemplateVersion](https://help.aliyun.com/document_detail/2679735.html). * * @param request - DeleteLaunchTemplateRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteLaunchTemplateResponse */ async deleteLaunchTemplateWithOptions(request: $_model.DeleteLaunchTemplateRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteLaunchTemplateResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.launchTemplateId)) { query["LaunchTemplateId"] = request.launchTemplateId; } if (!$dara.isNull(request.launchTemplateName)) { query["LaunchTemplateName"] = request.launchTemplateName; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteLaunchTemplate", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteLaunchTemplateResponse>(await this.callApi(params, req, runtime), new $_model.DeleteLaunchTemplateResponse({})); } /** * Deletes a launch template in a specified region by specifying the LaunchTemplateId or LaunchTemplateName parameter. * * @remarks * Take note of the following items: * - After you delete a launch template, ECS instances that were created by using the launch template are not affected. * - After you delete a launch template, all versions of the template are also deleted and cannot be recovered. If you want to delete only a specific version of a launch template, see [DeleteLaunchTemplateVersion](https://help.aliyun.com/document_detail/2679735.html). * * @param request - DeleteLaunchTemplateRequest * @returns DeleteLaunchTemplateResponse */ async deleteLaunchTemplate(request: $_model.DeleteLaunchTemplateRequest): Promise<$_model.DeleteLaunchTemplateResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteLaunchTemplateWithOptions(request, runtime); } /** * Deletes one or more versions of a specified launch template by specifying parameters such as LaunchTemplateId and DeleteVersion. * * @remarks * When you call this operation, take note of the following items: * - The default version cannot be deleted. You must delete the entire launch template to remove the default version. * - If the version you want to delete is the default version, you can call [ModifyLaunchTemplateDefaultVersion](https://help.aliyun.com/document_detail/2679734.html) or switch the default version in the **Launch Template** console, and then perform the delete operation. * - Deleting a version does not affect instances that were already created from that version. * * @param request - DeleteLaunchTemplateVersionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteLaunchTemplateVersionResponse */ async deleteLaunchTemplateVersionWithOptions(request: $_model.DeleteLaunchTemplateVersionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteLaunchTemplateVersionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.deleteVersion)) { query["DeleteVersion"] = request.deleteVersion; } if (!$dara.isNull(request.launchTemplateId)) { query["LaunchTemplateId"] = request.launchTemplateId; } if (!$dara.isNull(request.launchTemplateName)) { query["LaunchTemplateName"] = request.launchTemplateName; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteLaunchTemplateVersion", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteLaunchTemplateVersionResponse>(await this.callApi(params, req, runtime), new $_model.DeleteLaunchTemplateVersionResponse({})); } /** * Deletes one or more versions of a specified launch template by specifying parameters such as LaunchTemplateId and DeleteVersion. * * @remarks * When you call this operation, take note of the following items: * - The default version cannot be deleted. You must delete the entire launch template to remove the default version. * - If the version you want to delete is the default version, you can call [ModifyLaunchTemplateDefaultVersion](https://help.aliyun.com/document_detail/2679734.html) or switch the default version in the **Launch Template** console, and then perform the delete operation. * - Deleting a version does not affect instances that were already created from that version. * * @param request - DeleteLaunchTemplateVersionRequest * @returns DeleteLaunchTemplateVersionResponse */ async deleteLaunchTemplateVersion(request: $_model.DeleteLaunchTemplateVersionRequest): Promise<$_model.DeleteLaunchTemplateVersionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteLaunchTemplateVersionWithOptions(request, runtime); } /** * DeleteNatGateway * * @deprecated OpenAPI DeleteNatGateway is deprecated, please use Vpc::2016-04-28::DeleteNatGateway instead. * * @param request - DeleteNatGatewayRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteNatGatewayResponse */ async deleteNatGatewayWithOptions(request: $_model.DeleteNatGatewayRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteNatGatewayResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.natGatewayId)) { query["NatGatewayId"] = request.natGatewayId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteNatGateway", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteNatGatewayResponse>(await this.callApi(params, req, runtime), new $_model.DeleteNatGatewayResponse({})); } /** * DeleteNatGateway * * @deprecated OpenAPI DeleteNatGateway is deprecated, please use Vpc::2016-04-28::DeleteNatGateway instead. * * @param request - DeleteNatGatewayRequest * @returns DeleteNatGatewayResponse */ // Deprecated async deleteNatGateway(request: $_model.DeleteNatGatewayRequest): Promise<$_model.DeleteNatGatewayResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteNatGatewayWithOptions(request, runtime); } /** * Deletes an elastic network interface (ENI) in a region. DeleteNetworkInterface is an asynchronous operation. * * @remarks * Take note of the following items: * - The ENI to be deleted must be in the Available state. * - If the ENI to be deleted is attached to an Elastic Compute Service (ECS) instance, you must detach the ENI from the instance before you can delete the ENI. To detach the ENI, you can call the [DetachNetworkInterface](https://help.aliyun.com/document_detail/58514.html) operation. * - After an ENI is deleted, the following situations occur: * - All private IP addresses (including primary and secondary private IP addresses) of the ENI are automatically released. * - The ENI is automatically removed from all security groups. * - The DeleteNetworkInterface operation is an asynchronous operation. After this operation is called to delete an ENI, you can check the status or events of the ENI to determine whether the ENI is deleted. The following figure shows the transitions between the states of the ENI. * ![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/en-US/20230223/krcd/DeleteNetworkInterface.png) * - If the ENI is in the Deleting state, the ENI deletion request is sent and the ENI is being deleted. * - If the ENI is not found, the ENI is deleted. * - If the ENI is stuck in the Deleting state, the ENI fails to be deleted. You can re-initiate the request to delete the ENI. * For information about examples on how to call the DeleteNetworkInterface operation, see [Delete an ENI](https://help.aliyun.com/document_detail/471553.html). * * @param request - DeleteNetworkInterfaceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteNetworkInterfaceResponse */ async deleteNetworkInterfaceWithOptions(request: $_model.DeleteNetworkInterfaceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteNetworkInterfaceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteNetworkInterface", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteNetworkInterfaceResponse>(await this.callApi(params, req, runtime), new $_model.DeleteNetworkInterfaceResponse({})); } /** * Deletes an elastic network interface (ENI) in a region. DeleteNetworkInterface is an asynchronous operation. * * @remarks * Take note of the following items: * - The ENI to be deleted must be in the Available state. * - If the ENI to be deleted is attached to an Elastic Compute Service (ECS) instance, you must detach the ENI from the instance before you can delete the ENI. To detach the ENI, you can call the [DetachNetworkInterface](https://help.aliyun.com/document_detail/58514.html) operation. * - After an ENI is deleted, the following situations occur: * - All private IP addresses (including primary and secondary private IP addresses) of the ENI are automatically released. * - The ENI is automatically removed from all security groups. * - The DeleteNetworkInterface operation is an asynchronous operation. After this operation is called to delete an ENI, you can check the status or events of the ENI to determine whether the ENI is deleted. The following figure shows the transitions between the states of the ENI. * ![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/en-US/20230223/krcd/DeleteNetworkInterface.png) * - If the ENI is in the Deleting state, the ENI deletion request is sent and the ENI is being deleted. * - If the ENI is not found, the ENI is deleted. * - If the ENI is stuck in the Deleting state, the ENI fails to be deleted. You can re-initiate the request to delete the ENI. * For information about examples on how to call the DeleteNetworkInterface operation, see [Delete an ENI](https://help.aliyun.com/document_detail/471553.html). * * @param request - DeleteNetworkInterfaceRequest * @returns DeleteNetworkInterfaceResponse */ async deleteNetworkInterface(request: $_model.DeleteNetworkInterfaceRequest): Promise<$_model.DeleteNetworkInterfaceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteNetworkInterfaceWithOptions(request, runtime); } /** * Deletes a permission for an elastic network interface. * * @deprecated OpenAPI DeleteNetworkInterfacePermission is deprecated, please use Ecs::2014-05-26::DeleteNetworkInterface instead. * * @param request - DeleteNetworkInterfacePermissionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteNetworkInterfacePermissionResponse */ async deleteNetworkInterfacePermissionWithOptions(request: $_model.DeleteNetworkInterfacePermissionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteNetworkInterfacePermissionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.force)) { query["Force"] = request.force; } if (!$dara.isNull(request.networkInterfacePermissionId)) { query["NetworkInterfacePermissionId"] = request.networkInterfacePermissionId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteNetworkInterfacePermission", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteNetworkInterfacePermissionResponse>(await this.callApi(params, req, runtime), new $_model.DeleteNetworkInterfacePermissionResponse({})); } /** * Deletes a permission for an elastic network interface. * * @deprecated OpenAPI DeleteNetworkInterfacePermission is deprecated, please use Ecs::2014-05-26::DeleteNetworkInterface instead. * * @param request - DeleteNetworkInterfacePermissionRequest * @returns DeleteNetworkInterfacePermissionResponse */ // Deprecated async deleteNetworkInterfacePermission(request: $_model.DeleteNetworkInterfacePermissionRequest): Promise<$_model.DeleteNetworkInterfacePermissionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteNetworkInterfacePermissionWithOptions(request, runtime); } /** * Deletes a physical connection. * * @deprecated OpenAPI DeletePhysicalConnection is deprecated, please use Vpc::2016-04-28::DeletePhysicalConnection instead. * * @param request - DeletePhysicalConnectionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeletePhysicalConnectionResponse */ async deletePhysicalConnectionWithOptions(request: $_model.DeletePhysicalConnectionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeletePhysicalConnectionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.physicalConnectionId)) { query["PhysicalConnectionId"] = request.physicalConnectionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeletePhysicalConnection", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeletePhysicalConnectionResponse>(await this.callApi(params, req, runtime), new $_model.DeletePhysicalConnectionResponse({})); } /** * Deletes a physical connection. * * @deprecated OpenAPI DeletePhysicalConnection is deprecated, please use Vpc::2016-04-28::DeletePhysicalConnection instead. * * @param request - DeletePhysicalConnectionRequest * @returns DeletePhysicalConnectionResponse */ // Deprecated async deletePhysicalConnection(request: $_model.DeletePhysicalConnectionRequest): Promise<$_model.DeletePhysicalConnectionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deletePhysicalConnectionWithOptions(request, runtime); } /** * Deletes a maintenance window. * * @param request - DeletePlanMaintenanceWindowRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeletePlanMaintenanceWindowResponse */ async deletePlanMaintenanceWindowWithOptions(request: $_model.DeletePlanMaintenanceWindowRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeletePlanMaintenanceWindowResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.planWindowId)) { query["PlanWindowId"] = request.planWindowId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeletePlanMaintenanceWindow", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeletePlanMaintenanceWindowResponse>(await this.callApi(params, req, runtime), new $_model.DeletePlanMaintenanceWindowResponse({})); } /** * Deletes a maintenance window. * * @param request - DeletePlanMaintenanceWindowRequest * @returns DeletePlanMaintenanceWindowResponse */ async deletePlanMaintenanceWindow(request: $_model.DeletePlanMaintenanceWindowRequest): Promise<$_model.DeletePlanMaintenanceWindowResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deletePlanMaintenanceWindowWithOptions(request, runtime); } /** * Deletes a port list and all entries in the port list. * * @param request - DeletePortRangeListRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeletePortRangeListResponse */ async deletePortRangeListWithOptions(request: $_model.DeletePortRangeListRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeletePortRangeListResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.portRangeListId)) { query["PortRangeListId"] = request.portRangeListId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeletePortRangeList", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeletePortRangeListResponse>(await this.callApi(params, req, runtime), new $_model.DeletePortRangeListResponse({})); } /** * Deletes a port list and all entries in the port list. * * @param request - DeletePortRangeListRequest * @returns DeletePortRangeListResponse */ async deletePortRangeList(request: $_model.DeletePortRangeListRequest): Promise<$_model.DeletePortRangeListResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deletePortRangeListWithOptions(request, runtime); } /** * Calls DeletePrefixList to delete a specified prefix list and all entries in the prefix list. * * @remarks * If a prefix list is associated with other resources, you cannot directly delete it. Dissociate the prefix list from the other resources first, and then delete it. You can call [DescribePrefixListAssociations](https://help.aliyun.com/document_detail/204724.html) to query the resources associated with a specified prefix list. * * @param request - DeletePrefixListRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeletePrefixListResponse */ async deletePrefixListWithOptions(request: $_model.DeletePrefixListRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeletePrefixListResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.prefixListId)) { query["PrefixListId"] = request.prefixListId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeletePrefixList", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeletePrefixListResponse>(await this.callApi(params, req, runtime), new $_model.DeletePrefixListResponse({})); } /** * Calls DeletePrefixList to delete a specified prefix list and all entries in the prefix list. * * @remarks * If a prefix list is associated with other resources, you cannot directly delete it. Dissociate the prefix list from the other resources first, and then delete it. You can call [DescribePrefixListAssociations](https://help.aliyun.com/document_detail/204724.html) to query the resources associated with a specified prefix list. * * @param request - DeletePrefixListRequest * @returns DeletePrefixListResponse */ async deletePrefixList(request: $_model.DeletePrefixListRequest): Promise<$_model.DeletePrefixListResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deletePrefixListWithOptions(request, runtime); } /** * DeleteRouteEntry * * @deprecated OpenAPI DeleteRouteEntry is deprecated, please use Vpc::2016-04-28::DeleteRouteEntry instead. * * @param request - DeleteRouteEntryRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteRouteEntryResponse */ async deleteRouteEntryWithOptions(request: $_model.DeleteRouteEntryRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteRouteEntryResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.destinationCidrBlock)) { query["DestinationCidrBlock"] = request.destinationCidrBlock; } if (!$dara.isNull(request.nextHopId)) { query["NextHopId"] = request.nextHopId; } if (!$dara.isNull(request.nextHopList)) { query["NextHopList"] = request.nextHopList; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.routeTableId)) { query["RouteTableId"] = request.routeTableId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteRouteEntry", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteRouteEntryResponse>(await this.callApi(params, req, runtime), new $_model.DeleteRouteEntryResponse({})); } /** * DeleteRouteEntry * * @deprecated OpenAPI DeleteRouteEntry is deprecated, please use Vpc::2016-04-28::DeleteRouteEntry instead. * * @param request - DeleteRouteEntryRequest * @returns DeleteRouteEntryResponse */ // Deprecated async deleteRouteEntry(request: $_model.DeleteRouteEntryRequest): Promise<$_model.DeleteRouteEntryResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteRouteEntryWithOptions(request, runtime); } /** * DeleteRouterInterface * * @deprecated OpenAPI DeleteRouterInterface is deprecated, please use Vpc::2016-04-28::DeleteRouterInterface instead. * * @param request - DeleteRouterInterfaceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteRouterInterfaceResponse */ async deleteRouterInterfaceWithOptions(request: $_model.DeleteRouterInterfaceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteRouterInterfaceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.routerInterfaceId)) { query["RouterInterfaceId"] = request.routerInterfaceId; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteRouterInterface", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteRouterInterfaceResponse>(await this.callApi(params, req, runtime), new $_model.DeleteRouterInterfaceResponse({})); } /** * DeleteRouterInterface * * @deprecated OpenAPI DeleteRouterInterface is deprecated, please use Vpc::2016-04-28::DeleteRouterInterface instead. * * @param request - DeleteRouterInterfaceRequest * @returns DeleteRouterInterfaceResponse */ // Deprecated async deleteRouterInterface(request: $_model.DeleteRouterInterfaceRequest): Promise<$_model.DeleteRouterInterfaceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteRouterInterfaceWithOptions(request, runtime); } /** * Deletes a security group and all security group rules in the security group. * * @remarks * - Make sure that no Elastic Compute Service (ECS) instances exist in the security group. You can query instances by calling the [DescribeInstances](https://help.aliyun.com/document_detail/2679689.html) operation. * - Make sure that no elastic network interfaces (ENIs) exist in the security group. You can query ENIs by calling the [DescribeNetworkInterfaces](https://help.aliyun.com/document_detail/2679884.html) operation. * - Make sure that the security group that you want to delete is not referenced by rules of other security groups. You can query the associations by calling the [DescribeSecurityGroupReferences](https://help.aliyun.com/document_detail/57320.html) operation. * - If the `InvalidOperation.DeletionProtection` error code is returned when you call the DeleteSecurityGroup operation to delete a security group, the deletion protection feature is enabled for the security group. When you create a Container Service for Kubernetes (ACK) cluster, the deletion protection feature is enabled for an associated security group to prevent accidental deletion. You cannot manually disable the deletion protection feature for the security group. The deletion protection feature can be automatically disabled only after the ACK cluster is deleted. For more information, see the [Disable deletion protection for a security group](https://help.aliyun.com/document_detail/353191.html) section of the "Configure and manage security groups for an ACK cluster" topic. * * @param request - DeleteSecurityGroupRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteSecurityGroupResponse */ async deleteSecurityGroupWithOptions(request: $_model.DeleteSecurityGroupRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteSecurityGroupResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteSecurityGroup", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteSecurityGroupResponse>(await this.callApi(params, req, runtime), new $_model.DeleteSecurityGroupResponse({})); } /** * Deletes a security group and all security group rules in the security group. * * @remarks * - Make sure that no Elastic Compute Service (ECS) instances exist in the security group. You can query instances by calling the [DescribeInstances](https://help.aliyun.com/document_detail/2679689.html) operation. * - Make sure that no elastic network interfaces (ENIs) exist in the security group. You can query ENIs by calling the [DescribeNetworkInterfaces](https://help.aliyun.com/document_detail/2679884.html) operation. * - Make sure that the security group that you want to delete is not referenced by rules of other security groups. You can query the associations by calling the [DescribeSecurityGroupReferences](https://help.aliyun.com/document_detail/57320.html) operation. * - If the `InvalidOperation.DeletionProtection` error code is returned when you call the DeleteSecurityGroup operation to delete a security group, the deletion protection feature is enabled for the security group. When you create a Container Service for Kubernetes (ACK) cluster, the deletion protection feature is enabled for an associated security group to prevent accidental deletion. You cannot manually disable the deletion protection feature for the security group. The deletion protection feature can be automatically disabled only after the ACK cluster is deleted. For more information, see the [Disable deletion protection for a security group](https://help.aliyun.com/document_detail/353191.html) section of the "Configure and manage security groups for an ACK cluster" topic. * * @param request - DeleteSecurityGroupRequest * @returns DeleteSecurityGroupResponse */ async deleteSecurityGroup(request: $_model.DeleteSecurityGroupRequest): Promise<$_model.DeleteSecurityGroupResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteSecurityGroupWithOptions(request, runtime); } /** * Deletes a specified snapshot. You can also call this operation to cancel a snapshot that is being created. * * @remarks * When you invoke this operation, note the following items: * - If the specified snapshot ID does not exist, the request is ignored. * - If the snapshot has been used to create a custom image, the snapshot cannot be deleted. You must first delete the custom image ([DeleteImage](https://help.aliyun.com/document_detail/25537.html)) before you can delete the snapshot. * - If the snapshot has been used to create a cloud disk and the `Force` parameter is not set or is set to `Force=false`, the snapshot cannot be directly deleted. To delete the snapshot, set `Force=true` to force delete it. After the snapshot is force deleted, the corresponding cloud disk cannot be reinitialized. * * @param request - DeleteSnapshotRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteSnapshotResponse */ async deleteSnapshotWithOptions(request: $_model.DeleteSnapshotRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteSnapshotResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.force)) { query["Force"] = request.force; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.snapshotId)) { query["SnapshotId"] = request.snapshotId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteSnapshot", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteSnapshotResponse>(await this.callApi(params, req, runtime), new $_model.DeleteSnapshotResponse({})); } /** * Deletes a specified snapshot. You can also call this operation to cancel a snapshot that is being created. * * @remarks * When you invoke this operation, note the following items: * - If the specified snapshot ID does not exist, the request is ignored. * - If the snapshot has been used to create a custom image, the snapshot cannot be deleted. You must first delete the custom image ([DeleteImage](https://help.aliyun.com/document_detail/25537.html)) before you can delete the snapshot. * - If the snapshot has been used to create a cloud disk and the `Force` parameter is not set or is set to `Force=false`, the snapshot cannot be directly deleted. To delete the snapshot, set `Force=true` to force delete it. After the snapshot is force deleted, the corresponding cloud disk cannot be reinitialized. * * @param request - DeleteSnapshotRequest * @returns DeleteSnapshotResponse */ async deleteSnapshot(request: $_model.DeleteSnapshotRequest): Promise<$_model.DeleteSnapshotResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteSnapshotWithOptions(request, runtime); } /** * Deletes a snapshot-consistent group. * * @remarks * If disk snapshots in a snapshot-consistent group have been used to create custom images, the related disk snapshots are not deleted when the snapshot-consistent group is deleted. To delete the related disk snapshots, first delete the custom images ([DeleteImage](https://help.aliyun.com/document_detail/25537.html)), and then delete the related disk snapshots ([DeleteSnapshot](https://help.aliyun.com/document_detail/25525.html)). * * @param request - DeleteSnapshotGroupRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteSnapshotGroupResponse */ async deleteSnapshotGroupWithOptions(request: $_model.DeleteSnapshotGroupRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteSnapshotGroupResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.snapshotGroupId)) { query["SnapshotGroupId"] = request.snapshotGroupId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteSnapshotGroup", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteSnapshotGroupResponse>(await this.callApi(params, req, runtime), new $_model.DeleteSnapshotGroupResponse({})); } /** * Deletes a snapshot-consistent group. * * @remarks * If disk snapshots in a snapshot-consistent group have been used to create custom images, the related disk snapshots are not deleted when the snapshot-consistent group is deleted. To delete the related disk snapshots, first delete the custom images ([DeleteImage](https://help.aliyun.com/document_detail/25537.html)), and then delete the related disk snapshots ([DeleteSnapshot](https://help.aliyun.com/document_detail/25525.html)). * * @param request - DeleteSnapshotGroupRequest * @returns DeleteSnapshotGroupResponse */ async deleteSnapshotGroup(request: $_model.DeleteSnapshotGroupRequest): Promise<$_model.DeleteSnapshotGroupResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteSnapshotGroupWithOptions(request, runtime); } /** * 删除一个指定的存储集 * * @param request - DeleteStorageSetRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteStorageSetResponse */ async deleteStorageSetWithOptions(request: $_model.DeleteStorageSetRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteStorageSetResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.storageSetId)) { query["StorageSetId"] = request.storageSetId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteStorageSet", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteStorageSetResponse>(await this.callApi(params, req, runtime), new $_model.DeleteStorageSetResponse({})); } /** * 删除一个指定的存储集 * * @param request - DeleteStorageSetRequest * @returns DeleteStorageSetResponse */ async deleteStorageSet(request: $_model.DeleteStorageSetRequest): Promise<$_model.DeleteStorageSetResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteStorageSetWithOptions(request, runtime); } /** * Deletes a specified VSwitch. * * @deprecated OpenAPI DeleteVSwitch is deprecated, please use Vpc::2016-04-28::DeleteVSwitch instead. * * @param request - DeleteVSwitchRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteVSwitchResponse */ async deleteVSwitchWithOptions(request: $_model.DeleteVSwitchRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteVSwitchResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.vSwitchId)) { query["VSwitchId"] = request.vSwitchId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteVSwitch", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteVSwitchResponse>(await this.callApi(params, req, runtime), new $_model.DeleteVSwitchResponse({})); } /** * Deletes a specified VSwitch. * * @deprecated OpenAPI DeleteVSwitch is deprecated, please use Vpc::2016-04-28::DeleteVSwitch instead. * * @param request - DeleteVSwitchRequest * @returns DeleteVSwitchResponse */ // Deprecated async deleteVSwitch(request: $_model.DeleteVSwitchRequest): Promise<$_model.DeleteVSwitchResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteVSwitchWithOptions(request, runtime); } /** * Deletes a virtual border router (VBR). * * @deprecated OpenAPI DeleteVirtualBorderRouter is deprecated, please use Vpc::2016-04-28::DeleteVirtualBorderRouter instead. * * @param request - DeleteVirtualBorderRouterRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteVirtualBorderRouterResponse */ async deleteVirtualBorderRouterWithOptions(request: $_model.DeleteVirtualBorderRouterRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteVirtualBorderRouterResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } if (!$dara.isNull(request.vbrId)) { query["VbrId"] = request.vbrId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteVirtualBorderRouter", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteVirtualBorderRouterResponse>(await this.callApi(params, req, runtime), new $_model.DeleteVirtualBorderRouterResponse({})); } /** * Deletes a virtual border router (VBR). * * @deprecated OpenAPI DeleteVirtualBorderRouter is deprecated, please use Vpc::2016-04-28::DeleteVirtualBorderRouter instead. * * @param request - DeleteVirtualBorderRouterRequest * @returns DeleteVirtualBorderRouterResponse */ // Deprecated async deleteVirtualBorderRouter(request: $_model.DeleteVirtualBorderRouterRequest): Promise<$_model.DeleteVirtualBorderRouterResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteVirtualBorderRouterWithOptions(request, runtime); } /** * delete a VPC * * @deprecated OpenAPI DeleteVpc is deprecated, please use Vpc::2016-04-28::DeleteVpc instead. * * @param request - DeleteVpcRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteVpcResponse */ async deleteVpcWithOptions(request: $_model.DeleteVpcRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteVpcResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteVpc", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteVpcResponse>(await this.callApi(params, req, runtime), new $_model.DeleteVpcResponse({})); } /** * delete a VPC * * @deprecated OpenAPI DeleteVpc is deprecated, please use Vpc::2016-04-28::DeleteVpc instead. * * @param request - DeleteVpcRequest * @returns DeleteVpcResponse */ // Deprecated async deleteVpc(request: $_model.DeleteVpcRequest): Promise<$_model.DeleteVpcResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteVpcWithOptions(request, runtime); } /** * 删除虚拟存储通道 * * @remarks * 调用该接口时,您需要注意: * - VSC需要先解绑CPFS等文件系统绑定。 * - 调用释放VSC,需要实例操作系统响应,如果实例操作系统未响应,VSC删除失败进入DetachFailed状态。您可以检查操作系统是否正常,或者对实例关机后再尝试删除。 * - 释放实例时,如果实例上有VSC会随实例一并释放。 * * @param request - DeleteVscRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeleteVscResponse */ async deleteVscWithOptions(request: $_model.DeleteVscRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteVscResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.vscId)) { query["VscId"] = request.vscId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeleteVsc", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeleteVscResponse>(await this.callApi(params, req, runtime), new $_model.DeleteVscResponse({})); } /** * 删除虚拟存储通道 * * @remarks * 调用该接口时,您需要注意: * - VSC需要先解绑CPFS等文件系统绑定。 * - 调用释放VSC,需要实例操作系统响应,如果实例操作系统未响应,VSC删除失败进入DetachFailed状态。您可以检查操作系统是否正常,或者对实例关机后再尝试删除。 * - 释放实例时,如果实例上有VSC会随实例一并释放。 * * @param request - DeleteVscRequest * @returns DeleteVscResponse */ async deleteVsc(request: $_model.DeleteVscRequest): Promise<$_model.DeleteVscResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteVscWithOptions(request, runtime); } /** * You can invoke DeregisterManagedInstance to log off a managed instance. After logging off, you can no longer use Cloud Assistant to send commands or files to the instance. * * @param request - DeregisterManagedInstanceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DeregisterManagedInstanceResponse */ async deregisterManagedInstanceWithOptions(request: $_model.DeregisterManagedInstanceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DeregisterManagedInstanceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DeregisterManagedInstance", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DeregisterManagedInstanceResponse>(await this.callApi(params, req, runtime), new $_model.DeregisterManagedInstanceResponse({})); } /** * You can invoke DeregisterManagedInstance to log off a managed instance. After logging off, you can no longer use Cloud Assistant to send commands or files to the instance. * * @param request - DeregisterManagedInstanceRequest * @returns DeregisterManagedInstanceResponse */ async deregisterManagedInstance(request: $_model.DeregisterManagedInstanceRequest): Promise<$_model.DeregisterManagedInstanceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deregisterManagedInstanceWithOptions(request, runtime); } /** * Queries access points. * * @deprecated OpenAPI DescribeAccessPoints is deprecated, please use Vpc::2016-04-28::DescribeAccessPoints instead. * * @param request - DescribeAccessPointsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeAccessPointsResponse */ async describeAccessPointsWithOptions(request: $_model.DescribeAccessPointsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeAccessPointsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.filter)) { query["Filter"] = request.filter; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.type)) { query["Type"] = request.type; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeAccessPoints", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeAccessPointsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeAccessPointsResponse({})); } /** * Queries access points. * * @deprecated OpenAPI DescribeAccessPoints is deprecated, please use Vpc::2016-04-28::DescribeAccessPoints instead. * * @param request - DescribeAccessPointsRequest * @returns DescribeAccessPointsResponse */ // Deprecated async describeAccessPoints(request: $_model.DescribeAccessPointsRequest): Promise<$_model.DescribeAccessPointsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeAccessPointsWithOptions(request, runtime); } /** * Queries the quotas of Elastic Compute Service (ECS) resources that you can create in an Alibaba Cloud region. For a specific region, you can query the maximum numbers of security groups, elastic network interfaces (ENIs), vCPUs for pay-as-you-go instances, vCPUs for spot instances, and dedicated hosts that you can create and the capacity quotas for pay-as-you-go disks that you can create. You can also query information such as network types or whether an account has completed the account verification. * * @remarks * After you [create](https://account.alibabacloud.com/register/intl_register.htm) an Alibaba Cloud account, you can create a specific number of ECS instances in different regions within the account. For more information, see [Limits](https://help.aliyun.com/document_detail/25412.html). * You can apply for a quota increase in the [Quota Center console](https://quotas.console.aliyun.com/products). * * @param request - DescribeAccountAttributesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeAccountAttributesResponse */ async describeAccountAttributesWithOptions(request: $_model.DescribeAccountAttributesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeAccountAttributesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.attributeName)) { query["AttributeName"] = request.attributeName; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeAccountAttributes", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeAccountAttributesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeAccountAttributesResponse({})); } /** * Queries the quotas of Elastic Compute Service (ECS) resources that you can create in an Alibaba Cloud region. For a specific region, you can query the maximum numbers of security groups, elastic network interfaces (ENIs), vCPUs for pay-as-you-go instances, vCPUs for spot instances, and dedicated hosts that you can create and the capacity quotas for pay-as-you-go disks that you can create. You can also query information such as network types or whether an account has completed the account verification. * * @remarks * After you [create](https://account.alibabacloud.com/register/intl_register.htm) an Alibaba Cloud account, you can create a specific number of ECS instances in different regions within the account. For more information, see [Limits](https://help.aliyun.com/document_detail/25412.html). * You can apply for a quota increase in the [Quota Center console](https://quotas.console.aliyun.com/products). * * @param request - DescribeAccountAttributesRequest * @returns DescribeAccountAttributesResponse */ async describeAccountAttributes(request: $_model.DescribeAccountAttributesRequest): Promise<$_model.DescribeAccountAttributesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeAccountAttributesWithOptions(request, runtime); } /** * Queries existing activation codes and their usage information. * * @remarks * ## [](#)Usage notes * You can use one of the following methods to check the responses: * - Method 1: During a paged query, when you call the DescribeActivations operation to retrieve the first page of results, use `MaxResults` to specify the maximum number of entries to return in the call. The return value of `NextToken` is a pagination token, which you can use in the next request to retrieve a new page of results. When you call the DescribeActivations operation to retrieve a new page of results, set `NextToken` to the `NextToken` value returned in the previous call and set `MaxResults` to specify the maximum number of entries to return in this call. * - Method 2: Use `PageSize` to specify the number of entries to return on each page, and then use `PageNumber` to specify the number of the page to return. You can use only one of the preceding methods. If you specify `MaxResults` or `NextToken`, the `PageSize` and `PageNumber` request parameters do not take effect and the `TotalCount` response parameter is invalid. * * @param request - DescribeActivationsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeActivationsResponse */ async describeActivationsWithOptions(request: $_model.DescribeActivationsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeActivationsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.activationId)) { query["ActivationId"] = request.activationId; } if (!$dara.isNull(request.instanceName)) { query["InstanceName"] = request.instanceName; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeActivations", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeActivationsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeActivationsResponse({})); } /** * Queries existing activation codes and their usage information. * * @remarks * ## [](#)Usage notes * You can use one of the following methods to check the responses: * - Method 1: During a paged query, when you call the DescribeActivations operation to retrieve the first page of results, use `MaxResults` to specify the maximum number of entries to return in the call. The return value of `NextToken` is a pagination token, which you can use in the next request to retrieve a new page of results. When you call the DescribeActivations operation to retrieve a new page of results, set `NextToken` to the `NextToken` value returned in the previous call and set `MaxResults` to specify the maximum number of entries to return in this call. * - Method 2: Use `PageSize` to specify the number of entries to return on each page, and then use `PageNumber` to specify the number of the page to return. You can use only one of the preceding methods. If you specify `MaxResults` or `NextToken`, the `PageSize` and `PageNumber` request parameters do not take effect and the `TotalCount` response parameter is invalid. * * @param request - DescribeActivationsRequest * @returns DescribeActivationsResponse */ async describeActivations(request: $_model.DescribeActivationsRequest): Promise<$_model.DescribeActivationsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeActivationsWithOptions(request, runtime); } /** * Call `DescribeAutoProvisioningGroupHistory` to query the history of scheduling tasks for an auto provisioning group. * * @param request - DescribeAutoProvisioningGroupHistoryRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeAutoProvisioningGroupHistoryResponse */ async describeAutoProvisioningGroupHistoryWithOptions(request: $_model.DescribeAutoProvisioningGroupHistoryRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeAutoProvisioningGroupHistoryResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoProvisioningGroupId)) { query["AutoProvisioningGroupId"] = request.autoProvisioningGroupId; } if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeAutoProvisioningGroupHistory", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeAutoProvisioningGroupHistoryResponse>(await this.callApi(params, req, runtime), new $_model.DescribeAutoProvisioningGroupHistoryResponse({})); } /** * Call `DescribeAutoProvisioningGroupHistory` to query the history of scheduling tasks for an auto provisioning group. * * @param request - DescribeAutoProvisioningGroupHistoryRequest * @returns DescribeAutoProvisioningGroupHistoryResponse */ async describeAutoProvisioningGroupHistory(request: $_model.DescribeAutoProvisioningGroupHistoryRequest): Promise<$_model.DescribeAutoProvisioningGroupHistoryResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeAutoProvisioningGroupHistoryWithOptions(request, runtime); } /** * Queries information about instances in an auto provisioning group. * * @param request - DescribeAutoProvisioningGroupInstancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeAutoProvisioningGroupInstancesResponse */ async describeAutoProvisioningGroupInstancesWithOptions(request: $_model.DescribeAutoProvisioningGroupInstancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeAutoProvisioningGroupInstancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoProvisioningGroupId)) { query["AutoProvisioningGroupId"] = request.autoProvisioningGroupId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeAutoProvisioningGroupInstances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeAutoProvisioningGroupInstancesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeAutoProvisioningGroupInstancesResponse({})); } /** * Queries information about instances in an auto provisioning group. * * @param request - DescribeAutoProvisioningGroupInstancesRequest * @returns DescribeAutoProvisioningGroupInstancesResponse */ async describeAutoProvisioningGroupInstances(request: $_model.DescribeAutoProvisioningGroupInstancesRequest): Promise<$_model.DescribeAutoProvisioningGroupInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeAutoProvisioningGroupInstancesWithOptions(request, runtime); } /** * Queries one or more Auto Provisioning Groups. * * @param request - DescribeAutoProvisioningGroupsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeAutoProvisioningGroupsResponse */ async describeAutoProvisioningGroupsWithOptions(request: $_model.DescribeAutoProvisioningGroupsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeAutoProvisioningGroupsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoProvisioningGroupId)) { query["AutoProvisioningGroupId"] = request.autoProvisioningGroupId; } if (!$dara.isNull(request.autoProvisioningGroupName)) { query["AutoProvisioningGroupName"] = request.autoProvisioningGroupName; } if (!$dara.isNull(request.autoProvisioningGroupStatus)) { query["AutoProvisioningGroupStatus"] = request.autoProvisioningGroupStatus; } if (!$dara.isNull(request.autoProvisioningGroupTypes)) { query["AutoProvisioningGroupTypes"] = request.autoProvisioningGroupTypes; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeAutoProvisioningGroups", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeAutoProvisioningGroupsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeAutoProvisioningGroupsResponse({})); } /** * Queries one or more Auto Provisioning Groups. * * @param request - DescribeAutoProvisioningGroupsRequest * @returns DescribeAutoProvisioningGroupsResponse */ async describeAutoProvisioningGroups(request: $_model.DescribeAutoProvisioningGroupsRequest): Promise<$_model.DescribeAutoProvisioningGroupsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeAutoProvisioningGroupsWithOptions(request, runtime); } /** * Queries the associate relationships of an automatic snapshot policy. * * @param request - DescribeAutoSnapshotPolicyAssociationsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeAutoSnapshotPolicyAssociationsResponse */ async describeAutoSnapshotPolicyAssociationsWithOptions(request: $_model.DescribeAutoSnapshotPolicyAssociationsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeAutoSnapshotPolicyAssociationsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoSnapshotPolicyId)) { query["AutoSnapshotPolicyId"] = request.autoSnapshotPolicyId; } if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeAutoSnapshotPolicyAssociations", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeAutoSnapshotPolicyAssociationsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeAutoSnapshotPolicyAssociationsResponse({})); } /** * Queries the associate relationships of an automatic snapshot policy. * * @param request - DescribeAutoSnapshotPolicyAssociationsRequest * @returns DescribeAutoSnapshotPolicyAssociationsResponse */ async describeAutoSnapshotPolicyAssociations(request: $_model.DescribeAutoSnapshotPolicyAssociationsRequest): Promise<$_model.DescribeAutoSnapshotPolicyAssociationsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeAutoSnapshotPolicyAssociationsWithOptions(request, runtime); } /** * Queries the details of automatic snapshot policies that are created in a specified region. * * @param request - DescribeAutoSnapshotPolicyExRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeAutoSnapshotPolicyExResponse */ async describeAutoSnapshotPolicyExWithOptions(request: $_model.DescribeAutoSnapshotPolicyExRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeAutoSnapshotPolicyExResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoSnapshotPolicyId)) { query["AutoSnapshotPolicyId"] = request.autoSnapshotPolicyId; } if (!$dara.isNull(request.autoSnapshotPolicyName)) { query["AutoSnapshotPolicyName"] = request.autoSnapshotPolicyName; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeAutoSnapshotPolicyEx", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeAutoSnapshotPolicyExResponse>(await this.callApi(params, req, runtime), new $_model.DescribeAutoSnapshotPolicyExResponse({})); } /** * Queries the details of automatic snapshot policies that are created in a specified region. * * @param request - DescribeAutoSnapshotPolicyExRequest * @returns DescribeAutoSnapshotPolicyExResponse */ async describeAutoSnapshotPolicyEx(request: $_model.DescribeAutoSnapshotPolicyExRequest): Promise<$_model.DescribeAutoSnapshotPolicyExResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeAutoSnapshotPolicyExWithOptions(request, runtime); } /** * Queries the inventory status of resources in a specified zone. This operation is primarily used to check whether target resources, such as instance types and system disk types, are available in a specific zone before you create instances (RunInstances) or modify instance specifications (ModifyInstanceSpec). * * @remarks * The DestinationResource parameter has different logic and requirements depending on its value. In the following ordered list, a lower-ranked value requires more parameters to be set. You cannot use a lower-ranked value to filter resources of a higher-ranked category. * - Value order: `Zone > IoOptimized > InstanceType = Network = ddh > SystemDisk > DataDisk` * - Examples: * - If DestinationResource is set to `DataDisk`: * - If `ResourceType` is set to `disk`, the operation queries data disk types that are not associated with a specific ECS instance type. In this case, the InstanceType parameter is optional. * - If `ResourceType` is set to `instance`, the operation queries data disk types that can be attached to an ECS instance. Because instance types impose restrictions on data disks, you must specify both `InstanceType` and `DataDiskCategory`. * - If DestinationResource is set to `SystemDisk` and `ResourceType` is set to `instance`, you must specify the InstanceType parameter because ECS instance types impose restrictions on system disks. * - If DestinationResource is set to `InstanceType`, specify the IoOptimized and InstanceType parameters. * - Query the inventory of ecs.g5.large across all zones in a specified region: `RegionId=ap-southeast-1 &DestinationResource=InstanceType &IoOptimized=optimized &InstanceType=ecs.g5.large`. * - Query the zones in a specified region where ecs.g5.large is available: `RegionId=ap-southeast-1 &DestinationResource=Zone &IoOptimized=optimized &InstanceType=ecs.g5.large`. *
* Query the zones in the China (Hangzhou) region where the ecs.g5.large instance type is available. * ``` * "RegionId": "cn-hangzhou", * "DestinationResource": "Zone", * "InstanceType": "ecs.g5.large" * ``` *
*
* Query the inventory of the ecs.g5.large instance type across all zones in the China (Hangzhou) region. * ``` * "RegionId": "cn-hangzhou", * "DestinationResource": "InstanceType", * "InstanceType": "ecs.g5.large" * ``` *
*
* [Purchase only a data disk] Query the inventory of the cloud_efficiency data disk type in Zone B of the China (Hangzhou) region. * ``` * "RegionId": "cn-hangzhou", * "ZoneId": "cn-hangzhou-b", * "ResourceType": "disk", * "DestinationResource": "DataDisk" * ``` *
*
* [Purchase an ECS instance and a system disk] Query the inventory of the ecs.g7.large instance type with the cloud_essd system disk type in Zone B of the China (Hangzhou) region. * ``` * "RegionId": "cn-hangzhou", * "ZoneId": "cn-hangzhou-b", * "ResourceType": "instance", * "InstanceType": "ecs.g7.large", * "DestinationResource": "SystemDisk", * "SystemDiskCategory": "cloud_essd" * ``` *
* * @param request - DescribeAvailableResourceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeAvailableResourceResponse */ async describeAvailableResourceWithOptions(request: $_model.DescribeAvailableResourceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeAvailableResourceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.cores)) { query["Cores"] = request.cores; } if (!$dara.isNull(request.dataDiskCategory)) { query["DataDiskCategory"] = request.dataDiskCategory; } if (!$dara.isNull(request.dedicatedHostId)) { query["DedicatedHostId"] = request.dedicatedHostId; } if (!$dara.isNull(request.destinationResource)) { query["DestinationResource"] = request.destinationResource; } if (!$dara.isNull(request.instanceChargeType)) { query["InstanceChargeType"] = request.instanceChargeType; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.ioOptimized)) { query["IoOptimized"] = request.ioOptimized; } if (!$dara.isNull(request.memory)) { query["Memory"] = request.memory; } if (!$dara.isNull(request.networkCategory)) { query["NetworkCategory"] = request.networkCategory; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } if (!$dara.isNull(request.scope)) { query["Scope"] = request.scope; } if (!$dara.isNull(request.spotDuration)) { query["SpotDuration"] = request.spotDuration; } if (!$dara.isNull(request.spotStrategy)) { query["SpotStrategy"] = request.spotStrategy; } if (!$dara.isNull(request.systemDiskCategory)) { query["SystemDiskCategory"] = request.systemDiskCategory; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeAvailableResource", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeAvailableResourceResponse>(await this.callApi(params, req, runtime), new $_model.DescribeAvailableResourceResponse({})); } /** * Queries the inventory status of resources in a specified zone. This operation is primarily used to check whether target resources, such as instance types and system disk types, are available in a specific zone before you create instances (RunInstances) or modify instance specifications (ModifyInstanceSpec). * * @remarks * The DestinationResource parameter has different logic and requirements depending on its value. In the following ordered list, a lower-ranked value requires more parameters to be set. You cannot use a lower-ranked value to filter resources of a higher-ranked category. * - Value order: `Zone > IoOptimized > InstanceType = Network = ddh > SystemDisk > DataDisk` * - Examples: * - If DestinationResource is set to `DataDisk`: * - If `ResourceType` is set to `disk`, the operation queries data disk types that are not associated with a specific ECS instance type. In this case, the InstanceType parameter is optional. * - If `ResourceType` is set to `instance`, the operation queries data disk types that can be attached to an ECS instance. Because instance types impose restrictions on data disks, you must specify both `InstanceType` and `DataDiskCategory`. * - If DestinationResource is set to `SystemDisk` and `ResourceType` is set to `instance`, you must specify the InstanceType parameter because ECS instance types impose restrictions on system disks. * - If DestinationResource is set to `InstanceType`, specify the IoOptimized and InstanceType parameters. * - Query the inventory of ecs.g5.large across all zones in a specified region: `RegionId=ap-southeast-1 &DestinationResource=InstanceType &IoOptimized=optimized &InstanceType=ecs.g5.large`. * - Query the zones in a specified region where ecs.g5.large is available: `RegionId=ap-southeast-1 &DestinationResource=Zone &IoOptimized=optimized &InstanceType=ecs.g5.large`. *
* Query the zones in the China (Hangzhou) region where the ecs.g5.large instance type is available. * ``` * "RegionId": "cn-hangzhou", * "DestinationResource": "Zone", * "InstanceType": "ecs.g5.large" * ``` *
*
* Query the inventory of the ecs.g5.large instance type across all zones in the China (Hangzhou) region. * ``` * "RegionId": "cn-hangzhou", * "DestinationResource": "InstanceType", * "InstanceType": "ecs.g5.large" * ``` *
*
* [Purchase only a data disk] Query the inventory of the cloud_efficiency data disk type in Zone B of the China (Hangzhou) region. * ``` * "RegionId": "cn-hangzhou", * "ZoneId": "cn-hangzhou-b", * "ResourceType": "disk", * "DestinationResource": "DataDisk" * ``` *
*
* [Purchase an ECS instance and a system disk] Query the inventory of the ecs.g7.large instance type with the cloud_essd system disk type in Zone B of the China (Hangzhou) region. * ``` * "RegionId": "cn-hangzhou", * "ZoneId": "cn-hangzhou-b", * "ResourceType": "instance", * "InstanceType": "ecs.g7.large", * "DestinationResource": "SystemDisk", * "SystemDiskCategory": "cloud_essd" * ``` *
* * @param request - DescribeAvailableResourceRequest * @returns DescribeAvailableResourceResponse */ async describeAvailableResource(request: $_model.DescribeAvailableResourceRequest): Promise<$_model.DescribeAvailableResourceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeAvailableResourceWithOptions(request, runtime); } /** * Calls DescribeBandwidthLimitation to query the maximum public bandwidth that can be purchased, upgraded, or downgraded for different instance types. * * @param request - DescribeBandwidthLimitationRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeBandwidthLimitationResponse */ async describeBandwidthLimitationWithOptions(request: $_model.DescribeBandwidthLimitationRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeBandwidthLimitationResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceChargeType)) { query["InstanceChargeType"] = request.instanceChargeType; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.operationType)) { query["OperationType"] = request.operationType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceId)) { query["ResourceId"] = request.resourceId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.spotStrategy)) { query["SpotStrategy"] = request.spotStrategy; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeBandwidthLimitation", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeBandwidthLimitationResponse>(await this.callApi(params, req, runtime), new $_model.DescribeBandwidthLimitationResponse({})); } /** * Calls DescribeBandwidthLimitation to query the maximum public bandwidth that can be purchased, upgraded, or downgraded for different instance types. * * @param request - DescribeBandwidthLimitationRequest * @returns DescribeBandwidthLimitationResponse */ async describeBandwidthLimitation(request: $_model.DescribeBandwidthLimitationRequest): Promise<$_model.DescribeBandwidthLimitationResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeBandwidthLimitationWithOptions(request, runtime); } /** * DescribeBandwidthPackages * * @param request - DescribeBandwidthPackagesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeBandwidthPackagesResponse */ async describeBandwidthPackagesWithOptions(request: $_model.DescribeBandwidthPackagesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeBandwidthPackagesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.bandwidthPackageId)) { query["BandwidthPackageId"] = request.bandwidthPackageId; } if (!$dara.isNull(request.natGatewayId)) { query["NatGatewayId"] = request.natGatewayId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeBandwidthPackages", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeBandwidthPackagesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeBandwidthPackagesResponse({})); } /** * DescribeBandwidthPackages * * @param request - DescribeBandwidthPackagesRequest * @returns DescribeBandwidthPackagesResponse */ async describeBandwidthPackages(request: $_model.DescribeBandwidthPackagesRequest): Promise<$_model.DescribeBandwidthPackagesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeBandwidthPackagesWithOptions(request, runtime); } /** * Queries the Elastic Compute Service (ECS) instances that match a capacity reservation. * * @param request - DescribeCapacityReservationInstancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeCapacityReservationInstancesResponse */ async describeCapacityReservationInstancesWithOptions(request: $_model.DescribeCapacityReservationInstancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeCapacityReservationInstancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeCapacityReservationInstances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeCapacityReservationInstancesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeCapacityReservationInstancesResponse({})); } /** * Queries the Elastic Compute Service (ECS) instances that match a capacity reservation. * * @param request - DescribeCapacityReservationInstancesRequest * @returns DescribeCapacityReservationInstancesResponse */ async describeCapacityReservationInstances(request: $_model.DescribeCapacityReservationInstancesRequest): Promise<$_model.DescribeCapacityReservationInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeCapacityReservationInstancesWithOptions(request, runtime); } /** * Returns details for one or more capacity reservation services, including their status, start and end times, private pool mode, and used instance count. * * @param request - DescribeCapacityReservationsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeCapacityReservationsResponse */ async describeCapacityReservationsWithOptions(request: $_model.DescribeCapacityReservationsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeCapacityReservationsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceChargeType)) { query["InstanceChargeType"] = request.instanceChargeType; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.platform)) { query["Platform"] = request.platform; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeCapacityReservations", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeCapacityReservationsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeCapacityReservationsResponse({})); } /** * Returns details for one or more capacity reservation services, including their status, start and end times, private pool mode, and used instance count. * * @param request - DescribeCapacityReservationsRequest * @returns DescribeCapacityReservationsResponse */ async describeCapacityReservations(request: $_model.DescribeCapacityReservationsRequest): Promise<$_model.DescribeCapacityReservationsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeCapacityReservationsWithOptions(request, runtime); } /** * Queries instances located in the classic network that have established ClassicLink connections to virtual private clouds (VPCs). * * @remarks * Take note of the following items: * - This operation applies only to instances that reside in the classic network. * - You can query a maximum of 100 instances that reside in the classic network at a time. * - At least one of the `VpcId` and `InstanceId` parameters must be configured. * * @param request - DescribeClassicLinkInstancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeClassicLinkInstancesResponse */ async describeClassicLinkInstancesWithOptions(request: $_model.DescribeClassicLinkInstancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeClassicLinkInstancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeClassicLinkInstances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeClassicLinkInstancesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeClassicLinkInstancesResponse({})); } /** * Queries instances located in the classic network that have established ClassicLink connections to virtual private clouds (VPCs). * * @remarks * Take note of the following items: * - This operation applies only to instances that reside in the classic network. * - You can query a maximum of 100 instances that reside in the classic network at a time. * - At least one of the `VpcId` and `InstanceId` parameters must be configured. * * @param request - DescribeClassicLinkInstancesRequest * @returns DescribeClassicLinkInstancesResponse */ async describeClassicLinkInstances(request: $_model.DescribeClassicLinkInstancesRequest): Promise<$_model.DescribeClassicLinkInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeClassicLinkInstancesWithOptions(request, runtime); } /** * View the Cloud Assistant service configuration. * * @param request - DescribeCloudAssistantSettingsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeCloudAssistantSettingsResponse */ async describeCloudAssistantSettingsWithOptions(request: $_model.DescribeCloudAssistantSettingsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeCloudAssistantSettingsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.settingType)) { query["SettingType"] = request.settingType; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeCloudAssistantSettings", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeCloudAssistantSettingsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeCloudAssistantSettingsResponse({})); } /** * View the Cloud Assistant service configuration. * * @param request - DescribeCloudAssistantSettingsRequest * @returns DescribeCloudAssistantSettingsResponse */ async describeCloudAssistantSettings(request: $_model.DescribeCloudAssistantSettingsRequest): Promise<$_model.DescribeCloudAssistantSettingsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeCloudAssistantSettingsWithOptions(request, runtime); } /** * Queries whether Cloud Assistant Agent is installed on instances. If Cloud Assistant Agent is installed, the system queries the total number of Cloud Assistant commands that have been run, the number of Cloud Assistant commands that are being run, and the time when Cloud Assistant commands were last run. * * @remarks * ## [](#)Usage notes * - Before you run commands on or send files to instances, especially new instances, we recommend that you query the status of Cloud Assistant on the instances by calling this operation and checking the return value of CloudAssistantStatus. Run commands on or send files to the instances only when the return value is true. * - During a paged query, when you call the DescribeCloudAssistantStatus operation to retrieve the first page of results, set `MaxResults` to specify the maximum number of entries to return in the call. The return value of `NextToken` is a pagination token that can be used in the next call to retrieve a new page of results. When you call the DescribeCloudAssistantStatus operation to retrieve a new page of results, set `NextToken` to the `NextToken` value returned in the previous call and set `MaxResults` to specify the maximum number of entries to return in this call. * * @param request - DescribeCloudAssistantStatusRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeCloudAssistantStatusResponse */ async describeCloudAssistantStatusWithOptions(request: $_model.DescribeCloudAssistantStatusRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeCloudAssistantStatusResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.OSType)) { query["OSType"] = request.OSType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeCloudAssistantStatus", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeCloudAssistantStatusResponse>(await this.callApi(params, req, runtime), new $_model.DescribeCloudAssistantStatusResponse({})); } /** * Queries whether Cloud Assistant Agent is installed on instances. If Cloud Assistant Agent is installed, the system queries the total number of Cloud Assistant commands that have been run, the number of Cloud Assistant commands that are being run, and the time when Cloud Assistant commands were last run. * * @remarks * ## [](#)Usage notes * - Before you run commands on or send files to instances, especially new instances, we recommend that you query the status of Cloud Assistant on the instances by calling this operation and checking the return value of CloudAssistantStatus. Run commands on or send files to the instances only when the return value is true. * - During a paged query, when you call the DescribeCloudAssistantStatus operation to retrieve the first page of results, set `MaxResults` to specify the maximum number of entries to return in the call. The return value of `NextToken` is a pagination token that can be used in the next call to retrieve a new page of results. When you call the DescribeCloudAssistantStatus operation to retrieve a new page of results, set `NextToken` to the `NextToken` value returned in the previous call and set `MaxResults` to specify the maximum number of entries to return in this call. * * @param request - DescribeCloudAssistantStatusRequest * @returns DescribeCloudAssistantStatusResponse */ async describeCloudAssistantStatus(request: $_model.DescribeCloudAssistantStatusRequest): Promise<$_model.DescribeCloudAssistantStatusResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeCloudAssistantStatusWithOptions(request, runtime); } /** * Describes one or more clusters. * * @deprecated OpenAPI DescribeClusters is deprecated * * @param request - DescribeClustersRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeClustersResponse */ async describeClustersWithOptions(request: $_model.DescribeClustersRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeClustersResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeClusters", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeClustersResponse>(await this.callApi(params, req, runtime), new $_model.DescribeClustersResponse({})); } /** * Describes one or more clusters. * * @deprecated OpenAPI DescribeClusters is deprecated * * @param request - DescribeClustersRequest * @returns DescribeClustersResponse */ // Deprecated async describeClusters(request: $_model.DescribeClustersRequest): Promise<$_model.DescribeClustersResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeClustersWithOptions(request, runtime); } /** * You can view your custom Cloud Assistant commands or the public commands provided by Alibaba Cloud. * * @remarks * ## API * - To list all your manually created commands (`CommandId`), provide only the `Action` and `RegionId` request parameters. * - Use `MaxResults` to limit the number of items to return. If a response includes a `NextToken`, more results are available. To retrieve the next page, pass the value of this `NextToken` in your subsequent request. * * @param request - DescribeCommandsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeCommandsResponse */ async describeCommandsWithOptions(request: $_model.DescribeCommandsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeCommandsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.commandId)) { query["CommandId"] = request.commandId; } if (!$dara.isNull(request.contentEncoding)) { query["ContentEncoding"] = request.contentEncoding; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.latest)) { query["Latest"] = request.latest; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.provider)) { query["Provider"] = request.provider; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.type)) { query["Type"] = request.type; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeCommands", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeCommandsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeCommandsResponse({})); } /** * You can view your custom Cloud Assistant commands or the public commands provided by Alibaba Cloud. * * @remarks * ## API * - To list all your manually created commands (`CommandId`), provide only the `Action` and `RegionId` request parameters. * - Use `MaxResults` to limit the number of items to return. If a response includes a `NextToken`, more results are available. To retrieve the next page, pass the value of this `NextToken` in your subsequent request. * * @param request - DescribeCommandsRequest * @returns DescribeCommandsResponse */ async describeCommands(request: $_model.DescribeCommandsRequest): Promise<$_model.DescribeCommandsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeCommandsWithOptions(request, runtime); } /** * Queries the auto-renewal status of one or more subscription dedicated hosts. * * @param request - DescribeDedicatedHostAutoRenewRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeDedicatedHostAutoRenewResponse */ async describeDedicatedHostAutoRenewWithOptions(request: $_model.DescribeDedicatedHostAutoRenewRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeDedicatedHostAutoRenewResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dedicatedHostIds)) { query["DedicatedHostIds"] = request.dedicatedHostIds; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeDedicatedHostAutoRenew", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeDedicatedHostAutoRenewResponse>(await this.callApi(params, req, runtime), new $_model.DescribeDedicatedHostAutoRenewResponse({})); } /** * Queries the auto-renewal status of one or more subscription dedicated hosts. * * @param request - DescribeDedicatedHostAutoRenewRequest * @returns DescribeDedicatedHostAutoRenewResponse */ async describeDedicatedHostAutoRenew(request: $_model.DescribeDedicatedHostAutoRenewRequest): Promise<$_model.DescribeDedicatedHostAutoRenewResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDedicatedHostAutoRenewWithOptions(request, runtime); } /** * Queries the details of one or more dedicated host groups. * * @remarks * ## [](#)Usage notes * You can specify multiple request parameters to filter query results. Specified request parameters have logical AND relations. Only the specified parameters are included in the filter conditions. However, if `DedicatedHostClusterIds` is set to an empty JSON array (`[]`), this parameter is regarded as a valid filter condition and an empty result is returned. * * @param request - DescribeDedicatedHostClustersRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeDedicatedHostClustersResponse */ async describeDedicatedHostClustersWithOptions(request: $_model.DescribeDedicatedHostClustersRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeDedicatedHostClustersResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dedicatedHostClusterIds)) { query["DedicatedHostClusterIds"] = request.dedicatedHostClusterIds; } if (!$dara.isNull(request.dedicatedHostClusterName)) { query["DedicatedHostClusterName"] = request.dedicatedHostClusterName; } if (!$dara.isNull(request.lockReason)) { query["LockReason"] = request.lockReason; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeDedicatedHostClusters", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeDedicatedHostClustersResponse>(await this.callApi(params, req, runtime), new $_model.DescribeDedicatedHostClustersResponse({})); } /** * Queries the details of one or more dedicated host groups. * * @remarks * ## [](#)Usage notes * You can specify multiple request parameters to filter query results. Specified request parameters have logical AND relations. Only the specified parameters are included in the filter conditions. However, if `DedicatedHostClusterIds` is set to an empty JSON array (`[]`), this parameter is regarded as a valid filter condition and an empty result is returned. * * @param request - DescribeDedicatedHostClustersRequest * @returns DescribeDedicatedHostClustersResponse */ async describeDedicatedHostClusters(request: $_model.DescribeDedicatedHostClustersRequest): Promise<$_model.DescribeDedicatedHostClustersResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDedicatedHostClustersWithOptions(request, runtime); } /** * Queries the details of dedicated host types supported in a region, or the Elastic Compute Service (ECS) instance families supported by a specific dedicated host type. * * @param request - DescribeDedicatedHostTypesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeDedicatedHostTypesResponse */ async describeDedicatedHostTypesWithOptions(request: $_model.DescribeDedicatedHostTypesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeDedicatedHostTypesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dedicatedHostType)) { query["DedicatedHostType"] = request.dedicatedHostType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.supportedInstanceTypeFamily)) { query["SupportedInstanceTypeFamily"] = request.supportedInstanceTypeFamily; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeDedicatedHostTypes", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeDedicatedHostTypesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeDedicatedHostTypesResponse({})); } /** * Queries the details of dedicated host types supported in a region, or the Elastic Compute Service (ECS) instance families supported by a specific dedicated host type. * * @param request - DescribeDedicatedHostTypesRequest * @returns DescribeDedicatedHostTypesResponse */ async describeDedicatedHostTypes(request: $_model.DescribeDedicatedHostTypesRequest): Promise<$_model.DescribeDedicatedHostTypesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDedicatedHostTypesWithOptions(request, runtime); } /** * Use this operation to query details for one or more dedicated hosts. It returns information such as physical performance metrics, machine code, status, and a list of ECS instances on the hosts. You can filter the results by parameters like dedicated host IDs, dedicated host cluster ID, host name, or status to find specific hosts. This feature helps you efficiently manage and optimize your cloud computing resources. * * @remarks * ## API * You can query the details of one or more dedicated hosts in one of the following ways: * - Specify `DedicatedHostIds` to query specific dedicated hosts. * - Specify `DedicatedHostClusterId` to query all dedicated hosts in a dedicated host cluster. * * @param request - DescribeDedicatedHostsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeDedicatedHostsResponse */ async describeDedicatedHostsWithOptions(request: $_model.DescribeDedicatedHostsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeDedicatedHostsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dedicatedHostClusterId)) { query["DedicatedHostClusterId"] = request.dedicatedHostClusterId; } if (!$dara.isNull(request.dedicatedHostIds)) { query["DedicatedHostIds"] = request.dedicatedHostIds; } if (!$dara.isNull(request.dedicatedHostName)) { query["DedicatedHostName"] = request.dedicatedHostName; } if (!$dara.isNull(request.dedicatedHostType)) { query["DedicatedHostType"] = request.dedicatedHostType; } if (!$dara.isNull(request.lockReason)) { query["LockReason"] = request.lockReason; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.queryInventory)) { query["QueryInventory"] = request.queryInventory; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.socketDetails)) { query["SocketDetails"] = request.socketDetails; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeDedicatedHosts", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeDedicatedHostsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeDedicatedHostsResponse({})); } /** * Use this operation to query details for one or more dedicated hosts. It returns information such as physical performance metrics, machine code, status, and a list of ECS instances on the hosts. You can filter the results by parameters like dedicated host IDs, dedicated host cluster ID, host name, or status to find specific hosts. This feature helps you efficiently manage and optimize your cloud computing resources. * * @remarks * ## API * You can query the details of one or more dedicated hosts in one of the following ways: * - Specify `DedicatedHostIds` to query specific dedicated hosts. * - Specify `DedicatedHostClusterId` to query all dedicated hosts in a dedicated host cluster. * * @param request - DescribeDedicatedHostsRequest * @returns DescribeDedicatedHostsResponse */ async describeDedicatedHosts(request: $_model.DescribeDedicatedHostsRequest): Promise<$_model.DescribeDedicatedHostsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDedicatedHostsWithOptions(request, runtime); } /** * Queries the instance families that support different deployment strategies. When you call this operation, specify parameters, such as RegionId and Strategy, in the request. * * @remarks * ## [](#)Usage notes * For information about instance families, see [Overview of instance families](https://help.aliyun.com/document_detail/25378.html). * * @param request - DescribeDeploymentSetSupportedInstanceTypeFamilyRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeDeploymentSetSupportedInstanceTypeFamilyResponse */ async describeDeploymentSetSupportedInstanceTypeFamilyWithOptions(request: $_model.DescribeDeploymentSetSupportedInstanceTypeFamilyRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeDeploymentSetSupportedInstanceTypeFamilyResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.strategy)) { query["Strategy"] = request.strategy; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeDeploymentSetSupportedInstanceTypeFamily", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeDeploymentSetSupportedInstanceTypeFamilyResponse>(await this.callApi(params, req, runtime), new $_model.DescribeDeploymentSetSupportedInstanceTypeFamilyResponse({})); } /** * Queries the instance families that support different deployment strategies. When you call this operation, specify parameters, such as RegionId and Strategy, in the request. * * @remarks * ## [](#)Usage notes * For information about instance families, see [Overview of instance families](https://help.aliyun.com/document_detail/25378.html). * * @param request - DescribeDeploymentSetSupportedInstanceTypeFamilyRequest * @returns DescribeDeploymentSetSupportedInstanceTypeFamilyResponse */ async describeDeploymentSetSupportedInstanceTypeFamily(request: $_model.DescribeDeploymentSetSupportedInstanceTypeFamilyRequest): Promise<$_model.DescribeDeploymentSetSupportedInstanceTypeFamilyResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDeploymentSetSupportedInstanceTypeFamilyWithOptions(request, runtime); } /** * Describes one or more deployment sets. * * @param request - DescribeDeploymentSetsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeDeploymentSetsResponse */ async describeDeploymentSetsWithOptions(request: $_model.DescribeDeploymentSetsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeDeploymentSetsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.deploymentSetIds)) { query["DeploymentSetIds"] = request.deploymentSetIds; } if (!$dara.isNull(request.deploymentSetName)) { query["DeploymentSetName"] = request.deploymentSetName; } if (!$dara.isNull(request.domain)) { query["Domain"] = request.domain; } if (!$dara.isNull(request.granularity)) { query["Granularity"] = request.granularity; } if (!$dara.isNull(request.networkType)) { query["NetworkType"] = request.networkType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.strategy)) { query["Strategy"] = request.strategy; } if (!$dara.isNull(request.type)) { query["Type"] = request.type; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeDeploymentSets", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeDeploymentSetsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeDeploymentSetsResponse({})); } /** * Describes one or more deployment sets. * * @param request - DescribeDeploymentSetsRequest * @returns DescribeDeploymentSetsResponse */ async describeDeploymentSets(request: $_model.DescribeDeploymentSetsRequest): Promise<$_model.DescribeDeploymentSetsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDeploymentSetsWithOptions(request, runtime); } /** * Queries diagnostic metric sets. * * @param request - DescribeDiagnosticMetricSetsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeDiagnosticMetricSetsResponse */ async describeDiagnosticMetricSetsWithOptions(request: $_model.DescribeDiagnosticMetricSetsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeDiagnosticMetricSetsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.metricSetIds)) { query["MetricSetIds"] = request.metricSetIds; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } if (!$dara.isNull(request.type)) { query["Type"] = request.type; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeDiagnosticMetricSets", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeDiagnosticMetricSetsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeDiagnosticMetricSetsResponse({})); } /** * Queries diagnostic metric sets. * * @param request - DescribeDiagnosticMetricSetsRequest * @returns DescribeDiagnosticMetricSetsResponse */ async describeDiagnosticMetricSets(request: $_model.DescribeDiagnosticMetricSetsRequest): Promise<$_model.DescribeDiagnosticMetricSetsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDiagnosticMetricSetsWithOptions(request, runtime); } /** * Queries diagnostic metrics. * * @param request - DescribeDiagnosticMetricsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeDiagnosticMetricsResponse */ async describeDiagnosticMetricsWithOptions(request: $_model.DescribeDiagnosticMetricsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeDiagnosticMetricsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.metricIds)) { query["MetricIds"] = request.metricIds; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeDiagnosticMetrics", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeDiagnosticMetricsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeDiagnosticMetricsResponse({})); } /** * Queries diagnostic metrics. * * @param request - DescribeDiagnosticMetricsRequest * @returns DescribeDiagnosticMetricsResponse */ async describeDiagnosticMetrics(request: $_model.DescribeDiagnosticMetricsRequest): Promise<$_model.DescribeDiagnosticMetricsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDiagnosticMetricsWithOptions(request, runtime); } /** * Call `DescribeDiagnosticReportAttributes` to get the details of a resource diagnosis. * * @param request - DescribeDiagnosticReportAttributesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeDiagnosticReportAttributesResponse */ async describeDiagnosticReportAttributesWithOptions(request: $_model.DescribeDiagnosticReportAttributesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeDiagnosticReportAttributesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.reportId)) { query["ReportId"] = request.reportId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeDiagnosticReportAttributes", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeDiagnosticReportAttributesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeDiagnosticReportAttributesResponse({})); } /** * Call `DescribeDiagnosticReportAttributes` to get the details of a resource diagnosis. * * @param request - DescribeDiagnosticReportAttributesRequest * @returns DescribeDiagnosticReportAttributesResponse */ async describeDiagnosticReportAttributes(request: $_model.DescribeDiagnosticReportAttributesRequest): Promise<$_model.DescribeDiagnosticReportAttributesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDiagnosticReportAttributesWithOptions(request, runtime); } /** * Queries resource diagnostic reports. * * @param request - DescribeDiagnosticReportsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeDiagnosticReportsResponse */ async describeDiagnosticReportsWithOptions(request: $_model.DescribeDiagnosticReportsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeDiagnosticReportsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.reportIds)) { query["ReportIds"] = request.reportIds; } if (!$dara.isNull(request.resourceIds)) { query["ResourceIds"] = request.resourceIds; } if (!$dara.isNull(request.severity)) { query["Severity"] = request.severity; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeDiagnosticReports", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeDiagnosticReportsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeDiagnosticReportsResponse({})); } /** * Queries resource diagnostic reports. * * @param request - DescribeDiagnosticReportsRequest * @returns DescribeDiagnosticReportsResponse */ async describeDiagnosticReports(request: $_model.DescribeDiagnosticReportsRequest): Promise<$_model.DescribeDiagnosticReportsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDiagnosticReportsWithOptions(request, runtime); } /** * Queries the key used for account-level default encryption of block storage. * * @param request - DescribeDiskDefaultKMSKeyIdRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeDiskDefaultKMSKeyIdResponse */ async describeDiskDefaultKMSKeyIdWithOptions(request: $_model.DescribeDiskDefaultKMSKeyIdRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeDiskDefaultKMSKeyIdResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeDiskDefaultKMSKeyId", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeDiskDefaultKMSKeyIdResponse>(await this.callApi(params, req, runtime), new $_model.DescribeDiskDefaultKMSKeyIdResponse({})); } /** * Queries the key used for account-level default encryption of block storage. * * @param request - DescribeDiskDefaultKMSKeyIdRequest * @returns DescribeDiskDefaultKMSKeyIdResponse */ async describeDiskDefaultKMSKeyId(request: $_model.DescribeDiskDefaultKMSKeyIdRequest): Promise<$_model.DescribeDiskDefaultKMSKeyIdResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDiskDefaultKMSKeyIdWithOptions(request, runtime); } /** * Queries the service status of account-level default encryption for block storage in a specified region. * * @param request - DescribeDiskEncryptionByDefaultStatusRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeDiskEncryptionByDefaultStatusResponse */ async describeDiskEncryptionByDefaultStatusWithOptions(request: $_model.DescribeDiskEncryptionByDefaultStatusRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeDiskEncryptionByDefaultStatusResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeDiskEncryptionByDefaultStatus", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeDiskEncryptionByDefaultStatusResponse>(await this.callApi(params, req, runtime), new $_model.DescribeDiskEncryptionByDefaultStatusResponse({})); } /** * Queries the service status of account-level default encryption for block storage in a specified region. * * @param request - DescribeDiskEncryptionByDefaultStatusRequest * @returns DescribeDiskEncryptionByDefaultStatusResponse */ async describeDiskEncryptionByDefaultStatus(request: $_model.DescribeDiskEncryptionByDefaultStatusRequest): Promise<$_model.DescribeDiskEncryptionByDefaultStatusResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDiskEncryptionByDefaultStatusWithOptions(request, runtime); } /** * Queries the usage information of a disk within a specified period, such as read IOPS, write IOPS, read bandwidth (B/s), write bandwidth (B/s), read latency (μs), and write latency (μs). * * @remarks * When you call this operation, take note of the following limits: * - You can query only the usage information of disks that are in the In Use (`In_use`) state. For more information, see [Disk states](https://help.aliyun.com/document_detail/25689.html). * > If the returned information has missing content, the disk was not in the In Use (`In_use`) state during that period, and the usage information cannot be obtained. * - A maximum of 400 data entries can be returned at a time. The value of `(EndTime – StartTime) / Period` must be less than or equal to 400. That is, the value of the `TotalCount` response parameter cannot exceed 400. Otherwise, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query the monitoring information of up to the last 30 days. The specified `StartTime` parameter cannot be more than 30 days earlier than the current time. * ## Request example * Assume that you want to query the usage information of a disk whose ID is `d-bp14emm68wx98vjk****` in the China (Hangzhou) region from `2025-02-17T00:00:00Z` to `2025-02-18T10:00:00Z` at intervals of 600 seconds. Configure the request parameters as follows: * ``` * RegionId:"cn-hangzhou", // Set the China (Hangzhou) region * DiskId:"d-bp14emm68wx98vjk****", // Set the disk ID * StartTime:"2025-02-15T00:00:00Z", // Set the query start time * EndTime:"2025-02-17T00:00:00Z", // Set the query end time * Period:"600", // Set the data granularity * ``` * * @param request - DescribeDiskMonitorDataRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeDiskMonitorDataResponse */ async describeDiskMonitorDataWithOptions(request: $_model.DescribeDiskMonitorDataRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeDiskMonitorDataResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeDiskMonitorData", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeDiskMonitorDataResponse>(await this.callApi(params, req, runtime), new $_model.DescribeDiskMonitorDataResponse({})); } /** * Queries the usage information of a disk within a specified period, such as read IOPS, write IOPS, read bandwidth (B/s), write bandwidth (B/s), read latency (μs), and write latency (μs). * * @remarks * When you call this operation, take note of the following limits: * - You can query only the usage information of disks that are in the In Use (`In_use`) state. For more information, see [Disk states](https://help.aliyun.com/document_detail/25689.html). * > If the returned information has missing content, the disk was not in the In Use (`In_use`) state during that period, and the usage information cannot be obtained. * - A maximum of 400 data entries can be returned at a time. The value of `(EndTime – StartTime) / Period` must be less than or equal to 400. That is, the value of the `TotalCount` response parameter cannot exceed 400. Otherwise, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query the monitoring information of up to the last 30 days. The specified `StartTime` parameter cannot be more than 30 days earlier than the current time. * ## Request example * Assume that you want to query the usage information of a disk whose ID is `d-bp14emm68wx98vjk****` in the China (Hangzhou) region from `2025-02-17T00:00:00Z` to `2025-02-18T10:00:00Z` at intervals of 600 seconds. Configure the request parameters as follows: * ``` * RegionId:"cn-hangzhou", // Set the China (Hangzhou) region * DiskId:"d-bp14emm68wx98vjk****", // Set the disk ID * StartTime:"2025-02-15T00:00:00Z", // Set the query start time * EndTime:"2025-02-17T00:00:00Z", // Set the query end time * Period:"600", // Set the data granularity * ``` * * @param request - DescribeDiskMonitorDataRequest * @returns DescribeDiskMonitorDataResponse */ async describeDiskMonitorData(request: $_model.DescribeDiskMonitorDataRequest): Promise<$_model.DescribeDiskMonitorDataResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDiskMonitorDataWithOptions(request, runtime); } /** * Queries information about one or more created block storage devices, including cloud disks, local disks, and elastic ephemeral disks. * * @remarks * - The request parameters RegionId, ZoneId, DiskIds, and InstanceId are filters. These parameters have a logical AND relationship. * - The DiskIds request parameter is a JSON format array. If this parameter is empty, the filter does not take effect. However, if DiskIds is an empty array, the filter is considered valid and an empty result is returned. * - Token-based paged query is supported. Set the NextToken parameter to specify the query token. Its value is the NextToken value returned in the previous call of DescribeDisks. Use MaxResults to settings the maximum number of entries per page. * - A cloud disk with the multi-attach feature enabled can be attached to multiple instances. You can view all attachment information for the disk from the Attachment list in the response. * When you invoke an API operation by using Cloud Assistant CLI, specify request parameters of different data types in the required formats. For more information, see [Parameter format overview](https://help.aliyun.com/document_detail/110340.html). * * @param request - DescribeDisksRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeDisksResponse */ async describeDisksWithOptions(request: $_model.DescribeDisksRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeDisksResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.additionalAttributes)) { query["AdditionalAttributes"] = request.additionalAttributes; } if (!$dara.isNull(request.autoSnapshotPolicyId)) { query["AutoSnapshotPolicyId"] = request.autoSnapshotPolicyId; } if (!$dara.isNull(request.category)) { query["Category"] = request.category; } if (!$dara.isNull(request.deleteAutoSnapshot)) { query["DeleteAutoSnapshot"] = request.deleteAutoSnapshot; } if (!$dara.isNull(request.deleteWithInstance)) { query["DeleteWithInstance"] = request.deleteWithInstance; } if (!$dara.isNull(request.diskChargeType)) { query["DiskChargeType"] = request.diskChargeType; } if (!$dara.isNull(request.diskIds)) { query["DiskIds"] = request.diskIds; } if (!$dara.isNull(request.diskName)) { query["DiskName"] = request.diskName; } if (!$dara.isNull(request.diskType)) { query["DiskType"] = request.diskType; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.enableAutoSnapshot)) { query["EnableAutoSnapshot"] = request.enableAutoSnapshot; } if (!$dara.isNull(request.enableAutomatedSnapshotPolicy)) { query["EnableAutomatedSnapshotPolicy"] = request.enableAutomatedSnapshotPolicy; } if (!$dara.isNull(request.enableShared)) { query["EnableShared"] = request.enableShared; } if (!$dara.isNull(request.encrypted)) { query["Encrypted"] = request.encrypted; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.KMSKeyId)) { query["KMSKeyId"] = request.KMSKeyId; } if (!$dara.isNull(request.lockReason)) { query["LockReason"] = request.lockReason; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.multiAttach)) { query["MultiAttach"] = request.multiAttach; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.portable)) { query["Portable"] = request.portable; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.snapshotId)) { query["SnapshotId"] = request.snapshotId; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } if (!$dara.isNull(request.filter)) { query["Filter"] = request.filter; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeDisks", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeDisksResponse>(await this.callApi(params, req, runtime), new $_model.DescribeDisksResponse({})); } /** * Queries information about one or more created block storage devices, including cloud disks, local disks, and elastic ephemeral disks. * * @remarks * - The request parameters RegionId, ZoneId, DiskIds, and InstanceId are filters. These parameters have a logical AND relationship. * - The DiskIds request parameter is a JSON format array. If this parameter is empty, the filter does not take effect. However, if DiskIds is an empty array, the filter is considered valid and an empty result is returned. * - Token-based paged query is supported. Set the NextToken parameter to specify the query token. Its value is the NextToken value returned in the previous call of DescribeDisks. Use MaxResults to settings the maximum number of entries per page. * - A cloud disk with the multi-attach feature enabled can be attached to multiple instances. You can view all attachment information for the disk from the Attachment list in the response. * When you invoke an API operation by using Cloud Assistant CLI, specify request parameters of different data types in the required formats. For more information, see [Parameter format overview](https://help.aliyun.com/document_detail/110340.html). * * @param request - DescribeDisksRequest * @returns DescribeDisksResponse */ async describeDisks(request: $_model.DescribeDisksRequest): Promise<$_model.DescribeDisksResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDisksWithOptions(request, runtime); } /** * Queries the full status information about one or more Elastic Block Storage (EBS) devices. * * @remarks * - The full status information about an EBS device includes the lifecycle status specified by the `Status` parameter, health status specified by the `HealthStatus` parameter, and event type specified by the `EventType` parameter of the EBS device. You can filter the results based on these parameters. * - The release time, scheduled execution time, and actual execution time of each EBS device event are identical. If you specify a period of time by using the `EventTime.Start` and `EventTime.End` parameters, all events that occurred within this period are queried. You can query events that occurred within the last seven days. * * @param request - DescribeDisksFullStatusRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeDisksFullStatusResponse */ async describeDisksFullStatusWithOptions(request: $_model.DescribeDisksFullStatusRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeDisksFullStatusResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.eventId)) { query["EventId"] = request.eventId; } if (!$dara.isNull(request.eventType)) { query["EventType"] = request.eventType; } if (!$dara.isNull(request.healthStatus)) { query["HealthStatus"] = request.healthStatus; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.eventTime)) { query["EventTime"] = request.eventTime; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeDisksFullStatus", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeDisksFullStatusResponse>(await this.callApi(params, req, runtime), new $_model.DescribeDisksFullStatusResponse({})); } /** * Queries the full status information about one or more Elastic Block Storage (EBS) devices. * * @remarks * - The full status information about an EBS device includes the lifecycle status specified by the `Status` parameter, health status specified by the `HealthStatus` parameter, and event type specified by the `EventType` parameter of the EBS device. You can filter the results based on these parameters. * - The release time, scheduled execution time, and actual execution time of each EBS device event are identical. If you specify a period of time by using the `EventTime.Start` and `EventTime.End` parameters, all events that occurred within this period are queried. You can query events that occurred within the last seven days. * * @param request - DescribeDisksFullStatusRequest * @returns DescribeDisksFullStatusResponse */ async describeDisksFullStatus(request: $_model.DescribeDisksFullStatusRequest): Promise<$_model.DescribeDisksFullStatusResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDisksFullStatusWithOptions(request, runtime); } /** * DescribeEipAddresses * * @deprecated OpenAPI DescribeEipAddresses is deprecated, please use Vpc::2016-04-28::DescribeEipAddresses instead. * * @param request - DescribeEipAddressesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeEipAddressesResponse */ async describeEipAddressesWithOptions(request: $_model.DescribeEipAddressesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeEipAddressesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.allocationId)) { query["AllocationId"] = request.allocationId; } if (!$dara.isNull(request.associatedInstanceId)) { query["AssociatedInstanceId"] = request.associatedInstanceId; } if (!$dara.isNull(request.associatedInstanceType)) { query["AssociatedInstanceType"] = request.associatedInstanceType; } if (!$dara.isNull(request.chargeType)) { query["ChargeType"] = request.chargeType; } if (!$dara.isNull(request.eipAddress)) { query["EipAddress"] = request.eipAddress; } if (!$dara.isNull(request.ISP)) { query["ISP"] = request.ISP; } if (!$dara.isNull(request.lockReason)) { query["LockReason"] = request.lockReason; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.filter)) { query["Filter"] = request.filter; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeEipAddresses", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeEipAddressesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeEipAddressesResponse({})); } /** * DescribeEipAddresses * * @deprecated OpenAPI DescribeEipAddresses is deprecated, please use Vpc::2016-04-28::DescribeEipAddresses instead. * * @param request - DescribeEipAddressesRequest * @returns DescribeEipAddressesResponse */ // Deprecated async describeEipAddresses(request: $_model.DescribeEipAddressesRequest): Promise<$_model.DescribeEipAddressesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeEipAddressesWithOptions(request, runtime); } /** * DescribeEipMonitorData * * @deprecated OpenAPI DescribeEipMonitorData is deprecated, please use Vpc::2016-04-28::DescribeEipMonitorData instead. * * @param request - DescribeEipMonitorDataRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeEipMonitorDataResponse */ async describeEipMonitorDataWithOptions(request: $_model.DescribeEipMonitorDataRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeEipMonitorDataResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.allocationId)) { query["AllocationId"] = request.allocationId; } if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeEipMonitorData", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeEipMonitorDataResponse>(await this.callApi(params, req, runtime), new $_model.DescribeEipMonitorDataResponse({})); } /** * DescribeEipMonitorData * * @deprecated OpenAPI DescribeEipMonitorData is deprecated, please use Vpc::2016-04-28::DescribeEipMonitorData instead. * * @param request - DescribeEipMonitorDataRequest * @returns DescribeEipMonitorDataResponse */ // Deprecated async describeEipMonitorData(request: $_model.DescribeEipMonitorDataRequest): Promise<$_model.DescribeEipMonitorDataResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeEipMonitorDataWithOptions(request, runtime); } /** * Queries the auto-renewal attributes of one or more elasticity assurance services. * * @param request - DescribeElasticityAssuranceAutoRenewAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeElasticityAssuranceAutoRenewAttributeResponse */ async describeElasticityAssuranceAutoRenewAttributeWithOptions(request: $_model.DescribeElasticityAssuranceAutoRenewAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeElasticityAssuranceAutoRenewAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeElasticityAssuranceAutoRenewAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeElasticityAssuranceAutoRenewAttributeResponse>(await this.callApi(params, req, runtime), new $_model.DescribeElasticityAssuranceAutoRenewAttributeResponse({})); } /** * Queries the auto-renewal attributes of one or more elasticity assurance services. * * @param request - DescribeElasticityAssuranceAutoRenewAttributeRequest * @returns DescribeElasticityAssuranceAutoRenewAttributeResponse */ async describeElasticityAssuranceAutoRenewAttribute(request: $_model.DescribeElasticityAssuranceAutoRenewAttributeRequest): Promise<$_model.DescribeElasticityAssuranceAutoRenewAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeElasticityAssuranceAutoRenewAttributeWithOptions(request, runtime); } /** * Queries the running Elastic Compute Service (ECS) instances that use an elasticity assurance. * * @remarks * When an elasticity assurance expires, data about the association between the instances and the private pool generated by the elasticity assurance becomes invalid. When you call this operation to query the expired elasticity assurance, no value is returned. * * @param request - DescribeElasticityAssuranceInstancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeElasticityAssuranceInstancesResponse */ async describeElasticityAssuranceInstancesWithOptions(request: $_model.DescribeElasticityAssuranceInstancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeElasticityAssuranceInstancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeElasticityAssuranceInstances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeElasticityAssuranceInstancesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeElasticityAssuranceInstancesResponse({})); } /** * Queries the running Elastic Compute Service (ECS) instances that use an elasticity assurance. * * @remarks * When an elasticity assurance expires, data about the association between the instances and the private pool generated by the elasticity assurance becomes invalid. When you call this operation to query the expired elasticity assurance, no value is returned. * * @param request - DescribeElasticityAssuranceInstancesRequest * @returns DescribeElasticityAssuranceInstancesResponse */ async describeElasticityAssuranceInstances(request: $_model.DescribeElasticityAssuranceInstancesRequest): Promise<$_model.DescribeElasticityAssuranceInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeElasticityAssuranceInstancesWithOptions(request, runtime); } /** * Retrieves the details of an Elasticity Assurance, including its status, matching mode, effective method, expiry time, and the number of used instances. * * @param request - DescribeElasticityAssurancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeElasticityAssurancesResponse */ async describeElasticityAssurancesWithOptions(request: $_model.DescribeElasticityAssurancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeElasticityAssurancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceChargeType)) { query["InstanceChargeType"] = request.instanceChargeType; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.packageType)) { query["PackageType"] = request.packageType; } if (!$dara.isNull(request.platform)) { query["Platform"] = request.platform; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeElasticityAssurances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeElasticityAssurancesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeElasticityAssurancesResponse({})); } /** * Retrieves the details of an Elasticity Assurance, including its status, matching mode, effective method, expiry time, and the number of used instances. * * @param request - DescribeElasticityAssurancesRequest * @returns DescribeElasticityAssurancesResponse */ async describeElasticityAssurances(request: $_model.DescribeElasticityAssurancesRequest): Promise<$_model.DescribeElasticityAssurancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeElasticityAssurancesWithOptions(request, runtime); } /** * Queries the monitoring data of a secondary elastic network interface (ENI) over a specific period of time. * * @remarks * ## [](#)Usage notes * The monitoring data of a secondary ENI includes the amount of traffic sent and received over the internal network, the number of packets sent and received by the secondary ENI, and the number of sent and received packets that are dropped by the secondary ENI. Specific information may be missing from the returned monitoring data. This may be because the system cannot obtain the relevant information. For example, if the instance to which the secondary ENI is attached is in the Stopped state or if the secondary ENI is not attached to an instance and is in the Available state, the monitoring data of the secondary ENI cannot be obtained. Take note of the following items: * - Up to 400 monitoring data entries can be returned at a time. Make sure that the `TotalCount` value does not exceed 400. The value is calculated by using the following formula: `TotalCount = (EndTime - StartTime)/Period`. If the TotalCount value is greater than 400, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query the monitoring data in the last 30 days. If the value of `StartTime` is more than 30 days earlier than the current time, an error is returned. * * @param request - DescribeEniMonitorDataRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeEniMonitorDataResponse */ async describeEniMonitorDataWithOptions(request: $_model.DescribeEniMonitorDataRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeEniMonitorDataResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.eniId)) { query["EniId"] = request.eniId; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeEniMonitorData", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeEniMonitorDataResponse>(await this.callApi(params, req, runtime), new $_model.DescribeEniMonitorDataResponse({})); } /** * Queries the monitoring data of a secondary elastic network interface (ENI) over a specific period of time. * * @remarks * ## [](#)Usage notes * The monitoring data of a secondary ENI includes the amount of traffic sent and received over the internal network, the number of packets sent and received by the secondary ENI, and the number of sent and received packets that are dropped by the secondary ENI. Specific information may be missing from the returned monitoring data. This may be because the system cannot obtain the relevant information. For example, if the instance to which the secondary ENI is attached is in the Stopped state or if the secondary ENI is not attached to an instance and is in the Available state, the monitoring data of the secondary ENI cannot be obtained. Take note of the following items: * - Up to 400 monitoring data entries can be returned at a time. Make sure that the `TotalCount` value does not exceed 400. The value is calculated by using the following formula: `TotalCount = (EndTime - StartTime)/Period`. If the TotalCount value is greater than 400, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query the monitoring data in the last 30 days. If the value of `StartTime` is more than 30 days earlier than the current time, an error is returned. * * @param request - DescribeEniMonitorDataRequest * @returns DescribeEniMonitorDataResponse */ async describeEniMonitorData(request: $_model.DescribeEniMonitorDataRequest): Promise<$_model.DescribeEniMonitorDataResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeEniMonitorDataWithOptions(request, runtime); } /** * DescribeForwardTableEntries * * @deprecated OpenAPI DescribeForwardTableEntries is deprecated, please use Vpc::2016-04-28::DescribeForwardTableEntries instead. * * @param request - DescribeForwardTableEntriesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeForwardTableEntriesResponse */ async describeForwardTableEntriesWithOptions(request: $_model.DescribeForwardTableEntriesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeForwardTableEntriesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.forwardEntryId)) { query["ForwardEntryId"] = request.forwardEntryId; } if (!$dara.isNull(request.forwardTableId)) { query["ForwardTableId"] = request.forwardTableId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeForwardTableEntries", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeForwardTableEntriesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeForwardTableEntriesResponse({})); } /** * DescribeForwardTableEntries * * @deprecated OpenAPI DescribeForwardTableEntries is deprecated, please use Vpc::2016-04-28::DescribeForwardTableEntries instead. * * @param request - DescribeForwardTableEntriesRequest * @returns DescribeForwardTableEntriesResponse */ // Deprecated async describeForwardTableEntries(request: $_model.DescribeForwardTableEntriesRequest): Promise<$_model.DescribeForwardTableEntriesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeForwardTableEntriesWithOptions(request, runtime); } /** * DescribeHaVips * * @deprecated OpenAPI DescribeHaVips is deprecated, please use Vpc::2016-04-28::DescribeHaVips instead. * * @param request - DescribeHaVipsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeHaVipsResponse */ async describeHaVipsWithOptions(request: $_model.DescribeHaVipsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeHaVipsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.filter)) { query["Filter"] = request.filter; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeHaVips", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeHaVipsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeHaVipsResponse({})); } /** * DescribeHaVips * * @deprecated OpenAPI DescribeHaVips is deprecated, please use Vpc::2016-04-28::DescribeHaVips instead. * * @param request - DescribeHaVipsRequest * @returns DescribeHaVipsResponse */ // Deprecated async describeHaVips(request: $_model.DescribeHaVipsRequest): Promise<$_model.DescribeHaVipsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeHaVipsWithOptions(request, runtime); } /** * Queries available High Performance Computing (HPC) clusters. Request parameters serve as filters. Filters are evaluated by using a logical AND. The parameters are independent of each other. * * @param request - DescribeHpcClustersRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeHpcClustersResponse */ async describeHpcClustersWithOptions(request: $_model.DescribeHpcClustersRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeHpcClustersResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.hpcClusterIds)) { query["HpcClusterIds"] = request.hpcClusterIds; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeHpcClusters", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeHpcClustersResponse>(await this.callApi(params, req, runtime), new $_model.DescribeHpcClustersResponse({})); } /** * Queries available High Performance Computing (HPC) clusters. Request parameters serve as filters. Filters are evaluated by using a logical AND. The parameters are independent of each other. * * @param request - DescribeHpcClustersRequest * @returns DescribeHpcClustersResponse */ async describeHpcClusters(request: $_model.DescribeHpcClustersRequest): Promise<$_model.DescribeHpcClustersResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeHpcClustersWithOptions(request, runtime); } /** * Queries the details of one or more image components. * * @remarks * You can set NextToken to the value of NextToken returned by the previous call to DescribeImageComponents, and set MaxResults to specify the maximum number of entries per page. * * @param request - DescribeImageComponentsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeImageComponentsResponse */ async describeImageComponentsWithOptions(request: $_model.DescribeImageComponentsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeImageComponentsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.componentType)) { query["ComponentType"] = request.componentType; } if (!$dara.isNull(request.componentVersion)) { query["ComponentVersion"] = request.componentVersion; } if (!$dara.isNull(request.imageComponentId)) { query["ImageComponentId"] = request.imageComponentId; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.owner)) { query["Owner"] = request.owner; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.systemType)) { query["SystemType"] = request.systemType; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeImageComponents", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeImageComponentsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeImageComponentsResponse({})); } /** * Queries the details of one or more image components. * * @remarks * You can set NextToken to the value of NextToken returned by the previous call to DescribeImageComponents, and set MaxResults to specify the maximum number of entries per page. * * @param request - DescribeImageComponentsRequest * @returns DescribeImageComponentsResponse */ async describeImageComponents(request: $_model.DescribeImageComponentsRequest): Promise<$_model.DescribeImageComponentsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeImageComponentsWithOptions(request, runtime); } /** * Queries available custom images that are most recently created in a specific image family. * * @remarks * ## [](#)Usage notes * If no available image exists in a specific image family, the response is empty. * * @param request - DescribeImageFromFamilyRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeImageFromFamilyResponse */ async describeImageFromFamilyWithOptions(request: $_model.DescribeImageFromFamilyRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeImageFromFamilyResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.imageFamily)) { query["ImageFamily"] = request.imageFamily; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeImageFromFamily", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeImageFromFamilyResponse>(await this.callApi(params, req, runtime), new $_model.DescribeImageFromFamilyResponse({})); } /** * Queries available custom images that are most recently created in a specific image family. * * @remarks * ## [](#)Usage notes * If no available image exists in a specific image family, the response is empty. * * @param request - DescribeImageFromFamilyRequest * @returns DescribeImageFromFamilyResponse */ async describeImageFromFamily(request: $_model.DescribeImageFromFamilyRequest): Promise<$_model.DescribeImageFromFamilyResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeImageFromFamilyWithOptions(request, runtime); } /** * Call `DescribeImagePipelineExecutions` to get details about an image build task. * * @remarks * ## API * - The `ImagePipelineId` cannot refer to a deleted image pipeline. Deleting an image pipeline also deletes its associated build tasks. * - The `ImagePipelineId` and `ExecutionId` parameters cannot both be empty. * - To paginate the results, set `NextToken` to the value returned by the previous call to `DescribeImagePipelineExecutions`. Use `MaxResults` to specify the maximum number of results per page. * * @param request - DescribeImagePipelineExecutionsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeImagePipelineExecutionsResponse */ async describeImagePipelineExecutionsWithOptions(request: $_model.DescribeImagePipelineExecutionsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeImagePipelineExecutionsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.executionId)) { query["ExecutionId"] = request.executionId; } if (!$dara.isNull(request.imagePipelineId)) { query["ImagePipelineId"] = request.imagePipelineId; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeImagePipelineExecutions", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeImagePipelineExecutionsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeImagePipelineExecutionsResponse({})); } /** * Call `DescribeImagePipelineExecutions` to get details about an image build task. * * @remarks * ## API * - The `ImagePipelineId` cannot refer to a deleted image pipeline. Deleting an image pipeline also deletes its associated build tasks. * - The `ImagePipelineId` and `ExecutionId` parameters cannot both be empty. * - To paginate the results, set `NextToken` to the value returned by the previous call to `DescribeImagePipelineExecutions`. Use `MaxResults` to specify the maximum number of results per page. * * @param request - DescribeImagePipelineExecutionsRequest * @returns DescribeImagePipelineExecutionsResponse */ async describeImagePipelineExecutions(request: $_model.DescribeImagePipelineExecutionsRequest): Promise<$_model.DescribeImagePipelineExecutionsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeImagePipelineExecutionsWithOptions(request, runtime); } /** * Describes one or more image templates. * * @remarks * To perform a paginated query, set the `NextToken` parameter to the `NextToken` value returned by the previous `DescribeImagePipelines` call, and use the `MaxResults` parameter to specify the maximum number of entries. * * @param request - DescribeImagePipelinesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeImagePipelinesResponse */ async describeImagePipelinesWithOptions(request: $_model.DescribeImagePipelinesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeImagePipelinesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.imagePipelineId)) { query["ImagePipelineId"] = request.imagePipelineId; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeImagePipelines", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeImagePipelinesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeImagePipelinesResponse({})); } /** * Describes one or more image templates. * * @remarks * To perform a paginated query, set the `NextToken` parameter to the `NextToken` value returned by the previous `DescribeImagePipelines` call, and use the `MaxResults` parameter to specify the maximum number of entries. * * @param request - DescribeImagePipelinesRequest * @returns DescribeImagePipelinesResponse */ async describeImagePipelines(request: $_model.DescribeImagePipelinesRequest): Promise<$_model.DescribeImagePipelinesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeImagePipelinesWithOptions(request, runtime); } /** * Queries all users with whom a custom image is shared. The returned results support pagination, with 10 entries per page by default. * * @param request - DescribeImageSharePermissionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeImageSharePermissionResponse */ async describeImageSharePermissionWithOptions(request: $_model.DescribeImageSharePermissionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeImageSharePermissionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeImageSharePermission", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeImageSharePermissionResponse>(await this.callApi(params, req, runtime), new $_model.DescribeImageSharePermissionResponse({})); } /** * Queries all users with whom a custom image is shared. The returned results support pagination, with 10 entries per page by default. * * @param request - DescribeImageSharePermissionRequest * @returns DescribeImageSharePermissionResponse */ async describeImageSharePermission(request: $_model.DescribeImageSharePermissionRequest): Promise<$_model.DescribeImageSharePermissionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeImageSharePermissionWithOptions(request, runtime); } /** * Queries the instance types supported by a specified image. * * @param request - DescribeImageSupportInstanceTypesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeImageSupportInstanceTypesResponse */ async describeImageSupportInstanceTypesWithOptions(request: $_model.DescribeImageSupportInstanceTypesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeImageSupportInstanceTypesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.actionType)) { query["ActionType"] = request.actionType; } if (!$dara.isNull(request.filter)) { query["Filter"] = request.filter; } if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeImageSupportInstanceTypes", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeImageSupportInstanceTypesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeImageSupportInstanceTypesResponse({})); } /** * Queries the instance types supported by a specified image. * * @param request - DescribeImageSupportInstanceTypesRequest * @returns DescribeImageSupportInstanceTypesResponse */ async describeImageSupportInstanceTypes(request: $_model.DescribeImageSupportInstanceTypesRequest): Promise<$_model.DescribeImageSupportInstanceTypesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeImageSupportInstanceTypesWithOptions(request, runtime); } /** * Queries the list of image resources that you can use by specifying parameters such as ImageId, image usage scenarios, and Filter conditions. * * @remarks * - Image resources that you can query include your custom images, public images provided by Alibaba Cloud, Alibaba Cloud Marketplace images, and shared images that other Alibaba Cloud users have shared with you. * - Paging is supported. The query results include the total number of available image resources and the image resources on the current page. The default number of entries per page is 10. * - When you invoke an API operation by using Cloud Assistant CLI, request parameters of different data types must comply with format requirements. For more information, see [CLI parameter format](https://help.aliyun.com/document_detail/110340.html). * - When you query images provided by Alibaba Cloud or shared images (ImageOwnerAlias is set to system or others), the request can bypass RAM authentication rules. For more information, see [Authentication rules](https://help.aliyun.com/document_detail/25497.html). * * @param request - DescribeImagesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeImagesResponse */ async describeImagesWithOptions(request: $_model.DescribeImagesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeImagesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.actionType)) { query["ActionType"] = request.actionType; } if (!$dara.isNull(request.architecture)) { query["Architecture"] = request.architecture; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.filter)) { query["Filter"] = request.filter; } if (!$dara.isNull(request.imageFamily)) { query["ImageFamily"] = request.imageFamily; } if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.imageName)) { query["ImageName"] = request.imageName; } if (!$dara.isNull(request.imageOwnerAlias)) { query["ImageOwnerAlias"] = request.imageOwnerAlias; } if (!$dara.isNull(request.imageOwnerId)) { query["ImageOwnerId"] = request.imageOwnerId; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.isPublic)) { query["IsPublic"] = request.isPublic; } if (!$dara.isNull(request.isSupportCloudinit)) { query["IsSupportCloudinit"] = request.isSupportCloudinit; } if (!$dara.isNull(request.isSupportIoOptimized)) { query["IsSupportIoOptimized"] = request.isSupportIoOptimized; } if (!$dara.isNull(request.OSType)) { query["OSType"] = request.OSType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.showExpired)) { query["ShowExpired"] = request.showExpired; } if (!$dara.isNull(request.snapshotId)) { query["SnapshotId"] = request.snapshotId; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.usable)) { query["Usable"] = request.usable; } if (!$dara.isNull(request.usage)) { query["Usage"] = request.usage; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeImages", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeImagesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeImagesResponse({})); } /** * Queries the list of image resources that you can use by specifying parameters such as ImageId, image usage scenarios, and Filter conditions. * * @remarks * - Image resources that you can query include your custom images, public images provided by Alibaba Cloud, Alibaba Cloud Marketplace images, and shared images that other Alibaba Cloud users have shared with you. * - Paging is supported. The query results include the total number of available image resources and the image resources on the current page. The default number of entries per page is 10. * - When you invoke an API operation by using Cloud Assistant CLI, request parameters of different data types must comply with format requirements. For more information, see [CLI parameter format](https://help.aliyun.com/document_detail/110340.html). * - When you query images provided by Alibaba Cloud or shared images (ImageOwnerAlias is set to system or others), the request can bypass RAM authentication rules. For more information, see [Authentication rules](https://help.aliyun.com/document_detail/25497.html). * * @param request - DescribeImagesRequest * @returns DescribeImagesResponse */ async describeImages(request: $_model.DescribeImagesRequest): Promise<$_model.DescribeImagesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeImagesWithOptions(request, runtime); } /** * Queries the information about the private pools that Elastic Compute Service (ECS) instances match. * * @remarks * ## [](#)Usage notes * After an elasticity assurance or a capacity reservation is created, a private pool is generated and associated with information about the instances that are created by using the private pool. You can specify a private pool when you create an instance. This way, the instance matches the elasticity assurance or capacity reservation that is associated with the private pool. * When a private pool expires, data related to the association between instances and the private pool becomes invalid. If you call this operation to query information about the private pool, empty values are returned. * * @param request - DescribeInstanceAttachmentAttributesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInstanceAttachmentAttributesResponse */ async describeInstanceAttachmentAttributesWithOptions(request: $_model.DescribeInstanceAttachmentAttributesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInstanceAttachmentAttributesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceIds)) { query["InstanceIds"] = request.instanceIds; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInstanceAttachmentAttributes", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInstanceAttachmentAttributesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInstanceAttachmentAttributesResponse({})); } /** * Queries the information about the private pools that Elastic Compute Service (ECS) instances match. * * @remarks * ## [](#)Usage notes * After an elasticity assurance or a capacity reservation is created, a private pool is generated and associated with information about the instances that are created by using the private pool. You can specify a private pool when you create an instance. This way, the instance matches the elasticity assurance or capacity reservation that is associated with the private pool. * When a private pool expires, data related to the association between instances and the private pool becomes invalid. If you call this operation to query information about the private pool, empty values are returned. * * @param request - DescribeInstanceAttachmentAttributesRequest * @returns DescribeInstanceAttachmentAttributesResponse */ async describeInstanceAttachmentAttributes(request: $_model.DescribeInstanceAttachmentAttributesRequest): Promise<$_model.DescribeInstanceAttachmentAttributesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstanceAttachmentAttributesWithOptions(request, runtime); } /** * Queries the attribute information of a specified ECS instance. * * @param request - DescribeInstanceAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInstanceAttributeResponse */ async describeInstanceAttributeWithOptions(request: $_model.DescribeInstanceAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInstanceAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInstanceAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInstanceAttributeResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInstanceAttributeResponse({})); } /** * Queries the attribute information of a specified ECS instance. * * @param request - DescribeInstanceAttributeRequest * @returns DescribeInstanceAttributeResponse */ async describeInstanceAttribute(request: $_model.DescribeInstanceAttributeRequest): Promise<$_model.DescribeInstanceAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstanceAttributeWithOptions(request, runtime); } /** * This API returns the auto-renewal status and renewal period for one or more subscription ECS instances. * * @remarks * - This API supports only subscription instances. Calling this API for a pay-as-you-go instance returns an error. * - Before you configure auto-renewal or manual renewal for an instance, query its renewal status to check if auto-renewal is already enabled. * * @param request - DescribeInstanceAutoRenewAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInstanceAutoRenewAttributeResponse */ async describeInstanceAutoRenewAttributeWithOptions(request: $_model.DescribeInstanceAutoRenewAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInstanceAutoRenewAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.renewalStatus)) { query["RenewalStatus"] = request.renewalStatus; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInstanceAutoRenewAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInstanceAutoRenewAttributeResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInstanceAutoRenewAttributeResponse({})); } /** * This API returns the auto-renewal status and renewal period for one or more subscription ECS instances. * * @remarks * - This API supports only subscription instances. Calling this API for a pay-as-you-go instance returns an error. * - Before you configure auto-renewal or manual renewal for an instance, query its renewal status to check if auto-renewal is already enabled. * * @param request - DescribeInstanceAutoRenewAttributeRequest * @returns DescribeInstanceAutoRenewAttributeResponse */ async describeInstanceAutoRenewAttribute(request: $_model.DescribeInstanceAutoRenewAttributeRequest): Promise<$_model.DescribeInstanceAutoRenewAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstanceAutoRenewAttributeWithOptions(request, runtime); } /** * Queries system event information for a specified instance by calling the DescribeInstanceHistoryEvents operation. You can specify parameters such as InstanceId and EventType. By default, this operation queries historical system events in inactive states. * * @remarks * - You can query completed historical system events from the last 30 days. There is no time limit for querying uncompleted system events. * - If neither EventCycleStatus nor InstanceEventCycleStatus is specified, the query results include only system events in the Avoided, Executed, Canceled, and Failed states by default. * - By specifying the InstanceEventCycleStatus parameter, you can also query system events in the Scheduled, Executing, and Inquiring states. * * @param request - DescribeInstanceHistoryEventsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInstanceHistoryEventsResponse */ async describeInstanceHistoryEventsWithOptions(request: $_model.DescribeInstanceHistoryEventsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInstanceHistoryEventsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.eventCycleStatus)) { query["EventCycleStatus"] = request.eventCycleStatus; } if (!$dara.isNull(request.eventId)) { query["EventId"] = request.eventId; } if (!$dara.isNull(request.eventType)) { query["EventType"] = request.eventType; } if (!$dara.isNull(request.impactLevel)) { query["ImpactLevel"] = request.impactLevel; } if (!$dara.isNull(request.instanceEventCycleStatus)) { query["InstanceEventCycleStatus"] = request.instanceEventCycleStatus; } if (!$dara.isNull(request.instanceEventType)) { query["InstanceEventType"] = request.instanceEventType; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceId)) { query["ResourceId"] = request.resourceId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.eventPublishTime)) { query["EventPublishTime"] = request.eventPublishTime; } if (!$dara.isNull(request.notBefore)) { query["NotBefore"] = request.notBefore; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInstanceHistoryEvents", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInstanceHistoryEventsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInstanceHistoryEventsResponse({})); } /** * Queries system event information for a specified instance by calling the DescribeInstanceHistoryEvents operation. You can specify parameters such as InstanceId and EventType. By default, this operation queries historical system events in inactive states. * * @remarks * - You can query completed historical system events from the last 30 days. There is no time limit for querying uncompleted system events. * - If neither EventCycleStatus nor InstanceEventCycleStatus is specified, the query results include only system events in the Avoided, Executed, Canceled, and Failed states by default. * - By specifying the InstanceEventCycleStatus parameter, you can also query system events in the Scheduled, Executing, and Inquiring states. * * @param request - DescribeInstanceHistoryEventsRequest * @returns DescribeInstanceHistoryEventsResponse */ async describeInstanceHistoryEvents(request: $_model.DescribeInstanceHistoryEventsRequest): Promise<$_model.DescribeInstanceHistoryEventsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstanceHistoryEventsWithOptions(request, runtime); } /** * Queries the maintenance attributes of an instance. * * @remarks * This operation is used to query the specified maintenance policy of an instance, which contains the following maintenance attributes: * - Maintenance window: the time period that you specify for maintenance. * - Maintenance action: the action that you specify in response to instance shutdown. * * @param request - DescribeInstanceMaintenanceAttributesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInstanceMaintenanceAttributesResponse */ async describeInstanceMaintenanceAttributesWithOptions(request: $_model.DescribeInstanceMaintenanceAttributesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInstanceMaintenanceAttributesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInstanceMaintenanceAttributes", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInstanceMaintenanceAttributesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInstanceMaintenanceAttributesResponse({})); } /** * Queries the maintenance attributes of an instance. * * @remarks * This operation is used to query the specified maintenance policy of an instance, which contains the following maintenance attributes: * - Maintenance window: the time period that you specify for maintenance. * - Maintenance action: the action that you specify in response to instance shutdown. * * @param request - DescribeInstanceMaintenanceAttributesRequest * @returns DescribeInstanceMaintenanceAttributesResponse */ async describeInstanceMaintenanceAttributes(request: $_model.DescribeInstanceMaintenanceAttributesRequest): Promise<$_model.DescribeInstanceMaintenanceAttributesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstanceMaintenanceAttributesWithOptions(request, runtime); } /** * Retrieves the pricing for upgrading an active subscription ECS instance to a target instance type and for adding a subscription data disk. * * @remarks * - You can query pricing for upgrading unexpired subscription ECS instances, but not for downgrading them. * - You cannot query prices for resizing pay-as-you-go ECS instances. Because a resized instance is priced the same as a new one, call [DescribePrice](https://help.aliyun.com/document_detail/107829.html) to get the current price. * - Before upgrading an instance, call [DescribeResourcesModification](https://help.aliyun.com/document_detail/66187.html) to find the instance types available for an upgrade in a specific availability zone. * * @param request - DescribeInstanceModificationPriceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInstanceModificationPriceResponse */ async describeInstanceModificationPriceWithOptions(request: $_model.DescribeInstanceModificationPriceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInstanceModificationPriceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dataDisk)) { query["DataDisk"] = request.dataDisk; } if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.ISP)) { query["ISP"] = request.ISP; } if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.internetChargeType)) { query["InternetChargeType"] = request.internetChargeType; } if (!$dara.isNull(request.internetMaxBandwidthOut)) { query["InternetMaxBandwidthOut"] = request.internetMaxBandwidthOut; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } if (!$dara.isNull(request.systemDisk)) { query["SystemDisk"] = request.systemDisk; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInstanceModificationPrice", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInstanceModificationPriceResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInstanceModificationPriceResponse({})); } /** * Retrieves the pricing for upgrading an active subscription ECS instance to a target instance type and for adding a subscription data disk. * * @remarks * - You can query pricing for upgrading unexpired subscription ECS instances, but not for downgrading them. * - You cannot query prices for resizing pay-as-you-go ECS instances. Because a resized instance is priced the same as a new one, call [DescribePrice](https://help.aliyun.com/document_detail/107829.html) to get the current price. * - Before upgrading an instance, call [DescribeResourcesModification](https://help.aliyun.com/document_detail/66187.html) to find the instance types available for an upgrade in a specific availability zone. * * @param request - DescribeInstanceModificationPriceRequest * @returns DescribeInstanceModificationPriceResponse */ async describeInstanceModificationPrice(request: $_model.DescribeInstanceModificationPriceRequest): Promise<$_model.DescribeInstanceModificationPriceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstanceModificationPriceWithOptions(request, runtime); } /** * Queries the monitoring data of an Elastic Compute Service (ECS) instance. The monitoring data can include the vCPU utilization, CPU credits of the burstable instance, amount of received data traffic, amount of sent data traffic, and average bandwidth. * * @remarks * ## [](#)Usage notes * Take note of the following items: * - Up to 400 monitoring data entries can be returned at a time. Make sure that the `TotalCount` value does not exceed 400. The value is calculated by using the following formula: `TotalCount = (EndTime - StartTime)/Period`. If the TotalCount value is greater than 400, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query the monitoring data in the last 30 days. If the value of `StartTime` is more than 30 days earlier than the current time, an error is returned. * - In some scenarios, such as when the instance is in the Stopped state, the system cannot obtain the relevant information and specific information may be missing from the returned monitoring data. * - You cannot call this operation to obtain the CPU basic monitoring information of an ECS bare metal instance. To obtain the CPU monitoring information of an ECS bare metal instance, install the CloudMonitor agent on the instance. For more information, see [InstallCloudMonitor](https://help.aliyun.com/document_detail/183482.html). * * @param request - DescribeInstanceMonitorDataRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInstanceMonitorDataResponse */ async describeInstanceMonitorDataWithOptions(request: $_model.DescribeInstanceMonitorDataRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInstanceMonitorDataResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInstanceMonitorData", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInstanceMonitorDataResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInstanceMonitorDataResponse({})); } /** * Queries the monitoring data of an Elastic Compute Service (ECS) instance. The monitoring data can include the vCPU utilization, CPU credits of the burstable instance, amount of received data traffic, amount of sent data traffic, and average bandwidth. * * @remarks * ## [](#)Usage notes * Take note of the following items: * - Up to 400 monitoring data entries can be returned at a time. Make sure that the `TotalCount` value does not exceed 400. The value is calculated by using the following formula: `TotalCount = (EndTime - StartTime)/Period`. If the TotalCount value is greater than 400, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query the monitoring data in the last 30 days. If the value of `StartTime` is more than 30 days earlier than the current time, an error is returned. * - In some scenarios, such as when the instance is in the Stopped state, the system cannot obtain the relevant information and specific information may be missing from the returned monitoring data. * - You cannot call this operation to obtain the CPU basic monitoring information of an ECS bare metal instance. To obtain the CPU monitoring information of an ECS bare metal instance, install the CloudMonitor agent on the instance. For more information, see [InstallCloudMonitor](https://help.aliyun.com/document_detail/183482.html). * * @param request - DescribeInstanceMonitorDataRequest * @returns DescribeInstanceMonitorDataResponse */ async describeInstanceMonitorData(request: $_model.DescribeInstanceMonitorDataRequest): Promise<$_model.DescribeInstanceMonitorDataResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstanceMonitorDataWithOptions(request, runtime); } /** * Queries the instance Resource Access Management (RAM) roles that are attached to Elastic Compute Service (ECS) instances based on the instance IDs, or queries the ECS instances to which a specific instance RAM role is attached based on the name of the instance RAM role. * * @remarks * ## [](#)Usage notes * When you call the API operation by using Alibaba Cloud CLI, you must specify request parameter values of different data types in the required formats. For more information, see [Parameter formats](https://help.aliyun.com/document_detail/110340.html). * * @param request - DescribeInstanceRamRoleRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInstanceRamRoleResponse */ async describeInstanceRamRoleWithOptions(request: $_model.DescribeInstanceRamRoleRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInstanceRamRoleResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceIds)) { query["InstanceIds"] = request.instanceIds; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.ramRoleName)) { query["RamRoleName"] = request.ramRoleName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInstanceRamRole", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInstanceRamRoleResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInstanceRamRoleResponse({})); } /** * Queries the instance Resource Access Management (RAM) roles that are attached to Elastic Compute Service (ECS) instances based on the instance IDs, or queries the ECS instances to which a specific instance RAM role is attached based on the name of the instance RAM role. * * @remarks * ## [](#)Usage notes * When you call the API operation by using Alibaba Cloud CLI, you must specify request parameter values of different data types in the required formats. For more information, see [Parameter formats](https://help.aliyun.com/document_detail/110340.html). * * @param request - DescribeInstanceRamRoleRequest * @returns DescribeInstanceRamRoleResponse */ async describeInstanceRamRole(request: $_model.DescribeInstanceRamRoleRequest): Promise<$_model.DescribeInstanceRamRoleResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstanceRamRoleWithOptions(request, runtime); } /** * Queries the status of one or more Elastic Compute Service (ECS) instances. You can also call this operation to query the list of ECS instances that match the specified filter conditions. * * @remarks * For information about the lifecycle states of an ECS instance, see [Instance lifecycle](https://help.aliyun.com/document_detail/25687.html). * ## [](#)Sample requests * - Query the ECS instances and the status of the instances in a **specific region**. Sample request: * * ``` * "RegionID": "cn-hangzhou" * ``` * - Query the ECS instances and the status of the instances in a **zone** of a **specific region**. Sample request: * * ``` * "RegionID": "cn-hangzhou", * "ZoneID": "cn-hangzhou-a" * ``` * - Query the status of an ECS instance in a **specific region** based on the **instance ID**. Sample request: * * ``` * "RegionID": "cn-hangzhou", * "InstancesID": ["i-bp1f7c1zqp999zvp****", "i-bp1dqjv36biueg61****"] * ``` * * @param request - DescribeInstanceStatusRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInstanceStatusResponse */ async describeInstanceStatusWithOptions(request: $_model.DescribeInstanceStatusRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInstanceStatusResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clusterId)) { query["ClusterId"] = request.clusterId; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInstanceStatus", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInstanceStatusResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInstanceStatusResponse({})); } /** * Queries the status of one or more Elastic Compute Service (ECS) instances. You can also call this operation to query the list of ECS instances that match the specified filter conditions. * * @remarks * For information about the lifecycle states of an ECS instance, see [Instance lifecycle](https://help.aliyun.com/document_detail/25687.html). * ## [](#)Sample requests * - Query the ECS instances and the status of the instances in a **specific region**. Sample request: * * ``` * "RegionID": "cn-hangzhou" * ``` * - Query the ECS instances and the status of the instances in a **zone** of a **specific region**. Sample request: * * ``` * "RegionID": "cn-hangzhou", * "ZoneID": "cn-hangzhou-a" * ``` * - Query the status of an ECS instance in a **specific region** based on the **instance ID**. Sample request: * * ``` * "RegionID": "cn-hangzhou", * "InstancesID": ["i-bp1f7c1zqp999zvp****", "i-bp1dqjv36biueg61****"] * ``` * * @param request - DescribeInstanceStatusRequest * @returns DescribeInstanceStatusResponse */ async describeInstanceStatus(request: $_model.DescribeInstanceStatusRequest): Promise<$_model.DescribeInstanceStatusResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstanceStatusWithOptions(request, runtime); } /** * 实例拓扑查询接口 * * @param request - DescribeInstanceTopologyRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInstanceTopologyResponse */ async describeInstanceTopologyWithOptions(request: $_model.DescribeInstanceTopologyRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInstanceTopologyResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceIds)) { query["InstanceIds"] = request.instanceIds; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInstanceTopology", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInstanceTopologyResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInstanceTopologyResponse({})); } /** * 实例拓扑查询接口 * * @param request - DescribeInstanceTopologyRequest * @returns DescribeInstanceTopologyResponse */ async describeInstanceTopology(request: $_model.DescribeInstanceTopologyRequest): Promise<$_model.DescribeInstanceTopologyResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstanceTopologyWithOptions(request, runtime); } /** * Queries the instance families provided by Elastic Compute Service (ECS). You can call the DescribeInstanceTypeFamilies operation to obtain information about different series of instance families. This helps you better understand the available instance types and choose appropriate instance types to create ECS instances. * * @param request - DescribeInstanceTypeFamiliesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInstanceTypeFamiliesResponse */ async describeInstanceTypeFamiliesWithOptions(request: $_model.DescribeInstanceTypeFamiliesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInstanceTypeFamiliesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.generation)) { query["Generation"] = request.generation; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInstanceTypeFamilies", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInstanceTypeFamiliesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInstanceTypeFamiliesResponse({})); } /** * Queries the instance families provided by Elastic Compute Service (ECS). You can call the DescribeInstanceTypeFamilies operation to obtain information about different series of instance families. This helps you better understand the available instance types and choose appropriate instance types to create ECS instances. * * @param request - DescribeInstanceTypeFamiliesRequest * @returns DescribeInstanceTypeFamiliesResponse */ async describeInstanceTypeFamilies(request: $_model.DescribeInstanceTypeFamiliesRequest): Promise<$_model.DescribeInstanceTypeFamiliesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstanceTypeFamiliesWithOptions(request, runtime); } /** * Queries the information about all instance types provided by Elastic Compute Service (ECS) and obtains the detailed information about the instance types. You can also query the information about specific instance types based on specific conditions. This helps you understand the configurations and performance of different instance types so that you can select instance types that meet your business requirements. * * @remarks * - **Paginated query**: You can set the MaxResults parameter to limit the number of instance types returned in each response. If only a subset of the queried instance types is returned, the NextToken parameter value is also returned. To perform a paginated query, set the NextToken parameter to the value returned by the previous call and set the MaxResults parameter. * - If you call this API operation without passing the NextToken parameter for paginated retrieval, only the first page of data (up to 100 entries) is returned by default. To retrieve more data, pass the NextToken parameter for paginated retrieval or pass filter conditions to limit the returned data range. * > The maximum value of the MaxResults parameter (maximum entries per page) is 100. For users who called this API before 2022, the maximum value of MaxResults remains 1600. On and after November 15, 2023, the maximum value of MaxResults will be reduced to 100 for all users, and 1600 will no longer be supported. * - DescribeInstanceTypes only queries the configuration and performance information of instance types. To query instance types available for purchase in a specific region, use [DescribeAvailableResource](https://help.aliyun.com/document_detail/66186.html). * * - If you require instance types that are not publicly available for sale or have special requirements, [submit a ticket](https://selfservice.console.aliyun.com/ticket/createIndex). * * * - If you require instance types that are not publicly available for sale or have special requirements, [submit a ticket](https://smartservice.console.aliyun.com/service/create-ticket-intl). * * @param request - DescribeInstanceTypesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInstanceTypesResponse */ async describeInstanceTypesWithOptions(request: $_model.DescribeInstanceTypesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInstanceTypesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.additionalAttributes)) { query["AdditionalAttributes"] = request.additionalAttributes; } if (!$dara.isNull(request.cpuArchitecture)) { query["CpuArchitecture"] = request.cpuArchitecture; } if (!$dara.isNull(request.cpuArchitectures)) { query["CpuArchitectures"] = request.cpuArchitectures; } if (!$dara.isNull(request.GPUSpec)) { query["GPUSpec"] = request.GPUSpec; } if (!$dara.isNull(request.gpuSpecs)) { query["GpuSpecs"] = request.gpuSpecs; } if (!$dara.isNull(request.instanceCategories)) { query["InstanceCategories"] = request.instanceCategories; } if (!$dara.isNull(request.instanceCategory)) { query["InstanceCategory"] = request.instanceCategory; } if (!$dara.isNull(request.instanceFamilyLevel)) { query["InstanceFamilyLevel"] = request.instanceFamilyLevel; } if (!$dara.isNull(request.instanceTypeFamilies)) { query["InstanceTypeFamilies"] = request.instanceTypeFamilies; } if (!$dara.isNull(request.instanceTypeFamily)) { query["InstanceTypeFamily"] = request.instanceTypeFamily; } if (!$dara.isNull(request.instanceTypes)) { query["InstanceTypes"] = request.instanceTypes; } if (!$dara.isNull(request.localStorageCategories)) { query["LocalStorageCategories"] = request.localStorageCategories; } if (!$dara.isNull(request.localStorageCategory)) { query["LocalStorageCategory"] = request.localStorageCategory; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.maximumCpuCoreCount)) { query["MaximumCpuCoreCount"] = request.maximumCpuCoreCount; } if (!$dara.isNull(request.maximumCpuSpeedFrequency)) { query["MaximumCpuSpeedFrequency"] = request.maximumCpuSpeedFrequency; } if (!$dara.isNull(request.maximumCpuTurboFrequency)) { query["MaximumCpuTurboFrequency"] = request.maximumCpuTurboFrequency; } if (!$dara.isNull(request.maximumGPUAmount)) { query["MaximumGPUAmount"] = request.maximumGPUAmount; } if (!$dara.isNull(request.maximumMemorySize)) { query["MaximumMemorySize"] = request.maximumMemorySize; } if (!$dara.isNull(request.minimumBaselineCredit)) { query["MinimumBaselineCredit"] = request.minimumBaselineCredit; } if (!$dara.isNull(request.minimumCpuCoreCount)) { query["MinimumCpuCoreCount"] = request.minimumCpuCoreCount; } if (!$dara.isNull(request.minimumCpuSpeedFrequency)) { query["MinimumCpuSpeedFrequency"] = request.minimumCpuSpeedFrequency; } if (!$dara.isNull(request.minimumCpuTurboFrequency)) { query["MinimumCpuTurboFrequency"] = request.minimumCpuTurboFrequency; } if (!$dara.isNull(request.minimumDiskQuantity)) { query["MinimumDiskQuantity"] = request.minimumDiskQuantity; } if (!$dara.isNull(request.minimumEniIpv6AddressQuantity)) { query["MinimumEniIpv6AddressQuantity"] = request.minimumEniIpv6AddressQuantity; } if (!$dara.isNull(request.minimumEniPrivateIpAddressQuantity)) { query["MinimumEniPrivateIpAddressQuantity"] = request.minimumEniPrivateIpAddressQuantity; } if (!$dara.isNull(request.minimumEniQuantity)) { query["MinimumEniQuantity"] = request.minimumEniQuantity; } if (!$dara.isNull(request.minimumEriQuantity)) { query["MinimumEriQuantity"] = request.minimumEriQuantity; } if (!$dara.isNull(request.minimumGPUAmount)) { query["MinimumGPUAmount"] = request.minimumGPUAmount; } if (!$dara.isNull(request.minimumInitialCredit)) { query["MinimumInitialCredit"] = request.minimumInitialCredit; } if (!$dara.isNull(request.minimumInstanceBandwidthRx)) { query["MinimumInstanceBandwidthRx"] = request.minimumInstanceBandwidthRx; } if (!$dara.isNull(request.minimumInstanceBandwidthTx)) { query["MinimumInstanceBandwidthTx"] = request.minimumInstanceBandwidthTx; } if (!$dara.isNull(request.minimumInstancePpsRx)) { query["MinimumInstancePpsRx"] = request.minimumInstancePpsRx; } if (!$dara.isNull(request.minimumInstancePpsTx)) { query["MinimumInstancePpsTx"] = request.minimumInstancePpsTx; } if (!$dara.isNull(request.minimumLocalStorageAmount)) { query["MinimumLocalStorageAmount"] = request.minimumLocalStorageAmount; } if (!$dara.isNull(request.minimumLocalStorageCapacity)) { query["MinimumLocalStorageCapacity"] = request.minimumLocalStorageCapacity; } if (!$dara.isNull(request.minimumMemorySize)) { query["MinimumMemorySize"] = request.minimumMemorySize; } if (!$dara.isNull(request.minimumPrimaryEniQueueNumber)) { query["MinimumPrimaryEniQueueNumber"] = request.minimumPrimaryEniQueueNumber; } if (!$dara.isNull(request.minimumQueuePairNumber)) { query["MinimumQueuePairNumber"] = request.minimumQueuePairNumber; } if (!$dara.isNull(request.minimumSecondaryEniQueueNumber)) { query["MinimumSecondaryEniQueueNumber"] = request.minimumSecondaryEniQueueNumber; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.nvmeSupport)) { query["NvmeSupport"] = request.nvmeSupport; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.physicalProcessorModel)) { query["PhysicalProcessorModel"] = request.physicalProcessorModel; } if (!$dara.isNull(request.physicalProcessorModels)) { query["PhysicalProcessorModels"] = request.physicalProcessorModels; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInstanceTypes", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInstanceTypesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInstanceTypesResponse({})); } /** * Queries the information about all instance types provided by Elastic Compute Service (ECS) and obtains the detailed information about the instance types. You can also query the information about specific instance types based on specific conditions. This helps you understand the configurations and performance of different instance types so that you can select instance types that meet your business requirements. * * @remarks * - **Paginated query**: You can set the MaxResults parameter to limit the number of instance types returned in each response. If only a subset of the queried instance types is returned, the NextToken parameter value is also returned. To perform a paginated query, set the NextToken parameter to the value returned by the previous call and set the MaxResults parameter. * - If you call this API operation without passing the NextToken parameter for paginated retrieval, only the first page of data (up to 100 entries) is returned by default. To retrieve more data, pass the NextToken parameter for paginated retrieval or pass filter conditions to limit the returned data range. * > The maximum value of the MaxResults parameter (maximum entries per page) is 100. For users who called this API before 2022, the maximum value of MaxResults remains 1600. On and after November 15, 2023, the maximum value of MaxResults will be reduced to 100 for all users, and 1600 will no longer be supported. * - DescribeInstanceTypes only queries the configuration and performance information of instance types. To query instance types available for purchase in a specific region, use [DescribeAvailableResource](https://help.aliyun.com/document_detail/66186.html). * * - If you require instance types that are not publicly available for sale or have special requirements, [submit a ticket](https://selfservice.console.aliyun.com/ticket/createIndex). * * * - If you require instance types that are not publicly available for sale or have special requirements, [submit a ticket](https://smartservice.console.aliyun.com/service/create-ticket-intl). * * @param request - DescribeInstanceTypesRequest * @returns DescribeInstanceTypesResponse */ async describeInstanceTypes(request: $_model.DescribeInstanceTypesRequest): Promise<$_model.DescribeInstanceTypesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstanceTypesWithOptions(request, runtime); } /** * Queries the VNC logon URL of an ECS instance. * * @remarks * - The API returns a VNC logon URL (VncUrl) that cannot be used directly. You can access the instance through the **management terminal URL**. * > To construct the management terminal URL, append `vncUrl=\\*\\*\\*\\*`, `instanceId=****`, and `isWindows=true/false` to the end of `https://g.alicdn.com/aliyun/ecs-console-vnc2/0.0.8/index.html?`, and connect the parameters with `&`. Parameters: * >- `vncUrl`: the VNC logon URL. * >- `instanceId`: the instance ID. * >- `isWindows`: specifies whether the operating system of the instance is Windows. A value of `true` indicates Windows. A value of `false` indicates non-Windows. * >- Password-free VNC connections are supported. You do not need to set the `password` parameter. * - The KeepAlive time of a single management terminal URL is 300 seconds. If no interaction occurs within 300 seconds, the connection is automatically closed. * - If the connection is interrupted, call this operation again to obtain a new `VncUrl` and construct a new management terminal URL to reconnect. You can reconnect up to 30 times per minute. * Example management terminal URL: * ``` * https://g.alicdn.com/aliyun/ecs-console-vnc2/0.0.8/index.html?vncUrl=ws%3A%2F%****&instanceId=i-wz9hhwq5a6tm****&isWindows=true * ```. * * @param request - DescribeInstanceVncUrlRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInstanceVncUrlResponse */ async describeInstanceVncUrlWithOptions(request: $_model.DescribeInstanceVncUrlRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInstanceVncUrlResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInstanceVncUrl", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInstanceVncUrlResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInstanceVncUrlResponse({})); } /** * Queries the VNC logon URL of an ECS instance. * * @remarks * - The API returns a VNC logon URL (VncUrl) that cannot be used directly. You can access the instance through the **management terminal URL**. * > To construct the management terminal URL, append `vncUrl=\\*\\*\\*\\*`, `instanceId=****`, and `isWindows=true/false` to the end of `https://g.alicdn.com/aliyun/ecs-console-vnc2/0.0.8/index.html?`, and connect the parameters with `&`. Parameters: * >- `vncUrl`: the VNC logon URL. * >- `instanceId`: the instance ID. * >- `isWindows`: specifies whether the operating system of the instance is Windows. A value of `true` indicates Windows. A value of `false` indicates non-Windows. * >- Password-free VNC connections are supported. You do not need to set the `password` parameter. * - The KeepAlive time of a single management terminal URL is 300 seconds. If no interaction occurs within 300 seconds, the connection is automatically closed. * - If the connection is interrupted, call this operation again to obtain a new `VncUrl` and construct a new management terminal URL to reconnect. You can reconnect up to 30 times per minute. * Example management terminal URL: * ``` * https://g.alicdn.com/aliyun/ecs-console-vnc2/0.0.8/index.html?vncUrl=ws%3A%2F%****&instanceId=i-wz9hhwq5a6tm****&isWindows=true * ```. * * @param request - DescribeInstanceVncUrlRequest * @returns DescribeInstanceVncUrlResponse */ async describeInstanceVncUrl(request: $_model.DescribeInstanceVncUrlRequest): Promise<$_model.DescribeInstanceVncUrlResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstanceVncUrlWithOptions(request, runtime); } /** * Queries a list of instances based on specified request conditions and returns the associated detailed information of the instances. * * @remarks * ### Before you begin * - When you invoke API operations by using Cloud Assistant CLI, make sure that request parameters of different data types are in the required formats. For more information, see [CLI parameter format](https://help.aliyun.com/document_detail/110340.html). * ### Usage notes * - Send a dry run request by using the DryRun request parameter to check the validity of parameters and authorization. * - When performing a paging query for the first page of results, set only `MaxResults` to limit the number of entries to return. The `NextToken` value in the response is used as the credential for querying subsequent pages. When performing a paging query for subsequent pages, set `NextToken` to the `NextToken` value obtained from the previous response and set `MaxResults` to limit the number of entries to return. * * @param request - DescribeInstancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInstancesResponse */ async describeInstancesWithOptions(request: $_model.DescribeInstancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInstancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.additionalAttributes)) { query["AdditionalAttributes"] = request.additionalAttributes; } if (!$dara.isNull(request.deviceAvailable)) { query["DeviceAvailable"] = request.deviceAvailable; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.eipAddresses)) { query["EipAddresses"] = request.eipAddresses; } if (!$dara.isNull(request.hpcClusterId)) { query["HpcClusterId"] = request.hpcClusterId; } if (!$dara.isNull(request.httpEndpoint)) { query["HttpEndpoint"] = request.httpEndpoint; } if (!$dara.isNull(request.httpPutResponseHopLimit)) { query["HttpPutResponseHopLimit"] = request.httpPutResponseHopLimit; } if (!$dara.isNull(request.httpTokens)) { query["HttpTokens"] = request.httpTokens; } if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.innerIpAddresses)) { query["InnerIpAddresses"] = request.innerIpAddresses; } if (!$dara.isNull(request.instanceChargeType)) { query["InstanceChargeType"] = request.instanceChargeType; } if (!$dara.isNull(request.instanceIds)) { query["InstanceIds"] = request.instanceIds; } if (!$dara.isNull(request.instanceName)) { query["InstanceName"] = request.instanceName; } if (!$dara.isNull(request.instanceNetworkType)) { query["InstanceNetworkType"] = request.instanceNetworkType; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.instanceTypeFamily)) { query["InstanceTypeFamily"] = request.instanceTypeFamily; } if (!$dara.isNull(request.internetChargeType)) { query["InternetChargeType"] = request.internetChargeType; } if (!$dara.isNull(request.ioOptimized)) { query["IoOptimized"] = request.ioOptimized; } if (!$dara.isNull(request.ipv6Address)) { query["Ipv6Address"] = request.ipv6Address; } if (!$dara.isNull(request.keyPairName)) { query["KeyPairName"] = request.keyPairName; } if (!$dara.isNull(request.lockReason)) { query["LockReason"] = request.lockReason; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.needSaleCycle)) { query["NeedSaleCycle"] = request.needSaleCycle; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.privateIpAddresses)) { query["PrivateIpAddresses"] = request.privateIpAddresses; } if (!$dara.isNull(request.publicIpAddresses)) { query["PublicIpAddresses"] = request.publicIpAddresses; } if (!$dara.isNull(request.rdmaIpAddresses)) { query["RdmaIpAddresses"] = request.rdmaIpAddresses; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.vSwitchId)) { query["VSwitchId"] = request.vSwitchId; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } if (!$dara.isNull(request.filter)) { query["Filter"] = request.filter; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInstances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInstancesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInstancesResponse({})); } /** * Queries a list of instances based on specified request conditions and returns the associated detailed information of the instances. * * @remarks * ### Before you begin * - When you invoke API operations by using Cloud Assistant CLI, make sure that request parameters of different data types are in the required formats. For more information, see [CLI parameter format](https://help.aliyun.com/document_detail/110340.html). * ### Usage notes * - Send a dry run request by using the DryRun request parameter to check the validity of parameters and authorization. * - When performing a paging query for the first page of results, set only `MaxResults` to limit the number of entries to return. The `NextToken` value in the response is used as the credential for querying subsequent pages. When performing a paging query for subsequent pages, set `NextToken` to the `NextToken` value obtained from the previous response and set `MaxResults` to limit the number of entries to return. * * @param request - DescribeInstancesRequest * @returns DescribeInstancesResponse */ async describeInstances(request: $_model.DescribeInstancesRequest): Promise<$_model.DescribeInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstancesWithOptions(request, runtime); } /** * Queries the full status information of one or more Elastic Compute Service (ECS) instances. The full status information includes the instance status and the status of instance system events. The instance status is the lifecycle status of instances. The status of instance system events is the health status of maintenance events. * * @remarks * ## [](#)Usage notes * The response includes the instance status and the instance system events that are in the Scheduled state. * You can specify a period of time to query events that occurred within the period of time. * * @param request - DescribeInstancesFullStatusRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInstancesFullStatusResponse */ async describeInstancesFullStatusWithOptions(request: $_model.DescribeInstancesFullStatusRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInstancesFullStatusResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.eventId)) { query["EventId"] = request.eventId; } if (!$dara.isNull(request.eventType)) { query["EventType"] = request.eventType; } if (!$dara.isNull(request.healthStatus)) { query["HealthStatus"] = request.healthStatus; } if (!$dara.isNull(request.instanceEventType)) { query["InstanceEventType"] = request.instanceEventType; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.eventPublishTime)) { query["EventPublishTime"] = request.eventPublishTime; } if (!$dara.isNull(request.notBefore)) { query["NotBefore"] = request.notBefore; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInstancesFullStatus", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInstancesFullStatusResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInstancesFullStatusResponse({})); } /** * Queries the full status information of one or more Elastic Compute Service (ECS) instances. The full status information includes the instance status and the status of instance system events. The instance status is the lifecycle status of instances. The status of instance system events is the health status of maintenance events. * * @remarks * ## [](#)Usage notes * The response includes the instance status and the instance system events that are in the Scheduled state. * You can specify a period of time to query events that occurred within the period of time. * * @param request - DescribeInstancesFullStatusRequest * @returns DescribeInstancesFullStatusResponse */ async describeInstancesFullStatus(request: $_model.DescribeInstancesFullStatusRequest): Promise<$_model.DescribeInstancesFullStatusResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstancesFullStatusWithOptions(request, runtime); } /** * Queries the execution results of one or more Cloud Assistant commands, which are the actual execution results on ECS instances. * * @remarks * ## Operation description * - After you run a command, the command is not guaranteed to succeed or produce the expected results. Call this operation to view the actual execution results based on the actual output. * - You can query execution information from the last 30 days. A maximum of 10,000 entries of execution information can be retained. * - You can use [Cloud Assistant task status event subscription](https://help.aliyun.com/document_detail/2669130.html) to obtain task results through events, which avoids frequent polling and improves efficiency. * - When paged query the first page, set only MaxResults to limit the number of entries to return. The NextToken value in the response serves as the token for querying subsequent pages. When paged query subsequent pages, set NextToken to the NextToken value obtained from the previous response and set MaxResults to limit the number of entries to return. * - Differences between `DescribeInvocations` and `DescribeInvocationResults`: * - When a single `RunCommand`/`InvokeCommand` call specifies multiple instances: * - `DescribeInvocations` returns the execution status on each instance and the aggregated status across all instances. * - `DescribeInvocationResults` returns only the individual execution status on each instance, without the aggregated status across instances. * - When a single `RunCommand`/`InvokeCommand` call specifies one instance: * - `DescribeInvocations` and `DescribeInvocationResults` are largely interchangeable. * - When you want to view the execution history of scheduled (periodic) tasks or tasks that run at each system startup (`RepeatMode=Period, EveryReboot`), only `DescribeInvocationResults` can return historical execution records (you must specify `IncludeHistory=true`). `DescribeInvocations` returns only the latest task status. * - When you want to view the command content and parameters, only `DescribeInvocations` returns `CommandContent`. * * @param request - DescribeInvocationResultsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInvocationResultsResponse */ async describeInvocationResultsWithOptions(request: $_model.DescribeInvocationResultsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInvocationResultsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.commandId)) { query["CommandId"] = request.commandId; } if (!$dara.isNull(request.contentEncoding)) { query["ContentEncoding"] = request.contentEncoding; } if (!$dara.isNull(request.includeHistory)) { query["IncludeHistory"] = request.includeHistory; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.invokeId)) { query["InvokeId"] = request.invokeId; } if (!$dara.isNull(request.invokeRecordStatus)) { query["InvokeRecordStatus"] = request.invokeRecordStatus; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInvocationResults", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInvocationResultsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInvocationResultsResponse({})); } /** * Queries the execution results of one or more Cloud Assistant commands, which are the actual execution results on ECS instances. * * @remarks * ## Operation description * - After you run a command, the command is not guaranteed to succeed or produce the expected results. Call this operation to view the actual execution results based on the actual output. * - You can query execution information from the last 30 days. A maximum of 10,000 entries of execution information can be retained. * - You can use [Cloud Assistant task status event subscription](https://help.aliyun.com/document_detail/2669130.html) to obtain task results through events, which avoids frequent polling and improves efficiency. * - When paged query the first page, set only MaxResults to limit the number of entries to return. The NextToken value in the response serves as the token for querying subsequent pages. When paged query subsequent pages, set NextToken to the NextToken value obtained from the previous response and set MaxResults to limit the number of entries to return. * - Differences between `DescribeInvocations` and `DescribeInvocationResults`: * - When a single `RunCommand`/`InvokeCommand` call specifies multiple instances: * - `DescribeInvocations` returns the execution status on each instance and the aggregated status across all instances. * - `DescribeInvocationResults` returns only the individual execution status on each instance, without the aggregated status across instances. * - When a single `RunCommand`/`InvokeCommand` call specifies one instance: * - `DescribeInvocations` and `DescribeInvocationResults` are largely interchangeable. * - When you want to view the execution history of scheduled (periodic) tasks or tasks that run at each system startup (`RepeatMode=Period, EveryReboot`), only `DescribeInvocationResults` can return historical execution records (you must specify `IncludeHistory=true`). `DescribeInvocations` returns only the latest task status. * - When you want to view the command content and parameters, only `DescribeInvocations` returns `CommandContent`. * * @param request - DescribeInvocationResultsRequest * @returns DescribeInvocationResultsResponse */ async describeInvocationResults(request: $_model.DescribeInvocationResultsRequest): Promise<$_model.DescribeInvocationResultsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInvocationResultsWithOptions(request, runtime); } /** * Queries the execution list and status of Cloud Assistant commands. * * @remarks * - After you run a command, the command does not necessarily run successfully or produce the expected results. You must check the actual execution results based on the return values of this operation. The actual output takes precedence. * - You can query execution information from the last 30 days. A maximum of 10,000 execution records are retained. * - You can subscribe to [Cloud Assistant task status events](https://help.aliyun.com/document_detail/2669130.html) to obtain task results through events, which avoids frequent polling and improves efficiency. * - When paged query the first page, set only MaxResults to limit the number of entries to return. The NextToken value in the response serves as the token for querying subsequent pages. When paged query subsequent pages, set NextToken to the NextToken value obtained from the previous response and set MaxResults to limit the number of entries to return. * - Differences between `DescribeInvocations` and `DescribeInvocationResults`: * - When a single `RunCommand`/`InvokeCommand` call specifies multiple instances: * - `DescribeInvocations` returns the execution status on each instance and the aggregated status across all instances. * - `DescribeInvocationResults` returns only the individual execution status on each instance, without the aggregated status. * - When a single `RunCommand`/`InvokeCommand` call specifies one instance: * - `DescribeInvocations` and `DescribeInvocationResults` are largely interchangeable. * - To view the execution details of each run for scheduled (periodic) or boot-triggered tasks (`RepeatMode=Period, EveryReboot`), only `DescribeInvocationResults` can return historical execution records (with `IncludeHistory=true` specified). `DescribeInvocations` returns only the latest task status. * - To view the command content and parameters, only `DescribeInvocations` returns `CommandContent`. * * @param request - DescribeInvocationsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeInvocationsResponse */ async describeInvocationsWithOptions(request: $_model.DescribeInvocationsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeInvocationsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.commandId)) { query["CommandId"] = request.commandId; } if (!$dara.isNull(request.commandName)) { query["CommandName"] = request.commandName; } if (!$dara.isNull(request.commandType)) { query["CommandType"] = request.commandType; } if (!$dara.isNull(request.contentEncoding)) { query["ContentEncoding"] = request.contentEncoding; } if (!$dara.isNull(request.includeOutput)) { query["IncludeOutput"] = request.includeOutput; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.invokeId)) { query["InvokeId"] = request.invokeId; } if (!$dara.isNull(request.invokeStatus)) { query["InvokeStatus"] = request.invokeStatus; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.repeatMode)) { query["RepeatMode"] = request.repeatMode; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.timed)) { query["Timed"] = request.timed; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeInvocations", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeInvocationsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeInvocationsResponse({})); } /** * Queries the execution list and status of Cloud Assistant commands. * * @remarks * - After you run a command, the command does not necessarily run successfully or produce the expected results. You must check the actual execution results based on the return values of this operation. The actual output takes precedence. * - You can query execution information from the last 30 days. A maximum of 10,000 execution records are retained. * - You can subscribe to [Cloud Assistant task status events](https://help.aliyun.com/document_detail/2669130.html) to obtain task results through events, which avoids frequent polling and improves efficiency. * - When paged query the first page, set only MaxResults to limit the number of entries to return. The NextToken value in the response serves as the token for querying subsequent pages. When paged query subsequent pages, set NextToken to the NextToken value obtained from the previous response and set MaxResults to limit the number of entries to return. * - Differences between `DescribeInvocations` and `DescribeInvocationResults`: * - When a single `RunCommand`/`InvokeCommand` call specifies multiple instances: * - `DescribeInvocations` returns the execution status on each instance and the aggregated status across all instances. * - `DescribeInvocationResults` returns only the individual execution status on each instance, without the aggregated status. * - When a single `RunCommand`/`InvokeCommand` call specifies one instance: * - `DescribeInvocations` and `DescribeInvocationResults` are largely interchangeable. * - To view the execution details of each run for scheduled (periodic) or boot-triggered tasks (`RepeatMode=Period, EveryReboot`), only `DescribeInvocationResults` can return historical execution records (with `IncludeHistory=true` specified). `DescribeInvocations` returns only the latest task status. * - To view the command content and parameters, only `DescribeInvocations` returns `CommandContent`. * * @param request - DescribeInvocationsRequest * @returns DescribeInvocationsResponse */ async describeInvocations(request: $_model.DescribeInvocationsRequest): Promise<$_model.DescribeInvocationsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInvocationsWithOptions(request, runtime); } /** * Queries one or more key pairs. * * @param request - DescribeKeyPairsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeKeyPairsResponse */ async describeKeyPairsWithOptions(request: $_model.DescribeKeyPairsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeKeyPairsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.includePublicKey)) { query["IncludePublicKey"] = request.includePublicKey; } if (!$dara.isNull(request.keyPairFingerPrint)) { query["KeyPairFingerPrint"] = request.keyPairFingerPrint; } if (!$dara.isNull(request.keyPairName)) { query["KeyPairName"] = request.keyPairName; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeKeyPairs", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeKeyPairsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeKeyPairsResponse({})); } /** * Queries one or more key pairs. * * @param request - DescribeKeyPairsRequest * @returns DescribeKeyPairsResponse */ async describeKeyPairs(request: $_model.DescribeKeyPairsRequest): Promise<$_model.DescribeKeyPairsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeKeyPairsWithOptions(request, runtime); } /** * Queries information about launch template versions of ECS instances, such as the total number of launch templates, template names, and template version numbers. * * @param request - DescribeLaunchTemplateVersionsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeLaunchTemplateVersionsResponse */ async describeLaunchTemplateVersionsWithOptions(request: $_model.DescribeLaunchTemplateVersionsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeLaunchTemplateVersionsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.defaultVersion)) { query["DefaultVersion"] = request.defaultVersion; } if (!$dara.isNull(request.detailFlag)) { query["DetailFlag"] = request.detailFlag; } if (!$dara.isNull(request.launchTemplateId)) { query["LaunchTemplateId"] = request.launchTemplateId; } if (!$dara.isNull(request.launchTemplateName)) { query["LaunchTemplateName"] = request.launchTemplateName; } if (!$dara.isNull(request.launchTemplateVersion)) { query["LaunchTemplateVersion"] = request.launchTemplateVersion; } if (!$dara.isNull(request.maxVersion)) { query["MaxVersion"] = request.maxVersion; } if (!$dara.isNull(request.minVersion)) { query["MinVersion"] = request.minVersion; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeLaunchTemplateVersions", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeLaunchTemplateVersionsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeLaunchTemplateVersionsResponse({})); } /** * Queries information about launch template versions of ECS instances, such as the total number of launch templates, template names, and template version numbers. * * @param request - DescribeLaunchTemplateVersionsRequest * @returns DescribeLaunchTemplateVersionsResponse */ async describeLaunchTemplateVersions(request: $_model.DescribeLaunchTemplateVersionsRequest): Promise<$_model.DescribeLaunchTemplateVersionsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeLaunchTemplateVersionsWithOptions(request, runtime); } /** * Calls the DescribeLaunchTemplates operation. You can specify parameters such as TemplateTag, TemplateResourceGroupId, and LaunchTemplateId to query information about one or more launch templates, including the total number of launch templates, template creation time, and latest version number. * * @param request - DescribeLaunchTemplatesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeLaunchTemplatesResponse */ async describeLaunchTemplatesWithOptions(request: $_model.DescribeLaunchTemplatesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeLaunchTemplatesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.launchTemplateId)) { query["LaunchTemplateId"] = request.launchTemplateId; } if (!$dara.isNull(request.launchTemplateName)) { query["LaunchTemplateName"] = request.launchTemplateName; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.templateResourceGroupId)) { query["TemplateResourceGroupId"] = request.templateResourceGroupId; } if (!$dara.isNull(request.templateTag)) { query["TemplateTag"] = request.templateTag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeLaunchTemplates", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeLaunchTemplatesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeLaunchTemplatesResponse({})); } /** * Calls the DescribeLaunchTemplates operation. You can specify parameters such as TemplateTag, TemplateResourceGroupId, and LaunchTemplateId to query information about one or more launch templates, including the total number of launch templates, template creation time, and latest version number. * * @param request - DescribeLaunchTemplatesRequest * @returns DescribeLaunchTemplatesResponse */ async describeLaunchTemplates(request: $_model.DescribeLaunchTemplatesRequest): Promise<$_model.DescribeLaunchTemplatesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeLaunchTemplatesWithOptions(request, runtime); } /** * Queries the limitations on your account. * * @deprecated OpenAPI DescribeLimitation is deprecated * * @param request - DescribeLimitationRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeLimitationResponse */ async describeLimitationWithOptions(request: $_model.DescribeLimitationRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeLimitationResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.limitation)) { query["Limitation"] = request.limitation; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeLimitation", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeLimitationResponse>(await this.callApi(params, req, runtime), new $_model.DescribeLimitationResponse({})); } /** * Queries the limitations on your account. * * @deprecated OpenAPI DescribeLimitation is deprecated * * @param request - DescribeLimitationRequest * @returns DescribeLimitationResponse */ // Deprecated async describeLimitation(request: $_model.DescribeLimitationRequest): Promise<$_model.DescribeLimitationResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeLimitationWithOptions(request, runtime); } /** * Queries the lock status and configuration of a snapshot. * * @param request - DescribeLockedSnapshotsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeLockedSnapshotsResponse */ async describeLockedSnapshotsWithOptions(request: $_model.DescribeLockedSnapshotsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeLockedSnapshotsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.lockStatus)) { query["LockStatus"] = request.lockStatus; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.snapshotIds)) { query["SnapshotIds"] = request.snapshotIds; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeLockedSnapshots", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeLockedSnapshotsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeLockedSnapshotsResponse({})); } /** * Queries the lock status and configuration of a snapshot. * * @param request - DescribeLockedSnapshotsRequest * @returns DescribeLockedSnapshotsResponse */ async describeLockedSnapshots(request: $_model.DescribeLockedSnapshotsRequest): Promise<$_model.DescribeLockedSnapshotsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeLockedSnapshotsWithOptions(request, runtime); } /** * Queries managed instances. * * @remarks * When performing a paged query on the home page, you only need to set `MaxResults` to limit the number of entries in the return result. The `NextToken` in the returned result serves as the credential for querying subsequent pages. When querying subsequent pages, set the `NextToken` parameter to the `NextToken` obtained from the previous response as the query credential, and set `MaxResults` to limit the number of returned entries. * * @param request - DescribeManagedInstancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeManagedInstancesResponse */ async describeManagedInstancesWithOptions(request: $_model.DescribeManagedInstancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeManagedInstancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.activationId)) { query["ActivationId"] = request.activationId; } if (!$dara.isNull(request.connected)) { query["Connected"] = request.connected; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.instanceIp)) { query["InstanceIp"] = request.instanceIp; } if (!$dara.isNull(request.instanceName)) { query["InstanceName"] = request.instanceName; } if (!$dara.isNull(request.machineId)) { query["MachineId"] = request.machineId; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.osType)) { query["OsType"] = request.osType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeManagedInstances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeManagedInstancesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeManagedInstancesResponse({})); } /** * Queries managed instances. * * @remarks * When performing a paged query on the home page, you only need to set `MaxResults` to limit the number of entries in the return result. The `NextToken` in the returned result serves as the credential for querying subsequent pages. When querying subsequent pages, set the `NextToken` parameter to the `NextToken` obtained from the previous response as the query credential, and set `MaxResults` to limit the number of returned entries. * * @param request - DescribeManagedInstancesRequest * @returns DescribeManagedInstancesResponse */ async describeManagedInstances(request: $_model.DescribeManagedInstancesRequest): Promise<$_model.DescribeManagedInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeManagedInstancesWithOptions(request, runtime); } /** * DescribeNatGateways * * @deprecated OpenAPI DescribeNatGateways is deprecated, please use Vpc::2016-04-28::DescribeNatGateways instead. * * @param request - DescribeNatGatewaysRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeNatGatewaysResponse */ async describeNatGatewaysWithOptions(request: $_model.DescribeNatGatewaysRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeNatGatewaysResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.natGatewayId)) { query["NatGatewayId"] = request.natGatewayId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeNatGateways", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeNatGatewaysResponse>(await this.callApi(params, req, runtime), new $_model.DescribeNatGatewaysResponse({})); } /** * DescribeNatGateways * * @deprecated OpenAPI DescribeNatGateways is deprecated, please use Vpc::2016-04-28::DescribeNatGateways instead. * * @param request - DescribeNatGatewaysRequest * @returns DescribeNatGatewaysResponse */ // Deprecated async describeNatGateways(request: $_model.DescribeNatGatewaysRequest): Promise<$_model.DescribeNatGatewaysResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeNatGatewaysWithOptions(request, runtime); } /** * Provides details about a specified elastic network interface. * * @param request - DescribeNetworkInterfaceAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeNetworkInterfaceAttributeResponse */ async describeNetworkInterfaceAttributeWithOptions(request: $_model.DescribeNetworkInterfaceAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeNetworkInterfaceAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.attribute)) { query["Attribute"] = request.attribute; } if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeNetworkInterfaceAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeNetworkInterfaceAttributeResponse>(await this.callApi(params, req, runtime), new $_model.DescribeNetworkInterfaceAttributeResponse({})); } /** * Provides details about a specified elastic network interface. * * @param request - DescribeNetworkInterfaceAttributeRequest * @returns DescribeNetworkInterfaceAttributeResponse */ async describeNetworkInterfaceAttribute(request: $_model.DescribeNetworkInterfaceAttributeRequest): Promise<$_model.DescribeNetworkInterfaceAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeNetworkInterfaceAttributeWithOptions(request, runtime); } /** * Queries the list of Elastic Network Interface (ENI) permissions that you have granted to an Alibaba Cloud partner (certified ISV) or an individual user. * * @param request - DescribeNetworkInterfacePermissionsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeNetworkInterfacePermissionsResponse */ async describeNetworkInterfacePermissionsWithOptions(request: $_model.DescribeNetworkInterfacePermissionsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeNetworkInterfacePermissionsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.networkInterfacePermissionId)) { query["NetworkInterfacePermissionId"] = request.networkInterfacePermissionId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeNetworkInterfacePermissions", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeNetworkInterfacePermissionsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeNetworkInterfacePermissionsResponse({})); } /** * Queries the list of Elastic Network Interface (ENI) permissions that you have granted to an Alibaba Cloud partner (certified ISV) or an individual user. * * @param request - DescribeNetworkInterfacePermissionsRequest * @returns DescribeNetworkInterfacePermissionsResponse */ async describeNetworkInterfacePermissions(request: $_model.DescribeNetworkInterfacePermissionsRequest): Promise<$_model.DescribeNetworkInterfacePermissionsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeNetworkInterfacePermissionsWithOptions(request, runtime); } /** * Queries the details of one or more Elastic Network Interface (ENIs). * * @remarks * ## [](#)Usage notes * You can call the `DescribeNetworkInterfaces` operation for paged query by specifying the `MaxResults` or `NextToken` parameter. Take note of the following items: * - During a paged query, when you call the DescribeNetworkInterfaces operation to retrieve the first page of results, set `MaxResults` to specify the maximum number of entries to return in the call. The return value of `NextToken` is a pagination token that can be used in the next call to retrieve a new page of results. * - When you call the DescribeNetworkInterfaces operation to retrieve a new page of results, set `NextToken` to the `NextToken` value returned in the previous call and set `MaxResults` to specify the maximum number of entries to return in this call. * * @param request - DescribeNetworkInterfacesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeNetworkInterfacesResponse */ async describeNetworkInterfacesWithOptions(request: $_model.DescribeNetworkInterfacesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeNetworkInterfacesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ipv6Address)) { query["Ipv6Address"] = request.ipv6Address; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.networkInterfaceName)) { query["NetworkInterfaceName"] = request.networkInterfaceName; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.primaryIpAddress)) { query["PrimaryIpAddress"] = request.primaryIpAddress; } if (!$dara.isNull(request.privateIpAddress)) { query["PrivateIpAddress"] = request.privateIpAddress; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.serviceManaged)) { query["ServiceManaged"] = request.serviceManaged; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.type)) { query["Type"] = request.type; } if (!$dara.isNull(request.vSwitchId)) { query["VSwitchId"] = request.vSwitchId; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeNetworkInterfaces", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeNetworkInterfacesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeNetworkInterfacesResponse({})); } /** * Queries the details of one or more Elastic Network Interface (ENIs). * * @remarks * ## [](#)Usage notes * You can call the `DescribeNetworkInterfaces` operation for paged query by specifying the `MaxResults` or `NextToken` parameter. Take note of the following items: * - During a paged query, when you call the DescribeNetworkInterfaces operation to retrieve the first page of results, set `MaxResults` to specify the maximum number of entries to return in the call. The return value of `NextToken` is a pagination token that can be used in the next call to retrieve a new page of results. * - When you call the DescribeNetworkInterfaces operation to retrieve a new page of results, set `NextToken` to the `NextToken` value returned in the previous call and set `MaxResults` to specify the maximum number of entries to return in this call. * * @param request - DescribeNetworkInterfacesRequest * @returns DescribeNetworkInterfacesResponse */ async describeNetworkInterfaces(request: $_model.DescribeNetworkInterfacesRequest): Promise<$_model.DescribeNetworkInterfacesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeNetworkInterfacesWithOptions(request, runtime); } /** * Queries the monitoring data of an Elastic IP Address (EIP) associated with a new project. * * @deprecated OpenAPI DescribeNewProjectEipMonitorData is deprecated, please use Vpc::2016-04-28::DescribeEipMonitorData instead. * * @param request - DescribeNewProjectEipMonitorDataRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeNewProjectEipMonitorDataResponse */ async describeNewProjectEipMonitorDataWithOptions(request: $_model.DescribeNewProjectEipMonitorDataRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeNewProjectEipMonitorDataResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.allocationId)) { query["AllocationId"] = request.allocationId; } if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeNewProjectEipMonitorData", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeNewProjectEipMonitorDataResponse>(await this.callApi(params, req, runtime), new $_model.DescribeNewProjectEipMonitorDataResponse({})); } /** * Queries the monitoring data of an Elastic IP Address (EIP) associated with a new project. * * @deprecated OpenAPI DescribeNewProjectEipMonitorData is deprecated, please use Vpc::2016-04-28::DescribeEipMonitorData instead. * * @param request - DescribeNewProjectEipMonitorDataRequest * @returns DescribeNewProjectEipMonitorDataResponse */ // Deprecated async describeNewProjectEipMonitorData(request: $_model.DescribeNewProjectEipMonitorDataRequest): Promise<$_model.DescribeNewProjectEipMonitorDataResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeNewProjectEipMonitorDataWithOptions(request, runtime); } /** * Queries physical connections. * * @deprecated OpenAPI DescribePhysicalConnections is deprecated, please use Vpc::2016-04-28::DescribePhysicalConnections instead. * * @param request - DescribePhysicalConnectionsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribePhysicalConnectionsResponse */ async describePhysicalConnectionsWithOptions(request: $_model.DescribePhysicalConnectionsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribePhysicalConnectionsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.filter)) { query["Filter"] = request.filter; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribePhysicalConnections", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribePhysicalConnectionsResponse>(await this.callApi(params, req, runtime), new $_model.DescribePhysicalConnectionsResponse({})); } /** * Queries physical connections. * * @deprecated OpenAPI DescribePhysicalConnections is deprecated, please use Vpc::2016-04-28::DescribePhysicalConnections instead. * * @param request - DescribePhysicalConnectionsRequest * @returns DescribePhysicalConnectionsResponse */ // Deprecated async describePhysicalConnections(request: $_model.DescribePhysicalConnectionsRequest): Promise<$_model.DescribePhysicalConnectionsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describePhysicalConnectionsWithOptions(request, runtime); } /** * Queries O&M windows. * * @remarks * Queries the configured maintenance policies. Each policy contains two maintenance attributes: * - Maintenance time window: A time period you specify during which O&M operations are performed. * - Maintenance action: The instance downtime handling policy you specify. * * @param tmpReq - DescribePlanMaintenanceWindowsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribePlanMaintenanceWindowsResponse */ async describePlanMaintenanceWindowsWithOptions(tmpReq: $_model.DescribePlanMaintenanceWindowsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribePlanMaintenanceWindowsResponse> { tmpReq.validate(); let request = new $_model.DescribePlanMaintenanceWindowsShrinkRequest({ }); OpenApiUtil.convert(tmpReq, request); if (!$dara.isNull(tmpReq.targetResourceTags)) { request.targetResourceTagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.targetResourceTags, "TargetResourceTags", "json"); } let query = { }; if (!$dara.isNull(request.enable)) { query["Enable"] = request.enable; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.planWindowId)) { query["PlanWindowId"] = request.planWindowId; } if (!$dara.isNull(request.planWindowName)) { query["PlanWindowName"] = request.planWindowName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.targetResourceGroupId)) { query["TargetResourceGroupId"] = request.targetResourceGroupId; } if (!$dara.isNull(request.targetResourceTagsShrink)) { query["TargetResourceTags"] = request.targetResourceTagsShrink; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribePlanMaintenanceWindows", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribePlanMaintenanceWindowsResponse>(await this.callApi(params, req, runtime), new $_model.DescribePlanMaintenanceWindowsResponse({})); } /** * Queries O&M windows. * * @remarks * Queries the configured maintenance policies. Each policy contains two maintenance attributes: * - Maintenance time window: A time period you specify during which O&M operations are performed. * - Maintenance action: The instance downtime handling policy you specify. * * @param request - DescribePlanMaintenanceWindowsRequest * @returns DescribePlanMaintenanceWindowsResponse */ async describePlanMaintenanceWindows(request: $_model.DescribePlanMaintenanceWindowsRequest): Promise<$_model.DescribePlanMaintenanceWindowsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describePlanMaintenanceWindowsWithOptions(request, runtime); } /** * Queries the resources that are associated with a port list, such as security groups. * * @param request - DescribePortRangeListAssociationsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribePortRangeListAssociationsResponse */ async describePortRangeListAssociationsWithOptions(request: $_model.DescribePortRangeListAssociationsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribePortRangeListAssociationsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.portRangeListId)) { query["PortRangeListId"] = request.portRangeListId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribePortRangeListAssociations", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribePortRangeListAssociationsResponse>(await this.callApi(params, req, runtime), new $_model.DescribePortRangeListAssociationsResponse({})); } /** * Queries the resources that are associated with a port list, such as security groups. * * @param request - DescribePortRangeListAssociationsRequest * @returns DescribePortRangeListAssociationsResponse */ async describePortRangeListAssociations(request: $_model.DescribePortRangeListAssociationsRequest): Promise<$_model.DescribePortRangeListAssociationsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describePortRangeListAssociationsWithOptions(request, runtime); } /** * Queries the entries of a specified port range list. * * @param request - DescribePortRangeListEntriesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribePortRangeListEntriesResponse */ async describePortRangeListEntriesWithOptions(request: $_model.DescribePortRangeListEntriesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribePortRangeListEntriesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.portRangeListId)) { query["PortRangeListId"] = request.portRangeListId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribePortRangeListEntries", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribePortRangeListEntriesResponse>(await this.callApi(params, req, runtime), new $_model.DescribePortRangeListEntriesResponse({})); } /** * Queries the entries of a specified port range list. * * @param request - DescribePortRangeListEntriesRequest * @returns DescribePortRangeListEntriesResponse */ async describePortRangeListEntries(request: $_model.DescribePortRangeListEntriesRequest): Promise<$_model.DescribePortRangeListEntriesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describePortRangeListEntriesWithOptions(request, runtime); } /** * Queries the port lists. * * @param request - DescribePortRangeListsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribePortRangeListsResponse */ async describePortRangeListsWithOptions(request: $_model.DescribePortRangeListsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribePortRangeListsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.portRangeListId)) { query["PortRangeListId"] = request.portRangeListId; } if (!$dara.isNull(request.portRangeListName)) { query["PortRangeListName"] = request.portRangeListName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribePortRangeLists", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribePortRangeListsResponse>(await this.callApi(params, req, runtime), new $_model.DescribePortRangeListsResponse({})); } /** * Queries the port lists. * * @param request - DescribePortRangeListsRequest * @returns DescribePortRangeListsResponse */ async describePortRangeLists(request: $_model.DescribePortRangeListsRequest): Promise<$_model.DescribePortRangeListsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describePortRangeListsWithOptions(request, runtime); } /** * Queries information about resources that are associated with a prefix list, such as the resource IDs and types. * * @param request - DescribePrefixListAssociationsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribePrefixListAssociationsResponse */ async describePrefixListAssociationsWithOptions(request: $_model.DescribePrefixListAssociationsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribePrefixListAssociationsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.prefixListId)) { query["PrefixListId"] = request.prefixListId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribePrefixListAssociations", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribePrefixListAssociationsResponse>(await this.callApi(params, req, runtime), new $_model.DescribePrefixListAssociationsResponse({})); } /** * Queries information about resources that are associated with a prefix list, such as the resource IDs and types. * * @param request - DescribePrefixListAssociationsRequest * @returns DescribePrefixListAssociationsResponse */ async describePrefixListAssociations(request: $_model.DescribePrefixListAssociationsRequest): Promise<$_model.DescribePrefixListAssociationsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describePrefixListAssociationsWithOptions(request, runtime); } /** * Queries the details of a prefix list, including the name, address family, maximum number of entries, and details of the entries. * * @param request - DescribePrefixListAttributesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribePrefixListAttributesResponse */ async describePrefixListAttributesWithOptions(request: $_model.DescribePrefixListAttributesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribePrefixListAttributesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.prefixListId)) { query["PrefixListId"] = request.prefixListId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribePrefixListAttributes", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribePrefixListAttributesResponse>(await this.callApi(params, req, runtime), new $_model.DescribePrefixListAttributesResponse({})); } /** * Queries the details of a prefix list, including the name, address family, maximum number of entries, and details of the entries. * * @param request - DescribePrefixListAttributesRequest * @returns DescribePrefixListAttributesResponse */ async describePrefixListAttributes(request: $_model.DescribePrefixListAttributesRequest): Promise<$_model.DescribePrefixListAttributesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describePrefixListAttributesWithOptions(request, runtime); } /** * Queries the information of prefix lists. * * @remarks * You can specify the `AddressFamily`, `PrefixListId.N`, and `PrefixListName` request parameters in the request. Specified parameters have logical AND relations. Only the parameters that you set are included in the filter conditions. * * @param request - DescribePrefixListsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribePrefixListsResponse */ async describePrefixListsWithOptions(request: $_model.DescribePrefixListsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribePrefixListsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.addressFamily)) { query["AddressFamily"] = request.addressFamily; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.prefixListId)) { query["PrefixListId"] = request.prefixListId; } if (!$dara.isNull(request.prefixListName)) { query["PrefixListName"] = request.prefixListName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribePrefixLists", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribePrefixListsResponse>(await this.callApi(params, req, runtime), new $_model.DescribePrefixListsResponse({})); } /** * Queries the information of prefix lists. * * @remarks * You can specify the `AddressFamily`, `PrefixListId.N`, and `PrefixListName` request parameters in the request. Specified parameters have logical AND relations. Only the parameters that you set are included in the filter conditions. * * @param request - DescribePrefixListsRequest * @returns DescribePrefixListsResponse */ async describePrefixLists(request: $_model.DescribePrefixListsRequest): Promise<$_model.DescribePrefixListsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describePrefixListsWithOptions(request, runtime); } /** * Queries the latest prices of specified resources. You can query the latest prices of ECS instances, disks, dedicated hosts, elasticity assurance services, and capacity reservation services based on resource type. The response includes promotion rules, prices, and discounts. * * @remarks * The parameter settings vary based on the resource type: * - When `ResourceType=instance`, you must also specify `InstanceType`. * By default, the price of the pay-as-you-go (`PostPaid`) billing method (`ChargeType`) is queried. You can specify the `PriceUnit` parameter to query Elastic Compute Service (ECS) prices for different billing cycles. * - When `ResourceType=disk`, you must also specify `DataDisk.1.Category` and `DataDisk.1.Size`. When you query the price of `disk` resources, only the pay-as-you-go price of disks is returned. This means that the `PriceUnit` parameter can only be set to `Hour`. * - When `ResourceType=diskperformance`, you must also specify `DataDisk.1.Category` and `DataDisk.1.ProvisionedIops`. * - When `ResourceType=ddh`, you must also specify `DedicatedHostType`. * - When `ResourceType=ElasticityAssurance`, you must also specify `InstanceType`. * - When `ResourceType=CapacityReservation`, you must also specify `InstanceType`. * - When `ResourceType=bandwidth`, only the pay-by-traffic (`PayByTraffic`) price is returned. * * @param request - DescribePriceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribePriceResponse */ async describePriceWithOptions(request: $_model.DescribePriceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribePriceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.amount)) { query["Amount"] = request.amount; } if (!$dara.isNull(request.assuranceTimes)) { query["AssuranceTimes"] = request.assuranceTimes; } if (!$dara.isNull(request.capacity)) { query["Capacity"] = request.capacity; } if (!$dara.isNull(request.dedicatedHostType)) { query["DedicatedHostType"] = request.dedicatedHostType; } if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.instanceAmount)) { query["InstanceAmount"] = request.instanceAmount; } if (!$dara.isNull(request.instanceCpuCoreCount)) { query["InstanceCpuCoreCount"] = request.instanceCpuCoreCount; } if (!$dara.isNull(request.instanceNetworkType)) { query["InstanceNetworkType"] = request.instanceNetworkType; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.instanceTypeList)) { query["InstanceTypeList"] = request.instanceTypeList; } if (!$dara.isNull(request.internetChargeType)) { query["InternetChargeType"] = request.internetChargeType; } if (!$dara.isNull(request.internetMaxBandwidthOut)) { query["InternetMaxBandwidthOut"] = request.internetMaxBandwidthOut; } if (!$dara.isNull(request.ioOptimized)) { query["IoOptimized"] = request.ioOptimized; } if (!$dara.isNull(request.isp)) { query["Isp"] = request.isp; } if (!$dara.isNull(request.offeringType)) { query["OfferingType"] = request.offeringType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.platform)) { query["Platform"] = request.platform; } if (!$dara.isNull(request.priceUnit)) { query["PriceUnit"] = request.priceUnit; } if (!$dara.isNull(request.recurrenceRules)) { query["RecurrenceRules"] = request.recurrenceRules; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } if (!$dara.isNull(request.scope)) { query["Scope"] = request.scope; } if (!$dara.isNull(request.spotDuration)) { query["SpotDuration"] = request.spotDuration; } if (!$dara.isNull(request.spotStrategy)) { query["SpotStrategy"] = request.spotStrategy; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } if (!$dara.isNull(request.dataDisk)) { query["DataDisk"] = request.dataDisk; } if (!$dara.isNull(request.schedulerOptions)) { query["SchedulerOptions"] = request.schedulerOptions; } if (!$dara.isNull(request.systemDisk)) { query["SystemDisk"] = request.systemDisk; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribePrice", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribePriceResponse>(await this.callApi(params, req, runtime), new $_model.DescribePriceResponse({})); } /** * Queries the latest prices of specified resources. You can query the latest prices of ECS instances, disks, dedicated hosts, elasticity assurance services, and capacity reservation services based on resource type. The response includes promotion rules, prices, and discounts. * * @remarks * The parameter settings vary based on the resource type: * - When `ResourceType=instance`, you must also specify `InstanceType`. * By default, the price of the pay-as-you-go (`PostPaid`) billing method (`ChargeType`) is queried. You can specify the `PriceUnit` parameter to query Elastic Compute Service (ECS) prices for different billing cycles. * - When `ResourceType=disk`, you must also specify `DataDisk.1.Category` and `DataDisk.1.Size`. When you query the price of `disk` resources, only the pay-as-you-go price of disks is returned. This means that the `PriceUnit` parameter can only be set to `Hour`. * - When `ResourceType=diskperformance`, you must also specify `DataDisk.1.Category` and `DataDisk.1.ProvisionedIops`. * - When `ResourceType=ddh`, you must also specify `DedicatedHostType`. * - When `ResourceType=ElasticityAssurance`, you must also specify `InstanceType`. * - When `ResourceType=CapacityReservation`, you must also specify `InstanceType`. * - When `ResourceType=bandwidth`, only the pay-by-traffic (`PayByTraffic`) price is returned. * * @param request - DescribePriceRequest * @returns DescribePriceResponse */ async describePrice(request: $_model.DescribePriceRequest): Promise<$_model.DescribePriceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describePriceWithOptions(request, runtime); } /** * (Beta) Queries one or more alternative instance types based on a specified instance type. For instance types that have been or will be retired, DescribeRecommendInstanceType lists all instance types that can serve as replacements. * * @param request - DescribeRecommendInstanceTypeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeRecommendInstanceTypeResponse */ async describeRecommendInstanceTypeWithOptions(request: $_model.DescribeRecommendInstanceTypeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeRecommendInstanceTypeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.cores)) { query["Cores"] = request.cores; } if (!$dara.isNull(request.instanceChargeType)) { query["InstanceChargeType"] = request.instanceChargeType; } if (!$dara.isNull(request.instanceFamilyLevel)) { query["InstanceFamilyLevel"] = request.instanceFamilyLevel; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.instanceTypeFamily)) { query["InstanceTypeFamily"] = request.instanceTypeFamily; } if (!$dara.isNull(request.ioOptimized)) { query["IoOptimized"] = request.ioOptimized; } if (!$dara.isNull(request.maxPrice)) { query["MaxPrice"] = request.maxPrice; } if (!$dara.isNull(request.memory)) { query["Memory"] = request.memory; } if (!$dara.isNull(request.networkType)) { query["NetworkType"] = request.networkType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.priorityStrategy)) { query["PriorityStrategy"] = request.priorityStrategy; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.scene)) { query["Scene"] = request.scene; } if (!$dara.isNull(request.spotStrategy)) { query["SpotStrategy"] = request.spotStrategy; } if (!$dara.isNull(request.systemDiskCategory)) { query["SystemDiskCategory"] = request.systemDiskCategory; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } if (!$dara.isNull(request.zoneMatchMode)) { query["ZoneMatchMode"] = request.zoneMatchMode; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeRecommendInstanceType", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeRecommendInstanceTypeResponse>(await this.callApi(params, req, runtime), new $_model.DescribeRecommendInstanceTypeResponse({})); } /** * (Beta) Queries one or more alternative instance types based on a specified instance type. For instance types that have been or will be retired, DescribeRecommendInstanceType lists all instance types that can serve as replacements. * * @param request - DescribeRecommendInstanceTypeRequest * @returns DescribeRecommendInstanceTypeResponse */ async describeRecommendInstanceType(request: $_model.DescribeRecommendInstanceTypeRequest): Promise<$_model.DescribeRecommendInstanceTypeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeRecommendInstanceTypeWithOptions(request, runtime); } /** * Queries Alibaba Cloud regions. When you call this operation, you can specify parameters, such as InstanceChargeType and ResourceType, in the request. * * @param request - DescribeRegionsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeRegionsResponse */ async describeRegionsWithOptions(request: $_model.DescribeRegionsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeRegionsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.acceptLanguage)) { query["AcceptLanguage"] = request.acceptLanguage; } if (!$dara.isNull(request.instanceChargeType)) { query["InstanceChargeType"] = request.instanceChargeType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeRegions", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeRegionsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeRegionsResponse({})); } /** * Queries Alibaba Cloud regions. When you call this operation, you can specify parameters, such as InstanceChargeType and ResourceType, in the request. * * @param request - DescribeRegionsRequest * @returns DescribeRegionsResponse */ async describeRegions(request: $_model.DescribeRegionsRequest): Promise<$_model.DescribeRegionsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeRegionsWithOptions(request, runtime); } /** * Queries the renewal price of Elastic Compute Service (ECS) resources. Only subscription resources are supported. * * @remarks * - Only the price for renewing a subscription ECS instance for a specified duration or renewing it to a unified expiration date is supported. * - Note the following when you set the parameters: * - If you set only the required parameters, the price for renewing the instance for one month is returned by default. * - You cannot query the renewal duration price and the unified expiration date price at the same time. The renewal duration parameters (`Period` and `PeriodUnit`) and the unified expiration date parameter (`ExpectedRenewDay`) cannot be set at the same time. * * @param request - DescribeRenewalPriceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeRenewalPriceResponse */ async describeRenewalPriceWithOptions(request: $_model.DescribeRenewalPriceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeRenewalPriceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.expectedRenewDay)) { query["ExpectedRenewDay"] = request.expectedRenewDay; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.priceUnit)) { query["PriceUnit"] = request.priceUnit; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceId)) { query["ResourceId"] = request.resourceId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeRenewalPrice", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeRenewalPriceResponse>(await this.callApi(params, req, runtime), new $_model.DescribeRenewalPriceResponse({})); } /** * Queries the renewal price of Elastic Compute Service (ECS) resources. Only subscription resources are supported. * * @remarks * - Only the price for renewing a subscription ECS instance for a specified duration or renewing it to a unified expiration date is supported. * - Note the following when you set the parameters: * - If you set only the required parameters, the price for renewing the instance for one month is returned by default. * - You cannot query the renewal duration price and the unified expiration date price at the same time. The renewal duration parameters (`Period` and `PeriodUnit`) and the unified expiration date parameter (`ExpectedRenewDay`) cannot be set at the same time. * * @param request - DescribeRenewalPriceRequest * @returns DescribeRenewalPriceResponse */ async describeRenewalPrice(request: $_model.DescribeRenewalPriceRequest): Promise<$_model.DescribeRenewalPriceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeRenewalPriceWithOptions(request, runtime); } /** * Queries the auto-renewal attributes of one or more reserved instances, including the auto-renewal duration and auto-renewal status. * * @param request - DescribeReservedInstanceAutoRenewAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeReservedInstanceAutoRenewAttributeResponse */ async describeReservedInstanceAutoRenewAttributeWithOptions(request: $_model.DescribeReservedInstanceAutoRenewAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeReservedInstanceAutoRenewAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.reservedInstanceId)) { query["ReservedInstanceId"] = request.reservedInstanceId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeReservedInstanceAutoRenewAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeReservedInstanceAutoRenewAttributeResponse>(await this.callApi(params, req, runtime), new $_model.DescribeReservedInstanceAutoRenewAttributeResponse({})); } /** * Queries the auto-renewal attributes of one or more reserved instances, including the auto-renewal duration and auto-renewal status. * * @param request - DescribeReservedInstanceAutoRenewAttributeRequest * @returns DescribeReservedInstanceAutoRenewAttributeResponse */ async describeReservedInstanceAutoRenewAttribute(request: $_model.DescribeReservedInstanceAutoRenewAttributeRequest): Promise<$_model.DescribeReservedInstanceAutoRenewAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeReservedInstanceAutoRenewAttributeWithOptions(request, runtime); } /** * Queries the details of reserved instances that you have purchased in a specific region. You can query the details of reserved instances based on parameters, such as tags and reserved instance attributes. * * @remarks * ### [](#)Scenarios * - Query all reserved instances in a specific region. * - Query the details of a reserved instance based on the ID or name. * - Query your purchased reserved instances based on the instance type or instance family. * - Query your purchased reserved instances based on the scope or status of reserved instances. * ### [](#)Sample requests * **Example: Query all purchased reserved instances in the China (Hangzhou) region** * ``` * "RegionId":"cn-hangzhou", //The ID of the region. * ``` * **Example: Query the details of the reserved instance whose ID is ecsri-bp129enntoynwwj5\\*\\*\\*\\* in the China (Hangzhou) region** * ``` * "RegionId":"cn-hangzhou", //The ID of the region."ReservedInstanceId":"ecsri-bp129enntoynwwj5****" //The ID of the reserved instance. * ``` * **Example: Query the reserved instances that can be used to offset the bills of ecs.c5.2xlarge instances in the China (Hangzhou) region** * ``` * "RegionId":"cn-hangzhou", //The ID of the region."InstanceType":"ecs.c5.2xlarge", //The instance type. * ``` * **Example: Query the regional reserved instances that are within the validity period in the China (Hangzhou) region** * ``` * "RegionId":"cn-hangzhou", //The ID of the region."Scope":"Region", //Set the scope of the reserved instance to regional."Status":["Active"] //Set the status to Active, which indicates that the reserved instance is within the validity period. * ``` * * @param request - DescribeReservedInstancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeReservedInstancesResponse */ async describeReservedInstancesWithOptions(request: $_model.DescribeReservedInstancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeReservedInstancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.allocationType)) { query["AllocationType"] = request.allocationType; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.instanceTypeFamily)) { query["InstanceTypeFamily"] = request.instanceTypeFamily; } if (!$dara.isNull(request.lockReason)) { query["LockReason"] = request.lockReason; } if (!$dara.isNull(request.offeringType)) { query["OfferingType"] = request.offeringType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.reservedInstanceId)) { query["ReservedInstanceId"] = request.reservedInstanceId; } if (!$dara.isNull(request.reservedInstanceName)) { query["ReservedInstanceName"] = request.reservedInstanceName; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.scope)) { query["Scope"] = request.scope; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeReservedInstances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeReservedInstancesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeReservedInstancesResponse({})); } /** * Queries the details of reserved instances that you have purchased in a specific region. You can query the details of reserved instances based on parameters, such as tags and reserved instance attributes. * * @remarks * ### [](#)Scenarios * - Query all reserved instances in a specific region. * - Query the details of a reserved instance based on the ID or name. * - Query your purchased reserved instances based on the instance type or instance family. * - Query your purchased reserved instances based on the scope or status of reserved instances. * ### [](#)Sample requests * **Example: Query all purchased reserved instances in the China (Hangzhou) region** * ``` * "RegionId":"cn-hangzhou", //The ID of the region. * ``` * **Example: Query the details of the reserved instance whose ID is ecsri-bp129enntoynwwj5\\*\\*\\*\\* in the China (Hangzhou) region** * ``` * "RegionId":"cn-hangzhou", //The ID of the region."ReservedInstanceId":"ecsri-bp129enntoynwwj5****" //The ID of the reserved instance. * ``` * **Example: Query the reserved instances that can be used to offset the bills of ecs.c5.2xlarge instances in the China (Hangzhou) region** * ``` * "RegionId":"cn-hangzhou", //The ID of the region."InstanceType":"ecs.c5.2xlarge", //The instance type. * ``` * **Example: Query the regional reserved instances that are within the validity period in the China (Hangzhou) region** * ``` * "RegionId":"cn-hangzhou", //The ID of the region."Scope":"Region", //Set the scope of the reserved instance to regional."Status":["Active"] //Set the status to Active, which indicates that the reserved instance is within the validity period. * ``` * * @param request - DescribeReservedInstancesRequest * @returns DescribeReservedInstancesResponse */ async describeReservedInstances(request: $_model.DescribeReservedInstancesRequest): Promise<$_model.DescribeReservedInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeReservedInstancesWithOptions(request, runtime); } /** * The DescribeResourceByTags operation retrieves resources by tag or resource type. * * @deprecated OpenAPI DescribeResourceByTags is deprecated, please use Tag::2018-08-28::ListResourcesByTag instead. * * @param request - DescribeResourceByTagsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeResourceByTagsResponse */ async describeResourceByTagsWithOptions(request: $_model.DescribeResourceByTagsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeResourceByTagsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeResourceByTags", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeResourceByTagsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeResourceByTagsResponse({})); } /** * The DescribeResourceByTags operation retrieves resources by tag or resource type. * * @deprecated OpenAPI DescribeResourceByTags is deprecated, please use Tag::2018-08-28::ListResourcesByTag instead. * * @param request - DescribeResourceByTagsRequest * @returns DescribeResourceByTagsResponse */ // Deprecated async describeResourceByTags(request: $_model.DescribeResourceByTagsRequest): Promise<$_model.DescribeResourceByTagsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeResourceByTagsWithOptions(request, runtime); } /** * Queries the inventory of instance types or system disk types in a zone before you change the instance type or system disk type of an instance. * * @remarks * The following examples describe common change scenarios: * ### Example 1: Query instance types to which the current instance can be changed * Query the instance types to which instance i-bp67acfmxazb4p**** can be changed, and the inventory of the corresponding instance types in the zone where the instance resides. * ``` * http(s)://ecs.aliyuncs.com/?Action=DescribeResourcesModification * &RegionId=ap-southeast-1 * &ResourceId=i-bp67acfmxazb4p**** * &DestinationResource=InstanceType * &OperationType=Upgrade * &Common request parameters * ``` * ### Example 2: Query instance types available after changing the disk type of the current instance * Query the instance types to which instance i-bp67acfmxazb4p**** can be changed after the disk type is changed, and the inventory of the corresponding instance types in the zone where the instance resides. * ``` * http(s)://ecs.aliyuncs.com/?Action=DescribeResourcesModification * &RegionId=ap-southeast-1 * &ResourceId=i-bp67acfmxazb4p**** * &DestinationResource=InstanceType * &OperationType=Upgrade * &Conditions.0=DiskCategory * &Common request parameters * ``` * ### Example 3: Query the disk type required by the target instance type * Query the disk type required by the target instance type (for example, ecs.g7.large). The current instance i-bp67acfmxazb4p**** must be changed to this disk type before it can be changed to the target instance type. Also query the inventory of the disk type in the zone where the instance resides. * > The target instance type must be obtained by using Example 2. * ``` * http(s)://ecs.aliyuncs.com/?Action=DescribeResourcesModification * &RegionId=ap-southeast-1 * &ResourceId=i-bp67acfmxazb4p**** * &DestinationResource=SystemDisk * &OperationType=Upgrade * &InstanceType=ecs.g7.large * &Common request parameters * ``` * * @param request - DescribeResourcesModificationRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeResourcesModificationResponse */ async describeResourcesModificationWithOptions(request: $_model.DescribeResourcesModificationRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeResourcesModificationResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.conditions)) { query["Conditions"] = request.conditions; } if (!$dara.isNull(request.cores)) { query["Cores"] = request.cores; } if (!$dara.isNull(request.destinationResource)) { query["DestinationResource"] = request.destinationResource; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.memory)) { query["Memory"] = request.memory; } if (!$dara.isNull(request.migrateAcrossZone)) { query["MigrateAcrossZone"] = request.migrateAcrossZone; } if (!$dara.isNull(request.operationType)) { query["OperationType"] = request.operationType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceId)) { query["ResourceId"] = request.resourceId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeResourcesModification", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeResourcesModificationResponse>(await this.callApi(params, req, runtime), new $_model.DescribeResourcesModificationResponse({})); } /** * Queries the inventory of instance types or system disk types in a zone before you change the instance type or system disk type of an instance. * * @remarks * The following examples describe common change scenarios: * ### Example 1: Query instance types to which the current instance can be changed * Query the instance types to which instance i-bp67acfmxazb4p**** can be changed, and the inventory of the corresponding instance types in the zone where the instance resides. * ``` * http(s)://ecs.aliyuncs.com/?Action=DescribeResourcesModification * &RegionId=ap-southeast-1 * &ResourceId=i-bp67acfmxazb4p**** * &DestinationResource=InstanceType * &OperationType=Upgrade * &Common request parameters * ``` * ### Example 2: Query instance types available after changing the disk type of the current instance * Query the instance types to which instance i-bp67acfmxazb4p**** can be changed after the disk type is changed, and the inventory of the corresponding instance types in the zone where the instance resides. * ``` * http(s)://ecs.aliyuncs.com/?Action=DescribeResourcesModification * &RegionId=ap-southeast-1 * &ResourceId=i-bp67acfmxazb4p**** * &DestinationResource=InstanceType * &OperationType=Upgrade * &Conditions.0=DiskCategory * &Common request parameters * ``` * ### Example 3: Query the disk type required by the target instance type * Query the disk type required by the target instance type (for example, ecs.g7.large). The current instance i-bp67acfmxazb4p**** must be changed to this disk type before it can be changed to the target instance type. Also query the inventory of the disk type in the zone where the instance resides. * > The target instance type must be obtained by using Example 2. * ``` * http(s)://ecs.aliyuncs.com/?Action=DescribeResourcesModification * &RegionId=ap-southeast-1 * &ResourceId=i-bp67acfmxazb4p**** * &DestinationResource=SystemDisk * &OperationType=Upgrade * &InstanceType=ecs.g7.large * &Common request parameters * ``` * * @param request - DescribeResourcesModificationRequest * @returns DescribeResourcesModificationResponse */ async describeResourcesModification(request: $_model.DescribeResourcesModificationRequest): Promise<$_model.DescribeResourcesModificationResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeResourcesModificationWithOptions(request, runtime); } /** * List route tables * * @deprecated OpenAPI DescribeRouteTables is deprecated, please use Vpc::2016-04-28::DescribeRouteTableList instead. * * @param request - DescribeRouteTablesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeRouteTablesResponse */ async describeRouteTablesWithOptions(request: $_model.DescribeRouteTablesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeRouteTablesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.routeTableId)) { query["RouteTableId"] = request.routeTableId; } if (!$dara.isNull(request.routeTableName)) { query["RouteTableName"] = request.routeTableName; } if (!$dara.isNull(request.routerId)) { query["RouterId"] = request.routerId; } if (!$dara.isNull(request.routerType)) { query["RouterType"] = request.routerType; } if (!$dara.isNull(request.VRouterId)) { query["VRouterId"] = request.VRouterId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeRouteTables", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeRouteTablesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeRouteTablesResponse({})); } /** * List route tables * * @deprecated OpenAPI DescribeRouteTables is deprecated, please use Vpc::2016-04-28::DescribeRouteTableList instead. * * @param request - DescribeRouteTablesRequest * @returns DescribeRouteTablesResponse */ // Deprecated async describeRouteTables(request: $_model.DescribeRouteTablesRequest): Promise<$_model.DescribeRouteTablesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeRouteTablesWithOptions(request, runtime); } /** * DescribeRouterInterfaces * * @deprecated OpenAPI DescribeRouterInterfaces is deprecated, please use Vpc::2016-04-28::DescribeRouterInterfaces instead. * * @param request - DescribeRouterInterfacesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeRouterInterfacesResponse */ async describeRouterInterfacesWithOptions(request: $_model.DescribeRouterInterfacesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeRouterInterfacesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.filter)) { query["Filter"] = request.filter; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeRouterInterfaces", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeRouterInterfacesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeRouterInterfacesResponse({})); } /** * DescribeRouterInterfaces * * @deprecated OpenAPI DescribeRouterInterfaces is deprecated, please use Vpc::2016-04-28::DescribeRouterInterfaces instead. * * @param request - DescribeRouterInterfacesRequest * @returns DescribeRouterInterfacesResponse */ // Deprecated async describeRouterInterfaces(request: $_model.DescribeRouterInterfacesRequest): Promise<$_model.DescribeRouterInterfacesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeRouterInterfacesWithOptions(request, runtime); } /** * 节省计划测算 * * @param request - DescribeSavingsPlanEstimationRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeSavingsPlanEstimationResponse */ async describeSavingsPlanEstimationWithOptions(request: $_model.DescribeSavingsPlanEstimationRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeSavingsPlanEstimationResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.estimationResource)) { query["EstimationResource"] = request.estimationResource; } if (!$dara.isNull(request.instanceTypeScope)) { query["InstanceTypeScope"] = request.instanceTypeScope; } if (!$dara.isNull(request.offeringType)) { query["OfferingType"] = request.offeringType; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.planType)) { query["PlanType"] = request.planType; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceId)) { query["ResourceId"] = request.resourceId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeSavingsPlanEstimation", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeSavingsPlanEstimationResponse>(await this.callApi(params, req, runtime), new $_model.DescribeSavingsPlanEstimationResponse({})); } /** * 节省计划测算 * * @param request - DescribeSavingsPlanEstimationRequest * @returns DescribeSavingsPlanEstimationResponse */ async describeSavingsPlanEstimation(request: $_model.DescribeSavingsPlanEstimationRequest): Promise<$_model.DescribeSavingsPlanEstimationResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeSavingsPlanEstimationWithOptions(request, runtime); } /** * 询价购买节省计划并预付费换购按量付费 * * @param request - DescribeSavingsPlanPriceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeSavingsPlanPriceResponse */ async describeSavingsPlanPriceWithOptions(request: $_model.DescribeSavingsPlanPriceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeSavingsPlanPriceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.committedAmount)) { query["CommittedAmount"] = request.committedAmount; } if (!$dara.isNull(request.instanceTypeFamily)) { query["InstanceTypeFamily"] = request.instanceTypeFamily; } if (!$dara.isNull(request.instanceTypeFamilyGroup)) { query["InstanceTypeFamilyGroup"] = request.instanceTypeFamilyGroup; } if (!$dara.isNull(request.offeringType)) { query["OfferingType"] = request.offeringType; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.planType)) { query["PlanType"] = request.planType; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceId)) { query["ResourceId"] = request.resourceId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeSavingsPlanPrice", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeSavingsPlanPriceResponse>(await this.callApi(params, req, runtime), new $_model.DescribeSavingsPlanPriceResponse({})); } /** * 询价购买节省计划并预付费换购按量付费 * * @param request - DescribeSavingsPlanPriceRequest * @returns DescribeSavingsPlanPriceResponse */ async describeSavingsPlanPrice(request: $_model.DescribeSavingsPlanPriceRequest): Promise<$_model.DescribeSavingsPlanPriceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeSavingsPlanPriceWithOptions(request, runtime); } /** * Queries the details of a specified security group, including the list of security group rules. * * @param request - DescribeSecurityGroupAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeSecurityGroupAttributeResponse */ async describeSecurityGroupAttributeWithOptions(request: $_model.DescribeSecurityGroupAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeSecurityGroupAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.attribute)) { query["Attribute"] = request.attribute; } if (!$dara.isNull(request.direction)) { query["Direction"] = request.direction; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.nicType)) { query["NicType"] = request.nicType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeSecurityGroupAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeSecurityGroupAttributeResponse>(await this.callApi(params, req, runtime), new $_model.DescribeSecurityGroupAttributeResponse({})); } /** * Queries the details of a specified security group, including the list of security group rules. * * @param request - DescribeSecurityGroupAttributeRequest * @returns DescribeSecurityGroupAttributeResponse */ async describeSecurityGroupAttribute(request: $_model.DescribeSecurityGroupAttributeRequest): Promise<$_model.DescribeSecurityGroupAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeSecurityGroupAttributeWithOptions(request, runtime); } /** * Queries the list of other security groups that have been authorized by one or more specified security groups. * * @remarks * - If you cannot delete a security group ([DeleteSecurityGroup](https://help.aliyun.com/document_detail/25558.html)), you can call this operation to check whether the specified security group has been authorized by other security groups. If the specified security group has been authorized, you can call [RevokeSecurityGroup](https://help.aliyun.com/document_detail/2679855.html) and [RevokeSecurityGroupEgress](https://help.aliyun.com/document_detail/2679856.html) to delete the corresponding security group rules to revoke the authorization. * * @param request - DescribeSecurityGroupReferencesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeSecurityGroupReferencesResponse */ async describeSecurityGroupReferencesWithOptions(request: $_model.DescribeSecurityGroupReferencesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeSecurityGroupReferencesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeSecurityGroupReferences", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeSecurityGroupReferencesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeSecurityGroupReferencesResponse({})); } /** * Queries the list of other security groups that have been authorized by one or more specified security groups. * * @remarks * - If you cannot delete a security group ([DeleteSecurityGroup](https://help.aliyun.com/document_detail/25558.html)), you can call this operation to check whether the specified security group has been authorized by other security groups. If the specified security group has been authorized, you can call [RevokeSecurityGroup](https://help.aliyun.com/document_detail/2679855.html) and [RevokeSecurityGroupEgress](https://help.aliyun.com/document_detail/2679856.html) to delete the corresponding security group rules to revoke the authorization. * * @param request - DescribeSecurityGroupReferencesRequest * @returns DescribeSecurityGroupReferencesResponse */ async describeSecurityGroupReferences(request: $_model.DescribeSecurityGroupReferencesRequest): Promise<$_model.DescribeSecurityGroupReferencesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeSecurityGroupReferencesWithOptions(request, runtime); } /** * Queries the basic information about security groups. You can filter results by region, security group ID, security group type, and other parameters through parameter query. * * @remarks * - **Paging query**: Use `MaxResults` and `NextToken` for paging query. * - If `NextToken` is not returned, the current page is the last page. * - For the first page, set only `MaxResults` to limit the number of entries to return. The `NextToken` value in the response is used to query subsequent pages. * - For subsequent pages, set `NextToken` to the `NextToken` value returned in the previous response and set `MaxResults` to limit the number of entries to return. * - When you invoke an API operation by using Cloud Assistant CLI, specify request parameters in the required format. For more information, see [Parameter format of CLI commands](https://help.aliyun.com/document_detail/110340.html). * * @param request - DescribeSecurityGroupsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeSecurityGroupsResponse */ async describeSecurityGroupsWithOptions(request: $_model.DescribeSecurityGroupsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeSecurityGroupsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.fuzzyQuery)) { query["FuzzyQuery"] = request.fuzzyQuery; } if (!$dara.isNull(request.isQueryEcsCount)) { query["IsQueryEcsCount"] = request.isQueryEcsCount; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.networkType)) { query["NetworkType"] = request.networkType; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.securityGroupIds)) { query["SecurityGroupIds"] = request.securityGroupIds; } if (!$dara.isNull(request.securityGroupName)) { query["SecurityGroupName"] = request.securityGroupName; } if (!$dara.isNull(request.securityGroupType)) { query["SecurityGroupType"] = request.securityGroupType; } if (!$dara.isNull(request.serviceManaged)) { query["ServiceManaged"] = request.serviceManaged; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeSecurityGroups", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeSecurityGroupsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeSecurityGroupsResponse({})); } /** * Queries the basic information about security groups. You can filter results by region, security group ID, security group type, and other parameters through parameter query. * * @remarks * - **Paging query**: Use `MaxResults` and `NextToken` for paging query. * - If `NextToken` is not returned, the current page is the last page. * - For the first page, set only `MaxResults` to limit the number of entries to return. The `NextToken` value in the response is used to query subsequent pages. * - For subsequent pages, set `NextToken` to the `NextToken` value returned in the previous response and set `MaxResults` to limit the number of entries to return. * - When you invoke an API operation by using Cloud Assistant CLI, specify request parameters in the required format. For more information, see [Parameter format of CLI commands](https://help.aliyun.com/document_detail/110340.html). * * @param request - DescribeSecurityGroupsRequest * @returns DescribeSecurityGroupsResponse */ async describeSecurityGroups(request: $_model.DescribeSecurityGroupsRequest): Promise<$_model.DescribeSecurityGroupsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeSecurityGroupsWithOptions(request, runtime); } /** * Queries the list and status of files sent by Cloud Assistant. * * @remarks * ## Operation description: * - After you send a file, the file is not necessarily sent successfully. You must check the actual delivery result based on the return value of this operation. The actual output prevails. * - You can query execution information from the last day. A maximum of 1,000 entries of execution information can be retained. * - When you execute a paging query for the first page, set only `MaxResults` to limit the number of entries returned. The `NextToken` value in the response serves as the token for querying subsequent pages. When querying subsequent pages, set the `NextToken` parameter to the value obtained from the previous response and set `MaxResults` to limit the number of entries returned. * * @param request - DescribeSendFileResultsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeSendFileResultsResponse */ async describeSendFileResultsWithOptions(request: $_model.DescribeSendFileResultsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeSendFileResultsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.invocationStatus)) { query["InvocationStatus"] = request.invocationStatus; } if (!$dara.isNull(request.invokeId)) { query["InvokeId"] = request.invokeId; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeSendFileResults", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeSendFileResultsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeSendFileResultsResponse({})); } /** * Queries the list and status of files sent by Cloud Assistant. * * @remarks * ## Operation description: * - After you send a file, the file is not necessarily sent successfully. You must check the actual delivery result based on the return value of this operation. The actual output prevails. * - You can query execution information from the last day. A maximum of 1,000 entries of execution information can be retained. * - When you execute a paging query for the first page, set only `MaxResults` to limit the number of entries returned. The `NextToken` value in the response serves as the token for querying subsequent pages. When querying subsequent pages, set the `NextToken` parameter to the value obtained from the previous response and set `MaxResults` to limit the number of entries returned. * * @param request - DescribeSendFileResultsRequest * @returns DescribeSendFileResultsResponse */ async describeSendFileResults(request: $_model.DescribeSendFileResultsRequest): Promise<$_model.DescribeSendFileResultsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeSendFileResultsWithOptions(request, runtime); } /** * Queries information about one or more snapshot-consistent groups, such as the status, associated instance ID, and snapshot creation progress. * * @remarks * `InstanceId`, `SnapshotGroupId.N`, and `Status.N` are not required request parameters, but they can be used to build filter logic. The parameters have a logical AND relationship. * * @param request - DescribeSnapshotGroupsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeSnapshotGroupsResponse */ async describeSnapshotGroupsWithOptions(request: $_model.DescribeSnapshotGroupsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeSnapshotGroupsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.additionalAttributes)) { query["AdditionalAttributes"] = request.additionalAttributes; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.snapshotGroupId)) { query["SnapshotGroupId"] = request.snapshotGroupId; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeSnapshotGroups", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeSnapshotGroupsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeSnapshotGroupsResponse({})); } /** * Queries information about one or more snapshot-consistent groups, such as the status, associated instance ID, and snapshot creation progress. * * @remarks * `InstanceId`, `SnapshotGroupId.N`, and `Status.N` are not required request parameters, but they can be used to build filter logic. The parameters have a logical AND relationship. * * @param request - DescribeSnapshotGroupsRequest * @returns DescribeSnapshotGroupsResponse */ async describeSnapshotGroups(request: $_model.DescribeSnapshotGroupsRequest): Promise<$_model.DescribeSnapshotGroupsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeSnapshotGroupsWithOptions(request, runtime); } /** * Queries snapshot chains of disks. A snapshot chain consists of all snapshots of a disk. Each disk corresponds to one snapshot chain. * * @remarks * ## Operation description * When you call this operation, take note of the following items: * - The request parameters such as `RegionId`, `DiskIds`, and `InstanceId` act as filters. Logical AND is used between these parameters. * - If you do not specify any parameters, the filters do not take effect. If `DiskIds` and `SnapshotLinkIds` are both empty arrays, the filters are considered valid, but the response is empty. * * @param request - DescribeSnapshotLinksRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeSnapshotLinksResponse */ async describeSnapshotLinksWithOptions(request: $_model.DescribeSnapshotLinksRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeSnapshotLinksResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.diskIds)) { query["DiskIds"] = request.diskIds; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.snapshotLinkIds)) { query["SnapshotLinkIds"] = request.snapshotLinkIds; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeSnapshotLinks", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeSnapshotLinksResponse>(await this.callApi(params, req, runtime), new $_model.DescribeSnapshotLinksResponse({})); } /** * Queries snapshot chains of disks. A snapshot chain consists of all snapshots of a disk. Each disk corresponds to one snapshot chain. * * @remarks * ## Operation description * When you call this operation, take note of the following items: * - The request parameters such as `RegionId`, `DiskIds`, and `InstanceId` act as filters. Logical AND is used between these parameters. * - If you do not specify any parameters, the filters do not take effect. If `DiskIds` and `SnapshotLinkIds` are both empty arrays, the filters are considered valid, but the response is empty. * * @param request - DescribeSnapshotLinksRequest * @returns DescribeSnapshotLinksResponse */ async describeSnapshotLinks(request: $_model.DescribeSnapshotLinksRequest): Promise<$_model.DescribeSnapshotLinksResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeSnapshotLinksWithOptions(request, runtime); } /** * Queries the monitoring data of snapshot sizes in a region within the last 30 days. * * @remarks * ## [](#)Usage notes * Take note of the following items: * - Up to 400 monitoring data entries can be returned at a time. Make sure that the `TotalCount` value does not exceed 400. The value is calculated by using the following formula: `TotalCount = (EndTime - StartTime)/Period`. If the TotalCount value is greater than 400, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query the monitoring data of snapshot sizes in the last 30 days. If the value of `StartTime` is more than 30 days earlier than the current time, an error is returned. * * @param request - DescribeSnapshotMonitorDataRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeSnapshotMonitorDataResponse */ async describeSnapshotMonitorDataWithOptions(request: $_model.DescribeSnapshotMonitorDataRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeSnapshotMonitorDataResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.category)) { query["Category"] = request.category; } if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeSnapshotMonitorData", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeSnapshotMonitorDataResponse>(await this.callApi(params, req, runtime), new $_model.DescribeSnapshotMonitorDataResponse({})); } /** * Queries the monitoring data of snapshot sizes in a region within the last 30 days. * * @remarks * ## [](#)Usage notes * Take note of the following items: * - Up to 400 monitoring data entries can be returned at a time. Make sure that the `TotalCount` value does not exceed 400. The value is calculated by using the following formula: `TotalCount = (EndTime - StartTime)/Period`. If the TotalCount value is greater than 400, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query the monitoring data of snapshot sizes in the last 30 days. If the value of `StartTime` is more than 30 days earlier than the current time, an error is returned. * * @param request - DescribeSnapshotMonitorDataRequest * @returns DescribeSnapshotMonitorDataResponse */ async describeSnapshotMonitorData(request: $_model.DescribeSnapshotMonitorDataRequest): Promise<$_model.DescribeSnapshotMonitorDataResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeSnapshotMonitorDataWithOptions(request, runtime); } /** * Queries the Object Storage Service (OSS) storage plans that you purchased in an Alibaba Cloud region. OSS storage plans can be used to offset the storage fees for standard snapshots instead of local snapshots. * * @param request - DescribeSnapshotPackageRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeSnapshotPackageResponse */ async describeSnapshotPackageWithOptions(request: $_model.DescribeSnapshotPackageRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeSnapshotPackageResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeSnapshotPackage", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeSnapshotPackageResponse>(await this.callApi(params, req, runtime), new $_model.DescribeSnapshotPackageResponse({})); } /** * Queries the Object Storage Service (OSS) storage plans that you purchased in an Alibaba Cloud region. OSS storage plans can be used to offset the storage fees for standard snapshots instead of local snapshots. * * @param request - DescribeSnapshotPackageRequest * @returns DescribeSnapshotPackageResponse */ async describeSnapshotPackage(request: $_model.DescribeSnapshotPackageRequest): Promise<$_model.DescribeSnapshotPackageResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeSnapshotPackageWithOptions(request, runtime); } /** * Queries the snapshot list of a disk, including snapshot status, remaining time for a snapshot being created, and automatic snapshot retention days. * * @remarks * InstanceId, DiskId, and SnapshotIds are not required request parameters, but you can use them to build filter logic. These parameters are evaluated by using a logical AND. * When you invoke an API operation by using Cloud Assistant CLI, specify request parameter values in the required formats based on their data types. For details, see [CLI parameter format](https://help.aliyun.com/document_detail/110340.html). * Request examples: *
* Query the snapshot list of all disks attached to an ECS instance in the China (Hangzhou) region * ``` * RegionId: cn-hangzhou, // Set the region to China (Hangzhou). * InstanceId: i-bp1fh7by6d9mw7zr**** // Set the instance ID to query. * ``` *
*
* Query the snapshot information of a specific disk in the China (Hangzhou) region * ``` * RegionId: cn-hangzhou, // Set the region to China (Hangzhou). * DiskId: d-bp10e7ej8z743dmu**** // Set the disk ID to query. * ``` *
*
* Query the information of two snapshots in the China (Hangzhou) region by snapshot ID * ``` * RegionId: cn-hangzhou, // Set the region to China (Hangzhou). * SnapshotIds: ["d-bp10e7ej8z743dmu****", "s-bp19vd1lorzgzt2s****"] // Set the array of snapshot IDs to query. * ``` *
*
* Query the snapshot information created after a specific point in time in the China (Hangzhou) region * ``` * RegionId: cn-hangzhou, // Set the region to China (Hangzhou). * Filter.1.Key: CreationStartTime, // Set the filter key for the creation start time. * Filter.1.Value: 2024-11-27T00:00Z. * ``` *
* * @param request - DescribeSnapshotsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeSnapshotsResponse */ async describeSnapshotsWithOptions(request: $_model.DescribeSnapshotsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeSnapshotsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.category)) { query["Category"] = request.category; } if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.encrypted)) { query["Encrypted"] = request.encrypted; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.KMSKeyId)) { query["KMSKeyId"] = request.KMSKeyId; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.snapshotIds)) { query["SnapshotIds"] = request.snapshotIds; } if (!$dara.isNull(request.snapshotLinkId)) { query["SnapshotLinkId"] = request.snapshotLinkId; } if (!$dara.isNull(request.snapshotName)) { query["SnapshotName"] = request.snapshotName; } if (!$dara.isNull(request.snapshotType)) { query["SnapshotType"] = request.snapshotType; } if (!$dara.isNull(request.sourceDiskType)) { query["SourceDiskType"] = request.sourceDiskType; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.usage)) { query["Usage"] = request.usage; } if (!$dara.isNull(request.filter)) { query["Filter"] = request.filter; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeSnapshots", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeSnapshotsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeSnapshotsResponse({})); } /** * Queries the snapshot list of a disk, including snapshot status, remaining time for a snapshot being created, and automatic snapshot retention days. * * @remarks * InstanceId, DiskId, and SnapshotIds are not required request parameters, but you can use them to build filter logic. These parameters are evaluated by using a logical AND. * When you invoke an API operation by using Cloud Assistant CLI, specify request parameter values in the required formats based on their data types. For details, see [CLI parameter format](https://help.aliyun.com/document_detail/110340.html). * Request examples: *
* Query the snapshot list of all disks attached to an ECS instance in the China (Hangzhou) region * ``` * RegionId: cn-hangzhou, // Set the region to China (Hangzhou). * InstanceId: i-bp1fh7by6d9mw7zr**** // Set the instance ID to query. * ``` *
*
* Query the snapshot information of a specific disk in the China (Hangzhou) region * ``` * RegionId: cn-hangzhou, // Set the region to China (Hangzhou). * DiskId: d-bp10e7ej8z743dmu**** // Set the disk ID to query. * ``` *
*
* Query the information of two snapshots in the China (Hangzhou) region by snapshot ID * ``` * RegionId: cn-hangzhou, // Set the region to China (Hangzhou). * SnapshotIds: ["d-bp10e7ej8z743dmu****", "s-bp19vd1lorzgzt2s****"] // Set the array of snapshot IDs to query. * ``` *
*
* Query the snapshot information created after a specific point in time in the China (Hangzhou) region * ``` * RegionId: cn-hangzhou, // Set the region to China (Hangzhou). * Filter.1.Key: CreationStartTime, // Set the filter key for the creation start time. * Filter.1.Value: 2024-11-27T00:00Z. * ``` *
* * @param request - DescribeSnapshotsRequest * @returns DescribeSnapshotsResponse */ async describeSnapshots(request: $_model.DescribeSnapshotsRequest): Promise<$_model.DescribeSnapshotsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeSnapshotsWithOptions(request, runtime); } /** * Queries the number of snapshots that are stored in a region and the total size of the snapshots. * * @remarks * ## [](#)Usage notes * If you want to view the snapshot usage of each disk in the current region, we recommend that you call the [DescribeSnapshotLinks](https://help.aliyun.com/document_detail/55837.html) operation to query snapshot chain information. * * @param request - DescribeSnapshotsUsageRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeSnapshotsUsageResponse */ async describeSnapshotsUsageWithOptions(request: $_model.DescribeSnapshotsUsageRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeSnapshotsUsageResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeSnapshotsUsage", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeSnapshotsUsageResponse>(await this.callApi(params, req, runtime), new $_model.DescribeSnapshotsUsageResponse({})); } /** * Queries the number of snapshots that are stored in a region and the total size of the snapshots. * * @remarks * ## [](#)Usage notes * If you want to view the snapshot usage of each disk in the current region, we recommend that you call the [DescribeSnapshotLinks](https://help.aliyun.com/document_detail/55837.html) operation to query snapshot chain information. * * @param request - DescribeSnapshotsUsageRequest * @returns DescribeSnapshotsUsageResponse */ async describeSnapshotsUsage(request: $_model.DescribeSnapshotsUsageRequest): Promise<$_model.DescribeSnapshotsUsageResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeSnapshotsUsageWithOptions(request, runtime); } /** * Queries information about spot instances in a region in the previous 30 days. The information includes the average release rate of spot instances and the percentage of the average spot instance price relative to the pay-as-you-go instance price. * * @remarks * - This operation is applicable only to I/O optimized spot instances that reside in virtual private clouds (VPCs). * - You can use one of the following methods to call this operation: * - Specify `Cores` and `Memory` or `MinCores` and `MinMemory` to query information about the instance types that meet the specified vCPU and memory requirements. * - Specify `InstanceTypes.N` to query information about the specified instance types. * - Specify `Cores` and `Memory` or `MinCores` and `MinMemory`, and then specify `InstanceTypeFamily` or `InstanceFamilyLevel` to query information about the instance types that meet the specified vCPU and memory requirements within the specified instance family or at a specified instance family level. * - You can calculate the average price of spot instances based on the percentage of the average spot instance price relative to the pay-as-you-go instance price and the pay-as-you-go instance price. * * @param request - DescribeSpotAdviceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeSpotAdviceResponse */ async describeSpotAdviceWithOptions(request: $_model.DescribeSpotAdviceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeSpotAdviceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.cores)) { query["Cores"] = request.cores; } if (!$dara.isNull(request.gpuAmount)) { query["GpuAmount"] = request.gpuAmount; } if (!$dara.isNull(request.gpuSpec)) { query["GpuSpec"] = request.gpuSpec; } if (!$dara.isNull(request.instanceFamilyLevel)) { query["InstanceFamilyLevel"] = request.instanceFamilyLevel; } if (!$dara.isNull(request.instanceTypeFamily)) { query["InstanceTypeFamily"] = request.instanceTypeFamily; } if (!$dara.isNull(request.instanceTypes)) { query["InstanceTypes"] = request.instanceTypes; } if (!$dara.isNull(request.memory)) { query["Memory"] = request.memory; } if (!$dara.isNull(request.minCores)) { query["MinCores"] = request.minCores; } if (!$dara.isNull(request.minMemory)) { query["MinMemory"] = request.minMemory; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeSpotAdvice", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeSpotAdviceResponse>(await this.callApi(params, req, runtime), new $_model.DescribeSpotAdviceResponse({})); } /** * Queries information about spot instances in a region in the previous 30 days. The information includes the average release rate of spot instances and the percentage of the average spot instance price relative to the pay-as-you-go instance price. * * @remarks * - This operation is applicable only to I/O optimized spot instances that reside in virtual private clouds (VPCs). * - You can use one of the following methods to call this operation: * - Specify `Cores` and `Memory` or `MinCores` and `MinMemory` to query information about the instance types that meet the specified vCPU and memory requirements. * - Specify `InstanceTypes.N` to query information about the specified instance types. * - Specify `Cores` and `Memory` or `MinCores` and `MinMemory`, and then specify `InstanceTypeFamily` or `InstanceFamilyLevel` to query information about the instance types that meet the specified vCPU and memory requirements within the specified instance family or at a specified instance family level. * - You can calculate the average price of spot instances based on the percentage of the average spot instance price relative to the pay-as-you-go instance price and the pay-as-you-go instance price. * * @param request - DescribeSpotAdviceRequest * @returns DescribeSpotAdviceResponse */ async describeSpotAdvice(request: $_model.DescribeSpotAdviceRequest): Promise<$_model.DescribeSpotAdviceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeSpotAdviceWithOptions(request, runtime); } /** * Queries the historical prices of spot instances. You can query price data from the last 30 days. The historical price data helps you set a reasonable maximum price for a spot instance. * * @remarks * - Only I/O optimized spot instances are supported. * - The data returned by this operation may be paginated. If the response contains the `NextOffset` parameter, set the `Offset` request parameter to the value of `NextOffset` to query the next page of data. * * @param request - DescribeSpotPriceHistoryRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeSpotPriceHistoryResponse */ async describeSpotPriceHistoryWithOptions(request: $_model.DescribeSpotPriceHistoryRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeSpotPriceHistoryResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.ioOptimized)) { query["IoOptimized"] = request.ioOptimized; } if (!$dara.isNull(request.networkType)) { query["NetworkType"] = request.networkType; } if (!$dara.isNull(request.OSType)) { query["OSType"] = request.OSType; } if (!$dara.isNull(request.offset)) { query["Offset"] = request.offset; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.spotDuration)) { query["SpotDuration"] = request.spotDuration; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeSpotPriceHistory", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeSpotPriceHistoryResponse>(await this.callApi(params, req, runtime), new $_model.DescribeSpotPriceHistoryResponse({})); } /** * Queries the historical prices of spot instances. You can query price data from the last 30 days. The historical price data helps you set a reasonable maximum price for a spot instance. * * @remarks * - Only I/O optimized spot instances are supported. * - The data returned by this operation may be paginated. If the response contains the `NextOffset` parameter, set the `Offset` request parameter to the value of `NextOffset` to query the next page of data. * * @param request - DescribeSpotPriceHistoryRequest * @returns DescribeSpotPriceHistoryResponse */ async describeSpotPriceHistory(request: $_model.DescribeSpotPriceHistoryRequest): Promise<$_model.DescribeSpotPriceHistoryResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeSpotPriceHistoryWithOptions(request, runtime); } /** * Queries the details of storage capacity units (SCUs). In the request, you can specify the name, status, or capacity of each SCU. * * @param request - DescribeStorageCapacityUnitsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeStorageCapacityUnitsResponse */ async describeStorageCapacityUnitsWithOptions(request: $_model.DescribeStorageCapacityUnitsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeStorageCapacityUnitsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.allocationType)) { query["AllocationType"] = request.allocationType; } if (!$dara.isNull(request.capacity)) { query["Capacity"] = request.capacity; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.storageCapacityUnitId)) { query["StorageCapacityUnitId"] = request.storageCapacityUnitId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeStorageCapacityUnits", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeStorageCapacityUnitsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeStorageCapacityUnitsResponse({})); } /** * Queries the details of storage capacity units (SCUs). In the request, you can specify the name, status, or capacity of each SCU. * * @param request - DescribeStorageCapacityUnitsRequest * @returns DescribeStorageCapacityUnitsResponse */ async describeStorageCapacityUnits(request: $_model.DescribeStorageCapacityUnitsRequest): Promise<$_model.DescribeStorageCapacityUnitsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeStorageCapacityUnitsWithOptions(request, runtime); } /** * 查询指定存储集的详情 * * @param request - DescribeStorageSetDetailsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeStorageSetDetailsResponse */ async describeStorageSetDetailsWithOptions(request: $_model.DescribeStorageSetDetailsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeStorageSetDetailsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.diskIds)) { query["DiskIds"] = request.diskIds; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.storageSetId)) { query["StorageSetId"] = request.storageSetId; } if (!$dara.isNull(request.storageSetPartitionNumber)) { query["StorageSetPartitionNumber"] = request.storageSetPartitionNumber; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeStorageSetDetails", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeStorageSetDetailsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeStorageSetDetailsResponse({})); } /** * 查询指定存储集的详情 * * @param request - DescribeStorageSetDetailsRequest * @returns DescribeStorageSetDetailsResponse */ async describeStorageSetDetails(request: $_model.DescribeStorageSetDetailsRequest): Promise<$_model.DescribeStorageSetDetailsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeStorageSetDetailsWithOptions(request, runtime); } /** * 查询当前地域下的存储集信息 * * @param request - DescribeStorageSetsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeStorageSetsResponse */ async describeStorageSetsWithOptions(request: $_model.DescribeStorageSetsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeStorageSetsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.storageSetIds)) { query["StorageSetIds"] = request.storageSetIds; } if (!$dara.isNull(request.storageSetName)) { query["StorageSetName"] = request.storageSetName; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeStorageSets", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeStorageSetsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeStorageSetsResponse({})); } /** * 查询当前地域下的存储集信息 * * @param request - DescribeStorageSetsRequest * @returns DescribeStorageSetsResponse */ async describeStorageSets(request: $_model.DescribeStorageSetsRequest): Promise<$_model.DescribeStorageSetsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeStorageSetsWithOptions(request, runtime); } /** * Queries tags available to you. You can perform a conditional query for tags based on resource type, resource ID, tag key, or tag value. The filter conditions are evaluated by using a logical AND (&&) operator, and only tags that meet all filter conditions are returned. * * @remarks * If you specify a tag key (Tag.N.Key) without specifying a tag value (Tag.N.Value), all tag key-value pairs associated with the tag key are returned. If you specify a tag key-value pair, only the tag that is an exact match of the key-value pair is returned. * * @deprecated OpenAPI DescribeTags is deprecated, please use Tag::2018-08-28::CountResourcesByTags instead. * * @param request - DescribeTagsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeTagsResponse */ async describeTagsWithOptions(request: $_model.DescribeTagsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeTagsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.category)) { query["Category"] = request.category; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceId)) { query["ResourceId"] = request.resourceId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeTags", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeTagsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeTagsResponse({})); } /** * Queries tags available to you. You can perform a conditional query for tags based on resource type, resource ID, tag key, or tag value. The filter conditions are evaluated by using a logical AND (&&) operator, and only tags that meet all filter conditions are returned. * * @remarks * If you specify a tag key (Tag.N.Key) without specifying a tag value (Tag.N.Value), all tag key-value pairs associated with the tag key are returned. If you specify a tag key-value pair, only the tag that is an exact match of the key-value pair is returned. * * @deprecated OpenAPI DescribeTags is deprecated, please use Tag::2018-08-28::CountResourcesByTags instead. * * @param request - DescribeTagsRequest * @returns DescribeTagsResponse */ // Deprecated async describeTags(request: $_model.DescribeTagsRequest): Promise<$_model.DescribeTagsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeTagsWithOptions(request, runtime); } /** * Queries the details of an asynchronous task. Currently, the asynchronous tasks that can be queried include ImportImage, ExportImage, and ModifyDiskSpec. * * @param request - DescribeTaskAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeTaskAttributeResponse */ async describeTaskAttributeWithOptions(request: $_model.DescribeTaskAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeTaskAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.taskId)) { query["TaskId"] = request.taskId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeTaskAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeTaskAttributeResponse>(await this.callApi(params, req, runtime), new $_model.DescribeTaskAttributeResponse({})); } /** * Queries the details of an asynchronous task. Currently, the asynchronous tasks that can be queried include ImportImage, ExportImage, and ModifyDiskSpec. * * @param request - DescribeTaskAttributeRequest * @returns DescribeTaskAttributeResponse */ async describeTaskAttribute(request: $_model.DescribeTaskAttributeRequest): Promise<$_model.DescribeTaskAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeTaskAttributeWithOptions(request, runtime); } /** * Invoke DescribeTasks to query the progress of one or more asynchronous requests. * * @param request - DescribeTasksRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeTasksResponse */ async describeTasksWithOptions(request: $_model.DescribeTasksRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeTasksResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceIds)) { query["ResourceIds"] = request.resourceIds; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } if (!$dara.isNull(request.taskAction)) { query["TaskAction"] = request.taskAction; } if (!$dara.isNull(request.taskGroupId)) { query["TaskGroupId"] = request.taskGroupId; } if (!$dara.isNull(request.taskIds)) { query["TaskIds"] = request.taskIds; } if (!$dara.isNull(request.taskStatus)) { query["TaskStatus"] = request.taskStatus; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeTasks", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeTasksResponse>(await this.callApi(params, req, runtime), new $_model.DescribeTasksResponse({})); } /** * Invoke DescribeTasks to query the progress of one or more asynchronous requests. * * @param request - DescribeTasksRequest * @returns DescribeTasksResponse */ async describeTasks(request: $_model.DescribeTasksRequest): Promise<$_model.DescribeTasksResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeTasksWithOptions(request, runtime); } /** * Queries the session history of Session Manager. * * @remarks * You can query Session Manager session records created within the last 30 days. A maximum of 1,000 successful records are retained. * * @param request - DescribeTerminalSessionsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeTerminalSessionsResponse */ async describeTerminalSessionsWithOptions(request: $_model.DescribeTerminalSessionsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeTerminalSessionsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.sessionId)) { query["SessionId"] = request.sessionId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeTerminalSessions", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeTerminalSessionsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeTerminalSessionsResponse({})); } /** * Queries the session history of Session Manager. * * @remarks * You can query Session Manager session records created within the last 30 days. A maximum of 1,000 successful records are retained. * * @param request - DescribeTerminalSessionsRequest * @returns DescribeTerminalSessionsResponse */ async describeTerminalSessions(request: $_model.DescribeTerminalSessionsRequest): Promise<$_model.DescribeTerminalSessionsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeTerminalSessionsWithOptions(request, runtime); } /** * Queries a user\\"s default attributes. * * @deprecated OpenAPI DescribeUserBusinessBehavior is deprecated * * @param request - DescribeUserBusinessBehaviorRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeUserBusinessBehaviorResponse */ async describeUserBusinessBehaviorWithOptions(request: $_model.DescribeUserBusinessBehaviorRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeUserBusinessBehaviorResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.statusKey)) { query["statusKey"] = request.statusKey; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeUserBusinessBehavior", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeUserBusinessBehaviorResponse>(await this.callApi(params, req, runtime), new $_model.DescribeUserBusinessBehaviorResponse({})); } /** * Queries a user\\"s default attributes. * * @deprecated OpenAPI DescribeUserBusinessBehavior is deprecated * * @param request - DescribeUserBusinessBehaviorRequest * @returns DescribeUserBusinessBehaviorResponse */ // Deprecated async describeUserBusinessBehavior(request: $_model.DescribeUserBusinessBehaviorRequest): Promise<$_model.DescribeUserBusinessBehaviorResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeUserBusinessBehaviorWithOptions(request, runtime); } /** * Queries the user data of an Elastic Compute Service (ECS) instance. * * @remarks * - If no user data is configured for the ECS instance, an empty string is returned. * * @param request - DescribeUserDataRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeUserDataResponse */ async describeUserDataWithOptions(request: $_model.DescribeUserDataRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeUserDataResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeUserData", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeUserDataResponse>(await this.callApi(params, req, runtime), new $_model.DescribeUserDataResponse({})); } /** * Queries the user data of an Elastic Compute Service (ECS) instance. * * @remarks * - If no user data is configured for the ECS instance, an empty string is returned. * * @param request - DescribeUserDataRequest * @returns DescribeUserDataResponse */ async describeUserData(request: $_model.DescribeUserDataRequest): Promise<$_model.DescribeUserDataResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeUserDataWithOptions(request, runtime); } /** * Queries VRouters. * * @deprecated OpenAPI DescribeVRouters is deprecated, please use Vpc::2016-04-28::DescribeVRouters instead. * * @param request - DescribeVRoutersRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeVRoutersResponse */ async describeVRoutersWithOptions(request: $_model.DescribeVRoutersRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeVRoutersResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.VRouterId)) { query["VRouterId"] = request.VRouterId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeVRouters", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeVRoutersResponse>(await this.callApi(params, req, runtime), new $_model.DescribeVRoutersResponse({})); } /** * Queries VRouters. * * @deprecated OpenAPI DescribeVRouters is deprecated, please use Vpc::2016-04-28::DescribeVRouters instead. * * @param request - DescribeVRoutersRequest * @returns DescribeVRoutersResponse */ // Deprecated async describeVRouters(request: $_model.DescribeVRoutersRequest): Promise<$_model.DescribeVRoutersResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeVRoutersWithOptions(request, runtime); } /** * DescribeVSwitches * * @deprecated OpenAPI DescribeVSwitches is deprecated, please use Vpc::2016-04-28::DescribeVSwitches instead. * * @param request - DescribeVSwitchesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeVSwitchesResponse */ async describeVSwitchesWithOptions(request: $_model.DescribeVSwitchesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeVSwitchesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.isDefault)) { query["IsDefault"] = request.isDefault; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.vSwitchId)) { query["VSwitchId"] = request.vSwitchId; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeVSwitches", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeVSwitchesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeVSwitchesResponse({})); } /** * DescribeVSwitches * * @deprecated OpenAPI DescribeVSwitches is deprecated, please use Vpc::2016-04-28::DescribeVSwitches instead. * * @param request - DescribeVSwitchesRequest * @returns DescribeVSwitchesResponse */ // Deprecated async describeVSwitches(request: $_model.DescribeVSwitchesRequest): Promise<$_model.DescribeVSwitchesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeVSwitchesWithOptions(request, runtime); } /** * DescribeVirtualBorderRouters * * @deprecated OpenAPI DescribeVirtualBorderRouters is deprecated, please use Vpc::2016-04-28::DescribeVirtualBorderRouters instead. * * @param request - DescribeVirtualBorderRoutersRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeVirtualBorderRoutersResponse */ async describeVirtualBorderRoutersWithOptions(request: $_model.DescribeVirtualBorderRoutersRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeVirtualBorderRoutersResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.filter)) { query["Filter"] = request.filter; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeVirtualBorderRouters", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeVirtualBorderRoutersResponse>(await this.callApi(params, req, runtime), new $_model.DescribeVirtualBorderRoutersResponse({})); } /** * DescribeVirtualBorderRouters * * @deprecated OpenAPI DescribeVirtualBorderRouters is deprecated, please use Vpc::2016-04-28::DescribeVirtualBorderRouters instead. * * @param request - DescribeVirtualBorderRoutersRequest * @returns DescribeVirtualBorderRoutersResponse */ // Deprecated async describeVirtualBorderRouters(request: $_model.DescribeVirtualBorderRoutersRequest): Promise<$_model.DescribeVirtualBorderRoutersResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeVirtualBorderRoutersWithOptions(request, runtime); } /** * DescribeVirtualBorderRoutersForPhysicalConnection. * * @deprecated OpenAPI DescribeVirtualBorderRoutersForPhysicalConnection is deprecated, please use Vpc::2016-04-28::DescribeVirtualBorderRoutersForPhysicalConnection instead. * * @param request - DescribeVirtualBorderRoutersForPhysicalConnectionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeVirtualBorderRoutersForPhysicalConnectionResponse */ async describeVirtualBorderRoutersForPhysicalConnectionWithOptions(request: $_model.DescribeVirtualBorderRoutersForPhysicalConnectionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeVirtualBorderRoutersForPhysicalConnectionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.filter)) { query["Filter"] = request.filter; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.physicalConnectionId)) { query["PhysicalConnectionId"] = request.physicalConnectionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeVirtualBorderRoutersForPhysicalConnection", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeVirtualBorderRoutersForPhysicalConnectionResponse>(await this.callApi(params, req, runtime), new $_model.DescribeVirtualBorderRoutersForPhysicalConnectionResponse({})); } /** * DescribeVirtualBorderRoutersForPhysicalConnection. * * @deprecated OpenAPI DescribeVirtualBorderRoutersForPhysicalConnection is deprecated, please use Vpc::2016-04-28::DescribeVirtualBorderRoutersForPhysicalConnection instead. * * @param request - DescribeVirtualBorderRoutersForPhysicalConnectionRequest * @returns DescribeVirtualBorderRoutersForPhysicalConnectionResponse */ // Deprecated async describeVirtualBorderRoutersForPhysicalConnection(request: $_model.DescribeVirtualBorderRoutersForPhysicalConnectionRequest): Promise<$_model.DescribeVirtualBorderRoutersForPhysicalConnectionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeVirtualBorderRoutersForPhysicalConnectionWithOptions(request, runtime); } /** * Query VPCs * * @deprecated OpenAPI DescribeVpcs is deprecated, please use Vpc::2016-04-28::DescribeVpcs instead. * * @param request - DescribeVpcsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeVpcsResponse */ async describeVpcsWithOptions(request: $_model.DescribeVpcsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeVpcsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.isDefault)) { query["IsDefault"] = request.isDefault; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeVpcs", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeVpcsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeVpcsResponse({})); } /** * Query VPCs * * @deprecated OpenAPI DescribeVpcs is deprecated, please use Vpc::2016-04-28::DescribeVpcs instead. * * @param request - DescribeVpcsRequest * @returns DescribeVpcsResponse */ // Deprecated async describeVpcs(request: $_model.DescribeVpcsRequest): Promise<$_model.DescribeVpcsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeVpcsWithOptions(request, runtime); } /** * 查询虚拟存储通道 * * @remarks * 如果您指定了标签键(Tag.N.Key)但没有指定标签值(Tag.N.Value),我们将查询该标签键对应的所有标签键值对。如果您指定了标签键值对,就查询精确匹配该键值对的标签。 * * @param request - DescribeVscsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeVscsResponse */ async describeVscsWithOptions(request: $_model.DescribeVscsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeVscsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.vscIds)) { query["VscIds"] = request.vscIds; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeVscs", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeVscsResponse>(await this.callApi(params, req, runtime), new $_model.DescribeVscsResponse({})); } /** * 查询虚拟存储通道 * * @remarks * 如果您指定了标签键(Tag.N.Key)但没有指定标签值(Tag.N.Value),我们将查询该标签键对应的所有标签键值对。如果您指定了标签键值对,就查询精确匹配该键值对的标签。 * * @param request - DescribeVscsRequest * @returns DescribeVscsResponse */ async describeVscs(request: $_model.DescribeVscsRequest): Promise<$_model.DescribeVscsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeVscsWithOptions(request, runtime); } /** * Queries the list of active zones based on parameters such as region ID and billing method. * * @remarks * DescribeZones only queries the list of zones provided by Alibaba Cloud and returns limited inventory information. To query the instance types and disk categories available for purchase in a specific zone, use [DescribeAvailableResource](https://help.aliyun.com/document_detail/66186.html). * * @param request - DescribeZonesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DescribeZonesResponse */ async describeZonesWithOptions(request: $_model.DescribeZonesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeZonesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.acceptLanguage)) { query["AcceptLanguage"] = request.acceptLanguage; } if (!$dara.isNull(request.instanceChargeType)) { query["InstanceChargeType"] = request.instanceChargeType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.spotStrategy)) { query["SpotStrategy"] = request.spotStrategy; } if (!$dara.isNull(request.verbose)) { query["Verbose"] = request.verbose; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DescribeZones", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DescribeZonesResponse>(await this.callApi(params, req, runtime), new $_model.DescribeZonesResponse({})); } /** * Queries the list of active zones based on parameters such as region ID and billing method. * * @remarks * DescribeZones only queries the list of zones provided by Alibaba Cloud and returns limited inventory information. To query the instance types and disk categories available for purchase in a specific zone, use [DescribeAvailableResource](https://help.aliyun.com/document_detail/66186.html). * * @param request - DescribeZonesRequest * @returns DescribeZonesResponse */ async describeZones(request: $_model.DescribeZonesRequest): Promise<$_model.DescribeZonesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeZonesWithOptions(request, runtime); } /** * Unlinks an Elastic Compute Service (ECS) instance that resides in the classic network from a virtual private cloud (VPC) by closing the ClassicLink connection between the instance and the VPC. After the instance is unlinked from the VPC, the instance can no longer communicate with instances in the VPC. * * @param request - DetachClassicLinkVpcRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DetachClassicLinkVpcResponse */ async detachClassicLinkVpcWithOptions(request: $_model.DetachClassicLinkVpcRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DetachClassicLinkVpcResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DetachClassicLinkVpc", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DetachClassicLinkVpcResponse>(await this.callApi(params, req, runtime), new $_model.DetachClassicLinkVpcResponse({})); } /** * Unlinks an Elastic Compute Service (ECS) instance that resides in the classic network from a virtual private cloud (VPC) by closing the ClassicLink connection between the instance and the VPC. After the instance is unlinked from the VPC, the instance can no longer communicate with instances in the VPC. * * @param request - DetachClassicLinkVpcRequest * @returns DetachClassicLinkVpcResponse */ async detachClassicLinkVpc(request: $_model.DetachClassicLinkVpcRequest): Promise<$_model.DetachClassicLinkVpcResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.detachClassicLinkVpcWithOptions(request, runtime); } /** * Detaches a pay-as-you-go data disk or a system disk from an Elastic Compute Service (ECS) instance. * * @remarks * Take note of the following items: * - This operation is an asynchronous operation. After you call the operation to detach a disk from an ECS instance, the disk is detached in approximately 1 minute. * - If `OperationLocks` in the response contains `"LockReason" : "security"` when you query information about an instance, the instance is locked for security reasons and all operations are prohibited on the instance. * - If you want to attach an elastic ephemeral disk that you detached from an instance, you can attach the disk only to the instance. * * @param request - DetachDiskRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DetachDiskResponse */ async detachDiskWithOptions(request: $_model.DetachDiskRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DetachDiskResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.deleteWithInstance)) { query["DeleteWithInstance"] = request.deleteWithInstance; } if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DetachDisk", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DetachDiskResponse>(await this.callApi(params, req, runtime), new $_model.DetachDiskResponse({})); } /** * Detaches a pay-as-you-go data disk or a system disk from an Elastic Compute Service (ECS) instance. * * @remarks * Take note of the following items: * - This operation is an asynchronous operation. After you call the operation to detach a disk from an ECS instance, the disk is detached in approximately 1 minute. * - If `OperationLocks` in the response contains `"LockReason" : "security"` when you query information about an instance, the instance is locked for security reasons and all operations are prohibited on the instance. * - If you want to attach an elastic ephemeral disk that you detached from an instance, you can attach the disk only to the instance. * * @param request - DetachDiskRequest * @returns DetachDiskResponse */ async detachDisk(request: $_model.DetachDiskRequest): Promise<$_model.DetachDiskResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.detachDiskWithOptions(request, runtime); } /** * Detaches instance Resource Access Management (RAM) roles from Elastic Compute Service (ECS) instances. * * @param request - DetachInstanceRamRoleRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DetachInstanceRamRoleResponse */ async detachInstanceRamRoleWithOptions(request: $_model.DetachInstanceRamRoleRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DetachInstanceRamRoleResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceIds)) { query["InstanceIds"] = request.instanceIds; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.ramRoleName)) { query["RamRoleName"] = request.ramRoleName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DetachInstanceRamRole", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DetachInstanceRamRoleResponse>(await this.callApi(params, req, runtime), new $_model.DetachInstanceRamRoleResponse({})); } /** * Detaches instance Resource Access Management (RAM) roles from Elastic Compute Service (ECS) instances. * * @param request - DetachInstanceRamRoleRequest * @returns DetachInstanceRamRoleResponse */ async detachInstanceRamRole(request: $_model.DetachInstanceRamRoleRequest): Promise<$_model.DetachInstanceRamRoleResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.detachInstanceRamRoleWithOptions(request, runtime); } /** * Unbinds SSH key pairs from one or more Linux instances. * * @remarks * Take note of the following items when you call this operation: * - After you unbind an SSH key pair, restart the instance ([RebootInstance](https://help.aliyun.com/document_detail/25502.html)) for the changes to take effect. * - After you unbind an SSH key pair, the instance uses the username and password authentication method by default. * * @param request - DetachKeyPairRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DetachKeyPairResponse */ async detachKeyPairWithOptions(request: $_model.DetachKeyPairRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DetachKeyPairResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceIds)) { query["InstanceIds"] = request.instanceIds; } if (!$dara.isNull(request.keyPairName)) { query["KeyPairName"] = request.keyPairName; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DetachKeyPair", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DetachKeyPairResponse>(await this.callApi(params, req, runtime), new $_model.DetachKeyPairResponse({})); } /** * Unbinds SSH key pairs from one or more Linux instances. * * @remarks * Take note of the following items when you call this operation: * - After you unbind an SSH key pair, restart the instance ([RebootInstance](https://help.aliyun.com/document_detail/25502.html)) for the changes to take effect. * - After you unbind an SSH key pair, the instance uses the username and password authentication method by default. * * @param request - DetachKeyPairRequest * @returns DetachKeyPairResponse */ async detachKeyPair(request: $_model.DetachKeyPairRequest): Promise<$_model.DetachKeyPairResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.detachKeyPairWithOptions(request, runtime); } /** * Detach an elastic network interface (ENI) from an Elastic Compute Service (ECS) instance. * * @remarks * Take note of the following items: * - You cannot detach the primary ENI of an instance. * - Make sure that the ENI to be detached is in the Detaching (Unbinding) or InUse (Bound) state. * - Make sure that the instance from which you want to detach an ENI is in the Running (Running) or Stopped (Stopped) state. * - The DetachNetworkInterface operation is an asynchronous operation. After this operation is called to detach an ENI, you can check the status or events of the ENI to determine whether the ENI is detached. The following figure shows the transitions between the states of the ENI.![](https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20230223/uemr/DetachNetworkInterface.png) * - If the ENI is in the Detaching state, the ENI detachment request is sent and the ENI is being detached from the associated instance. * - If the ENI is in the Available state, the ENI is detached from the associated instance. * - If the ENI is stuck in the Detaching state, the ENI may fail to be detached from the associated instance due to specific reasons. For example, the ENI may fail to be detached because the operating system of the instance did not respond to the ENI detachment request. If this issue occurs, you can re-initiate the request to detach the ENI. If the issue persists, restart the instance. * For information about examples on how to call the DetachNetworkInterface operation, see [Detach an ENI from an ECS instance](https://help.aliyun.com/document_detail/471551.html). * * @param request - DetachNetworkInterfaceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DetachNetworkInterfaceResponse */ async detachNetworkInterfaceWithOptions(request: $_model.DetachNetworkInterfaceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DetachNetworkInterfaceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.trunkNetworkInstanceId)) { query["TrunkNetworkInstanceId"] = request.trunkNetworkInstanceId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DetachNetworkInterface", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DetachNetworkInterfaceResponse>(await this.callApi(params, req, runtime), new $_model.DetachNetworkInterfaceResponse({})); } /** * Detach an elastic network interface (ENI) from an Elastic Compute Service (ECS) instance. * * @remarks * Take note of the following items: * - You cannot detach the primary ENI of an instance. * - Make sure that the ENI to be detached is in the Detaching (Unbinding) or InUse (Bound) state. * - Make sure that the instance from which you want to detach an ENI is in the Running (Running) or Stopped (Stopped) state. * - The DetachNetworkInterface operation is an asynchronous operation. After this operation is called to detach an ENI, you can check the status or events of the ENI to determine whether the ENI is detached. The following figure shows the transitions between the states of the ENI.![](https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20230223/uemr/DetachNetworkInterface.png) * - If the ENI is in the Detaching state, the ENI detachment request is sent and the ENI is being detached from the associated instance. * - If the ENI is in the Available state, the ENI is detached from the associated instance. * - If the ENI is stuck in the Detaching state, the ENI may fail to be detached from the associated instance due to specific reasons. For example, the ENI may fail to be detached because the operating system of the instance did not respond to the ENI detachment request. If this issue occurs, you can re-initiate the request to detach the ENI. If the issue persists, restart the instance. * For information about examples on how to call the DetachNetworkInterface operation, see [Detach an ENI from an ECS instance](https://help.aliyun.com/document_detail/471551.html). * * @param request - DetachNetworkInterfaceRequest * @returns DetachNetworkInterfaceResponse */ async detachNetworkInterface(request: $_model.DetachNetworkInterfaceRequest): Promise<$_model.DetachNetworkInterfaceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.detachNetworkInterfaceWithOptions(request, runtime); } /** * To prevent an activation code from being leaked, you can call the DisableActivation operation to disable the activation code. Disabled activation codes cannot be used to register new managed instances. However, managed instances that are already registered are not affected. * * @remarks * ## [](#)Usage notes * To prevent an activation code from being leaked, you can call the DisableActivation operation to disable the activation code. Disabled activation codes cannot be used to register new managed instances. However, managed instances that are already registered are not affected. * * @param request - DisableActivationRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DisableActivationResponse */ async disableActivationWithOptions(request: $_model.DisableActivationRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DisableActivationResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.activationId)) { query["ActivationId"] = request.activationId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DisableActivation", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DisableActivationResponse>(await this.callApi(params, req, runtime), new $_model.DisableActivationResponse({})); } /** * To prevent an activation code from being leaked, you can call the DisableActivation operation to disable the activation code. Disabled activation codes cannot be used to register new managed instances. However, managed instances that are already registered are not affected. * * @remarks * ## [](#)Usage notes * To prevent an activation code from being leaked, you can call the DisableActivation operation to disable the activation code. Disabled activation codes cannot be used to register new managed instances. However, managed instances that are already registered are not affected. * * @param request - DisableActivationRequest * @returns DisableActivationResponse */ async disableActivation(request: $_model.DisableActivationRequest): Promise<$_model.DisableActivationResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.disableActivationWithOptions(request, runtime); } /** * Disables the account-level default encryption for block storage in a specified region. * * @remarks * - **Before you begin** * - Resource Access Management (RAM) users require the `AliyunECSFullAccess` permission. For more information about how to perform authorization, see [Grant permissions to a RAM user](https://help.aliyun.com/document_detail/116146.html). * - **Usage notes** * - After you shutdown account-level default encryption for block storage, the encryption status of existing cloud disks is not affected. * - After you shutdown account-level default encryption for block storage, you can still manually select encryption when you create cloud disks. * * @param request - DisableDiskEncryptionByDefaultRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DisableDiskEncryptionByDefaultResponse */ async disableDiskEncryptionByDefaultWithOptions(request: $_model.DisableDiskEncryptionByDefaultRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DisableDiskEncryptionByDefaultResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DisableDiskEncryptionByDefault", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DisableDiskEncryptionByDefaultResponse>(await this.callApi(params, req, runtime), new $_model.DisableDiskEncryptionByDefaultResponse({})); } /** * Disables the account-level default encryption for block storage in a specified region. * * @remarks * - **Before you begin** * - Resource Access Management (RAM) users require the `AliyunECSFullAccess` permission. For more information about how to perform authorization, see [Grant permissions to a RAM user](https://help.aliyun.com/document_detail/116146.html). * - **Usage notes** * - After you shutdown account-level default encryption for block storage, the encryption status of existing cloud disks is not affected. * - After you shutdown account-level default encryption for block storage, you can still manually select encryption when you create cloud disks. * * @param request - DisableDiskEncryptionByDefaultRequest * @returns DisableDiskEncryptionByDefaultResponse */ async disableDiskEncryptionByDefault(request: $_model.DisableDiskEncryptionByDefaultRequest): Promise<$_model.DisableDiskEncryptionByDefaultResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.disableDiskEncryptionByDefaultWithOptions(request, runtime); } /** * Disables Elastic Network Interface (ENI) QoS speed setting. * * @param request - DisableNetworkInterfaceQoSRequest * @param runtime - runtime options for this request RuntimeOptions * @returns DisableNetworkInterfaceQoSResponse */ async disableNetworkInterfaceQoSWithOptions(request: $_model.DisableNetworkInterfaceQoSRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DisableNetworkInterfaceQoSResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "DisableNetworkInterfaceQoS", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.DisableNetworkInterfaceQoSResponse>(await this.callApi(params, req, runtime), new $_model.DisableNetworkInterfaceQoSResponse({})); } /** * Disables Elastic Network Interface (ENI) QoS speed setting. * * @param request - DisableNetworkInterfaceQoSRequest * @returns DisableNetworkInterfaceQoSResponse */ async disableNetworkInterfaceQoS(request: $_model.DisableNetworkInterfaceQoSRequest): Promise<$_model.DisableNetworkInterfaceQoSResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.disableNetworkInterfaceQoSWithOptions(request, runtime); } /** * Enables the Account-level Elastic Block Storage (EBS) Default Encryption feature in a region. * * @remarks * > The Account-level EBS Default Encryption feature is available only in specific regions and to specific users. To use the feature, [submit a ticket](https://smartservice.console.aliyun.com/service/create-ticket-intl). * - **Precautions** * - To enable the Account-level EBS Default Encryption feature as a Resource Access Management (RAM) user, grant the `AliyunECSFullAccess` permission to the RAM user. For more information, see [Grant permissions to a RAM user](https://help.aliyun.com/document_detail/116146.html). * - Before you can enable the Account-level EBS Default Encryption feature in a region, you must [activate Key Management Service (KMS)](https://help.aliyun.com/document_detail/480156.html) in the region. * - After you enable the Account-level EBS Default Encryption feature in a region, you can purchase only encrypted cloud disks in the region. For more information, see the [Limits](~~59643#50de175230erj~~) section of the "Encrypt cloud disks" topic. * - **Considerations** * - After you enable the Account-level EBS Default Encryption feature in a region, new pay-as-you-go and subscription cloud disks in the region must be encrypted. You can use the KMS key configured for the feature or specify other KMS keys to encrypt the cloud disks. * - The first time you enable the Account-level EBS Default Encryption feature in a region, the service key in the region is automatically used to encrypt EBS resources. * - **Suggestions** * - You can call the [DescribeDiskEncryptionByDefaultStatus](https://help.aliyun.com/document_detail/2851493.html) operation to query whether the Account-level EBS Default Encryption feature is enabled in a region and the [DescribeDiskDefaultKMSKeyId](https://help.aliyun.com/document_detail/2851490.html) operation to query the ID of the KMS key used by the feature in a region. * - You can call the [ModifyDiskDefaultKMSKeyId](https://help.aliyun.com/document_detail/2851492.html) or [ResetDiskDefaultKMSKeyId](https://help.aliyun.com/document_detail/2851539.html) operation to change or reset the KMS key used by the Account-level EBS Default Encryption feature in a region. * - You can call the [DisableDiskEncryptionByDefault](https://help.aliyun.com/document_detail/2851491.html) operation to disable the Account-level EBS Default Encryption feature in a region. * * @param request - EnableDiskEncryptionByDefaultRequest * @param runtime - runtime options for this request RuntimeOptions * @returns EnableDiskEncryptionByDefaultResponse */ async enableDiskEncryptionByDefaultWithOptions(request: $_model.EnableDiskEncryptionByDefaultRequest, runtime: $dara.RuntimeOptions): Promise<$_model.EnableDiskEncryptionByDefaultResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "EnableDiskEncryptionByDefault", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.EnableDiskEncryptionByDefaultResponse>(await this.callApi(params, req, runtime), new $_model.EnableDiskEncryptionByDefaultResponse({})); } /** * Enables the Account-level Elastic Block Storage (EBS) Default Encryption feature in a region. * * @remarks * > The Account-level EBS Default Encryption feature is available only in specific regions and to specific users. To use the feature, [submit a ticket](https://smartservice.console.aliyun.com/service/create-ticket-intl). * - **Precautions** * - To enable the Account-level EBS Default Encryption feature as a Resource Access Management (RAM) user, grant the `AliyunECSFullAccess` permission to the RAM user. For more information, see [Grant permissions to a RAM user](https://help.aliyun.com/document_detail/116146.html). * - Before you can enable the Account-level EBS Default Encryption feature in a region, you must [activate Key Management Service (KMS)](https://help.aliyun.com/document_detail/480156.html) in the region. * - After you enable the Account-level EBS Default Encryption feature in a region, you can purchase only encrypted cloud disks in the region. For more information, see the [Limits](~~59643#50de175230erj~~) section of the "Encrypt cloud disks" topic. * - **Considerations** * - After you enable the Account-level EBS Default Encryption feature in a region, new pay-as-you-go and subscription cloud disks in the region must be encrypted. You can use the KMS key configured for the feature or specify other KMS keys to encrypt the cloud disks. * - The first time you enable the Account-level EBS Default Encryption feature in a region, the service key in the region is automatically used to encrypt EBS resources. * - **Suggestions** * - You can call the [DescribeDiskEncryptionByDefaultStatus](https://help.aliyun.com/document_detail/2851493.html) operation to query whether the Account-level EBS Default Encryption feature is enabled in a region and the [DescribeDiskDefaultKMSKeyId](https://help.aliyun.com/document_detail/2851490.html) operation to query the ID of the KMS key used by the feature in a region. * - You can call the [ModifyDiskDefaultKMSKeyId](https://help.aliyun.com/document_detail/2851492.html) or [ResetDiskDefaultKMSKeyId](https://help.aliyun.com/document_detail/2851539.html) operation to change or reset the KMS key used by the Account-level EBS Default Encryption feature in a region. * - You can call the [DisableDiskEncryptionByDefault](https://help.aliyun.com/document_detail/2851491.html) operation to disable the Account-level EBS Default Encryption feature in a region. * * @param request - EnableDiskEncryptionByDefaultRequest * @returns EnableDiskEncryptionByDefaultResponse */ async enableDiskEncryptionByDefault(request: $_model.EnableDiskEncryptionByDefaultRequest): Promise<$_model.EnableDiskEncryptionByDefaultResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.enableDiskEncryptionByDefaultWithOptions(request, runtime); } /** * Enable or modify Elastic Network Interface (ENI) QoS rate limit settings * * @param request - EnableNetworkInterfaceQoSRequest * @param runtime - runtime options for this request RuntimeOptions * @returns EnableNetworkInterfaceQoSResponse */ async enableNetworkInterfaceQoSWithOptions(request: $_model.EnableNetworkInterfaceQoSRequest, runtime: $dara.RuntimeOptions): Promise<$_model.EnableNetworkInterfaceQoSResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.qoS)) { query["QoS"] = request.qoS; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "EnableNetworkInterfaceQoS", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.EnableNetworkInterfaceQoSResponse>(await this.callApi(params, req, runtime), new $_model.EnableNetworkInterfaceQoSResponse({})); } /** * Enable or modify Elastic Network Interface (ENI) QoS rate limit settings * * @param request - EnableNetworkInterfaceQoSRequest * @returns EnableNetworkInterfaceQoSResponse */ async enableNetworkInterfaceQoS(request: $_model.EnableNetworkInterfaceQoSRequest): Promise<$_model.EnableNetworkInterfaceQoSResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.enableNetworkInterfaceQoSWithOptions(request, runtime); } /** * Enables a physical connection. * * @deprecated OpenAPI EnablePhysicalConnection is deprecated, please use Vpc::2016-04-28::EnablePhysicalConnection instead. * * @param request - EnablePhysicalConnectionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns EnablePhysicalConnectionResponse */ async enablePhysicalConnectionWithOptions(request: $_model.EnablePhysicalConnectionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.EnablePhysicalConnectionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.physicalConnectionId)) { query["PhysicalConnectionId"] = request.physicalConnectionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "EnablePhysicalConnection", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.EnablePhysicalConnectionResponse>(await this.callApi(params, req, runtime), new $_model.EnablePhysicalConnectionResponse({})); } /** * Enables a physical connection. * * @deprecated OpenAPI EnablePhysicalConnection is deprecated, please use Vpc::2016-04-28::EnablePhysicalConnection instead. * * @param request - EnablePhysicalConnectionRequest * @returns EnablePhysicalConnectionResponse */ // Deprecated async enablePhysicalConnection(request: $_model.EnablePhysicalConnectionRequest): Promise<$_model.EnablePhysicalConnectionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.enablePhysicalConnectionWithOptions(request, runtime); } /** * Permanently closes the data connection of a specified session. * * @remarks * - Closes the data connection of a specified session. The session can no longer be used. * - The WebSocket URL associated with the session also becomes invalid and can no longer be used. * * @param request - EndTerminalSessionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns EndTerminalSessionResponse */ async endTerminalSessionWithOptions(request: $_model.EndTerminalSessionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.EndTerminalSessionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.sessionId)) { query["SessionId"] = request.sessionId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "EndTerminalSession", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.EndTerminalSessionResponse>(await this.callApi(params, req, runtime), new $_model.EndTerminalSessionResponse({})); } /** * Permanently closes the data connection of a specified session. * * @remarks * - Closes the data connection of a specified session. The session can no longer be used. * - The WebSocket URL associated with the session also becomes invalid and can no longer be used. * * @param request - EndTerminalSessionRequest * @returns EndTerminalSessionResponse */ async endTerminalSession(request: $_model.EndTerminalSessionRequest): Promise<$_model.EndTerminalSessionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.endTerminalSessionWithOptions(request, runtime); } /** * Export a custom image to an OSS bucket in the same region as the image. * * @remarks * Before you export an image: * - Review the prerequisites and considerations in [Export an image](https://help.aliyun.com/document_detail/58181.html). * - The `ImageFormat` parameter is available only in the following regions: Japan (Tokyo), Indonesia (Jakarta), Germany (Frankfurt), UAE (Dubai), US (Virginia), UK (London), Singapore, Malaysia (Kuala Lumpur), and US (Silicon Valley). In regions that do not support this parameter, images are exported in the RAW format by default. * - You must use RAM to grant ECS permissions to write to OSS. Follow these steps: * - Create a role with the required name `AliyunECSImageExportDefaultRole` and attach the following trust policy:``` * { * "Statement": [ * { * "Action": "sts:AssumeRole", * "Effect": "Allow", * "Principal": { * "Service": [ * "ecs.aliyuncs.com" * ] * } * } * ], * "Version": "1" * } * ``` * - Attach the default system permission policy, `AliyunECSImageExportRolePolicy`, to the `AliyunECSImageExportDefaultRole` role. For more details, see [Grant permissions to a RAM role](https://ram.console.aliyun.com/?spm=5176.2020520101.0.0.64c64df5dfpmdY#/role/authorize?request=%7B%22Requests%22:%20%7B%22request1%22:%20%7B%22RoleName%22:%20%22AliyunECSImageImportDefaultRole%22,%20%22TemplateId%22:%20%22ECSImportRole%22%7D,%20%22request2%22:%20%7B%22RoleName%22:%20%22AliyunECSImageExportDefaultRole%22,%20%22TemplateId%22:%20%22ECSExportRole%22%7D%7D,%20%22ReturnUrl%22:%20%22https:%2F%2Fecs.console.aliyun.com%2F%22,%20%22Service%22:%20%22ECS%22%7D). You can also create a custom policy that includes the following permissions:``` * { * "Version": "1", * "Statement": [ * { * "Action": [ * "oss:GetObject", * "oss:PutObject", * "oss:DeleteObject", * "oss:GetBucketLocation", * "oss:GetBucketInfo", * "oss:AbortMultipartUpload", * "oss:ListMultipartUploads", * "oss:ListParts" * ], * "Resource": "*", * "Effect": "Allow" * } * ] * } * ``` * After the image is exported: * The custom image is stored in the specified OSS bucket. For download instructions, see [Download a custom image](https://help.aliyun.com/document_detail/31912.html). * * @param request - ExportImageRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ExportImageResponse */ async exportImageWithOptions(request: $_model.ExportImageRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ExportImageResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.imageFormat)) { query["ImageFormat"] = request.imageFormat; } if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.OSSBucket)) { query["OSSBucket"] = request.OSSBucket; } if (!$dara.isNull(request.OSSPrefix)) { query["OSSPrefix"] = request.OSSPrefix; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.roleName)) { query["RoleName"] = request.roleName; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ExportImage", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ExportImageResponse>(await this.callApi(params, req, runtime), new $_model.ExportImageResponse({})); } /** * Export a custom image to an OSS bucket in the same region as the image. * * @remarks * Before you export an image: * - Review the prerequisites and considerations in [Export an image](https://help.aliyun.com/document_detail/58181.html). * - The `ImageFormat` parameter is available only in the following regions: Japan (Tokyo), Indonesia (Jakarta), Germany (Frankfurt), UAE (Dubai), US (Virginia), UK (London), Singapore, Malaysia (Kuala Lumpur), and US (Silicon Valley). In regions that do not support this parameter, images are exported in the RAW format by default. * - You must use RAM to grant ECS permissions to write to OSS. Follow these steps: * - Create a role with the required name `AliyunECSImageExportDefaultRole` and attach the following trust policy:``` * { * "Statement": [ * { * "Action": "sts:AssumeRole", * "Effect": "Allow", * "Principal": { * "Service": [ * "ecs.aliyuncs.com" * ] * } * } * ], * "Version": "1" * } * ``` * - Attach the default system permission policy, `AliyunECSImageExportRolePolicy`, to the `AliyunECSImageExportDefaultRole` role. For more details, see [Grant permissions to a RAM role](https://ram.console.aliyun.com/?spm=5176.2020520101.0.0.64c64df5dfpmdY#/role/authorize?request=%7B%22Requests%22:%20%7B%22request1%22:%20%7B%22RoleName%22:%20%22AliyunECSImageImportDefaultRole%22,%20%22TemplateId%22:%20%22ECSImportRole%22%7D,%20%22request2%22:%20%7B%22RoleName%22:%20%22AliyunECSImageExportDefaultRole%22,%20%22TemplateId%22:%20%22ECSExportRole%22%7D%7D,%20%22ReturnUrl%22:%20%22https:%2F%2Fecs.console.aliyun.com%2F%22,%20%22Service%22:%20%22ECS%22%7D). You can also create a custom policy that includes the following permissions:``` * { * "Version": "1", * "Statement": [ * { * "Action": [ * "oss:GetObject", * "oss:PutObject", * "oss:DeleteObject", * "oss:GetBucketLocation", * "oss:GetBucketInfo", * "oss:AbortMultipartUpload", * "oss:ListMultipartUploads", * "oss:ListParts" * ], * "Resource": "*", * "Effect": "Allow" * } * ] * } * ``` * After the image is exported: * The custom image is stored in the specified OSS bucket. For download instructions, see [Download a custom image](https://help.aliyun.com/document_detail/31912.html). * * @param request - ExportImageRequest * @returns ExportImageResponse */ async exportImage(request: $_model.ExportImageRequest): Promise<$_model.ExportImageResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.exportImageWithOptions(request, runtime); } /** * Exports a snapshot to a specified Object Storage Service (OSS) bucket. * * @deprecated OpenAPI ExportSnapshot is deprecated * * @param request - ExportSnapshotRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ExportSnapshotResponse */ async exportSnapshotWithOptions(request: $_model.ExportSnapshotRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ExportSnapshotResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ossBucket)) { query["OssBucket"] = request.ossBucket; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.roleName)) { query["RoleName"] = request.roleName; } if (!$dara.isNull(request.snapshotId)) { query["SnapshotId"] = request.snapshotId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ExportSnapshot", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ExportSnapshotResponse>(await this.callApi(params, req, runtime), new $_model.ExportSnapshotResponse({})); } /** * Exports a snapshot to a specified Object Storage Service (OSS) bucket. * * @deprecated OpenAPI ExportSnapshot is deprecated * * @param request - ExportSnapshotRequest * @returns ExportSnapshotResponse */ // Deprecated async exportSnapshot(request: $_model.ExportSnapshotRequest): Promise<$_model.ExportSnapshotResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.exportSnapshotWithOptions(request, runtime); } /** * Retrieves the system command-line output of an instance. The data is returned in Base64-encoded format. * * @remarks * - Elastic Compute Service (ECS) is a virtualization-based cloud server that cannot be connected to display devices or manually screenshotted. However, Alibaba Cloud caches the system command line output from the last time an instance was started, restarted, or shut down. You can invoke GetInstanceConsoleOutput to retrieve this output. * - System command line output cannot be retrieved for [retired instance types](https://help.aliyun.com/document_detail/55263.html). * - Windows instances do not support retrieving system command line output. * * @param request - GetInstanceConsoleOutputRequest * @param runtime - runtime options for this request RuntimeOptions * @returns GetInstanceConsoleOutputResponse */ async getInstanceConsoleOutputWithOptions(request: $_model.GetInstanceConsoleOutputRequest, runtime: $dara.RuntimeOptions): Promise<$_model.GetInstanceConsoleOutputResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.removeSymbols)) { query["RemoveSymbols"] = request.removeSymbols; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "GetInstanceConsoleOutput", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.GetInstanceConsoleOutputResponse>(await this.callApi(params, req, runtime), new $_model.GetInstanceConsoleOutputResponse({})); } /** * Retrieves the system command-line output of an instance. The data is returned in Base64-encoded format. * * @remarks * - Elastic Compute Service (ECS) is a virtualization-based cloud server that cannot be connected to display devices or manually screenshotted. However, Alibaba Cloud caches the system command line output from the last time an instance was started, restarted, or shut down. You can invoke GetInstanceConsoleOutput to retrieve this output. * - System command line output cannot be retrieved for [retired instance types](https://help.aliyun.com/document_detail/55263.html). * - Windows instances do not support retrieving system command line output. * * @param request - GetInstanceConsoleOutputRequest * @returns GetInstanceConsoleOutputResponse */ async getInstanceConsoleOutput(request: $_model.GetInstanceConsoleOutputRequest): Promise<$_model.GetInstanceConsoleOutputResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.getInstanceConsoleOutputWithOptions(request, runtime); } /** * Calls GetInstanceScreenshot to retrieve the screenshot information of an instance. * * @remarks * After Elastic Compute Service (ECS) returns the instance screenshot in Base64-encoded JPG image format, you must decode it yourself. You can call this operation when troubleshooting faults. Note the following items: * - The instance must be in the Running state. * - Screenshots cannot be retrieved for [retired instance types](https://help.aliyun.com/document_detail/55263.html). * - If you call this operation multiple times on the same instance, the interval between calls must be at least 10 seconds. Otherwise, the Throttling error code is returned. * * @param request - GetInstanceScreenshotRequest * @param runtime - runtime options for this request RuntimeOptions * @returns GetInstanceScreenshotResponse */ async getInstanceScreenshotWithOptions(request: $_model.GetInstanceScreenshotRequest, runtime: $dara.RuntimeOptions): Promise<$_model.GetInstanceScreenshotResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.wakeUp)) { query["WakeUp"] = request.wakeUp; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "GetInstanceScreenshot", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.GetInstanceScreenshotResponse>(await this.callApi(params, req, runtime), new $_model.GetInstanceScreenshotResponse({})); } /** * Calls GetInstanceScreenshot to retrieve the screenshot information of an instance. * * @remarks * After Elastic Compute Service (ECS) returns the instance screenshot in Base64-encoded JPG image format, you must decode it yourself. You can call this operation when troubleshooting faults. Note the following items: * - The instance must be in the Running state. * - Screenshots cannot be retrieved for [retired instance types](https://help.aliyun.com/document_detail/55263.html). * - If you call this operation multiple times on the same instance, the interval between calls must be at least 10 seconds. Otherwise, the Throttling error code is returned. * * @param request - GetInstanceScreenshotRequest * @returns GetInstanceScreenshotResponse */ async getInstanceScreenshot(request: $_model.GetInstanceScreenshotRequest): Promise<$_model.GetInstanceScreenshotResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.getInstanceScreenshotWithOptions(request, runtime); } /** * Imports a local image file to Elastic Compute Service (ECS) as a custom image that appears in the specified region. You can then use the imported image to create ECS instances (RunInstances) or replace the system disk of an instance (ReplaceSystemDisk). * * @remarks * ### Operation description * When you call this operation, take note of the following items: * - You must upload the image file to Object Storage Service (OSS) in advance. For more information, see [Upload files](https://help.aliyun.com/document_detail/31886.html). * - To prevent ECS instances created from the imported custom image from failing to start due to operating system issues on some servers, virtual machines, or cloud hosts, check whether you need to install the virtio driver on the source server before importing the image. For more information, see [Install the virtio driver](https://help.aliyun.com/document_detail/62423.html). * - When you import an image for the first time, you must authorize ECS to access your OSS bucket by using Resource Access Management (RAM). Otherwise, the `NoSetRoletoECSServiceAccount` or `InvalidOperation.CloudBoxImageImportRoleRequired` error is returned. The following two scenarios apply: * - **Import an image file without using CloudBox**: You can complete RAM authorization in the RAM console with a single click. For more information, see [Cloud resource access authorization](https://ram.console.aliyun.com/?spm=5176.2020520101image.0.0.2ffa4df57kSoHX#/role/authorize?request=%7B%22Requests%22%3A%20%7B%22request1%22%3A%20%7B%22RoleName%22%3A%20%22AliyunECSImageImportDefaultRole%22%2C%20%22TemplateId%22%3A%20%22ECSImportRole%22%7D%2C%20%22request2%22%3A%20%7B%22RoleName%22%3A%20%22AliyunECSImageExportDefaultRole%22%2C%20%22TemplateId%22%3A%20%22ECSExportRole%22%7D%7D%2C%20%22ReturnUrl%22%3A%20%22https%3A//ecs.console.aliyun.com/%22%2C%20%22Service%22%3A%20%22ECS%22%7D). You can also manually complete RAM authorization. The following policies and permissions are required for some operations. For more information, see [Account access control](https://help.aliyun.com/document_detail/25481.html). * 1. Create a role named `AliyunECSImageImportDefaultRole`. You must use this exact name. Otherwise, the image import fails. Use the following policy for the role: * ``` * { * "Statement": [ * { * "Action": "sts:AssumeRole", * "Effect": "Allow", * "Principal": { * "Service": [ * "ecs.aliyuncs.com" * ] * } * } * ], * "Version": "1" * } * ``` * 2. Attach the system policy `AliyunECSImageImportRolePolicy` to the role. You can also create a custom policy that includes the following permissions: * ``` * { * "Version": "1", * "Statement": [ * { * "Action": [ * "oss:GetObject", * "oss:GetBucketLocation", * "oss:GetBucketInfo" * ], * "Resource": "*", * "Effect": "Allow" * } * ] * } * * ``` * - **Import an image file by using CloudBox**: You can complete RAM authorization in the RAM console with a single click. For more information, see [Cloud resource access authorization](https://ram.console.aliyun.com/role/authorize?request=%7B%22ReturnUrl%22%3A%22https%3A%2F%2Fecs.console.aliyun.com%2F%22%2C%22Services%22%3A%5B%7B%22Roles%22%3A%5B%7B%22RoleName%22%3A%22AliyunECSCloudBoxImageImportDefaultRole%22%2C%22TemplateId%22%3A%22AliyunECSCloudBoxImageImportDefaultRole%22%7D%5D%2C%22Service%22%3A%22ECS%22%7D%5D%7D). You can also manually complete RAM authorization. The following policies and permissions are required for some operations. For more information, see [Account access control](https://help.aliyun.com/document_detail/25481.html). * 1. Create a role named `AliyunECSCloudBoxImageImportDefaultRole`. You must use this exact name. Otherwise, the image import fails. Use the following policy for the role: * ``` * { * "Statement": [ * { * "Action": "sts:AssumeRole", * "Effect": "Allow", * "Principal": { * "Service": [ * "ecs.aliyuncs.com" * ] * } * } * ], * "Version": "1" * } * ``` * 2. Attach the system policy `AliyunECSCloudBoxImageImportRolePolicy` to the role. You can also create a custom policy that includes the following permissions: * ``` * { * "Version": "1", * "Statement": [ * { * "Action": [ * "oss-cloudbox:GetObject", * "oss-cloudbox:GetBucketLocation", * "oss-cloudbox:GetBucketInfo" * ], * "Resource": "*", * "Effect": "Allow" * } * ] * } * * ``` * - You cannot delete an image that is being imported. You can only call [CancelTask](https://help.aliyun.com/document_detail/25624.html) to cancel the image import task. * - The region into which you import the image must be the same as the region of the OSS bucket to which the image file is uploaded. * - Valid values of N in the `DiskDeviceMapping.N` parameter: 1 to 17. When N is 1, the disk is a system disk. When N is 2 to 17, the disk is a data disk. When N is greater than 17, the system automatically ignores the value. * - When the `Architecture` parameter is set to `arm64`, or the `Platform` parameter is set to `CentOS Stream`, `Anolis`, `AlmaLinux`, `UOS`, `Kylin`, or `Rocky Linux`, take note of the following items: * - To ensure that the imported image supports password configuration or key pair modification, the image must meet the following requirements: * - The operating system kernel must support the `CONFIG_FW_CFG_SYSFS` feature. Linux community kernels later than version 4.6 support this feature by default. CentOS kernels later than version 3.10.0-826.el7 support this feature by default. You can run the `grep -nr CONFIG_FW_CFG_SYSFS /boot/config-$(uname -r)` command on the server that corresponds to the image. If the output contains `CONFIG_FW_CFG_SYSFS=y`, the kernel in the image supports the `CONFIG_FW_CFG_SYSFS` feature. * - The latest version of Alibaba Cloud cloud-init is installed on the operating system. Cloud-init 19.1 must Milvus version 19.1.3 or later. Cloud-init 0.7.6a on some earlier operating systems must Milvus version 0.7.6a15 or later. For more information, see [Install cloud-init](https://help.aliyun.com/document_detail/57803.html). * - The operating system must support the SHA-512 encryption algorithm. * - To ensure that the imported image supports disk resizing and file system resizing, the image must meet the following requirements: * - The operating system kernel version must be later than 3.6. * - The growpart command is supported. To support this command, install the `cloud-utils-growpart` package. The installation method varies by operating system. For more information, see [Resize partitions and file systems (Linux)](~~2949817#bb3b1f02e51pj~~). * - The resize2fs command is supported. To support this command, install the `e2fsprogs` package. This package is installed by default on the operating system. If it is not installed, install it manually. * - The latest version of Alibaba Cloud cloud-init is installed on the operating system. Cloud-init 19.1 must Milvus version 19.1.3 or later. Cloud-init 0.7.6a on some earlier operating systems must Milvus version 0.7.6a15 or later. For more information, see [Install cloud-init](https://help.aliyun.com/document_detail/57803.html). * - If the system architecture of the custom image that you want to import is arm64, set the RTC clock to use the UTC time standard. For more information, see [Linux time and time zone description](https://help.aliyun.com/document_detail/405080.html). * - Configure the image detection parameters when you import an image. This helps the system optimize your image. For more information, see [Image detection overview](https://help.aliyun.com/document_detail/439819.html). * * @param request - ImportImageRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ImportImageResponse */ async importImageWithOptions(request: $_model.ImportImageRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ImportImageResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.architecture)) { query["Architecture"] = request.architecture; } if (!$dara.isNull(request.bootMode)) { query["BootMode"] = request.bootMode; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.detectionStrategy)) { query["DetectionStrategy"] = request.detectionStrategy; } if (!$dara.isNull(request.diskDeviceMapping)) { query["DiskDeviceMapping"] = request.diskDeviceMapping; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.features)) { query["Features"] = request.features; } if (!$dara.isNull(request.imageName)) { query["ImageName"] = request.imageName; } if (!$dara.isNull(request.licenseType)) { query["LicenseType"] = request.licenseType; } if (!$dara.isNull(request.OSType)) { query["OSType"] = request.OSType; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.platform)) { query["Platform"] = request.platform; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.roleName)) { query["RoleName"] = request.roleName; } if (!$dara.isNull(request.storageLocationArn)) { query["StorageLocationArn"] = request.storageLocationArn; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ImportImage", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ImportImageResponse>(await this.callApi(params, req, runtime), new $_model.ImportImageResponse({})); } /** * Imports a local image file to Elastic Compute Service (ECS) as a custom image that appears in the specified region. You can then use the imported image to create ECS instances (RunInstances) or replace the system disk of an instance (ReplaceSystemDisk). * * @remarks * ### Operation description * When you call this operation, take note of the following items: * - You must upload the image file to Object Storage Service (OSS) in advance. For more information, see [Upload files](https://help.aliyun.com/document_detail/31886.html). * - To prevent ECS instances created from the imported custom image from failing to start due to operating system issues on some servers, virtual machines, or cloud hosts, check whether you need to install the virtio driver on the source server before importing the image. For more information, see [Install the virtio driver](https://help.aliyun.com/document_detail/62423.html). * - When you import an image for the first time, you must authorize ECS to access your OSS bucket by using Resource Access Management (RAM). Otherwise, the `NoSetRoletoECSServiceAccount` or `InvalidOperation.CloudBoxImageImportRoleRequired` error is returned. The following two scenarios apply: * - **Import an image file without using CloudBox**: You can complete RAM authorization in the RAM console with a single click. For more information, see [Cloud resource access authorization](https://ram.console.aliyun.com/?spm=5176.2020520101image.0.0.2ffa4df57kSoHX#/role/authorize?request=%7B%22Requests%22%3A%20%7B%22request1%22%3A%20%7B%22RoleName%22%3A%20%22AliyunECSImageImportDefaultRole%22%2C%20%22TemplateId%22%3A%20%22ECSImportRole%22%7D%2C%20%22request2%22%3A%20%7B%22RoleName%22%3A%20%22AliyunECSImageExportDefaultRole%22%2C%20%22TemplateId%22%3A%20%22ECSExportRole%22%7D%7D%2C%20%22ReturnUrl%22%3A%20%22https%3A//ecs.console.aliyun.com/%22%2C%20%22Service%22%3A%20%22ECS%22%7D). You can also manually complete RAM authorization. The following policies and permissions are required for some operations. For more information, see [Account access control](https://help.aliyun.com/document_detail/25481.html). * 1. Create a role named `AliyunECSImageImportDefaultRole`. You must use this exact name. Otherwise, the image import fails. Use the following policy for the role: * ``` * { * "Statement": [ * { * "Action": "sts:AssumeRole", * "Effect": "Allow", * "Principal": { * "Service": [ * "ecs.aliyuncs.com" * ] * } * } * ], * "Version": "1" * } * ``` * 2. Attach the system policy `AliyunECSImageImportRolePolicy` to the role. You can also create a custom policy that includes the following permissions: * ``` * { * "Version": "1", * "Statement": [ * { * "Action": [ * "oss:GetObject", * "oss:GetBucketLocation", * "oss:GetBucketInfo" * ], * "Resource": "*", * "Effect": "Allow" * } * ] * } * * ``` * - **Import an image file by using CloudBox**: You can complete RAM authorization in the RAM console with a single click. For more information, see [Cloud resource access authorization](https://ram.console.aliyun.com/role/authorize?request=%7B%22ReturnUrl%22%3A%22https%3A%2F%2Fecs.console.aliyun.com%2F%22%2C%22Services%22%3A%5B%7B%22Roles%22%3A%5B%7B%22RoleName%22%3A%22AliyunECSCloudBoxImageImportDefaultRole%22%2C%22TemplateId%22%3A%22AliyunECSCloudBoxImageImportDefaultRole%22%7D%5D%2C%22Service%22%3A%22ECS%22%7D%5D%7D). You can also manually complete RAM authorization. The following policies and permissions are required for some operations. For more information, see [Account access control](https://help.aliyun.com/document_detail/25481.html). * 1. Create a role named `AliyunECSCloudBoxImageImportDefaultRole`. You must use this exact name. Otherwise, the image import fails. Use the following policy for the role: * ``` * { * "Statement": [ * { * "Action": "sts:AssumeRole", * "Effect": "Allow", * "Principal": { * "Service": [ * "ecs.aliyuncs.com" * ] * } * } * ], * "Version": "1" * } * ``` * 2. Attach the system policy `AliyunECSCloudBoxImageImportRolePolicy` to the role. You can also create a custom policy that includes the following permissions: * ``` * { * "Version": "1", * "Statement": [ * { * "Action": [ * "oss-cloudbox:GetObject", * "oss-cloudbox:GetBucketLocation", * "oss-cloudbox:GetBucketInfo" * ], * "Resource": "*", * "Effect": "Allow" * } * ] * } * * ``` * - You cannot delete an image that is being imported. You can only call [CancelTask](https://help.aliyun.com/document_detail/25624.html) to cancel the image import task. * - The region into which you import the image must be the same as the region of the OSS bucket to which the image file is uploaded. * - Valid values of N in the `DiskDeviceMapping.N` parameter: 1 to 17. When N is 1, the disk is a system disk. When N is 2 to 17, the disk is a data disk. When N is greater than 17, the system automatically ignores the value. * - When the `Architecture` parameter is set to `arm64`, or the `Platform` parameter is set to `CentOS Stream`, `Anolis`, `AlmaLinux`, `UOS`, `Kylin`, or `Rocky Linux`, take note of the following items: * - To ensure that the imported image supports password configuration or key pair modification, the image must meet the following requirements: * - The operating system kernel must support the `CONFIG_FW_CFG_SYSFS` feature. Linux community kernels later than version 4.6 support this feature by default. CentOS kernels later than version 3.10.0-826.el7 support this feature by default. You can run the `grep -nr CONFIG_FW_CFG_SYSFS /boot/config-$(uname -r)` command on the server that corresponds to the image. If the output contains `CONFIG_FW_CFG_SYSFS=y`, the kernel in the image supports the `CONFIG_FW_CFG_SYSFS` feature. * - The latest version of Alibaba Cloud cloud-init is installed on the operating system. Cloud-init 19.1 must Milvus version 19.1.3 or later. Cloud-init 0.7.6a on some earlier operating systems must Milvus version 0.7.6a15 or later. For more information, see [Install cloud-init](https://help.aliyun.com/document_detail/57803.html). * - The operating system must support the SHA-512 encryption algorithm. * - To ensure that the imported image supports disk resizing and file system resizing, the image must meet the following requirements: * - The operating system kernel version must be later than 3.6. * - The growpart command is supported. To support this command, install the `cloud-utils-growpart` package. The installation method varies by operating system. For more information, see [Resize partitions and file systems (Linux)](~~2949817#bb3b1f02e51pj~~). * - The resize2fs command is supported. To support this command, install the `e2fsprogs` package. This package is installed by default on the operating system. If it is not installed, install it manually. * - The latest version of Alibaba Cloud cloud-init is installed on the operating system. Cloud-init 19.1 must Milvus version 19.1.3 or later. Cloud-init 0.7.6a on some earlier operating systems must Milvus version 0.7.6a15 or later. For more information, see [Install cloud-init](https://help.aliyun.com/document_detail/57803.html). * - If the system architecture of the custom image that you want to import is arm64, set the RTC clock to use the UTC time standard. For more information, see [Linux time and time zone description](https://help.aliyun.com/document_detail/405080.html). * - Configure the image detection parameters when you import an image. This helps the system optimize your image. For more information, see [Image detection overview](https://help.aliyun.com/document_detail/439819.html). * * @param request - ImportImageRequest * @returns ImportImageResponse */ async importImage(request: $_model.ImportImageRequest): Promise<$_model.ImportImageResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.importImageWithOptions(request, runtime); } /** * Imports the public key part of an RSA key pair generated by other tools. After the key pair is imported, Alibaba Cloud stores the public key for you. You must securely store the private key of the key pair. * * @remarks * ## Description * When you call this operation, take note of the following items: * - You can have a maximum of 500 key pairs in each region. * - The imported key pair must support one of the following encryption methods: * - rsa * - dsa * - ssh-rsa * - ssh-dss * - ecdsa * * @param request - ImportKeyPairRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ImportKeyPairResponse */ async importKeyPairWithOptions(request: $_model.ImportKeyPairRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ImportKeyPairResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.keyPairName)) { query["KeyPairName"] = request.keyPairName; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.publicKeyBody)) { query["PublicKeyBody"] = request.publicKeyBody; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ImportKeyPair", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ImportKeyPairResponse>(await this.callApi(params, req, runtime), new $_model.ImportKeyPairResponse({})); } /** * Imports the public key part of an RSA key pair generated by other tools. After the key pair is imported, Alibaba Cloud stores the public key for you. You must securely store the private key of the key pair. * * @remarks * ## Description * When you call this operation, take note of the following items: * - You can have a maximum of 500 key pairs in each region. * - The imported key pair must support one of the following encryption methods: * - rsa * - dsa * - ssh-rsa * - ssh-dss * - ecdsa * * @param request - ImportKeyPairRequest * @returns ImportKeyPairResponse */ async importKeyPair(request: $_model.ImportKeyPairRequest): Promise<$_model.ImportKeyPairResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.importKeyPairWithOptions(request, runtime); } /** * Installs Cloud Assistant Agent on Elastic Compute Service (ECS) instances. After you install Cloud Assistant Agent on ECS instances, restart the instances for the installation to take effect. * * @remarks * ## [](#)Usage notes * After you call the InstallCloudAssistant operation to install Cloud Assistant Agent on an ECS instance, call the [RebootInstance](https://help.aliyun.com/document_detail/25502.html) operation to restart the instance to make the installation take effect. * * @param request - InstallCloudAssistantRequest * @param runtime - runtime options for this request RuntimeOptions * @returns InstallCloudAssistantResponse */ async installCloudAssistantWithOptions(request: $_model.InstallCloudAssistantRequest, runtime: $dara.RuntimeOptions): Promise<$_model.InstallCloudAssistantResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "InstallCloudAssistant", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.InstallCloudAssistantResponse>(await this.callApi(params, req, runtime), new $_model.InstallCloudAssistantResponse({})); } /** * Installs Cloud Assistant Agent on Elastic Compute Service (ECS) instances. After you install Cloud Assistant Agent on ECS instances, restart the instances for the installation to take effect. * * @remarks * ## [](#)Usage notes * After you call the InstallCloudAssistant operation to install Cloud Assistant Agent on an ECS instance, call the [RebootInstance](https://help.aliyun.com/document_detail/25502.html) operation to restart the instance to make the installation take effect. * * @param request - InstallCloudAssistantRequest * @returns InstallCloudAssistantResponse */ async installCloudAssistant(request: $_model.InstallCloudAssistantRequest): Promise<$_model.InstallCloudAssistantResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.installCloudAssistantWithOptions(request, runtime); } /** * Specify parameters such as CommandId, InstanceId, and ResourceGroupId to trigger a Cloud Assistant command on one or more ECS instances. * * @remarks * ## API Guide * * - The following restrictions apply to the target ECS instances. If you select multiple ECS instances and any of them does not meet the execution conditions, you must invoke the API again. * - The instance status must be running (`Running`). You can call [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) to query the instance status. * - The [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html) must already be installed. * - When executing a PowerShell-type command, the instance must have the PowerShell module configured. * - One-time execution: The command runs only once. * - Scheduled execution: * - The command is executed periodically based on the time frequency specified by the `Frequency` parameter. The result of the previous execution does not affect the next execution. * - When you execute a scheduled task based on a cron expression and specify a time zone, the scheduled execution time is based on the specified time zone. If you do not specify a time zone, the scheduled execution time is based on the system time zone of the ECS instance, and the execution time follows the instance\\"s system time. Ensure that the time or time zone of the ECS instance matches your expected time. For more information about time zones, see [Manage Time Synchronization Service](https://help.aliyun.com/document_detail/92704.html). * To support new features of scheduled tasks (execution at fixed intervals, execution only once at a specified time, or specifying a year or time zone when executing based on a cron expression), the Cloud Assistant Agent version must be at least the following: * - Linux: 2.2.3.282 * - Windows: 2.1.3.282 * If the response returns the `ClientNeedUpgrade` error code, see [Upgrade or Disable Upgrade of Cloud Assistant Agent](https://help.aliyun.com/document_detail/134383.html) to update the client to the latest version. * - A command may fail to execute due to an abnormal instance status, network issues, or an abnormal Cloud Assistant Agent. In such cases, no execution information is generated. For more information, see [Common Execution Failures and Troubleshooting Suggestions](https://help.aliyun.com/document_detail/87029.html). * - If you enable the Custom Parameter feature when creating a command, you must pass the custom parameters (`Parameters`) when executing the command. * - We recommend that you first call [DescribeCloudAssistantStatus](https://help.aliyun.com/document_detail/87346.html) to check the Cloud Assistant status of the instance and execute the command only when `CloudAssistantStatus` is true, especially for newly purchased instances. * * - The following restrictions apply to the target ECS instances. If you select multiple ECS instances and any of them does not meet the execution conditions, you must invoke the API again. * - The instance status must be running (`Running`). You can call [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) to query the instance status. * - The [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html) must already be installed. * - When executing a PowerShell-type command, the instance must have the PowerShell module configured. * - One-time execution: The command runs only once. * - Scheduled execution: * - The command is executed periodically based on the time frequency specified by the `Frequency` parameter. The result of the previous execution does not affect the next execution. * - When you execute a scheduled task based on a cron expression and specify a time zone, the scheduled execution time is based on the specified time zone. If you do not specify a time zone, the scheduled execution time is based on the system time zone of the ECS instance, and the execution time follows the instance\\"s system time. Ensure that the time or time zone of the ECS instance matches your expected time. For more information about time zones, see [Manage Time Synchronization Service](https://help.aliyun.com/document_detail/92704.html). * To support new features of scheduled tasks (execution at fixed intervals, execution only once at a specified time, or specifying a year or time zone when executing based on a cron expression), the Cloud Assistant Agent version must be at least the following: * - Linux: 2.2.3.282 * - Windows: 2.1.3.282 * If the response returns the `ClientNeedUpgrade` error code, see [Upgrade or Disable Upgrade of Cloud Assistant Agent](https://help.aliyun.com/document_detail/134383.html) to update the client to the latest version. * - A command may fail to execute due to an abnormal instance status, network issues, or an abnormal Cloud Assistant Agent. In such cases, no execution information is generated. For more information, see [Common Execution Failures and Troubleshooting Suggestions](https://help.aliyun.com/document_detail/87029.html). * - If you enable the Custom Parameter feature when creating a command, you must pass the custom parameters (`Parameters`) when executing the command. * - We recommend that you first call [DescribeCloudAssistantStatus](https://help.aliyun.com/document_detail/87346.html) to check the Cloud Assistant status of the instance and execute the command only when `CloudAssistantStatus` is true, especially for newly purchased instances. * * @param tmpReq - InvokeCommandRequest * @param runtime - runtime options for this request RuntimeOptions * @returns InvokeCommandResponse */ async invokeCommandWithOptions(tmpReq: $_model.InvokeCommandRequest, runtime: $dara.RuntimeOptions): Promise<$_model.InvokeCommandResponse> { tmpReq.validate(); let request = new $_model.InvokeCommandShrinkRequest({ }); OpenApiUtil.convert(tmpReq, request); if (!$dara.isNull(tmpReq.parameters)) { request.parametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.parameters, "Parameters", "json"); } let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.commandId)) { query["CommandId"] = request.commandId; } if (!$dara.isNull(request.containerId)) { query["ContainerId"] = request.containerId; } if (!$dara.isNull(request.containerName)) { query["ContainerName"] = request.containerName; } if (!$dara.isNull(request.frequency)) { query["Frequency"] = request.frequency; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.launcher)) { query["Launcher"] = request.launcher; } if (!$dara.isNull(request.ossOutputDelivery)) { query["OssOutputDelivery"] = request.ossOutputDelivery; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.parametersShrink)) { query["Parameters"] = request.parametersShrink; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.repeatMode)) { query["RepeatMode"] = request.repeatMode; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourceTag)) { query["ResourceTag"] = request.resourceTag; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.terminationMode)) { query["TerminationMode"] = request.terminationMode; } if (!$dara.isNull(request.timed)) { query["Timed"] = request.timed; } if (!$dara.isNull(request.timeout)) { query["Timeout"] = request.timeout; } if (!$dara.isNull(request.username)) { query["Username"] = request.username; } if (!$dara.isNull(request.windowsPasswordName)) { query["WindowsPasswordName"] = request.windowsPasswordName; } if (!$dara.isNull(request.workingDir)) { query["WorkingDir"] = request.workingDir; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "InvokeCommand", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.InvokeCommandResponse>(await this.callApi(params, req, runtime), new $_model.InvokeCommandResponse({})); } /** * Specify parameters such as CommandId, InstanceId, and ResourceGroupId to trigger a Cloud Assistant command on one or more ECS instances. * * @remarks * ## API Guide * * - The following restrictions apply to the target ECS instances. If you select multiple ECS instances and any of them does not meet the execution conditions, you must invoke the API again. * - The instance status must be running (`Running`). You can call [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) to query the instance status. * - The [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html) must already be installed. * - When executing a PowerShell-type command, the instance must have the PowerShell module configured. * - One-time execution: The command runs only once. * - Scheduled execution: * - The command is executed periodically based on the time frequency specified by the `Frequency` parameter. The result of the previous execution does not affect the next execution. * - When you execute a scheduled task based on a cron expression and specify a time zone, the scheduled execution time is based on the specified time zone. If you do not specify a time zone, the scheduled execution time is based on the system time zone of the ECS instance, and the execution time follows the instance\\"s system time. Ensure that the time or time zone of the ECS instance matches your expected time. For more information about time zones, see [Manage Time Synchronization Service](https://help.aliyun.com/document_detail/92704.html). * To support new features of scheduled tasks (execution at fixed intervals, execution only once at a specified time, or specifying a year or time zone when executing based on a cron expression), the Cloud Assistant Agent version must be at least the following: * - Linux: 2.2.3.282 * - Windows: 2.1.3.282 * If the response returns the `ClientNeedUpgrade` error code, see [Upgrade or Disable Upgrade of Cloud Assistant Agent](https://help.aliyun.com/document_detail/134383.html) to update the client to the latest version. * - A command may fail to execute due to an abnormal instance status, network issues, or an abnormal Cloud Assistant Agent. In such cases, no execution information is generated. For more information, see [Common Execution Failures and Troubleshooting Suggestions](https://help.aliyun.com/document_detail/87029.html). * - If you enable the Custom Parameter feature when creating a command, you must pass the custom parameters (`Parameters`) when executing the command. * - We recommend that you first call [DescribeCloudAssistantStatus](https://help.aliyun.com/document_detail/87346.html) to check the Cloud Assistant status of the instance and execute the command only when `CloudAssistantStatus` is true, especially for newly purchased instances. * * - The following restrictions apply to the target ECS instances. If you select multiple ECS instances and any of them does not meet the execution conditions, you must invoke the API again. * - The instance status must be running (`Running`). You can call [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) to query the instance status. * - The [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html) must already be installed. * - When executing a PowerShell-type command, the instance must have the PowerShell module configured. * - One-time execution: The command runs only once. * - Scheduled execution: * - The command is executed periodically based on the time frequency specified by the `Frequency` parameter. The result of the previous execution does not affect the next execution. * - When you execute a scheduled task based on a cron expression and specify a time zone, the scheduled execution time is based on the specified time zone. If you do not specify a time zone, the scheduled execution time is based on the system time zone of the ECS instance, and the execution time follows the instance\\"s system time. Ensure that the time or time zone of the ECS instance matches your expected time. For more information about time zones, see [Manage Time Synchronization Service](https://help.aliyun.com/document_detail/92704.html). * To support new features of scheduled tasks (execution at fixed intervals, execution only once at a specified time, or specifying a year or time zone when executing based on a cron expression), the Cloud Assistant Agent version must be at least the following: * - Linux: 2.2.3.282 * - Windows: 2.1.3.282 * If the response returns the `ClientNeedUpgrade` error code, see [Upgrade or Disable Upgrade of Cloud Assistant Agent](https://help.aliyun.com/document_detail/134383.html) to update the client to the latest version. * - A command may fail to execute due to an abnormal instance status, network issues, or an abnormal Cloud Assistant Agent. In such cases, no execution information is generated. For more information, see [Common Execution Failures and Troubleshooting Suggestions](https://help.aliyun.com/document_detail/87029.html). * - If you enable the Custom Parameter feature when creating a command, you must pass the custom parameters (`Parameters`) when executing the command. * - We recommend that you first call [DescribeCloudAssistantStatus](https://help.aliyun.com/document_detail/87346.html) to check the Cloud Assistant status of the instance and execute the command only when `CloudAssistantStatus` is true, especially for newly purchased instances. * * @param request - InvokeCommandRequest * @returns InvokeCommandResponse */ async invokeCommand(request: $_model.InvokeCommandRequest): Promise<$_model.InvokeCommandResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.invokeCommandWithOptions(request, runtime); } /** * Calls JoinResourceGroup to add an ECS resource or service to a resource group. * * @remarks * ## Description * A resource is a cloud service entity that you create on Alibaba Cloud. For example, an ECS instance, an ECS elastic network interface, or an ECS image can be a resource. A resource group is a collection of infrastructure for projects, environments, or stacks. Managing resources in a resource group allows you to monitor and run tasks in a centralized manner, saving you from the hassle of switching between multiple Alibaba Cloud services. * * @param request - JoinResourceGroupRequest * @param runtime - runtime options for this request RuntimeOptions * @returns JoinResourceGroupResponse */ async joinResourceGroupWithOptions(request: $_model.JoinResourceGroupRequest, runtime: $dara.RuntimeOptions): Promise<$_model.JoinResourceGroupResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceId)) { query["ResourceId"] = request.resourceId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "JoinResourceGroup", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.JoinResourceGroupResponse>(await this.callApi(params, req, runtime), new $_model.JoinResourceGroupResponse({})); } /** * Calls JoinResourceGroup to add an ECS resource or service to a resource group. * * @remarks * ## Description * A resource is a cloud service entity that you create on Alibaba Cloud. For example, an ECS instance, an ECS elastic network interface, or an ECS image can be a resource. A resource group is a collection of infrastructure for projects, environments, or stacks. Managing resources in a resource group allows you to monitor and run tasks in a centralized manner, saving you from the hassle of switching between multiple Alibaba Cloud services. * * @param request - JoinResourceGroupRequest * @returns JoinResourceGroupResponse */ async joinResourceGroup(request: $_model.JoinResourceGroupRequest): Promise<$_model.JoinResourceGroupResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.joinResourceGroupWithOptions(request, runtime); } /** * Adds an ECS instance or an elastic network interface to a security group. * * @remarks * > This API is deprecated. We recommend calling the [ModifyInstanceAttribute](https://help.aliyun.com/document_detail/25503.html) operation to add or remove an ECS instance from a security group, or calling the [ModifyNetworkInterfaceAttribute](https://help.aliyun.com/document_detail/58513.html) operation to add or remove an elastic network interface (ENI) from a security group. * - You cannot add an instance and an elastic network interface to a security group in the same call. The `InstanceId` and `NetworkInterfaceId` parameters are mutually exclusive. * - The security group and the instance must be in the same Alibaba Cloud region. * - The security group and the instance must have the same network type. If the network type is VPC, they must also belong to the same VPC. * - You can add an instance to a security group only if the instance is in the **Stopped** or **Running** state. * - An instance or an elastic network interface can belong to a maximum of five security groups. For more information, see [Security group limitations](~~25412#SecurityGroupQuota1~~). * * @param request - JoinSecurityGroupRequest * @param runtime - runtime options for this request RuntimeOptions * @returns JoinSecurityGroupResponse */ async joinSecurityGroupWithOptions(request: $_model.JoinSecurityGroupRequest, runtime: $dara.RuntimeOptions): Promise<$_model.JoinSecurityGroupResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "JoinSecurityGroup", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.JoinSecurityGroupResponse>(await this.callApi(params, req, runtime), new $_model.JoinSecurityGroupResponse({})); } /** * Adds an ECS instance or an elastic network interface to a security group. * * @remarks * > This API is deprecated. We recommend calling the [ModifyInstanceAttribute](https://help.aliyun.com/document_detail/25503.html) operation to add or remove an ECS instance from a security group, or calling the [ModifyNetworkInterfaceAttribute](https://help.aliyun.com/document_detail/58513.html) operation to add or remove an elastic network interface (ENI) from a security group. * - You cannot add an instance and an elastic network interface to a security group in the same call. The `InstanceId` and `NetworkInterfaceId` parameters are mutually exclusive. * - The security group and the instance must be in the same Alibaba Cloud region. * - The security group and the instance must have the same network type. If the network type is VPC, they must also belong to the same VPC. * - You can add an instance to a security group only if the instance is in the **Stopped** or **Running** state. * - An instance or an elastic network interface can belong to a maximum of five security groups. For more information, see [Security group limitations](~~25412#SecurityGroupQuota1~~). * * @param request - JoinSecurityGroupRequest * @returns JoinSecurityGroupResponse */ async joinSecurityGroup(request: $_model.JoinSecurityGroupRequest): Promise<$_model.JoinSecurityGroupResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.joinSecurityGroupWithOptions(request, runtime); } /** * Removes an Elastic Compute Service (ECS) instance or an elastic network interface (ENI) from a security group. * * @remarks * > This operation is not recommended. We recommend that you call the [ModifyInstanceAttribute](https://help.aliyun.com/document_detail/25503.html) operation to add an instance to or remove an instance from a security group, and call the [ModifyNetworkInterfaceAttribute](https://help.aliyun.com/document_detail/58513.html) operation to add an ENI to or remove an ENI from a security group. * > Alibaba Cloud modified verification rules for the LeaveSecurityGroup operation on July 8, 2024. When you remove an ECS instance or ENI that does not belong to a security group from the security group, the "InvalidSecurityGroupAssociation.NotFound" error code is returned instead of a success response. Update the LeaveSecurityGroup operation to use the new verification rules with the new error code based on your business requirements. * - You cannot remove an instance and an ENI from a security group at the same time. This indicates that you cannot specify `InstanceId` and `NetworkInterfaceId` in one request. * - Before you remove an instance from a security group, the instance must be in the **Stopped** (Stopped) or **Running** (Running) state. * - An instance or ENI must be added to at least one security group. If you remove an instance or ENI from the only security group, the removal request fails and an error is returned. * - When you remove an instance or ENI that is not in a security group from the security group, the removal request fails and an error is returned. * * @param request - LeaveSecurityGroupRequest * @param runtime - runtime options for this request RuntimeOptions * @returns LeaveSecurityGroupResponse */ async leaveSecurityGroupWithOptions(request: $_model.LeaveSecurityGroupRequest, runtime: $dara.RuntimeOptions): Promise<$_model.LeaveSecurityGroupResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "LeaveSecurityGroup", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.LeaveSecurityGroupResponse>(await this.callApi(params, req, runtime), new $_model.LeaveSecurityGroupResponse({})); } /** * Removes an Elastic Compute Service (ECS) instance or an elastic network interface (ENI) from a security group. * * @remarks * > This operation is not recommended. We recommend that you call the [ModifyInstanceAttribute](https://help.aliyun.com/document_detail/25503.html) operation to add an instance to or remove an instance from a security group, and call the [ModifyNetworkInterfaceAttribute](https://help.aliyun.com/document_detail/58513.html) operation to add an ENI to or remove an ENI from a security group. * > Alibaba Cloud modified verification rules for the LeaveSecurityGroup operation on July 8, 2024. When you remove an ECS instance or ENI that does not belong to a security group from the security group, the "InvalidSecurityGroupAssociation.NotFound" error code is returned instead of a success response. Update the LeaveSecurityGroup operation to use the new verification rules with the new error code based on your business requirements. * - You cannot remove an instance and an ENI from a security group at the same time. This indicates that you cannot specify `InstanceId` and `NetworkInterfaceId` in one request. * - Before you remove an instance from a security group, the instance must be in the **Stopped** (Stopped) or **Running** (Running) state. * - An instance or ENI must be added to at least one security group. If you remove an instance or ENI from the only security group, the removal request fails and an error is returned. * - When you remove an instance or ENI that is not in a security group from the security group, the removal request fails and an error is returned. * * @param request - LeaveSecurityGroupRequest * @returns LeaveSecurityGroupResponse */ async leaveSecurityGroup(request: $_model.LeaveSecurityGroupRequest): Promise<$_model.LeaveSecurityGroupResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.leaveSecurityGroupWithOptions(request, runtime); } /** * Queries the states of Cloud Assistant plug-ins on Elastic Compute Service (ECS) instances. * * @remarks * - Before you call this operation to query the status of Cloud Assistant plug-ins on ECS instances, make sure that the versions of Cloud Assistant Agent on the instances are not earlier than the following ones: * - 2.2.3.344 for Linux instances * - 2.1.3.344 for Windows instances * - During a paged query, when you call the ListPluginStatus operation to retrieve the first page of results, set `MaxResults` to specify the maximum number of entries to return in the call. The return value of `NextToken` is a pagination token that can be used in the next call to retrieve a new page of results. When you call the ListPluginStatus operation to retrieve a new page of results, set `NextToken` to the `NextToken` value returned in the previous call and set `MaxResults` to specify the maximum number of entries to return in this call. * * @param request - ListPluginStatusRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ListPluginStatusResponse */ async listPluginStatusWithOptions(request: $_model.ListPluginStatusRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ListPluginStatusResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.maxResults)) { query["MaxResults"] = request.maxResults; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.pageNumber)) { query["PageNumber"] = request.pageNumber; } if (!$dara.isNull(request.pageSize)) { query["PageSize"] = request.pageSize; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ListPluginStatus", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ListPluginStatusResponse>(await this.callApi(params, req, runtime), new $_model.ListPluginStatusResponse({})); } /** * Queries the states of Cloud Assistant plug-ins on Elastic Compute Service (ECS) instances. * * @remarks * - Before you call this operation to query the status of Cloud Assistant plug-ins on ECS instances, make sure that the versions of Cloud Assistant Agent on the instances are not earlier than the following ones: * - 2.2.3.344 for Linux instances * - 2.1.3.344 for Windows instances * - During a paged query, when you call the ListPluginStatus operation to retrieve the first page of results, set `MaxResults` to specify the maximum number of entries to return in the call. The return value of `NextToken` is a pagination token that can be used in the next call to retrieve a new page of results. When you call the ListPluginStatus operation to retrieve a new page of results, set `NextToken` to the `NextToken` value returned in the previous call and set `MaxResults` to specify the maximum number of entries to return in this call. * * @param request - ListPluginStatusRequest * @returns ListPluginStatusResponse */ async listPluginStatus(request: $_model.ListPluginStatusRequest): Promise<$_model.ListPluginStatusResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.listPluginStatusWithOptions(request, runtime); } /** * Lists the tags on one or more ECS resources. * * @remarks * ## API * To find specific resources, include at least one of the following parameters in your request. * - `ResourceId.N` * - `Tag.N` (`Tag.N.Key` and `Tag.N.Value`) * - `TagFilter.N` * If you specify the following parameter combinations, the API returns only the ECS resources that match all conditions. * - `Tag.N` and `ResourceId.N` * - `TagFilter.N` and `ResourceId.N` * * @param request - ListTagResourcesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ListTagResourcesResponse */ async listTagResourcesWithOptions(request: $_model.ListTagResourcesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ListTagResourcesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.nextToken)) { query["NextToken"] = request.nextToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceId)) { query["ResourceId"] = request.resourceId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.tagFilter)) { query["TagFilter"] = request.tagFilter; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ListTagResources", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ListTagResourcesResponse>(await this.callApi(params, req, runtime), new $_model.ListTagResourcesResponse({})); } /** * Lists the tags on one or more ECS resources. * * @remarks * ## API * To find specific resources, include at least one of the following parameters in your request. * - `ResourceId.N` * - `Tag.N` (`Tag.N.Key` and `Tag.N.Value`) * - `TagFilter.N` * If you specify the following parameter combinations, the API returns only the ECS resources that match all conditions. * - `Tag.N` and `ResourceId.N` * - `TagFilter.N` and `ResourceId.N` * * @param request - ListTagResourcesRequest * @returns ListTagResourcesResponse */ async listTagResources(request: $_model.ListTagResourcesRequest): Promise<$_model.ListTagResourcesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.listTagResourcesWithOptions(request, runtime); } /** * Lock a snapshot in compliance mode to protect it from accidental or malicious deletion. While a snapshot is locked, it cannot be deleted. * * @remarks * This operation also lets you reconfigure a locked snapshot. The available settings depend on the lock mode and lock state: * - If a snapshot is locked in compliance mode and is in its cooldown period, you can extend or shorten the cooldown period and the lock duration. * - If a snapshot is locked in compliance mode and its cooldown period has passed, you can only extend the lock duration. * > Reconfiguring a locked snapshot during its cooldown period constitutes a new relock operation, which resets all lock parameters instead of adjusting them individually. * * @param request - LockSnapshotRequest * @param runtime - runtime options for this request RuntimeOptions * @returns LockSnapshotResponse */ async lockSnapshotWithOptions(request: $_model.LockSnapshotRequest, runtime: $dara.RuntimeOptions): Promise<$_model.LockSnapshotResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.coolOffPeriod)) { query["CoolOffPeriod"] = request.coolOffPeriod; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.lockDuration)) { query["LockDuration"] = request.lockDuration; } if (!$dara.isNull(request.lockMode)) { query["LockMode"] = request.lockMode; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.snapshotId)) { query["SnapshotId"] = request.snapshotId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "LockSnapshot", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.LockSnapshotResponse>(await this.callApi(params, req, runtime), new $_model.LockSnapshotResponse({})); } /** * Lock a snapshot in compliance mode to protect it from accidental or malicious deletion. While a snapshot is locked, it cannot be deleted. * * @remarks * This operation also lets you reconfigure a locked snapshot. The available settings depend on the lock mode and lock state: * - If a snapshot is locked in compliance mode and is in its cooldown period, you can extend or shorten the cooldown period and the lock duration. * - If a snapshot is locked in compliance mode and its cooldown period has passed, you can only extend the lock duration. * > Reconfiguring a locked snapshot during its cooldown period constitutes a new relock operation, which resets all lock parameters instead of adjusting them individually. * * @param request - LockSnapshotRequest * @returns LockSnapshotResponse */ async lockSnapshot(request: $_model.LockSnapshotRequest): Promise<$_model.LockSnapshotResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.lockSnapshotWithOptions(request, runtime); } /** * Modifies the configurations of an auto provisioning group. * * @remarks * Before you call this operation, take note of the following items: * - If you modify the capacity or capacity-related settings of an auto-provisioning group, the group executes a scheduling task after the group is modified. * - You cannot modify an auto-provisioning group when the group is being deleted. * * @param request - ModifyAutoProvisioningGroupRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyAutoProvisioningGroupResponse */ async modifyAutoProvisioningGroupWithOptions(request: $_model.ModifyAutoProvisioningGroupRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyAutoProvisioningGroupResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoProvisioningGroupId)) { query["AutoProvisioningGroupId"] = request.autoProvisioningGroupId; } if (!$dara.isNull(request.autoProvisioningGroupName)) { query["AutoProvisioningGroupName"] = request.autoProvisioningGroupName; } if (!$dara.isNull(request.defaultTargetCapacityType)) { query["DefaultTargetCapacityType"] = request.defaultTargetCapacityType; } if (!$dara.isNull(request.excessCapacityTerminationPolicy)) { query["ExcessCapacityTerminationPolicy"] = request.excessCapacityTerminationPolicy; } if (!$dara.isNull(request.launchTemplateConfig)) { query["LaunchTemplateConfig"] = request.launchTemplateConfig; } if (!$dara.isNull(request.maxSpotPrice)) { query["MaxSpotPrice"] = request.maxSpotPrice; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.payAsYouGoTargetCapacity)) { query["PayAsYouGoTargetCapacity"] = request.payAsYouGoTargetCapacity; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.spotTargetCapacity)) { query["SpotTargetCapacity"] = request.spotTargetCapacity; } if (!$dara.isNull(request.terminateInstancesWithExpiration)) { query["TerminateInstancesWithExpiration"] = request.terminateInstancesWithExpiration; } if (!$dara.isNull(request.totalTargetCapacity)) { query["TotalTargetCapacity"] = request.totalTargetCapacity; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyAutoProvisioningGroup", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyAutoProvisioningGroupResponse>(await this.callApi(params, req, runtime), new $_model.ModifyAutoProvisioningGroupResponse({})); } /** * Modifies the configurations of an auto provisioning group. * * @remarks * Before you call this operation, take note of the following items: * - If you modify the capacity or capacity-related settings of an auto-provisioning group, the group executes a scheduling task after the group is modified. * - You cannot modify an auto-provisioning group when the group is being deleted. * * @param request - ModifyAutoProvisioningGroupRequest * @returns ModifyAutoProvisioningGroupResponse */ async modifyAutoProvisioningGroup(request: $_model.ModifyAutoProvisioningGroupRequest): Promise<$_model.ModifyAutoProvisioningGroupResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyAutoProvisioningGroupWithOptions(request, runtime); } /** * Modifies an automatic snapshot policy, such as the snapshot creation time, repeat date, and retention period. * * @remarks * When you call this operation, take note of the following items: * - System policies cannot be modified. * - After you modify an automatic snapshot policy, the disks to which the policy has been applied immediately execute the modified policy. * - If cross-region snapshot replication is enabled and no encryption parameters are configured, encrypted snapshots are encrypted by using the service key of the destination region by default. * * @param request - ModifyAutoSnapshotPolicyExRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyAutoSnapshotPolicyExResponse */ async modifyAutoSnapshotPolicyExWithOptions(request: $_model.ModifyAutoSnapshotPolicyExRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyAutoSnapshotPolicyExResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.copiedSnapshotsRetentionDays)) { query["CopiedSnapshotsRetentionDays"] = request.copiedSnapshotsRetentionDays; } if (!$dara.isNull(request.copyEncryptionConfiguration)) { query["CopyEncryptionConfiguration"] = request.copyEncryptionConfiguration; } if (!$dara.isNull(request.enableCrossRegionCopy)) { query["EnableCrossRegionCopy"] = request.enableCrossRegionCopy; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.targetCopyRegions)) { query["TargetCopyRegions"] = request.targetCopyRegions; } if (!$dara.isNull(request.autoSnapshotPolicyId)) { query["autoSnapshotPolicyId"] = request.autoSnapshotPolicyId; } if (!$dara.isNull(request.autoSnapshotPolicyName)) { query["autoSnapshotPolicyName"] = request.autoSnapshotPolicyName; } if (!$dara.isNull(request.regionId)) { query["regionId"] = request.regionId; } if (!$dara.isNull(request.repeatWeekdays)) { query["repeatWeekdays"] = request.repeatWeekdays; } if (!$dara.isNull(request.retentionDays)) { query["retentionDays"] = request.retentionDays; } if (!$dara.isNull(request.timePoints)) { query["timePoints"] = request.timePoints; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyAutoSnapshotPolicyEx", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyAutoSnapshotPolicyExResponse>(await this.callApi(params, req, runtime), new $_model.ModifyAutoSnapshotPolicyExResponse({})); } /** * Modifies an automatic snapshot policy, such as the snapshot creation time, repeat date, and retention period. * * @remarks * When you call this operation, take note of the following items: * - System policies cannot be modified. * - After you modify an automatic snapshot policy, the disks to which the policy has been applied immediately execute the modified policy. * - If cross-region snapshot replication is enabled and no encryption parameters are configured, encrypted snapshots are encrypted by using the service key of the destination region by default. * * @param request - ModifyAutoSnapshotPolicyExRequest * @returns ModifyAutoSnapshotPolicyExResponse */ async modifyAutoSnapshotPolicyEx(request: $_model.ModifyAutoSnapshotPolicyExRequest): Promise<$_model.ModifyAutoSnapshotPolicyExResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyAutoSnapshotPolicyExWithOptions(request, runtime); } /** * Modifies the bandwidth of a bandwidth package. * * @deprecated OpenAPI ModifyBandwidthPackageSpec is deprecated * * @param request - ModifyBandwidthPackageSpecRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyBandwidthPackageSpecResponse */ async modifyBandwidthPackageSpecWithOptions(request: $_model.ModifyBandwidthPackageSpecRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyBandwidthPackageSpecResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.bandwidth)) { query["Bandwidth"] = request.bandwidth; } if (!$dara.isNull(request.bandwidthPackageId)) { query["BandwidthPackageId"] = request.bandwidthPackageId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyBandwidthPackageSpec", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyBandwidthPackageSpecResponse>(await this.callApi(params, req, runtime), new $_model.ModifyBandwidthPackageSpecResponse({})); } /** * Modifies the bandwidth of a bandwidth package. * * @deprecated OpenAPI ModifyBandwidthPackageSpec is deprecated * * @param request - ModifyBandwidthPackageSpecRequest * @returns ModifyBandwidthPackageSpecResponse */ // Deprecated async modifyBandwidthPackageSpec(request: $_model.ModifyBandwidthPackageSpecRequest): Promise<$_model.ModifyBandwidthPackageSpecResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyBandwidthPackageSpecWithOptions(request, runtime); } /** * Modifies the information of a capacity reservation, including the name, description, release mode, and the total number of Elastic Compute Service (ECS) instances for which capacity is reserved. * * @param request - ModifyCapacityReservationRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyCapacityReservationResponse */ async modifyCapacityReservationWithOptions(request: $_model.ModifyCapacityReservationRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyCapacityReservationResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.endTimeType)) { query["EndTimeType"] = request.endTimeType; } if (!$dara.isNull(request.instanceAmount)) { query["InstanceAmount"] = request.instanceAmount; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.platform)) { query["Platform"] = request.platform; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyCapacityReservation", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyCapacityReservationResponse>(await this.callApi(params, req, runtime), new $_model.ModifyCapacityReservationResponse({})); } /** * Modifies the information of a capacity reservation, including the name, description, release mode, and the total number of Elastic Compute Service (ECS) instances for which capacity is reserved. * * @param request - ModifyCapacityReservationRequest * @returns ModifyCapacityReservationResponse */ async modifyCapacityReservation(request: $_model.ModifyCapacityReservationRequest): Promise<$_model.ModifyCapacityReservationResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyCapacityReservationWithOptions(request, runtime); } /** * Change the Cloud Assistant settings. * * @param tmpReq - ModifyCloudAssistantSettingsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyCloudAssistantSettingsResponse */ async modifyCloudAssistantSettingsWithOptions(tmpReq: $_model.ModifyCloudAssistantSettingsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyCloudAssistantSettingsResponse> { tmpReq.validate(); let request = new $_model.ModifyCloudAssistantSettingsShrinkRequest({ }); OpenApiUtil.convert(tmpReq, request); if (!$dara.isNull(tmpReq.agentUpgradeConfig)) { request.agentUpgradeConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentUpgradeConfig, "AgentUpgradeConfig", "json"); } if (!$dara.isNull(tmpReq.ossDeliveryConfig)) { request.ossDeliveryConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.ossDeliveryConfig, "OssDeliveryConfig", "json"); } if (!$dara.isNull(tmpReq.resourceUsageConfig)) { request.resourceUsageConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceUsageConfig, "ResourceUsageConfig", "json"); } if (!$dara.isNull(tmpReq.sessionManagerConfig)) { request.sessionManagerConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sessionManagerConfig, "SessionManagerConfig", "json"); } if (!$dara.isNull(tmpReq.slsDeliveryConfig)) { request.slsDeliveryConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.slsDeliveryConfig, "SlsDeliveryConfig", "json"); } let query = { }; if (!$dara.isNull(request.agentUpgradeConfigShrink)) { query["AgentUpgradeConfig"] = request.agentUpgradeConfigShrink; } if (!$dara.isNull(request.ossDeliveryConfigShrink)) { query["OssDeliveryConfig"] = request.ossDeliveryConfigShrink; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourceUsageConfigShrink)) { query["ResourceUsageConfig"] = request.resourceUsageConfigShrink; } if (!$dara.isNull(request.sessionManagerConfigShrink)) { query["SessionManagerConfig"] = request.sessionManagerConfigShrink; } if (!$dara.isNull(request.settingType)) { query["SettingType"] = request.settingType; } if (!$dara.isNull(request.slsDeliveryConfigShrink)) { query["SlsDeliveryConfig"] = request.slsDeliveryConfigShrink; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyCloudAssistantSettings", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyCloudAssistantSettingsResponse>(await this.callApi(params, req, runtime), new $_model.ModifyCloudAssistantSettingsResponse({})); } /** * Change the Cloud Assistant settings. * * @param request - ModifyCloudAssistantSettingsRequest * @returns ModifyCloudAssistantSettingsResponse */ async modifyCloudAssistantSettings(request: $_model.ModifyCloudAssistantSettingsRequest): Promise<$_model.ModifyCloudAssistantSettingsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyCloudAssistantSettingsWithOptions(request, runtime); } /** * Modifies the parameters of a Cloud Assistant command. * * @param request - ModifyCommandRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyCommandResponse */ async modifyCommandWithOptions(request: $_model.ModifyCommandRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyCommandResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.commandContent)) { query["CommandContent"] = request.commandContent; } if (!$dara.isNull(request.commandId)) { query["CommandId"] = request.commandId; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.launcher)) { query["Launcher"] = request.launcher; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.timeout)) { query["Timeout"] = request.timeout; } if (!$dara.isNull(request.workingDir)) { query["WorkingDir"] = request.workingDir; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyCommand", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyCommandResponse>(await this.callApi(params, req, runtime), new $_model.ModifyCommandResponse({})); } /** * Modifies the parameters of a Cloud Assistant command. * * @param request - ModifyCommandRequest * @returns ModifyCommandResponse */ async modifyCommand(request: $_model.ModifyCommandRequest): Promise<$_model.ModifyCommandResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyCommandWithOptions(request, runtime); } /** * Modifies the information about a dedicated host, such as the name, description, and instance migration policy that is applied when the dedicated host fails. * * @remarks * ## [](#)Usage notes * - All Elastic Compute Service (ECS) instances that are hosted on a dedicated host must be in the Stopped (`Stopped`) state before you can modify the CPU overcommit ratio of the dedicated host. * - Changes to the CPU overcommit ratio of a dedicated host do not affect the running status of the dedicated host. After the CPU overcommit ratio is changed, the number of allocated vCPUs on the dedicated host cannot exceed the new total number of vCPUs. Otherwise, ECS instances that use the excess vCPUs cannot start. * * @param request - ModifyDedicatedHostAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyDedicatedHostAttributeResponse */ async modifyDedicatedHostAttributeWithOptions(request: $_model.ModifyDedicatedHostAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyDedicatedHostAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.actionOnMaintenance)) { query["ActionOnMaintenance"] = request.actionOnMaintenance; } if (!$dara.isNull(request.autoPlacement)) { query["AutoPlacement"] = request.autoPlacement; } if (!$dara.isNull(request.cpuOverCommitRatio)) { query["CpuOverCommitRatio"] = request.cpuOverCommitRatio; } if (!$dara.isNull(request.dedicatedHostClusterId)) { query["DedicatedHostClusterId"] = request.dedicatedHostClusterId; } if (!$dara.isNull(request.dedicatedHostId)) { query["DedicatedHostId"] = request.dedicatedHostId; } if (!$dara.isNull(request.dedicatedHostName)) { query["DedicatedHostName"] = request.dedicatedHostName; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.networkAttributes)) { query["NetworkAttributes"] = request.networkAttributes; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyDedicatedHostAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyDedicatedHostAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyDedicatedHostAttributeResponse({})); } /** * Modifies the information about a dedicated host, such as the name, description, and instance migration policy that is applied when the dedicated host fails. * * @remarks * ## [](#)Usage notes * - All Elastic Compute Service (ECS) instances that are hosted on a dedicated host must be in the Stopped (`Stopped`) state before you can modify the CPU overcommit ratio of the dedicated host. * - Changes to the CPU overcommit ratio of a dedicated host do not affect the running status of the dedicated host. After the CPU overcommit ratio is changed, the number of allocated vCPUs on the dedicated host cannot exceed the new total number of vCPUs. Otherwise, ECS instances that use the excess vCPUs cannot start. * * @param request - ModifyDedicatedHostAttributeRequest * @returns ModifyDedicatedHostAttributeResponse */ async modifyDedicatedHostAttribute(request: $_model.ModifyDedicatedHostAttributeRequest): Promise<$_model.ModifyDedicatedHostAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyDedicatedHostAttributeWithOptions(request, runtime); } /** * Sets the automatic release time for a pay-as-you-go dedicated host or cancels its automatic release. * * @remarks * ## Usage notes * A pay-as-you-go dedicated host can be automatically released at the specified time. Before you release a pay-as-you-go dedicated host, make sure that the host is no longer required and all necessary application data is backed up. * * @param request - ModifyDedicatedHostAutoReleaseTimeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyDedicatedHostAutoReleaseTimeResponse */ async modifyDedicatedHostAutoReleaseTimeWithOptions(request: $_model.ModifyDedicatedHostAutoReleaseTimeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyDedicatedHostAutoReleaseTimeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoReleaseTime)) { query["AutoReleaseTime"] = request.autoReleaseTime; } if (!$dara.isNull(request.dedicatedHostId)) { query["DedicatedHostId"] = request.dedicatedHostId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyDedicatedHostAutoReleaseTime", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyDedicatedHostAutoReleaseTimeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyDedicatedHostAutoReleaseTimeResponse({})); } /** * Sets the automatic release time for a pay-as-you-go dedicated host or cancels its automatic release. * * @remarks * ## Usage notes * A pay-as-you-go dedicated host can be automatically released at the specified time. Before you release a pay-as-you-go dedicated host, make sure that the host is no longer required and all necessary application data is backed up. * * @param request - ModifyDedicatedHostAutoReleaseTimeRequest * @returns ModifyDedicatedHostAutoReleaseTimeResponse */ async modifyDedicatedHostAutoReleaseTime(request: $_model.ModifyDedicatedHostAutoReleaseTimeRequest): Promise<$_model.ModifyDedicatedHostAutoReleaseTimeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyDedicatedHostAutoReleaseTimeWithOptions(request, runtime); } /** * Enables or disables auto-renewal for one or more subscription dedicated hosts. * * @remarks * - If you enable auto-renewal for your subscription dedicated host, the system attempts to deduct the renewal payment at 08:00:00 (UTC+8) nine days before the dedicated host expires to renew the dedicated host. If this deduction attempt fails, the system attempt to deduct the payment at the same point in time the next day. The system attempts to deduct the payment once every day until the dedicated host expires or until the payment is deducted. Make sure that your account balance is sufficient. * - Subscription dedicated hosts can be automatically renewed along with the subscription Elastic Compute Service (ECS) instances hosted on the dedicated hosts. For more information, see the description of the AutoRenewWithEcs parameter. * * @param request - ModifyDedicatedHostAutoRenewAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyDedicatedHostAutoRenewAttributeResponse */ async modifyDedicatedHostAutoRenewAttributeWithOptions(request: $_model.ModifyDedicatedHostAutoRenewAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyDedicatedHostAutoRenewAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoRenew)) { query["AutoRenew"] = request.autoRenew; } if (!$dara.isNull(request.autoRenewWithEcs)) { query["AutoRenewWithEcs"] = request.autoRenewWithEcs; } if (!$dara.isNull(request.dedicatedHostIds)) { query["DedicatedHostIds"] = request.dedicatedHostIds; } if (!$dara.isNull(request.duration)) { query["Duration"] = request.duration; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.renewalStatus)) { query["RenewalStatus"] = request.renewalStatus; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyDedicatedHostAutoRenewAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyDedicatedHostAutoRenewAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyDedicatedHostAutoRenewAttributeResponse({})); } /** * Enables or disables auto-renewal for one or more subscription dedicated hosts. * * @remarks * - If you enable auto-renewal for your subscription dedicated host, the system attempts to deduct the renewal payment at 08:00:00 (UTC+8) nine days before the dedicated host expires to renew the dedicated host. If this deduction attempt fails, the system attempt to deduct the payment at the same point in time the next day. The system attempts to deduct the payment once every day until the dedicated host expires or until the payment is deducted. Make sure that your account balance is sufficient. * - Subscription dedicated hosts can be automatically renewed along with the subscription Elastic Compute Service (ECS) instances hosted on the dedicated hosts. For more information, see the description of the AutoRenewWithEcs parameter. * * @param request - ModifyDedicatedHostAutoRenewAttributeRequest * @returns ModifyDedicatedHostAutoRenewAttributeResponse */ async modifyDedicatedHostAutoRenewAttribute(request: $_model.ModifyDedicatedHostAutoRenewAttributeRequest): Promise<$_model.ModifyDedicatedHostAutoRenewAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyDedicatedHostAutoRenewAttributeWithOptions(request, runtime); } /** * Modifies the information of a dedicated host group, including the name, description, and properties. * * @param request - ModifyDedicatedHostClusterAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyDedicatedHostClusterAttributeResponse */ async modifyDedicatedHostClusterAttributeWithOptions(request: $_model.ModifyDedicatedHostClusterAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyDedicatedHostClusterAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dedicatedHostClusterId)) { query["DedicatedHostClusterId"] = request.dedicatedHostClusterId; } if (!$dara.isNull(request.dedicatedHostClusterName)) { query["DedicatedHostClusterName"] = request.dedicatedHostClusterName; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyDedicatedHostClusterAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyDedicatedHostClusterAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyDedicatedHostClusterAttributeResponse({})); } /** * Modifies the information of a dedicated host group, including the name, description, and properties. * * @param request - ModifyDedicatedHostClusterAttributeRequest * @returns ModifyDedicatedHostClusterAttributeResponse */ async modifyDedicatedHostClusterAttribute(request: $_model.ModifyDedicatedHostClusterAttributeRequest): Promise<$_model.ModifyDedicatedHostClusterAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyDedicatedHostClusterAttributeWithOptions(request, runtime); } /** * Changes the billing method of dedicated hosts. * * @param request - ModifyDedicatedHostsChargeTypeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyDedicatedHostsChargeTypeResponse */ async modifyDedicatedHostsChargeTypeWithOptions(request: $_model.ModifyDedicatedHostsChargeTypeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyDedicatedHostsChargeTypeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoPay)) { query["AutoPay"] = request.autoPay; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.dedicatedHostChargeType)) { query["DedicatedHostChargeType"] = request.dedicatedHostChargeType; } if (!$dara.isNull(request.dedicatedHostIds)) { query["DedicatedHostIds"] = request.dedicatedHostIds; } if (!$dara.isNull(request.detailFee)) { query["DetailFee"] = request.detailFee; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyDedicatedHostsChargeType", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyDedicatedHostsChargeTypeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyDedicatedHostsChargeTypeResponse({})); } /** * Changes the billing method of dedicated hosts. * * @param request - ModifyDedicatedHostsChargeTypeRequest * @returns ModifyDedicatedHostsChargeTypeResponse */ async modifyDedicatedHostsChargeType(request: $_model.ModifyDedicatedHostsChargeTypeRequest): Promise<$_model.ModifyDedicatedHostsChargeTypeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyDedicatedHostsChargeTypeWithOptions(request, runtime); } /** * Modifies the name and description of a deployment set. * * @param request - ModifyDeploymentSetAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyDeploymentSetAttributeResponse */ async modifyDeploymentSetAttributeWithOptions(request: $_model.ModifyDeploymentSetAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyDeploymentSetAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.affinity)) { query["Affinity"] = request.affinity; } if (!$dara.isNull(request.deploymentSetId)) { query["DeploymentSetId"] = request.deploymentSetId; } if (!$dara.isNull(request.deploymentSetName)) { query["DeploymentSetName"] = request.deploymentSetName; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyDeploymentSetAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyDeploymentSetAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyDeploymentSetAttributeResponse({})); } /** * Modifies the name and description of a deployment set. * * @param request - ModifyDeploymentSetAttributeRequest * @returns ModifyDeploymentSetAttributeResponse */ async modifyDeploymentSetAttribute(request: $_model.ModifyDeploymentSetAttributeRequest): Promise<$_model.ModifyDeploymentSetAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyDeploymentSetAttributeWithOptions(request, runtime); } /** * Modifies a diagnostic metric set. * * @param request - ModifyDiagnosticMetricSetRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyDiagnosticMetricSetResponse */ async modifyDiagnosticMetricSetWithOptions(request: $_model.ModifyDiagnosticMetricSetRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyDiagnosticMetricSetResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.metricIds)) { query["MetricIds"] = request.metricIds; } if (!$dara.isNull(request.metricSetId)) { query["MetricSetId"] = request.metricSetId; } if (!$dara.isNull(request.metricSetName)) { query["MetricSetName"] = request.metricSetName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyDiagnosticMetricSet", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyDiagnosticMetricSetResponse>(await this.callApi(params, req, runtime), new $_model.ModifyDiagnosticMetricSetResponse({})); } /** * Modifies a diagnostic metric set. * * @param request - ModifyDiagnosticMetricSetRequest * @returns ModifyDiagnosticMetricSetResponse */ async modifyDiagnosticMetricSet(request: $_model.ModifyDiagnosticMetricSetRequest): Promise<$_model.ModifyDiagnosticMetricSetResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyDiagnosticMetricSetWithOptions(request, runtime); } /** * Modifies the name, description, release behavior, automatic snapshot deletion policy, automatic snapshot policy, performance burst settings, and other attributes of one or more block storage devices. * * @remarks * You can call the DiskId parameter to modify the name, description, release behavior, and other attributes of a single block storage device, or call the DiskIds.N parameter to modify the attributes of multiple block storage devices at a time. * * @param request - ModifyDiskAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyDiskAttributeResponse */ async modifyDiskAttributeWithOptions(request: $_model.ModifyDiskAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyDiskAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.burstingEnabled)) { query["BurstingEnabled"] = request.burstingEnabled; } if (!$dara.isNull(request.deleteAutoSnapshot)) { query["DeleteAutoSnapshot"] = request.deleteAutoSnapshot; } if (!$dara.isNull(request.deleteWithInstance)) { query["DeleteWithInstance"] = request.deleteWithInstance; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.diskIds)) { query["DiskIds"] = request.diskIds; } if (!$dara.isNull(request.diskName)) { query["DiskName"] = request.diskName; } if (!$dara.isNull(request.enableAutoSnapshot)) { query["EnableAutoSnapshot"] = request.enableAutoSnapshot; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyDiskAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyDiskAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyDiskAttributeResponse({})); } /** * Modifies the name, description, release behavior, automatic snapshot deletion policy, automatic snapshot policy, performance burst settings, and other attributes of one or more block storage devices. * * @remarks * You can call the DiskId parameter to modify the name, description, release behavior, and other attributes of a single block storage device, or call the DiskIds.N parameter to modify the attributes of multiple block storage devices at a time. * * @param request - ModifyDiskAttributeRequest * @returns ModifyDiskAttributeResponse */ async modifyDiskAttribute(request: $_model.ModifyDiskAttributeRequest): Promise<$_model.ModifyDiskAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyDiskAttributeWithOptions(request, runtime); } /** * Converts the billing method of a data disk attached to a subscription ECS instance between pay-as-you-go and subscription. * * @remarks * For information about how to change the billing method of cloud disks, see [Change the billing methods of a disk](https://help.aliyun.com/document_detail/145018.html). * Take note of the following items: * - Only pay-as-you-go disks can be attached to pay-as-you-go instances, and the billing methods of the disks cannot be changed. * - The instance to which data disks are attached cannot be in the Stopped state due to expiration. * - The price difference is refunded to the payment account that you used. Vouchers that have been redeemed are nonrefundable. * - You cannot change the billing method again within 5 minutes of a successful change. * After you change the billing method, the payment (if any) is automatically completed. Maintain sufficient balance in your account. Otherwise, your order becomes invalid and must be canceled. If your account balance is insufficient, you can set AutoPay to false to generate an unpaid order. Then, log on to the **Expenses and Costs console**, go to the [Orders page](https://usercenter2-intl.aliyun.com/order/list), and pay for the order. * * @param request - ModifyDiskChargeTypeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyDiskChargeTypeResponse */ async modifyDiskChargeTypeWithOptions(request: $_model.ModifyDiskChargeTypeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyDiskChargeTypeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoPay)) { query["AutoPay"] = request.autoPay; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.diskChargeType)) { query["DiskChargeType"] = request.diskChargeType; } if (!$dara.isNull(request.diskIds)) { query["DiskIds"] = request.diskIds; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyDiskChargeType", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyDiskChargeTypeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyDiskChargeTypeResponse({})); } /** * Converts the billing method of a data disk attached to a subscription ECS instance between pay-as-you-go and subscription. * * @remarks * For information about how to change the billing method of cloud disks, see [Change the billing methods of a disk](https://help.aliyun.com/document_detail/145018.html). * Take note of the following items: * - Only pay-as-you-go disks can be attached to pay-as-you-go instances, and the billing methods of the disks cannot be changed. * - The instance to which data disks are attached cannot be in the Stopped state due to expiration. * - The price difference is refunded to the payment account that you used. Vouchers that have been redeemed are nonrefundable. * - You cannot change the billing method again within 5 minutes of a successful change. * After you change the billing method, the payment (if any) is automatically completed. Maintain sufficient balance in your account. Otherwise, your order becomes invalid and must be canceled. If your account balance is insufficient, you can set AutoPay to false to generate an unpaid order. Then, log on to the **Expenses and Costs console**, go to the [Orders page](https://usercenter2-intl.aliyun.com/order/list), and pay for the order. * * @param request - ModifyDiskChargeTypeRequest * @returns ModifyDiskChargeTypeResponse */ async modifyDiskChargeType(request: $_model.ModifyDiskChargeTypeRequest): Promise<$_model.ModifyDiskChargeTypeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyDiskChargeTypeWithOptions(request, runtime); } /** * Changes the Key Management Service (KMS) key used by the Account-level Elastic Block Storage (EBS) Default Encryption feature in a region. * * @remarks * - To call this operation as a Resource Access Management (RAM) user, grant the `AliyunECSFullAccess` permission to the RAM user. For more information, see [Grant permissions to a RAM user](https://help.aliyun.com/document_detail/116146.html). * - Before you can call this operation in a region, make sure that the Account-level EBS Default Encryption feature is enabled in the region. * - The first time you use a customer master key (CMK), you must use the `AliyunECSDiskEncryptDefaultRole` role to grant Elastic Compute Service (ECS) access to KMS resources. For more information, see [Grant access to KMS keys through RAM roles](https://help.aliyun.com/document_detail/2838993.html). * * @param request - ModifyDiskDefaultKMSKeyIdRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyDiskDefaultKMSKeyIdResponse */ async modifyDiskDefaultKMSKeyIdWithOptions(request: $_model.ModifyDiskDefaultKMSKeyIdRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyDiskDefaultKMSKeyIdResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.KMSKeyId)) { query["KMSKeyId"] = request.KMSKeyId; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyDiskDefaultKMSKeyId", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyDiskDefaultKMSKeyIdResponse>(await this.callApi(params, req, runtime), new $_model.ModifyDiskDefaultKMSKeyIdResponse({})); } /** * Changes the Key Management Service (KMS) key used by the Account-level Elastic Block Storage (EBS) Default Encryption feature in a region. * * @remarks * - To call this operation as a Resource Access Management (RAM) user, grant the `AliyunECSFullAccess` permission to the RAM user. For more information, see [Grant permissions to a RAM user](https://help.aliyun.com/document_detail/116146.html). * - Before you can call this operation in a region, make sure that the Account-level EBS Default Encryption feature is enabled in the region. * - The first time you use a customer master key (CMK), you must use the `AliyunECSDiskEncryptDefaultRole` role to grant Elastic Compute Service (ECS) access to KMS resources. For more information, see [Grant access to KMS keys through RAM roles](https://help.aliyun.com/document_detail/2838993.html). * * @param request - ModifyDiskDefaultKMSKeyIdRequest * @returns ModifyDiskDefaultKMSKeyIdResponse */ async modifyDiskDefaultKMSKeyId(request: $_model.ModifyDiskDefaultKMSKeyIdRequest): Promise<$_model.ModifyDiskDefaultKMSKeyIdResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyDiskDefaultKMSKeyIdWithOptions(request, runtime); } /** * You can migrate cloud disks to, from, or between dedicated block storage clusters. * * @remarks * > The dedicated block storage cluster feature is available in the China (Hangzhou), China (Shanghai), China (Beijing), China (Zhangjiakou), China (Ulanqab), China (Shenzhen), China (Heyuan), Indonesia (Jakarta), and Germany (Frankfurt) regions, as well as the China (Shenzhen) Finance region. * Before you call this operation, make sure you understand the billing methods and pricing for cloud disks and dedicated block storage clusters. You must also ensure that your dedicated block storage cluster has not expired and your account has a positive balance. For more information, see [Billing for dedicated block storage](https://help.aliyun.com/document_detail/208883.html) and [Block storage billing](https://help.aliyun.com/document_detail/179022.html). * Note the following when you call this operation: * - The cloud disk and the dedicated block storage cluster must be in the same availability zone. * - Only pay-as-you-go cloud disks are supported. You must first convert subscription cloud disks to pay-as-you-go. For more information, see [Convert the billing method of a cloud disk](https://help.aliyun.com/document_detail/145018.html). * - The cloud disk type must be compatible with the target dedicated block storage cluster. When migrating a disk between clusters, you can change the disk type to match the types supported by the destination cluster. * - The cloud disk must be in the **In use** or **Available** state. * - If the cloud disk is attached to an ECS instance, the instance must be in the **Running** or **Stopped** state. The ECS instance must not be expired. * - The performance level of an ESSD cloud disk depends on its capacity. If you cannot upgrade the performance level, resize the disk and then retry the operation. For more information, see [ResizeDisk](https://help.aliyun.com/document_detail/25522.html) and [ESSD cloud disks](https://help.aliyun.com/document_detail/122389.html). * - You can perform a maximum of five concurrent cloud disk migration tasks per account in a single region. * - During the migration, you cannot cancel the migration, create snapshots, change the configuration, resize, attach, detach, or re-initialize the disk. * > After a cloud disk is migrated, the destination cluster determines its billing method, type, and capabilities. The changes take effect immediately after you call the operation, and Alibaba Cloud charges you based on the new disk type and performance level. For more information, see [Billing for dedicated block storage](https://help.aliyun.com/document_detail/208883.html) and [Block storage billing](https://help.aliyun.com/document_detail/179022.html). * * @param request - ModifyDiskDeploymentRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyDiskDeploymentResponse */ async modifyDiskDeploymentWithOptions(request: $_model.ModifyDiskDeploymentRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyDiskDeploymentResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.diskCategory)) { query["DiskCategory"] = request.diskCategory; } if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.performanceLevel)) { query["PerformanceLevel"] = request.performanceLevel; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.storageClusterId)) { query["StorageClusterId"] = request.storageClusterId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyDiskDeployment", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyDiskDeploymentResponse>(await this.callApi(params, req, runtime), new $_model.ModifyDiskDeploymentResponse({})); } /** * You can migrate cloud disks to, from, or between dedicated block storage clusters. * * @remarks * > The dedicated block storage cluster feature is available in the China (Hangzhou), China (Shanghai), China (Beijing), China (Zhangjiakou), China (Ulanqab), China (Shenzhen), China (Heyuan), Indonesia (Jakarta), and Germany (Frankfurt) regions, as well as the China (Shenzhen) Finance region. * Before you call this operation, make sure you understand the billing methods and pricing for cloud disks and dedicated block storage clusters. You must also ensure that your dedicated block storage cluster has not expired and your account has a positive balance. For more information, see [Billing for dedicated block storage](https://help.aliyun.com/document_detail/208883.html) and [Block storage billing](https://help.aliyun.com/document_detail/179022.html). * Note the following when you call this operation: * - The cloud disk and the dedicated block storage cluster must be in the same availability zone. * - Only pay-as-you-go cloud disks are supported. You must first convert subscription cloud disks to pay-as-you-go. For more information, see [Convert the billing method of a cloud disk](https://help.aliyun.com/document_detail/145018.html). * - The cloud disk type must be compatible with the target dedicated block storage cluster. When migrating a disk between clusters, you can change the disk type to match the types supported by the destination cluster. * - The cloud disk must be in the **In use** or **Available** state. * - If the cloud disk is attached to an ECS instance, the instance must be in the **Running** or **Stopped** state. The ECS instance must not be expired. * - The performance level of an ESSD cloud disk depends on its capacity. If you cannot upgrade the performance level, resize the disk and then retry the operation. For more information, see [ResizeDisk](https://help.aliyun.com/document_detail/25522.html) and [ESSD cloud disks](https://help.aliyun.com/document_detail/122389.html). * - You can perform a maximum of five concurrent cloud disk migration tasks per account in a single region. * - During the migration, you cannot cancel the migration, create snapshots, change the configuration, resize, attach, detach, or re-initialize the disk. * > After a cloud disk is migrated, the destination cluster determines its billing method, type, and capabilities. The changes take effect immediately after you call the operation, and Alibaba Cloud charges you based on the new disk type and performance level. For more information, see [Billing for dedicated block storage](https://help.aliyun.com/document_detail/208883.html) and [Block storage billing](https://help.aliyun.com/document_detail/179022.html). * * @param request - ModifyDiskDeploymentRequest * @returns ModifyDiskDeploymentResponse */ async modifyDiskDeployment(request: $_model.ModifyDiskDeploymentRequest): Promise<$_model.ModifyDiskDeploymentResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyDiskDeploymentWithOptions(request, runtime); } /** * Changes the disk category of a cloud disk or the performance level of an Enterprise SSD (ESSD). You cannot change the disk categories of Regional ESSDs, basic disks, elastic ephemeral disks, and local disks. * * @remarks * To minimize impacts on your business, change the disk categories or performance levels of cloud disks during off-peak hours. * Take note of the following items: * - To change the performance level of an ESSD, take note of the following items: * - If the ESSD is a subscription ESSD, you can only upgrade its performance level. * - If the ESSD is a pay-as-you-go ESSD, you can upgrade or downgrade its performance level. However, you cannot downgrade the performance level to PL0. * - The ESSD must be in the **In Use** (In_Use) or **Unattached** (Available) state. * - If the ESSD is attached to an Elastic Compute Service (ECS) instance, the instance must be in the **Running** (Running) or **Stopped** (Stopped) state. The instance cannot be in the Expired state or stopped due to an overdue payment. * - If you cannot upgrade the performance level of an ESSD due to the capacity limit, extend the ESSD by calling the [ResizeDisk](https://help.aliyun.com/document_detail/25522.html) operation and then try again. For more information, see [ESSDs](https://help.aliyun.com/document_detail/122389.html). * - For information about the limits on changing the disk category of a cloud disk, see [Change the category of a disk](~~161980#section_s4a_to0_1jx~~). * - For the disk categories to which cloud disks of each disk category can be changed, see [Change the category of a disk](~~161980#eb8bb54032nho~~). * After the disk category of a cloud disk is changed, the billing of the cloud disk has the following changes: * - If the cloud disk is a pay-as-you-go disk, you are charged for the disk based on the new disk category. * - If the cloud disk is a subscription disk, you may be charged additionally based on the price difference between the old and new disk categories and the remaining days of the billing cycle, starting from 00:00 the next day until the end of the subscription period. * For information about the billing of cloud disks, see [Block storage devices](https://help.aliyun.com/document_detail/179022.html). * * @param request - ModifyDiskSpecRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyDiskSpecResponse */ async modifyDiskSpecWithOptions(request: $_model.ModifyDiskSpecRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyDiskSpecResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.destinationZoneId)) { query["DestinationZoneId"] = request.destinationZoneId; } if (!$dara.isNull(request.diskCategory)) { query["DiskCategory"] = request.diskCategory; } if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.performanceControlOptions)) { query["PerformanceControlOptions"] = request.performanceControlOptions; } if (!$dara.isNull(request.performanceLevel)) { query["PerformanceLevel"] = request.performanceLevel; } if (!$dara.isNull(request.provisionedIops)) { query["ProvisionedIops"] = request.provisionedIops; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyDiskSpec", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyDiskSpecResponse>(await this.callApi(params, req, runtime), new $_model.ModifyDiskSpecResponse({})); } /** * Changes the disk category of a cloud disk or the performance level of an Enterprise SSD (ESSD). You cannot change the disk categories of Regional ESSDs, basic disks, elastic ephemeral disks, and local disks. * * @remarks * To minimize impacts on your business, change the disk categories or performance levels of cloud disks during off-peak hours. * Take note of the following items: * - To change the performance level of an ESSD, take note of the following items: * - If the ESSD is a subscription ESSD, you can only upgrade its performance level. * - If the ESSD is a pay-as-you-go ESSD, you can upgrade or downgrade its performance level. However, you cannot downgrade the performance level to PL0. * - The ESSD must be in the **In Use** (In_Use) or **Unattached** (Available) state. * - If the ESSD is attached to an Elastic Compute Service (ECS) instance, the instance must be in the **Running** (Running) or **Stopped** (Stopped) state. The instance cannot be in the Expired state or stopped due to an overdue payment. * - If you cannot upgrade the performance level of an ESSD due to the capacity limit, extend the ESSD by calling the [ResizeDisk](https://help.aliyun.com/document_detail/25522.html) operation and then try again. For more information, see [ESSDs](https://help.aliyun.com/document_detail/122389.html). * - For information about the limits on changing the disk category of a cloud disk, see [Change the category of a disk](~~161980#section_s4a_to0_1jx~~). * - For the disk categories to which cloud disks of each disk category can be changed, see [Change the category of a disk](~~161980#eb8bb54032nho~~). * After the disk category of a cloud disk is changed, the billing of the cloud disk has the following changes: * - If the cloud disk is a pay-as-you-go disk, you are charged for the disk based on the new disk category. * - If the cloud disk is a subscription disk, you may be charged additionally based on the price difference between the old and new disk categories and the remaining days of the billing cycle, starting from 00:00 the next day until the end of the subscription period. * For information about the billing of cloud disks, see [Block storage devices](https://help.aliyun.com/document_detail/179022.html). * * @param request - ModifyDiskSpecRequest * @returns ModifyDiskSpecResponse */ async modifyDiskSpec(request: $_model.ModifyDiskSpecRequest): Promise<$_model.ModifyDiskSpecResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyDiskSpecWithOptions(request, runtime); } /** * ModifyEipAddressAttribute * * @deprecated OpenAPI ModifyEipAddressAttribute is deprecated, please use Vpc::2016-04-28::ModifyEipAddressAttribute instead. * * @param request - ModifyEipAddressAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyEipAddressAttributeResponse */ async modifyEipAddressAttributeWithOptions(request: $_model.ModifyEipAddressAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyEipAddressAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.allocationId)) { query["AllocationId"] = request.allocationId; } if (!$dara.isNull(request.bandwidth)) { query["Bandwidth"] = request.bandwidth; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyEipAddressAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyEipAddressAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyEipAddressAttributeResponse({})); } /** * ModifyEipAddressAttribute * * @deprecated OpenAPI ModifyEipAddressAttribute is deprecated, please use Vpc::2016-04-28::ModifyEipAddressAttribute instead. * * @param request - ModifyEipAddressAttributeRequest * @returns ModifyEipAddressAttributeResponse */ // Deprecated async modifyEipAddressAttribute(request: $_model.ModifyEipAddressAttributeRequest): Promise<$_model.ModifyEipAddressAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyEipAddressAttributeWithOptions(request, runtime); } /** * Modifies information about an elasticity assurance, including the name, description, and capacity. Only capacity scale-in is supported . * * @param request - ModifyElasticityAssuranceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyElasticityAssuranceResponse */ async modifyElasticityAssuranceWithOptions(request: $_model.ModifyElasticityAssuranceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyElasticityAssuranceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.instanceAmount)) { query["InstanceAmount"] = request.instanceAmount; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.recurrenceRules)) { query["RecurrenceRules"] = request.recurrenceRules; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyElasticityAssurance", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyElasticityAssuranceResponse>(await this.callApi(params, req, runtime), new $_model.ModifyElasticityAssuranceResponse({})); } /** * Modifies information about an elasticity assurance, including the name, description, and capacity. Only capacity scale-in is supported . * * @param request - ModifyElasticityAssuranceRequest * @returns ModifyElasticityAssuranceResponse */ async modifyElasticityAssurance(request: $_model.ModifyElasticityAssuranceRequest): Promise<$_model.ModifyElasticityAssuranceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyElasticityAssuranceWithOptions(request, runtime); } /** * Modifies the auto-renewal attribute of elasticity assurances. * * @param request - ModifyElasticityAssuranceAutoRenewAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyElasticityAssuranceAutoRenewAttributeResponse */ async modifyElasticityAssuranceAutoRenewAttributeWithOptions(request: $_model.ModifyElasticityAssuranceAutoRenewAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyElasticityAssuranceAutoRenewAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.renewalStatus)) { query["RenewalStatus"] = request.renewalStatus; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyElasticityAssuranceAutoRenewAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyElasticityAssuranceAutoRenewAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyElasticityAssuranceAutoRenewAttributeResponse({})); } /** * Modifies the auto-renewal attribute of elasticity assurances. * * @param request - ModifyElasticityAssuranceAutoRenewAttributeRequest * @returns ModifyElasticityAssuranceAutoRenewAttributeResponse */ async modifyElasticityAssuranceAutoRenewAttribute(request: $_model.ModifyElasticityAssuranceAutoRenewAttributeRequest): Promise<$_model.ModifyElasticityAssuranceAutoRenewAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyElasticityAssuranceAutoRenewAttributeWithOptions(request, runtime); } /** * Modifies the properties of a specified forward entry. * * @deprecated OpenAPI ModifyForwardEntry is deprecated, please use Vpc::2016-04-28::ModifyForwardEntry instead. * * @param request - ModifyForwardEntryRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyForwardEntryResponse */ async modifyForwardEntryWithOptions(request: $_model.ModifyForwardEntryRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyForwardEntryResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.externalIp)) { query["ExternalIp"] = request.externalIp; } if (!$dara.isNull(request.externalPort)) { query["ExternalPort"] = request.externalPort; } if (!$dara.isNull(request.forwardEntryId)) { query["ForwardEntryId"] = request.forwardEntryId; } if (!$dara.isNull(request.forwardTableId)) { query["ForwardTableId"] = request.forwardTableId; } if (!$dara.isNull(request.internalIp)) { query["InternalIp"] = request.internalIp; } if (!$dara.isNull(request.internalPort)) { query["InternalPort"] = request.internalPort; } if (!$dara.isNull(request.ipProtocol)) { query["IpProtocol"] = request.ipProtocol; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyForwardEntry", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyForwardEntryResponse>(await this.callApi(params, req, runtime), new $_model.ModifyForwardEntryResponse({})); } /** * Modifies the properties of a specified forward entry. * * @deprecated OpenAPI ModifyForwardEntry is deprecated, please use Vpc::2016-04-28::ModifyForwardEntry instead. * * @param request - ModifyForwardEntryRequest * @returns ModifyForwardEntryResponse */ // Deprecated async modifyForwardEntry(request: $_model.ModifyForwardEntryRequest): Promise<$_model.ModifyForwardEntryResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyForwardEntryWithOptions(request, runtime); } /** * Modifies the attributes of a high-availability virtual IP address (HAVIP). * * @deprecated OpenAPI ModifyHaVipAttribute is deprecated, please use Vpc::2016-04-28::ModifyHaVipAttribute instead. * * @param request - ModifyHaVipAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyHaVipAttributeResponse */ async modifyHaVipAttributeWithOptions(request: $_model.ModifyHaVipAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyHaVipAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.haVipId)) { query["HaVipId"] = request.haVipId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyHaVipAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyHaVipAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyHaVipAttributeResponse({})); } /** * Modifies the attributes of a high-availability virtual IP address (HAVIP). * * @deprecated OpenAPI ModifyHaVipAttribute is deprecated, please use Vpc::2016-04-28::ModifyHaVipAttribute instead. * * @param request - ModifyHaVipAttributeRequest * @returns ModifyHaVipAttributeResponse */ // Deprecated async modifyHaVipAttribute(request: $_model.ModifyHaVipAttributeRequest): Promise<$_model.ModifyHaVipAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyHaVipAttributeWithOptions(request, runtime); } /** * Modifies the description of an HPC cluster. * * @param request - ModifyHpcClusterAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyHpcClusterAttributeResponse */ async modifyHpcClusterAttributeWithOptions(request: $_model.ModifyHpcClusterAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyHpcClusterAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.hpcClusterId)) { query["HpcClusterId"] = request.hpcClusterId; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyHpcClusterAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyHpcClusterAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyHpcClusterAttributeResponse({})); } /** * Modifies the description of an HPC cluster. * * @param request - ModifyHpcClusterAttributeRequest * @returns ModifyHpcClusterAttributeResponse */ async modifyHpcClusterAttribute(request: $_model.ModifyHpcClusterAttributeRequest): Promise<$_model.ModifyHpcClusterAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyHpcClusterAttributeWithOptions(request, runtime); } /** * Call the `ModifyImageAttribute` API to modify the attributes of a custom image, such as its image family, name, boot mode, status, or whether NVMe is supported. * * @param request - ModifyImageAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyImageAttributeResponse */ async modifyImageAttributeWithOptions(request: $_model.ModifyImageAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyImageAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.bootMode)) { query["BootMode"] = request.bootMode; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.features)) { query["Features"] = request.features; } if (!$dara.isNull(request.imageFamily)) { query["ImageFamily"] = request.imageFamily; } if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.imageName)) { query["ImageName"] = request.imageName; } if (!$dara.isNull(request.licenseType)) { query["LicenseType"] = request.licenseType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.status)) { query["Status"] = request.status; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyImageAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyImageAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyImageAttributeResponse({})); } /** * Call the `ModifyImageAttribute` API to modify the attributes of a custom image, such as its image family, name, boot mode, status, or whether NVMe is supported. * * @param request - ModifyImageAttributeRequest * @returns ModifyImageAttributeResponse */ async modifyImageAttribute(request: $_model.ModifyImageAttributeRequest): Promise<$_model.ModifyImageAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyImageAttributeWithOptions(request, runtime); } /** * Modifies the permissions of an image share group. * * @deprecated OpenAPI ModifyImageShareGroupPermission is deprecated, please use Ecs::2014-05-26::ModifyImageSharePermission instead. * * @param request - ModifyImageShareGroupPermissionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyImageShareGroupPermissionResponse */ async modifyImageShareGroupPermissionWithOptions(request: $_model.ModifyImageShareGroupPermissionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyImageShareGroupPermissionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.addGroup)) { query["AddGroup"] = request.addGroup; } if (!$dara.isNull(request.removeGroup)) { query["RemoveGroup"] = request.removeGroup; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyImageShareGroupPermission", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyImageShareGroupPermissionResponse>(await this.callApi(params, req, runtime), new $_model.ModifyImageShareGroupPermissionResponse({})); } /** * Modifies the permissions of an image share group. * * @deprecated OpenAPI ModifyImageShareGroupPermission is deprecated, please use Ecs::2014-05-26::ModifyImageSharePermission instead. * * @param request - ModifyImageShareGroupPermissionRequest * @returns ModifyImageShareGroupPermissionResponse */ // Deprecated async modifyImageShareGroupPermission(request: $_model.ModifyImageShareGroupPermissionRequest): Promise<$_model.ModifyImageShareGroupPermissionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyImageShareGroupPermissionWithOptions(request, runtime); } /** * You can manage image sharing permissions by sharing your custom images with other Alibaba Cloud accounts or publishing them as community images. * * @remarks * Before calling this operation, read [Share custom images](https://help.aliyun.com/document_detail/25463.html). * When you call this operation, note the following sharing rules: * - **Sharing limits**: You can only share custom images created in your account. An image can be shared with up to 50 Alibaba Cloud accounts, with a limit of 10 accounts per request. * - **Impact on instances**: After an ECS instance is created from a shared custom image by calling [RunInstances](https://help.aliyun.com/document_detail/63440.html), its system disk cannot be re-initialized by calling [ReInitDisk](https://help.aliyun.com/document_detail/25519.html) if the image owner later unshares the image or deletes it by calling [DeleteImage](https://help.aliyun.com/document_detail/25537.html). * >Notice: * The rules for sharing encrypted images on ECS have changed: you can share only images that are encrypted with a customer master key (CMK), not images that are encrypted with a service key. If you attempt to share an image that is encrypted with a service key, the request fails. To share such an image, you must use CopyImage to create a copy that is encrypted with a CMK. * Note the following when you publish or unpublish a community image: * - **Responsibilities and agreement**: As the image owner, you are responsible for the quality and version updates of the community image. Alibaba Cloud provides only platform support. You must read and agree to the Community Image Agreement before you can publish the image. For more information, see [Publish a community image](https://help.aliyun.com/document_detail/208370.html). * - **Encryption limits**: You cannot publish encrypted images as community images. * - **Visibility**: Community images are public to all Alibaba Cloud accounts within the image\\"s region. * - **Feature limitations**: You cannot share, export, or copy community images. * - **Impact of unpublishing**: When a community image is unpublished, it becomes private. However, any accounts that you previously shared the image with directly retain access. * * @param request - ModifyImageSharePermissionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyImageSharePermissionResponse */ async modifyImageSharePermissionWithOptions(request: $_model.ModifyImageSharePermissionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyImageSharePermissionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.addAccount)) { query["AddAccount"] = request.addAccount; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.isPublic)) { query["IsPublic"] = request.isPublic; } if (!$dara.isNull(request.launchPermission)) { query["LaunchPermission"] = request.launchPermission; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.removeAccount)) { query["RemoveAccount"] = request.removeAccount; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyImageSharePermission", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyImageSharePermissionResponse>(await this.callApi(params, req, runtime), new $_model.ModifyImageSharePermissionResponse({})); } /** * You can manage image sharing permissions by sharing your custom images with other Alibaba Cloud accounts or publishing them as community images. * * @remarks * Before calling this operation, read [Share custom images](https://help.aliyun.com/document_detail/25463.html). * When you call this operation, note the following sharing rules: * - **Sharing limits**: You can only share custom images created in your account. An image can be shared with up to 50 Alibaba Cloud accounts, with a limit of 10 accounts per request. * - **Impact on instances**: After an ECS instance is created from a shared custom image by calling [RunInstances](https://help.aliyun.com/document_detail/63440.html), its system disk cannot be re-initialized by calling [ReInitDisk](https://help.aliyun.com/document_detail/25519.html) if the image owner later unshares the image or deletes it by calling [DeleteImage](https://help.aliyun.com/document_detail/25537.html). * >Notice: * The rules for sharing encrypted images on ECS have changed: you can share only images that are encrypted with a customer master key (CMK), not images that are encrypted with a service key. If you attempt to share an image that is encrypted with a service key, the request fails. To share such an image, you must use CopyImage to create a copy that is encrypted with a CMK. * Note the following when you publish or unpublish a community image: * - **Responsibilities and agreement**: As the image owner, you are responsible for the quality and version updates of the community image. Alibaba Cloud provides only platform support. You must read and agree to the Community Image Agreement before you can publish the image. For more information, see [Publish a community image](https://help.aliyun.com/document_detail/208370.html). * - **Encryption limits**: You cannot publish encrypted images as community images. * - **Visibility**: Community images are public to all Alibaba Cloud accounts within the image\\"s region. * - **Feature limitations**: You cannot share, export, or copy community images. * - **Impact of unpublishing**: When a community image is unpublished, it becomes private. However, any accounts that you previously shared the image with directly retain access. * * @param request - ModifyImageSharePermissionRequest * @returns ModifyImageSharePermissionResponse */ async modifyImageSharePermission(request: $_model.ModifyImageSharePermissionRequest): Promise<$_model.ModifyImageSharePermissionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyImageSharePermissionWithOptions(request, runtime); } /** * Changes the type of the private pool for an Elastic Compute Service (ECS) instance. * * @remarks * A private pool is generated after an elasticity assurance or a capacity reservation is created. The private pool is associated with information about the instances that use the private pool. You can specify whether to use a private pool when you create an ECS instance to match the instance with the associated elasticity assurance or capacity reservation. * - After you call this operation to modify the private pool attributes of an ECS instance, you do not need to restart the instance for the changes to take effect. * - When you call the following operations on an ECS instance, the system attempts to match the instance with active private pools. If the instance is already matched to a specified private pool, the call to an operation may fail when the private pool capacity is used up or the private pool expires. If the call fails, call the ModifyInstanceAttachmentAttributes operation to change the type of the private pool to `Open`. * - [StartInstance](https://help.aliyun.com/document_detail/2679679.html): start an ECS instance that is stopped in economical mode. * - [ReActivateInstances](https://help.aliyun.com/document_detail/2679707.html): reactivates an ECS instance that has expired or is reclaimed due to an overdue payment. * - [ModifyInstanceChargeType](https://help.aliyun.com/document_detail/2679704.html): changes the billing method of an ECS instance. * - [ModifyPrepayInstanceSpec](https://help.aliyun.com/document_detail/2679706.html): changes the instance type of an ECS instance. * - [ReplaceSystemDisk](https://help.aliyun.com/document_detail/2679771.html): replaces the operating system of an ECS instance. * * @param request - ModifyInstanceAttachmentAttributesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyInstanceAttachmentAttributesResponse */ async modifyInstanceAttachmentAttributesWithOptions(request: $_model.ModifyInstanceAttachmentAttributesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyInstanceAttachmentAttributesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyInstanceAttachmentAttributes", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyInstanceAttachmentAttributesResponse>(await this.callApi(params, req, runtime), new $_model.ModifyInstanceAttachmentAttributesResponse({})); } /** * Changes the type of the private pool for an Elastic Compute Service (ECS) instance. * * @remarks * A private pool is generated after an elasticity assurance or a capacity reservation is created. The private pool is associated with information about the instances that use the private pool. You can specify whether to use a private pool when you create an ECS instance to match the instance with the associated elasticity assurance or capacity reservation. * - After you call this operation to modify the private pool attributes of an ECS instance, you do not need to restart the instance for the changes to take effect. * - When you call the following operations on an ECS instance, the system attempts to match the instance with active private pools. If the instance is already matched to a specified private pool, the call to an operation may fail when the private pool capacity is used up or the private pool expires. If the call fails, call the ModifyInstanceAttachmentAttributes operation to change the type of the private pool to `Open`. * - [StartInstance](https://help.aliyun.com/document_detail/2679679.html): start an ECS instance that is stopped in economical mode. * - [ReActivateInstances](https://help.aliyun.com/document_detail/2679707.html): reactivates an ECS instance that has expired or is reclaimed due to an overdue payment. * - [ModifyInstanceChargeType](https://help.aliyun.com/document_detail/2679704.html): changes the billing method of an ECS instance. * - [ModifyPrepayInstanceSpec](https://help.aliyun.com/document_detail/2679706.html): changes the instance type of an ECS instance. * - [ReplaceSystemDisk](https://help.aliyun.com/document_detail/2679771.html): replaces the operating system of an ECS instance. * * @param request - ModifyInstanceAttachmentAttributesRequest * @returns ModifyInstanceAttachmentAttributesResponse */ async modifyInstanceAttachmentAttributes(request: $_model.ModifyInstanceAttachmentAttributesRequest): Promise<$_model.ModifyInstanceAttachmentAttributesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyInstanceAttachmentAttributesWithOptions(request, runtime); } /** * Modifies some properties of an ECS instance, including the password, instance name, hostname, security group membership, MTU, and instance user data. * * @remarks * Instances that are locked for security reasons do not support this operation. For more information, see [Impact of resource security locks on API calls](https://help.aliyun.com/document_detail/25695.html). * * @param request - ModifyInstanceAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyInstanceAttributeResponse */ async modifyInstanceAttributeWithOptions(request: $_model.ModifyInstanceAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyInstanceAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.creditSpecification)) { query["CreditSpecification"] = request.creditSpecification; } if (!$dara.isNull(request.deletionProtection)) { query["DeletionProtection"] = request.deletionProtection; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.enableJumboFrame)) { query["EnableJumboFrame"] = request.enableJumboFrame; } if (!$dara.isNull(request.enableNetworkEncryption)) { query["EnableNetworkEncryption"] = request.enableNetworkEncryption; } if (!$dara.isNull(request.hostName)) { query["HostName"] = request.hostName; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.instanceName)) { query["InstanceName"] = request.instanceName; } if (!$dara.isNull(request.networkInterfaceQueueNumber)) { query["NetworkInterfaceQueueNumber"] = request.networkInterfaceQueueNumber; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.password)) { query["Password"] = request.password; } if (!$dara.isNull(request.privateDnsNameOptions)) { query["PrivateDnsNameOptions"] = request.privateDnsNameOptions; } if (!$dara.isNull(request.recyclable)) { query["Recyclable"] = request.recyclable; } if (!$dara.isNull(request.remoteConnectionOptions)) { query["RemoteConnectionOptions"] = request.remoteConnectionOptions; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupIds)) { query["SecurityGroupIds"] = request.securityGroupIds; } if (!$dara.isNull(request.userData)) { query["UserData"] = request.userData; } if (!$dara.isNull(request.cpuOptions)) { query["CpuOptions"] = request.cpuOptions; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyInstanceAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyInstanceAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyInstanceAttributeResponse({})); } /** * Modifies some properties of an ECS instance, including the password, instance name, hostname, security group membership, MTU, and instance user data. * * @remarks * Instances that are locked for security reasons do not support this operation. For more information, see [Impact of resource security locks on API calls](https://help.aliyun.com/document_detail/25695.html). * * @param request - ModifyInstanceAttributeRequest * @returns ModifyInstanceAttributeResponse */ async modifyInstanceAttribute(request: $_model.ModifyInstanceAttributeRequest): Promise<$_model.ModifyInstanceAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyInstanceAttributeWithOptions(request, runtime); } /** * Changes the automatic release time of a pay-as-you-go or spot instance or cancels the automatic release of the instance. * * @param request - ModifyInstanceAutoReleaseTimeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyInstanceAutoReleaseTimeResponse */ async modifyInstanceAutoReleaseTimeWithOptions(request: $_model.ModifyInstanceAutoReleaseTimeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyInstanceAutoReleaseTimeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoReleaseTime)) { query["AutoReleaseTime"] = request.autoReleaseTime; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyInstanceAutoReleaseTime", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyInstanceAutoReleaseTimeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyInstanceAutoReleaseTimeResponse({})); } /** * Changes the automatic release time of a pay-as-you-go or spot instance or cancels the automatic release of the instance. * * @param request - ModifyInstanceAutoReleaseTimeRequest * @returns ModifyInstanceAutoReleaseTimeResponse */ async modifyInstanceAutoReleaseTime(request: $_model.ModifyInstanceAutoReleaseTimeRequest): Promise<$_model.ModifyInstanceAutoReleaseTimeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyInstanceAutoReleaseTimeWithOptions(request, runtime); } /** * Modifies the auto-renewal attributes of one or more subscription instances, helping you reduce the maintenance cost of resource expiration. * * @remarks * *Before using this API, make sure you fully understand the billing methods and [pricing](https://www.aliyun.com/price/product#/ecs/detail)[pricing](https://www.alibabacloud.com/product/ecs#pricing) of Elastic Compute Service (ECS)**. * - Make sure your account balance or credit limit is sufficient. * - Only subscription instances are supported. An error is returned if you call this API for pay-as-you-go instances. * - The auto-renewal deduction date is 9 days before the instance expires. The deduction starts at 08:00:00 (UTC+8). * - If the auto-deduction fails on the previous day, it will be retried at the scheduled time on the next day until the deduction succeeds or the instance is locked after expiration 9 days later. * * - If the purchase duration of a newly created instance is one week, the auto-renewal deduction is made on the first day after the instance is created. * * @param request - ModifyInstanceAutoRenewAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyInstanceAutoRenewAttributeResponse */ async modifyInstanceAutoRenewAttributeWithOptions(request: $_model.ModifyInstanceAutoRenewAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyInstanceAutoRenewAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoRenew)) { query["AutoRenew"] = request.autoRenew; } if (!$dara.isNull(request.duration)) { query["Duration"] = request.duration; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.renewalStatus)) { query["RenewalStatus"] = request.renewalStatus; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyInstanceAutoRenewAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyInstanceAutoRenewAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyInstanceAutoRenewAttributeResponse({})); } /** * Modifies the auto-renewal attributes of one or more subscription instances, helping you reduce the maintenance cost of resource expiration. * * @remarks * *Before using this API, make sure you fully understand the billing methods and [pricing](https://www.aliyun.com/price/product#/ecs/detail)[pricing](https://www.alibabacloud.com/product/ecs#pricing) of Elastic Compute Service (ECS)**. * - Make sure your account balance or credit limit is sufficient. * - Only subscription instances are supported. An error is returned if you call this API for pay-as-you-go instances. * - The auto-renewal deduction date is 9 days before the instance expires. The deduction starts at 08:00:00 (UTC+8). * - If the auto-deduction fails on the previous day, it will be retried at the scheduled time on the next day until the deduction succeeds or the instance is locked after expiration 9 days later. * * - If the purchase duration of a newly created instance is one week, the auto-renewal deduction is made on the first day after the instance is created. * * @param request - ModifyInstanceAutoRenewAttributeRequest * @returns ModifyInstanceAutoRenewAttributeResponse */ async modifyInstanceAutoRenewAttribute(request: $_model.ModifyInstanceAutoRenewAttributeRequest): Promise<$_model.ModifyInstanceAutoRenewAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyInstanceAutoRenewAttributeWithOptions(request, runtime); } /** * Changes the billing method of Elastic Compute Service (ECS) instances in batches. * * @remarks * ### [](#)Precautions * - Before you call this operation, make sure that you are familiar with the [subscription](https://help.aliyun.com/document_detail/56220.html) and [pay-as-you-go](https://help.aliyun.com/document_detail/40653.html) billing methods and [pricing](https://www.alibabacloud.com/product/ecs#pricing) of ECS. * - The instances must be in the **Running** (`Running`) or **Stopped** (`Stopped`) state, and you have no overdue payments for the instances. * - After you change the billing method, the payment is automatically completed. Make sure that the balance in your account is sufficient. Otherwise, your order becomes invalid and is canceled. If your account balance is insufficient, you can set `AutoPay` to `false` to generate an unpaid order. Then, you can log on to the [ECS console](https://ecs.console.aliyun.com/) to pay for the order. * ### [](#)Considerations * - **Change the billing method from subscription to pay-as-you-go**: * - After you change the billing method of an instance from subscription to pay-as-you-go, the new billing method remains in effect for the remaining lifecycle of the instance. The price difference is refunded to the payment account that you used. Vouchers that have been redeemed are not refundable. * - **Refund rule**: You have a quota for the total refund amount each month, and unused balance of this quota is not carried forward into the next month. After you use up the refund quota of the current month, you can change the billing method only in the next month. The refund amount incurred when you change the billing method is calculated based on the following formula: **Number of vCPUs × (Number of remaining days × 24 ± Number of remaining or elapsed hours)**. For more information, see [Change the billing method of an instance from subscription to pay-as-you-go](https://help.aliyun.com/document_detail/85517.html). * - **Change the billing method from pay-as-you-go to subscription**: * - You can change the billing method of all data disks attached to an instance from pay-as-you-go to subscription. * - This operation cannot be called for a pay-as-you-go instance that has an automatic release time set. For more information, see [Change the billing method of an instance from subscription to pay-as-you-go](https://help.aliyun.com/document_detail/49884.html). * * @param request - ModifyInstanceChargeTypeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyInstanceChargeTypeResponse */ async modifyInstanceChargeTypeWithOptions(request: $_model.ModifyInstanceChargeTypeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyInstanceChargeTypeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoPay)) { query["AutoPay"] = request.autoPay; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.includeDataDisks)) { query["IncludeDataDisks"] = request.includeDataDisks; } if (!$dara.isNull(request.instanceChargeType)) { query["InstanceChargeType"] = request.instanceChargeType; } if (!$dara.isNull(request.instanceIds)) { query["InstanceIds"] = request.instanceIds; } if (!$dara.isNull(request.isDetailFee)) { query["IsDetailFee"] = request.isDetailFee; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyInstanceChargeType", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyInstanceChargeTypeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyInstanceChargeTypeResponse({})); } /** * Changes the billing method of Elastic Compute Service (ECS) instances in batches. * * @remarks * ### [](#)Precautions * - Before you call this operation, make sure that you are familiar with the [subscription](https://help.aliyun.com/document_detail/56220.html) and [pay-as-you-go](https://help.aliyun.com/document_detail/40653.html) billing methods and [pricing](https://www.alibabacloud.com/product/ecs#pricing) of ECS. * - The instances must be in the **Running** (`Running`) or **Stopped** (`Stopped`) state, and you have no overdue payments for the instances. * - After you change the billing method, the payment is automatically completed. Make sure that the balance in your account is sufficient. Otherwise, your order becomes invalid and is canceled. If your account balance is insufficient, you can set `AutoPay` to `false` to generate an unpaid order. Then, you can log on to the [ECS console](https://ecs.console.aliyun.com/) to pay for the order. * ### [](#)Considerations * - **Change the billing method from subscription to pay-as-you-go**: * - After you change the billing method of an instance from subscription to pay-as-you-go, the new billing method remains in effect for the remaining lifecycle of the instance. The price difference is refunded to the payment account that you used. Vouchers that have been redeemed are not refundable. * - **Refund rule**: You have a quota for the total refund amount each month, and unused balance of this quota is not carried forward into the next month. After you use up the refund quota of the current month, you can change the billing method only in the next month. The refund amount incurred when you change the billing method is calculated based on the following formula: **Number of vCPUs × (Number of remaining days × 24 ± Number of remaining or elapsed hours)**. For more information, see [Change the billing method of an instance from subscription to pay-as-you-go](https://help.aliyun.com/document_detail/85517.html). * - **Change the billing method from pay-as-you-go to subscription**: * - You can change the billing method of all data disks attached to an instance from pay-as-you-go to subscription. * - This operation cannot be called for a pay-as-you-go instance that has an automatic release time set. For more information, see [Change the billing method of an instance from subscription to pay-as-you-go](https://help.aliyun.com/document_detail/49884.html). * * @param request - ModifyInstanceChargeTypeRequest * @returns ModifyInstanceChargeTypeResponse */ async modifyInstanceChargeType(request: $_model.ModifyInstanceChargeTypeRequest): Promise<$_model.ModifyInstanceChargeTypeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyInstanceChargeTypeWithOptions(request, runtime); } /** * Modifies the instance clock options. * * @remarks * When you call this operation, note that: * - This is an asynchronous operation. The ID of the asynchronous task is returned after the call. Query the asynchronous task result to determine whether the execution is complete. * - To modify the PtpStatus parameter, you must specify the parameter. The instance types that are supported. You can query the instance type list ([DescribeInstanceTypes](https://help.aliyun.com/document_detail/25620.html) ). * * @param request - ModifyInstanceClockOptionsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyInstanceClockOptionsResponse */ async modifyInstanceClockOptionsWithOptions(request: $_model.ModifyInstanceClockOptionsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyInstanceClockOptionsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.ptpStatus)) { query["PtpStatus"] = request.ptpStatus; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyInstanceClockOptions", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyInstanceClockOptionsResponse>(await this.callApi(params, req, runtime), new $_model.ModifyInstanceClockOptionsResponse({})); } /** * Modifies the instance clock options. * * @remarks * When you call this operation, note that: * - This is an asynchronous operation. The ID of the asynchronous task is returned after the call. Query the asynchronous task result to determine whether the execution is complete. * - To modify the PtpStatus parameter, you must specify the parameter. The instance types that are supported. You can query the instance type list ([DescribeInstanceTypes](https://help.aliyun.com/document_detail/25620.html) ). * * @param request - ModifyInstanceClockOptionsRequest * @returns ModifyInstanceClockOptionsResponse */ async modifyInstanceClockOptions(request: $_model.ModifyInstanceClockOptionsRequest): Promise<$_model.ModifyInstanceClockOptionsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyInstanceClockOptionsWithOptions(request, runtime); } /** * Changes the deployment set of an Elastic Compute Service (ECS) instance or migrates an ECS instance to a dedicated host. You can change the instance type of an ECS instance when you migrate the instance. * * @remarks * Take note of the following items: * - The instance must be in the **Stopped** (Stopped) state. The instance is automatically restarted after it is migrated. * - The network type of the instance must be Virtual Private Cloud (VPC). * - The instance and the destination dedicated host to which to migrate the instance must belong to the same account and reside in the same region and zone. * - A pay-as-you-go instance can be migrated to a subscription dedicated host. A subscription instance can be migrated only between subscription dedicated hosts. The expiration date of the subscription instance cannot be later than that of the destination dedicated host. * - You can migrate only pay-as-you-go instances from a shared host to a dedicated host. You cannot migrate subscription instances or spot instances from a shared host to a dedicated host. * - You can redeploy an instance to a specific dedicated host cluster. * * @param request - ModifyInstanceDeploymentRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyInstanceDeploymentResponse */ async modifyInstanceDeploymentWithOptions(request: $_model.ModifyInstanceDeploymentRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyInstanceDeploymentResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.affinity)) { query["Affinity"] = request.affinity; } if (!$dara.isNull(request.dedicatedHostClusterId)) { query["DedicatedHostClusterId"] = request.dedicatedHostClusterId; } if (!$dara.isNull(request.dedicatedHostId)) { query["DedicatedHostId"] = request.dedicatedHostId; } if (!$dara.isNull(request.deploymentSetGroupNo)) { query["DeploymentSetGroupNo"] = request.deploymentSetGroupNo; } if (!$dara.isNull(request.deploymentSetId)) { query["DeploymentSetId"] = request.deploymentSetId; } if (!$dara.isNull(request.force)) { query["Force"] = request.force; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.migrationType)) { query["MigrationType"] = request.migrationType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.removeFromDeploymentSet)) { query["RemoveFromDeploymentSet"] = request.removeFromDeploymentSet; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tenancy)) { query["Tenancy"] = request.tenancy; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyInstanceDeployment", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyInstanceDeploymentResponse>(await this.callApi(params, req, runtime), new $_model.ModifyInstanceDeploymentResponse({})); } /** * Changes the deployment set of an Elastic Compute Service (ECS) instance or migrates an ECS instance to a dedicated host. You can change the instance type of an ECS instance when you migrate the instance. * * @remarks * Take note of the following items: * - The instance must be in the **Stopped** (Stopped) state. The instance is automatically restarted after it is migrated. * - The network type of the instance must be Virtual Private Cloud (VPC). * - The instance and the destination dedicated host to which to migrate the instance must belong to the same account and reside in the same region and zone. * - A pay-as-you-go instance can be migrated to a subscription dedicated host. A subscription instance can be migrated only between subscription dedicated hosts. The expiration date of the subscription instance cannot be later than that of the destination dedicated host. * - You can migrate only pay-as-you-go instances from a shared host to a dedicated host. You cannot migrate subscription instances or spot instances from a shared host to a dedicated host. * - You can redeploy an instance to a specific dedicated host cluster. * * @param request - ModifyInstanceDeploymentRequest * @returns ModifyInstanceDeploymentResponse */ async modifyInstanceDeployment(request: $_model.ModifyInstanceDeploymentRequest): Promise<$_model.ModifyInstanceDeploymentResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyInstanceDeploymentWithOptions(request, runtime); } /** * Modifies the maintenance attributes of an instance. * * @remarks * This operation is used to modify the maintenance policy of an instance. The maintenance policy consists of the following maintenance attributes: * - Maintenance window: the time period that you specify for maintenance. * - Maintenance action: the action that you specify in response to instance shutdown. * * @param request - ModifyInstanceMaintenanceAttributesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyInstanceMaintenanceAttributesResponse */ async modifyInstanceMaintenanceAttributesWithOptions(request: $_model.ModifyInstanceMaintenanceAttributesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyInstanceMaintenanceAttributesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.actionOnMaintenance)) { query["ActionOnMaintenance"] = request.actionOnMaintenance; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.maintenanceWindow)) { query["MaintenanceWindow"] = request.maintenanceWindow; } if (!$dara.isNull(request.notifyOnMaintenance)) { query["NotifyOnMaintenance"] = request.notifyOnMaintenance; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyInstanceMaintenanceAttributes", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyInstanceMaintenanceAttributesResponse>(await this.callApi(params, req, runtime), new $_model.ModifyInstanceMaintenanceAttributesResponse({})); } /** * Modifies the maintenance attributes of an instance. * * @remarks * This operation is used to modify the maintenance policy of an instance. The maintenance policy consists of the following maintenance attributes: * - Maintenance window: the time period that you specify for maintenance. * - Maintenance action: the action that you specify in response to instance shutdown. * * @param request - ModifyInstanceMaintenanceAttributesRequest * @returns ModifyInstanceMaintenanceAttributesResponse */ async modifyInstanceMaintenanceAttributes(request: $_model.ModifyInstanceMaintenanceAttributesRequest): Promise<$_model.ModifyInstanceMaintenanceAttributesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyInstanceMaintenanceAttributesWithOptions(request, runtime); } /** * Modifies the metadata access configurations of instances in a specific region, including whether to enable the metadata access channel and whether to forcefully use the security hardening mode to access instance metadata. * * @param request - ModifyInstanceMetadataOptionsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyInstanceMetadataOptionsResponse */ async modifyInstanceMetadataOptionsWithOptions(request: $_model.ModifyInstanceMetadataOptionsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyInstanceMetadataOptionsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.httpEndpoint)) { query["HttpEndpoint"] = request.httpEndpoint; } if (!$dara.isNull(request.httpPutResponseHopLimit)) { query["HttpPutResponseHopLimit"] = request.httpPutResponseHopLimit; } if (!$dara.isNull(request.httpTokens)) { query["HttpTokens"] = request.httpTokens; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.instanceMetadataTags)) { query["InstanceMetadataTags"] = request.instanceMetadataTags; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyInstanceMetadataOptions", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyInstanceMetadataOptionsResponse>(await this.callApi(params, req, runtime), new $_model.ModifyInstanceMetadataOptionsResponse({})); } /** * Modifies the metadata access configurations of instances in a specific region, including whether to enable the metadata access channel and whether to forcefully use the security hardening mode to access instance metadata. * * @param request - ModifyInstanceMetadataOptionsRequest * @returns ModifyInstanceMetadataOptionsResponse */ async modifyInstanceMetadataOptions(request: $_model.ModifyInstanceMetadataOptionsRequest): Promise<$_model.ModifyInstanceMetadataOptionsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyInstanceMetadataOptionsWithOptions(request, runtime); } /** * Modifies instance network configurations. * * @remarks * 调用该接口时,您需要注意: * - 当前接口是异步接口。调用后返回异步任务 ID。通查查询异步任务结果来判断是否执行完成。 * - 当前接口每次调用仅支持修改一个属性。如果修改多个属性,请分多次调用。 * - 修改 BandwidthWeighting,需要对应的规格支持设置该参数。您可以通过 [DescribeInstanceTypes](https://help.aliyun.com/document_detail/2679699.html) 查询当前实例规格是否支持带宽权重及支持的带宽权重值。 * * @param request - ModifyInstanceNetworkOptionsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyInstanceNetworkOptionsResponse */ async modifyInstanceNetworkOptionsWithOptions(request: $_model.ModifyInstanceNetworkOptionsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyInstanceNetworkOptionsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.bandwidthWeighting)) { query["BandwidthWeighting"] = request.bandwidthWeighting; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyInstanceNetworkOptions", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyInstanceNetworkOptionsResponse>(await this.callApi(params, req, runtime), new $_model.ModifyInstanceNetworkOptionsResponse({})); } /** * Modifies instance network configurations. * * @remarks * 调用该接口时,您需要注意: * - 当前接口是异步接口。调用后返回异步任务 ID。通查查询异步任务结果来判断是否执行完成。 * - 当前接口每次调用仅支持修改一个属性。如果修改多个属性,请分多次调用。 * - 修改 BandwidthWeighting,需要对应的规格支持设置该参数。您可以通过 [DescribeInstanceTypes](https://help.aliyun.com/document_detail/2679699.html) 查询当前实例规格是否支持带宽权重及支持的带宽权重值。 * * @param request - ModifyInstanceNetworkOptionsRequest * @returns ModifyInstanceNetworkOptionsResponse */ async modifyInstanceNetworkOptions(request: $_model.ModifyInstanceNetworkOptionsRequest): Promise<$_model.ModifyInstanceNetworkOptionsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyInstanceNetworkOptionsWithOptions(request, runtime); } /** * Modifies the bandwidth configuration of an ECS instance, allocates a public IP address, or converts the network billing method. Both upgrades and downgrades are supported. * * @remarks * - When you modify the bandwidth configuration of a subscription (PrePaid) instance, a public IP address is automatically allocated if the outbound public bandwidth (InternetMaxBandwidthOut) is upgraded from 0 Mbit/s to a non-zero value. * - When you modify the bandwidth configuration of a pay-as-you-go (PostPaid) instance, a public IP address is not automatically allocated if the outbound public bandwidth (InternetMaxBandwidthOut) is upgraded from 0 Mbit/s to a non-zero value. You need to set the `AllocatePublicIp` parameter to `true` to allocate a public IP address. * > In a single region, the total peak pay-by-bandwidth public bandwidth of a single Alibaba Cloud account is subject to a limit. For more information, see [Public bandwidth limits](~~25412#BandwidthQuota~~). * * - Fees: * * - After the bandwidth is upgraded, the payment is automatically deducted by default. Make sure that your payment method has sufficient balance. Otherwise, an abnormal order is generated, and you can only cancel the order. If your account balance is insufficient, you can set the AutoPay parameter to false. In this case, a normal unpaid order is generated. You can log on to the ECS console to pay for the order. * - After the bandwidth is downgraded, the price difference is refunded to the original payment method. Vouchers that have been used are not refundable. * * @param request - ModifyInstanceNetworkSpecRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyInstanceNetworkSpecResponse */ async modifyInstanceNetworkSpecWithOptions(request: $_model.ModifyInstanceNetworkSpecRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyInstanceNetworkSpecResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.allocatePublicIp)) { query["AllocatePublicIp"] = request.allocatePublicIp; } if (!$dara.isNull(request.autoPay)) { query["AutoPay"] = request.autoPay; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.ISP)) { query["ISP"] = request.ISP; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.internetMaxBandwidthIn)) { query["InternetMaxBandwidthIn"] = request.internetMaxBandwidthIn; } if (!$dara.isNull(request.internetMaxBandwidthOut)) { query["InternetMaxBandwidthOut"] = request.internetMaxBandwidthOut; } if (!$dara.isNull(request.networkChargeType)) { query["NetworkChargeType"] = request.networkChargeType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyInstanceNetworkSpec", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyInstanceNetworkSpecResponse>(await this.callApi(params, req, runtime), new $_model.ModifyInstanceNetworkSpecResponse({})); } /** * Modifies the bandwidth configuration of an ECS instance, allocates a public IP address, or converts the network billing method. Both upgrades and downgrades are supported. * * @remarks * - When you modify the bandwidth configuration of a subscription (PrePaid) instance, a public IP address is automatically allocated if the outbound public bandwidth (InternetMaxBandwidthOut) is upgraded from 0 Mbit/s to a non-zero value. * - When you modify the bandwidth configuration of a pay-as-you-go (PostPaid) instance, a public IP address is not automatically allocated if the outbound public bandwidth (InternetMaxBandwidthOut) is upgraded from 0 Mbit/s to a non-zero value. You need to set the `AllocatePublicIp` parameter to `true` to allocate a public IP address. * > In a single region, the total peak pay-by-bandwidth public bandwidth of a single Alibaba Cloud account is subject to a limit. For more information, see [Public bandwidth limits](~~25412#BandwidthQuota~~). * * - Fees: * * - After the bandwidth is upgraded, the payment is automatically deducted by default. Make sure that your payment method has sufficient balance. Otherwise, an abnormal order is generated, and you can only cancel the order. If your account balance is insufficient, you can set the AutoPay parameter to false. In this case, a normal unpaid order is generated. You can log on to the ECS console to pay for the order. * - After the bandwidth is downgraded, the price difference is refunded to the original payment method. Vouchers that have been used are not refundable. * * @param request - ModifyInstanceNetworkSpecRequest * @returns ModifyInstanceNetworkSpecResponse */ async modifyInstanceNetworkSpec(request: $_model.ModifyInstanceNetworkSpecRequest): Promise<$_model.ModifyInstanceNetworkSpecResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyInstanceNetworkSpecWithOptions(request, runtime); } /** * Modifies the instance type or public bandwidth of a pay-as-you-go ECS instance. * * @remarks * . * **Before you use this operation, make sure that you fully understand the billing methods and [pricing](https://www.aliyun.com/price/product#/ecs/detail) of ECS.**. * . * . * **Before you use this operation, make sure that you fully understand the billing methods and [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl) of ECS.**. * . * Before you [change the instance type of a pay-as-you-go instance](https://help.aliyun.com/document_detail/60051.html), you can call [DescribeResourcesModification](https://help.aliyun.com/document_detail/66187.html) to query the instance types to which the current instance can be changed. * **Before you begin**. * - Your account must not have overdue payments. * - Each call can modify only one configuration at a time. You can modify only the instance type or adjust only the public bandwidth in a single request. * - The instance status must be **Running** (`Running`) or **Stopped** (`Stopped`) before you can adjust the public bandwidth. The change takes effect immediately. * - The instance status must be **Stopped** (`Stopped`) before you can modify the instance type. After the modification, you must [start the instance](https://help.aliyun.com/document_detail/25441.html) for the change to take effect. * > In a single region, the total peak pay-by-bandwidth public bandwidth for a single Alibaba Cloud account is limited. For more information, see [Public bandwidth limits](~~25412#BandwidthQuota~~). * * @param request - ModifyInstanceSpecRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyInstanceSpecResponse */ async modifyInstanceSpecWithOptions(request: $_model.ModifyInstanceSpecRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyInstanceSpecResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.allowMigrateAcrossZone)) { query["AllowMigrateAcrossZone"] = request.allowMigrateAcrossZone; } if (!$dara.isNull(request.async)) { query["Async"] = request.async; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.disk)) { query["Disk"] = request.disk; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.internetMaxBandwidthIn)) { query["InternetMaxBandwidthIn"] = request.internetMaxBandwidthIn; } if (!$dara.isNull(request.internetMaxBandwidthOut)) { query["InternetMaxBandwidthOut"] = request.internetMaxBandwidthOut; } if (!$dara.isNull(request.modifyMode)) { query["ModifyMode"] = request.modifyMode; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.systemDisk)) { query["SystemDisk"] = request.systemDisk; } if (!$dara.isNull(request.temporary)) { query["Temporary"] = request.temporary; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyInstanceSpec", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyInstanceSpecResponse>(await this.callApi(params, req, runtime), new $_model.ModifyInstanceSpecResponse({})); } /** * Modifies the instance type or public bandwidth of a pay-as-you-go ECS instance. * * @remarks * . * **Before you use this operation, make sure that you fully understand the billing methods and [pricing](https://www.aliyun.com/price/product#/ecs/detail) of ECS.**. * . * . * **Before you use this operation, make sure that you fully understand the billing methods and [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl) of ECS.**. * . * Before you [change the instance type of a pay-as-you-go instance](https://help.aliyun.com/document_detail/60051.html), you can call [DescribeResourcesModification](https://help.aliyun.com/document_detail/66187.html) to query the instance types to which the current instance can be changed. * **Before you begin**. * - Your account must not have overdue payments. * - Each call can modify only one configuration at a time. You can modify only the instance type or adjust only the public bandwidth in a single request. * - The instance status must be **Running** (`Running`) or **Stopped** (`Stopped`) before you can adjust the public bandwidth. The change takes effect immediately. * - The instance status must be **Stopped** (`Stopped`) before you can modify the instance type. After the modification, you must [start the instance](https://help.aliyun.com/document_detail/25441.html) for the change to take effect. * > In a single region, the total peak pay-by-bandwidth public bandwidth for a single Alibaba Cloud account is limited. For more information, see [Public bandwidth limits](~~25412#BandwidthQuota~~). * * @param request - ModifyInstanceSpecRequest * @returns ModifyInstanceSpecResponse */ async modifyInstanceSpec(request: $_model.ModifyInstanceSpecRequest): Promise<$_model.ModifyInstanceSpecResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyInstanceSpecWithOptions(request, runtime); } /** * Changes the Virtual Network Computing (VNC) password of an Elastic Compute Service (ECS) instance. * * @remarks * - The VNC password must be six characters in length and can contain uppercase letters, lowercase letters, and digits. * - After you modify the VNC password of an ECS instance, take note of the following items: * - If the instance is I/O optimized, the new password takes effect immediately without the need to restart the instance. * - If the instance is not I/O optimized, you must [restart the instance](https://help.aliyun.com/document_detail/25440.html) in the ECS console or by calling the [RebootInstance](https://help.aliyun.com/document_detail/25502.html) operation for the new password to take effect. * * @param request - ModifyInstanceVncPasswdRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyInstanceVncPasswdResponse */ async modifyInstanceVncPasswdWithOptions(request: $_model.ModifyInstanceVncPasswdRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyInstanceVncPasswdResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.vncPassword)) { query["VncPassword"] = request.vncPassword; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyInstanceVncPasswd", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyInstanceVncPasswdResponse>(await this.callApi(params, req, runtime), new $_model.ModifyInstanceVncPasswdResponse({})); } /** * Changes the Virtual Network Computing (VNC) password of an Elastic Compute Service (ECS) instance. * * @remarks * - The VNC password must be six characters in length and can contain uppercase letters, lowercase letters, and digits. * - After you modify the VNC password of an ECS instance, take note of the following items: * - If the instance is I/O optimized, the new password takes effect immediately without the need to restart the instance. * - If the instance is not I/O optimized, you must [restart the instance](https://help.aliyun.com/document_detail/25440.html) in the ECS console or by calling the [RebootInstance](https://help.aliyun.com/document_detail/25502.html) operation for the new password to take effect. * * @param request - ModifyInstanceVncPasswdRequest * @returns ModifyInstanceVncPasswdResponse */ async modifyInstanceVncPasswd(request: $_model.ModifyInstanceVncPasswdRequest): Promise<$_model.ModifyInstanceVncPasswdResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyInstanceVncPasswdWithOptions(request, runtime); } /** * Changes the virtual private cloud (VPC), private IP address, security groups, or vSwitch of an Elastic Compute Service (ECS) instance located in a VPC. * * @remarks * The ECS instance that you want to manage must be in the **Stopped** (`Stopped`) state. * - When you call this operation to change the private IP address or vSwitch of an ECS instance, take note of the following items: * - If the instance is a new instance, you must restart the instance before you call this operation. * - After the private IP address or vSwitch of the instance is changed, you must restart the instance before you can recall this operation. * - When you call this operation to change the VPC of an ECS instance, take note of the following items: * - **ECS instance:** * - The instance cannot be in the Locked, To Be Released, Expired, To Be Recycled, Expired and Being Recycled, or Overdue and Being Recycled state. For more information, see [Overview of instances](https://help.aliyun.com/document_detail/25380.html). * - The instance cannot be associated with Server Load Balancer (SLB) instances. * - The instance cannot be used in other Alibaba Cloud services. For example, the instance cannot be in the process of being migrated or having its VPC changed, or the databases deployed on the instance cannot be managed by Data Transmission Service (DTS). * - **Network:** * - The cut-through mode or the multi-elastic IP address (EIP)-to-elastic network interface (ENI) mode cannot be enabled for the ECS instance. * - The ECS instance cannot be associated with a high-availability virtual IP address (HAVIP). * - The vSwitch of the ECS instance cannot be associated with a custom route table. * - Global Accelerator (GA) cannot be activated for the ECS instance. * - Secondary ENIs cannot be attached to the ECS instance. * - The ECS instance cannot be assigned an IPv6 address. * - The primary ENI of the ECS instance cannot be associated with multiple IP addresses. * - The vSwitch must belong to the new VPC. * - The original and new vSwitches must reside in the same zone. * - If you assign a private IP address to the primary ENI of the ECS instance, the private IP address must be an idle IP address within the CIDR block of the new vSwitch. If you do not assign a private IP address to the primary ENI of the ECS instance, a private IP address is randomly assigned to the ENI. Make sure that sufficient IP addresses are available in the CIDR block of the new vSwitch. * - If you use a VPC that is shared by another Alibaba Cloud account with your account and want to change the security groups of the ECS instance, specify the security groups that you created in the VPC, instead of the security group created by the VPC owner, as the new security groups. * * @param request - ModifyInstanceVpcAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyInstanceVpcAttributeResponse */ async modifyInstanceVpcAttributeWithOptions(request: $_model.ModifyInstanceVpcAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyInstanceVpcAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.privateIpAddress)) { query["PrivateIpAddress"] = request.privateIpAddress; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.vSwitchId)) { query["VSwitchId"] = request.vSwitchId; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyInstanceVpcAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyInstanceVpcAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyInstanceVpcAttributeResponse({})); } /** * Changes the virtual private cloud (VPC), private IP address, security groups, or vSwitch of an Elastic Compute Service (ECS) instance located in a VPC. * * @remarks * The ECS instance that you want to manage must be in the **Stopped** (`Stopped`) state. * - When you call this operation to change the private IP address or vSwitch of an ECS instance, take note of the following items: * - If the instance is a new instance, you must restart the instance before you call this operation. * - After the private IP address or vSwitch of the instance is changed, you must restart the instance before you can recall this operation. * - When you call this operation to change the VPC of an ECS instance, take note of the following items: * - **ECS instance:** * - The instance cannot be in the Locked, To Be Released, Expired, To Be Recycled, Expired and Being Recycled, or Overdue and Being Recycled state. For more information, see [Overview of instances](https://help.aliyun.com/document_detail/25380.html). * - The instance cannot be associated with Server Load Balancer (SLB) instances. * - The instance cannot be used in other Alibaba Cloud services. For example, the instance cannot be in the process of being migrated or having its VPC changed, or the databases deployed on the instance cannot be managed by Data Transmission Service (DTS). * - **Network:** * - The cut-through mode or the multi-elastic IP address (EIP)-to-elastic network interface (ENI) mode cannot be enabled for the ECS instance. * - The ECS instance cannot be associated with a high-availability virtual IP address (HAVIP). * - The vSwitch of the ECS instance cannot be associated with a custom route table. * - Global Accelerator (GA) cannot be activated for the ECS instance. * - Secondary ENIs cannot be attached to the ECS instance. * - The ECS instance cannot be assigned an IPv6 address. * - The primary ENI of the ECS instance cannot be associated with multiple IP addresses. * - The vSwitch must belong to the new VPC. * - The original and new vSwitches must reside in the same zone. * - If you assign a private IP address to the primary ENI of the ECS instance, the private IP address must be an idle IP address within the CIDR block of the new vSwitch. If you do not assign a private IP address to the primary ENI of the ECS instance, a private IP address is randomly assigned to the ENI. Make sure that sufficient IP addresses are available in the CIDR block of the new vSwitch. * - If you use a VPC that is shared by another Alibaba Cloud account with your account and want to change the security groups of the ECS instance, specify the security groups that you created in the VPC, instead of the security group created by the VPC owner, as the new security groups. * * @param request - ModifyInstanceVpcAttributeRequest * @returns ModifyInstanceVpcAttributeResponse */ async modifyInstanceVpcAttribute(request: $_model.ModifyInstanceVpcAttributeRequest): Promise<$_model.ModifyInstanceVpcAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyInstanceVpcAttributeWithOptions(request, runtime); } /** * Modifies the execution information of a Cloud Assistant scheduled command task, including modifying the content and execution frequency of the command and adding Elastic Compute Service (ECS) instances or Alibaba Cloud managed instances to the command task. * * @remarks * - Supports modifying tasks with the following execution modes (refer to the `RepeatMode` value returned by [DescribeInvocations](https://help.aliyun.com/document_detail/2679916.html)): * - Period: Execute periodically. * - NextRebootOnly: Automatically execute the command the next time the instance starts. * - EveryReboot: Automatically execute the command every time the instance starts. * - Supports modifying tasks in the following statuses (refer to the `InvocationStatus` value returned by [DescribeInvocations](https://help.aliyun.com/document_detail/2679916.html)): * - Pending: The system is validating or sending the command. If at least one instance has a command execution status of Pending, the overall execution status is Pending. * - Running: The command is running on an instance. If at least one instance has a command execution status of Running, the overall execution status is Running. * - Scheduled: The scheduled command has been sent and is waiting to run. If at least one instance has a command execution status of Scheduled, the overall execution status is Scheduled. * - Stopping: The task is being stopped. If at least one instance has a command execution status of Stopping, the overall execution status is Stopping. * - Before modifying the execution information of a scheduled task (including command content, Custom Parameters, and execution frequency), the Cloud Assistant Agent version on the involved ECS instances or managed instances must be higher than the following versions: * - Linux: 2.2.3.541 * - Windows: 2.1.3.541 * - If the response returns the error code `InvalidOperation.CloudAssistantVersionUnsupported`, update the Cloud Assistant Agent to the latest version. * - When you execute a Cloud Assistant public command, you cannot modify the `CommandContent`. * - If you modify the `CommandContent` and create a task by invoking [InvokeCommand](https://help.aliyun.com/document_detail/64841.html) or [RunCommand](https://help.aliyun.com/document_detail/141751.html) with `KeepCommand` set to `true`, a new command will be created and retained permanently, consuming your Cloud Assistant command quota. In each Region, you can retain between 500 and 50,000 Cloud Assistant commands. You can request a quota increase. For more information about how to query and increase your quota, see [Quota Management](https://help.aliyun.com/document_detail/184116.html). * * @param tmpReq - ModifyInvocationAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyInvocationAttributeResponse */ async modifyInvocationAttributeWithOptions(tmpReq: $_model.ModifyInvocationAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyInvocationAttributeResponse> { tmpReq.validate(); let request = new $_model.ModifyInvocationAttributeShrinkRequest({ }); OpenApiUtil.convert(tmpReq, request); if (!$dara.isNull(tmpReq.parameters)) { request.parametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.parameters, "Parameters", "json"); } let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.commandContent)) { query["CommandContent"] = request.commandContent; } if (!$dara.isNull(request.contentEncoding)) { query["ContentEncoding"] = request.contentEncoding; } if (!$dara.isNull(request.enableParameter)) { query["EnableParameter"] = request.enableParameter; } if (!$dara.isNull(request.frequency)) { query["Frequency"] = request.frequency; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.invokeId)) { query["InvokeId"] = request.invokeId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.parametersShrink)) { query["Parameters"] = request.parametersShrink; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyInvocationAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyInvocationAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyInvocationAttributeResponse({})); } /** * Modifies the execution information of a Cloud Assistant scheduled command task, including modifying the content and execution frequency of the command and adding Elastic Compute Service (ECS) instances or Alibaba Cloud managed instances to the command task. * * @remarks * - Supports modifying tasks with the following execution modes (refer to the `RepeatMode` value returned by [DescribeInvocations](https://help.aliyun.com/document_detail/2679916.html)): * - Period: Execute periodically. * - NextRebootOnly: Automatically execute the command the next time the instance starts. * - EveryReboot: Automatically execute the command every time the instance starts. * - Supports modifying tasks in the following statuses (refer to the `InvocationStatus` value returned by [DescribeInvocations](https://help.aliyun.com/document_detail/2679916.html)): * - Pending: The system is validating or sending the command. If at least one instance has a command execution status of Pending, the overall execution status is Pending. * - Running: The command is running on an instance. If at least one instance has a command execution status of Running, the overall execution status is Running. * - Scheduled: The scheduled command has been sent and is waiting to run. If at least one instance has a command execution status of Scheduled, the overall execution status is Scheduled. * - Stopping: The task is being stopped. If at least one instance has a command execution status of Stopping, the overall execution status is Stopping. * - Before modifying the execution information of a scheduled task (including command content, Custom Parameters, and execution frequency), the Cloud Assistant Agent version on the involved ECS instances or managed instances must be higher than the following versions: * - Linux: 2.2.3.541 * - Windows: 2.1.3.541 * - If the response returns the error code `InvalidOperation.CloudAssistantVersionUnsupported`, update the Cloud Assistant Agent to the latest version. * - When you execute a Cloud Assistant public command, you cannot modify the `CommandContent`. * - If you modify the `CommandContent` and create a task by invoking [InvokeCommand](https://help.aliyun.com/document_detail/64841.html) or [RunCommand](https://help.aliyun.com/document_detail/141751.html) with `KeepCommand` set to `true`, a new command will be created and retained permanently, consuming your Cloud Assistant command quota. In each Region, you can retain between 500 and 50,000 Cloud Assistant commands. You can request a quota increase. For more information about how to query and increase your quota, see [Quota Management](https://help.aliyun.com/document_detail/184116.html). * * @param request - ModifyInvocationAttributeRequest * @returns ModifyInvocationAttributeResponse */ async modifyInvocationAttribute(request: $_model.ModifyInvocationAttributeRequest): Promise<$_model.ModifyInvocationAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyInvocationAttributeWithOptions(request, runtime); } /** * Calls the ModifyLaunchTemplateDefaultVersion operation to switch the default version of a launch template by specifying the DefaultVersionNumber parameter. If you do not specify a template version number when you create an instance by calling the RunInstances operation, the default version is used. * * @param request - ModifyLaunchTemplateDefaultVersionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyLaunchTemplateDefaultVersionResponse */ async modifyLaunchTemplateDefaultVersionWithOptions(request: $_model.ModifyLaunchTemplateDefaultVersionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyLaunchTemplateDefaultVersionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.defaultVersionNumber)) { query["DefaultVersionNumber"] = request.defaultVersionNumber; } if (!$dara.isNull(request.launchTemplateId)) { query["LaunchTemplateId"] = request.launchTemplateId; } if (!$dara.isNull(request.launchTemplateName)) { query["LaunchTemplateName"] = request.launchTemplateName; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyLaunchTemplateDefaultVersion", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyLaunchTemplateDefaultVersionResponse>(await this.callApi(params, req, runtime), new $_model.ModifyLaunchTemplateDefaultVersionResponse({})); } /** * Calls the ModifyLaunchTemplateDefaultVersion operation to switch the default version of a launch template by specifying the DefaultVersionNumber parameter. If you do not specify a template version number when you create an instance by calling the RunInstances operation, the default version is used. * * @param request - ModifyLaunchTemplateDefaultVersionRequest * @returns ModifyLaunchTemplateDefaultVersionResponse */ async modifyLaunchTemplateDefaultVersion(request: $_model.ModifyLaunchTemplateDefaultVersionRequest): Promise<$_model.ModifyLaunchTemplateDefaultVersionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyLaunchTemplateDefaultVersionWithOptions(request, runtime); } /** * Modifies the information of a managed instance. * * @remarks * ## [](#)Usage notes * The ModifyManagedInstance operation can be called to change only the name of a single managed instance. * * @param request - ModifyManagedInstanceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyManagedInstanceResponse */ async modifyManagedInstanceWithOptions(request: $_model.ModifyManagedInstanceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyManagedInstanceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.instanceName)) { query["InstanceName"] = request.instanceName; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyManagedInstance", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyManagedInstanceResponse>(await this.callApi(params, req, runtime), new $_model.ModifyManagedInstanceResponse({})); } /** * Modifies the information of a managed instance. * * @remarks * ## [](#)Usage notes * The ModifyManagedInstance operation can be called to change only the name of a single managed instance. * * @param request - ModifyManagedInstanceRequest * @returns ModifyManagedInstanceResponse */ async modifyManagedInstance(request: $_model.ModifyManagedInstanceRequest): Promise<$_model.ModifyManagedInstanceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyManagedInstanceWithOptions(request, runtime); } /** * Modify attributes of an elastic network interface (ENI), such as its number of queues, security group, queue depth, communication mode, and whether to retain the interface upon instance release. * * @param request - ModifyNetworkInterfaceAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyNetworkInterfaceAttributeResponse */ async modifyNetworkInterfaceAttributeWithOptions(request: $_model.ModifyNetworkInterfaceAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyNetworkInterfaceAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.connectionTrackingConfiguration)) { query["ConnectionTrackingConfiguration"] = request.connectionTrackingConfiguration; } if (!$dara.isNull(request.deleteOnRelease)) { query["DeleteOnRelease"] = request.deleteOnRelease; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.enhancedNetwork)) { query["EnhancedNetwork"] = request.enhancedNetwork; } if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.networkInterfaceName)) { query["NetworkInterfaceName"] = request.networkInterfaceName; } if (!$dara.isNull(request.networkInterfaceTrafficConfig)) { query["NetworkInterfaceTrafficConfig"] = request.networkInterfaceTrafficConfig; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.queueNumber)) { query["QueueNumber"] = request.queueNumber; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.rxQueueSize)) { query["RxQueueSize"] = request.rxQueueSize; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.sourceDestCheck)) { query["SourceDestCheck"] = request.sourceDestCheck; } if (!$dara.isNull(request.txQueueSize)) { query["TxQueueSize"] = request.txQueueSize; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyNetworkInterfaceAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyNetworkInterfaceAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyNetworkInterfaceAttributeResponse({})); } /** * Modify attributes of an elastic network interface (ENI), such as its number of queues, security group, queue depth, communication mode, and whether to retain the interface upon instance release. * * @param request - ModifyNetworkInterfaceAttributeRequest * @returns ModifyNetworkInterfaceAttributeResponse */ async modifyNetworkInterfaceAttribute(request: $_model.ModifyNetworkInterfaceAttributeRequest): Promise<$_model.ModifyNetworkInterfaceAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyNetworkInterfaceAttributeWithOptions(request, runtime); } /** * ModifyPhysicalConnectionAttribute * * @deprecated OpenAPI ModifyPhysicalConnectionAttribute is deprecated, please use Vpc::2016-04-28::ModifyPhysicalConnectionAttribute instead. * * @param request - ModifyPhysicalConnectionAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyPhysicalConnectionAttributeResponse */ async modifyPhysicalConnectionAttributeWithOptions(request: $_model.ModifyPhysicalConnectionAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyPhysicalConnectionAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.circuitCode)) { query["CircuitCode"] = request.circuitCode; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.lineOperator)) { query["LineOperator"] = request.lineOperator; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.peerLocation)) { query["PeerLocation"] = request.peerLocation; } if (!$dara.isNull(request.physicalConnectionId)) { query["PhysicalConnectionId"] = request.physicalConnectionId; } if (!$dara.isNull(request.portType)) { query["PortType"] = request.portType; } if (!$dara.isNull(request.redundantPhysicalConnectionId)) { query["RedundantPhysicalConnectionId"] = request.redundantPhysicalConnectionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } if (!$dara.isNull(request.bandwidth)) { query["bandwidth"] = request.bandwidth; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyPhysicalConnectionAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyPhysicalConnectionAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyPhysicalConnectionAttributeResponse({})); } /** * ModifyPhysicalConnectionAttribute * * @deprecated OpenAPI ModifyPhysicalConnectionAttribute is deprecated, please use Vpc::2016-04-28::ModifyPhysicalConnectionAttribute instead. * * @param request - ModifyPhysicalConnectionAttributeRequest * @returns ModifyPhysicalConnectionAttributeResponse */ // Deprecated async modifyPhysicalConnectionAttribute(request: $_model.ModifyPhysicalConnectionAttributeRequest): Promise<$_model.ModifyPhysicalConnectionAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyPhysicalConnectionAttributeWithOptions(request, runtime); } /** * Updates an O&M window. * * @remarks * Modifies the attributes of an O&M window. When the TargetResource parameter of an O&M window is set to associate ECS instances and underlying hardware risks are detected that require scheduled O&M to mitigate, the execution time of the scheduled O&M is determined based on the time range specified by the TimePeriod parameter of the O&M window. When the execution time of an O&M event is reached, the platform automatically performs the corresponding O&M operation based on the type of the O&M event. * * @param tmpReq - ModifyPlanMaintenanceWindowRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyPlanMaintenanceWindowResponse */ async modifyPlanMaintenanceWindowWithOptions(tmpReq: $_model.ModifyPlanMaintenanceWindowRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyPlanMaintenanceWindowResponse> { tmpReq.validate(); let request = new $_model.ModifyPlanMaintenanceWindowShrinkRequest({ }); OpenApiUtil.convert(tmpReq, request); if (!$dara.isNull(tmpReq.targetResource)) { request.targetResourceShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.targetResource, "TargetResource", "json"); } if (!$dara.isNull(tmpReq.timePeriod)) { request.timePeriodShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.timePeriod, "TimePeriod", "json"); } let query = { }; if (!$dara.isNull(request.enable)) { query["Enable"] = request.enable; } if (!$dara.isNull(request.minMaintenanceInterval)) { query["MinMaintenanceInterval"] = request.minMaintenanceInterval; } if (!$dara.isNull(request.planWindowId)) { query["PlanWindowId"] = request.planWindowId; } if (!$dara.isNull(request.planWindowName)) { query["PlanWindowName"] = request.planWindowName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.supportMaintenanceAction)) { query["SupportMaintenanceAction"] = request.supportMaintenanceAction; } if (!$dara.isNull(request.targetResourceShrink)) { query["TargetResource"] = request.targetResourceShrink; } if (!$dara.isNull(request.timePeriodShrink)) { query["TimePeriod"] = request.timePeriodShrink; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyPlanMaintenanceWindow", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyPlanMaintenanceWindowResponse>(await this.callApi(params, req, runtime), new $_model.ModifyPlanMaintenanceWindowResponse({})); } /** * Updates an O&M window. * * @remarks * Modifies the attributes of an O&M window. When the TargetResource parameter of an O&M window is set to associate ECS instances and underlying hardware risks are detected that require scheduled O&M to mitigate, the execution time of the scheduled O&M is determined based on the time range specified by the TimePeriod parameter of the O&M window. When the execution time of an O&M event is reached, the platform automatically performs the corresponding O&M operation based on the type of the O&M event. * * @param request - ModifyPlanMaintenanceWindowRequest * @returns ModifyPlanMaintenanceWindowResponse */ async modifyPlanMaintenanceWindow(request: $_model.ModifyPlanMaintenanceWindowRequest): Promise<$_model.ModifyPlanMaintenanceWindowResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyPlanMaintenanceWindowWithOptions(request, runtime); } /** * Modifies the name and entries of a port list. You can call this operation to add, modify, and remove entries for a port list. * * @param request - ModifyPortRangeListRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyPortRangeListResponse */ async modifyPortRangeListWithOptions(request: $_model.ModifyPortRangeListRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyPortRangeListResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.addEntry)) { query["AddEntry"] = request.addEntry; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.portRangeListId)) { query["PortRangeListId"] = request.portRangeListId; } if (!$dara.isNull(request.portRangeListName)) { query["PortRangeListName"] = request.portRangeListName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.removeEntry)) { query["RemoveEntry"] = request.removeEntry; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyPortRangeList", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyPortRangeListResponse>(await this.callApi(params, req, runtime), new $_model.ModifyPortRangeListResponse({})); } /** * Modifies the name and entries of a port list. You can call this operation to add, modify, and remove entries for a port list. * * @param request - ModifyPortRangeListRequest * @returns ModifyPortRangeListResponse */ async modifyPortRangeList(request: $_model.ModifyPortRangeListRequest): Promise<$_model.ModifyPortRangeListResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyPortRangeListWithOptions(request, runtime); } /** * Modifies the name, description, or entries of a prefix list. You can add, modify, and delete entries in the prefix list. * * @remarks * ## 接口说明 * - 指定的 CIDR 地址块应当为标准形式。例如,10.0.0.0/8 是正确形式的 CIDR 地址块,而 10.0.0.1/8 是错误形式。更多信息,请参见[什么是 CIDR](~~40637#section-jua-0tj-q5m~~)。 * - 新增或删除条目时,不能指定重复的 CIDR 地址块。例如: * - 对于 IPv4 CIDR 地址块:不能同时指定两个 CIDR 地址块均为 10.0.0.0/8 的条目;不能同时指定两个 CIDR 地址块分别为 10.0.0.1/32 和 10.0.0.1 的条目,这两个地址块重复。 * - 对于 IPv6 CIDR 地址块:不能同时指定两个条目的 CIDR 地址块分别为 2001:fd01:0:0:0:0:0:0/32 和 2001:fd01::/32,这两个地址块重复。 * - 新增条目的 CIDR 地址块不能与删除条目的 CIDR 地址块重复。例如,在您新增 CIDR 地址块为 10.0.0.0/8 的条目时,不能在待删除的条目中包含 CIDR 地址块 10.0.0.0/8。 * - 若您需要修改条目的描述,需要指定条目的 CIDR 地址块(`AddEntry.N.Cidr`)和新的描述信息(`AddEntry.N.Description`)。 * * @param request - ModifyPrefixListRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyPrefixListResponse */ async modifyPrefixListWithOptions(request: $_model.ModifyPrefixListRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyPrefixListResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.addEntry)) { query["AddEntry"] = request.addEntry; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.prefixListId)) { query["PrefixListId"] = request.prefixListId; } if (!$dara.isNull(request.prefixListName)) { query["PrefixListName"] = request.prefixListName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.removeEntry)) { query["RemoveEntry"] = request.removeEntry; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyPrefixList", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyPrefixListResponse>(await this.callApi(params, req, runtime), new $_model.ModifyPrefixListResponse({})); } /** * Modifies the name, description, or entries of a prefix list. You can add, modify, and delete entries in the prefix list. * * @remarks * ## 接口说明 * - 指定的 CIDR 地址块应当为标准形式。例如,10.0.0.0/8 是正确形式的 CIDR 地址块,而 10.0.0.1/8 是错误形式。更多信息,请参见[什么是 CIDR](~~40637#section-jua-0tj-q5m~~)。 * - 新增或删除条目时,不能指定重复的 CIDR 地址块。例如: * - 对于 IPv4 CIDR 地址块:不能同时指定两个 CIDR 地址块均为 10.0.0.0/8 的条目;不能同时指定两个 CIDR 地址块分别为 10.0.0.1/32 和 10.0.0.1 的条目,这两个地址块重复。 * - 对于 IPv6 CIDR 地址块:不能同时指定两个条目的 CIDR 地址块分别为 2001:fd01:0:0:0:0:0:0/32 和 2001:fd01::/32,这两个地址块重复。 * - 新增条目的 CIDR 地址块不能与删除条目的 CIDR 地址块重复。例如,在您新增 CIDR 地址块为 10.0.0.0/8 的条目时,不能在待删除的条目中包含 CIDR 地址块 10.0.0.0/8。 * - 若您需要修改条目的描述,需要指定条目的 CIDR 地址块(`AddEntry.N.Cidr`)和新的描述信息(`AddEntry.N.Description`)。 * * @param request - ModifyPrefixListRequest * @returns ModifyPrefixListResponse */ async modifyPrefixList(request: $_model.ModifyPrefixListRequest): Promise<$_model.ModifyPrefixListResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyPrefixListWithOptions(request, runtime); } /** * Modifies the instance type of a subscription ECS instance. You can upgrade or downgrade the instance type. The new instance type takes effect for the entire lifecycle of the instance. * * @remarks * * **Before you call this operation, make sure that you fully understand the billing methods, [pricing](https://www.aliyun.com/price/product#/ecs/detail), and [downgrade refund rules](https://help.aliyun.com/document_detail/116043.html) of ECS.** * * **Before you call this operation, make sure that you fully understand the billing methods, [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl), and [downgrade refund rules](https://help.aliyun.com/document_detail/476339.html) of ECS.** * This operation is asynchronous. The configuration change takes effect after approximately 5 to 10 seconds. Before you upgrade or downgrade ECS instance type of a subscription ECS instance, you can call [DescribeResourcesModification](https://help.aliyun.com/document_detail/2679954.html) to query ECS instance types to which the current instance can be changed. * **Precautions** * - If the NVMe property of the source and target instance types are different (the `NvmeSupport` field returned by [DescribeInstanceTypes](https://help.aliyun.com/document_detail/2679699.html)) and the operating system is Windows (the `OSType` field returned by [DescribeInstances](https://help.aliyun.com/document_detail/2679689.html)), complete the [preventive measures](~~2978777#7de04a1c9fo50~~) before you perform the Upgrade/Downgrade. * - Expired instances cannot be changed to a different instance type. Complete the renewal and try again. * - Downgrade the instance type: * - The instance must be in the **Stopped** (`Stopped`) state. * - The price difference between the original and new instance types is refunded to your original billing method. Used vouchers are not refundable. The payer receives the refund. * - The new instance type takes effect only after you [start the instance](https://help.aliyun.com/document_detail/25441.html) after the Upgrade/Downgrade. * - Upgrade the instance type: * - The instance must be in the **Stopped** (`Stopped`) or **Running** (`Running`) state. * - The new instance type takes effect only after you [start the instance](https://help.aliyun.com/document_detail/25441.html) or [restart the instance](https://help.aliyun.com/document_detail/25440.html). * * @param request - ModifyPrepayInstanceSpecRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyPrepayInstanceSpecResponse */ async modifyPrepayInstanceSpecWithOptions(request: $_model.ModifyPrepayInstanceSpecRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyPrepayInstanceSpecResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoPay)) { query["AutoPay"] = request.autoPay; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.disk)) { query["Disk"] = request.disk; } if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.migrateAcrossZone)) { query["MigrateAcrossZone"] = request.migrateAcrossZone; } if (!$dara.isNull(request.modifyMode)) { query["ModifyMode"] = request.modifyMode; } if (!$dara.isNull(request.operatorType)) { query["OperatorType"] = request.operatorType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.rebootTime)) { query["RebootTime"] = request.rebootTime; } if (!$dara.isNull(request.rebootWhenFinished)) { query["RebootWhenFinished"] = request.rebootWhenFinished; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.systemDisk)) { query["SystemDisk"] = request.systemDisk; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyPrepayInstanceSpec", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyPrepayInstanceSpecResponse>(await this.callApi(params, req, runtime), new $_model.ModifyPrepayInstanceSpecResponse({})); } /** * Modifies the instance type of a subscription ECS instance. You can upgrade or downgrade the instance type. The new instance type takes effect for the entire lifecycle of the instance. * * @remarks * * **Before you call this operation, make sure that you fully understand the billing methods, [pricing](https://www.aliyun.com/price/product#/ecs/detail), and [downgrade refund rules](https://help.aliyun.com/document_detail/116043.html) of ECS.** * * **Before you call this operation, make sure that you fully understand the billing methods, [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl), and [downgrade refund rules](https://help.aliyun.com/document_detail/476339.html) of ECS.** * This operation is asynchronous. The configuration change takes effect after approximately 5 to 10 seconds. Before you upgrade or downgrade ECS instance type of a subscription ECS instance, you can call [DescribeResourcesModification](https://help.aliyun.com/document_detail/2679954.html) to query ECS instance types to which the current instance can be changed. * **Precautions** * - If the NVMe property of the source and target instance types are different (the `NvmeSupport` field returned by [DescribeInstanceTypes](https://help.aliyun.com/document_detail/2679699.html)) and the operating system is Windows (the `OSType` field returned by [DescribeInstances](https://help.aliyun.com/document_detail/2679689.html)), complete the [preventive measures](~~2978777#7de04a1c9fo50~~) before you perform the Upgrade/Downgrade. * - Expired instances cannot be changed to a different instance type. Complete the renewal and try again. * - Downgrade the instance type: * - The instance must be in the **Stopped** (`Stopped`) state. * - The price difference between the original and new instance types is refunded to your original billing method. Used vouchers are not refundable. The payer receives the refund. * - The new instance type takes effect only after you [start the instance](https://help.aliyun.com/document_detail/25441.html) after the Upgrade/Downgrade. * - Upgrade the instance type: * - The instance must be in the **Stopped** (`Stopped`) or **Running** (`Running`) state. * - The new instance type takes effect only after you [start the instance](https://help.aliyun.com/document_detail/25441.html) or [restart the instance](https://help.aliyun.com/document_detail/25440.html). * * @param request - ModifyPrepayInstanceSpecRequest * @returns ModifyPrepayInstanceSpecResponse */ async modifyPrepayInstanceSpec(request: $_model.ModifyPrepayInstanceSpecRequest): Promise<$_model.ModifyPrepayInstanceSpecResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyPrepayInstanceSpecWithOptions(request, runtime); } /** * Modifies the attributes of a reserved instance, such as the name and description of the instance. * * @param request - ModifyReservedInstanceAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyReservedInstanceAttributeResponse */ async modifyReservedInstanceAttributeWithOptions(request: $_model.ModifyReservedInstanceAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyReservedInstanceAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.reservedInstanceId)) { query["ReservedInstanceId"] = request.reservedInstanceId; } if (!$dara.isNull(request.reservedInstanceName)) { query["ReservedInstanceName"] = request.reservedInstanceName; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyReservedInstanceAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyReservedInstanceAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyReservedInstanceAttributeResponse({})); } /** * Modifies the attributes of a reserved instance, such as the name and description of the instance. * * @param request - ModifyReservedInstanceAttributeRequest * @returns ModifyReservedInstanceAttributeResponse */ async modifyReservedInstanceAttribute(request: $_model.ModifyReservedInstanceAttributeRequest): Promise<$_model.ModifyReservedInstanceAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyReservedInstanceAttributeWithOptions(request, runtime); } /** * Modifies the auto-renewal attributes of reserved instances. You can cancel or disable the auto-renewal feature for reserved instances. * * @param request - ModifyReservedInstanceAutoRenewAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyReservedInstanceAutoRenewAttributeResponse */ async modifyReservedInstanceAutoRenewAttributeWithOptions(request: $_model.ModifyReservedInstanceAutoRenewAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyReservedInstanceAutoRenewAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.renewalStatus)) { query["RenewalStatus"] = request.renewalStatus; } if (!$dara.isNull(request.reservedInstanceId)) { query["ReservedInstanceId"] = request.reservedInstanceId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyReservedInstanceAutoRenewAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyReservedInstanceAutoRenewAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyReservedInstanceAutoRenewAttributeResponse({})); } /** * Modifies the auto-renewal attributes of reserved instances. You can cancel or disable the auto-renewal feature for reserved instances. * * @param request - ModifyReservedInstanceAutoRenewAttributeRequest * @returns ModifyReservedInstanceAutoRenewAttributeResponse */ async modifyReservedInstanceAutoRenewAttribute(request: $_model.ModifyReservedInstanceAutoRenewAttributeRequest): Promise<$_model.ModifyReservedInstanceAutoRenewAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyReservedInstanceAutoRenewAttributeWithOptions(request, runtime); } /** * Modifies the configurations of a reserved instance, such as the instance type, quantity, and zone, to split, merge, or change the scope of the reserved instance. * * @remarks * This operation is an asynchronous operation. After you call this operation to modify a reserved instance, the operation starts the modification process and returns the ID of the resulting new reserved instance. The original reserved instance enters the `Updating` state and then the `Inactive` state. At the same time, the resulting new reserved instance is generated and enters the Creating state and then the Active state. You can call the [DescribeReservedInstances](https://help.aliyun.com/document_detail/2679781.html) operation to query the states of the reserved instance. * - You can modify the configurations of a reserved instance only if the reserved instance is in the **Active** state. * - Make sure that the [computing power](~~140660#2742f3844abzz~~) of the reserved instance remains unchanged before and after the modification. Otherwise, the modification fails. * - You cannot split, merge, or change the scope of a reserved instance at the same time. * For more information, see [Split, merge, or modify reserved instances](https://help.aliyun.com/document_detail/100375.html). * ## [](#)Sample requests * - **Sample request to split a reserved instance**: Split a regional reserved instance that is scoped to the China (Hangzhou) region and can match two pay-as-you-go instances of the ecs.g5.xlarge instance type into two regional reserved instances that are scoped to the China (Hangzhou) region and each can match one pay-as-you-go instance of the ecs.g5.large instance type: * * ``` * "RegionId":"cn-hangzhou", //The ID of the region. * "ReservedInstanceId":["ecsri-bp1hd03e9uv19e75****"], //The ID of the reserved instance that you want to split. * "Configuration":[ * { * "ReservedInstanceName":"testReservedInstanceName1", //The name of the new reserved instance. * "InstanceType":"ecs.g5.large", //The instance type that the new reserved instance can match. * "Scope":"Region", //The scope level of the new reserved instance, which must be the same as the scope level of the original reserved instance. * "InstanceAmount":1 //The number of pay-as-you-go instances of the specified instance type that each new reserved instance can match. * }, * { * "ReservedInstanceName":"testReservedInstanceName2", * "InstanceType":"ecs.g5.large", * "Scope":"Region", * "InstanceAmount":1 * } * ] * ``` * - **Sample request to merge reserved instance:**: Merge two zonal reserved instances that are scoped to Hangzhou Zone H and can match four pay-as-you-go instances of the ecs.g5.xlarge instance type into one zonal reserved instance that is scoped to Hangzhou Zone H and can match two pay-as-you-go instances of the ecs.g5.4xlarge instance type: * * ``` * "RegionId":"cn-hangzhou", //The ID of the region. * "ReservedInstanceId":["ecsri-bp1hd03e9uv16b75****",""ecsri-bp1hd03e9uv16b76****""], //The IDs of the reserved instances that you want to merge. * "Configuration":[ * { * "ReservedInstanceName":"testReservedInstanceName", //The name of the new reserved instance. * "InstanceType":"ecs.g5.4xlarge", //The instance type that the new reserved instance can match. * "Scope":"Zone", //The scope level of the new reserved instance, which must be the same as the scope level of the original reserved instances. * "ZoneId":"cn-hangzhou-h", // * "InstanceAmount":2 //The number of pay-as-you-go instances of the specified instance type that the new reserved instance can match. * } * ] * ``` * - **Sample request to change the scope of a reserved instance**: Change a regional reserved instance that is scoped to Hangzhou Zone H and can match six pay-as-you-go instances of the ecs.g5.xlarge instance type to a regional reserved instance that is scoped to the China (Hangzhou) region and can match three pay-as-you-go instances of the ecs.g5.2xlarge instance type. * * ``` * "RegionId":"cn-hangzhou", //The ID of the region. * "ReservedInstanceId":["ecsri-bp1hd03e9uv16b77****"], //The ID of the reserved instance whose scope you want to change. * "Configuration":[ * { * "ReservedInstanceName":"testReservedInstanceName", //The name of the new reserved instance. * "InstanceType":"ecs.g5.2xlarge", //The instance type that the new reserved instance can match. * "Scope":"Region", //The scope level of the new reserved instance. * "InstanceAmount":3 //The number of pay-as-you-go instances of the specified instance type that the new reserved instance can match. * } * ] * ``` * * @param request - ModifyReservedInstancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyReservedInstancesResponse */ async modifyReservedInstancesWithOptions(request: $_model.ModifyReservedInstancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyReservedInstancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.configuration)) { query["Configuration"] = request.configuration; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.reservedInstanceId)) { query["ReservedInstanceId"] = request.reservedInstanceId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyReservedInstances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyReservedInstancesResponse>(await this.callApi(params, req, runtime), new $_model.ModifyReservedInstancesResponse({})); } /** * Modifies the configurations of a reserved instance, such as the instance type, quantity, and zone, to split, merge, or change the scope of the reserved instance. * * @remarks * This operation is an asynchronous operation. After you call this operation to modify a reserved instance, the operation starts the modification process and returns the ID of the resulting new reserved instance. The original reserved instance enters the `Updating` state and then the `Inactive` state. At the same time, the resulting new reserved instance is generated and enters the Creating state and then the Active state. You can call the [DescribeReservedInstances](https://help.aliyun.com/document_detail/2679781.html) operation to query the states of the reserved instance. * - You can modify the configurations of a reserved instance only if the reserved instance is in the **Active** state. * - Make sure that the [computing power](~~140660#2742f3844abzz~~) of the reserved instance remains unchanged before and after the modification. Otherwise, the modification fails. * - You cannot split, merge, or change the scope of a reserved instance at the same time. * For more information, see [Split, merge, or modify reserved instances](https://help.aliyun.com/document_detail/100375.html). * ## [](#)Sample requests * - **Sample request to split a reserved instance**: Split a regional reserved instance that is scoped to the China (Hangzhou) region and can match two pay-as-you-go instances of the ecs.g5.xlarge instance type into two regional reserved instances that are scoped to the China (Hangzhou) region and each can match one pay-as-you-go instance of the ecs.g5.large instance type: * * ``` * "RegionId":"cn-hangzhou", //The ID of the region. * "ReservedInstanceId":["ecsri-bp1hd03e9uv19e75****"], //The ID of the reserved instance that you want to split. * "Configuration":[ * { * "ReservedInstanceName":"testReservedInstanceName1", //The name of the new reserved instance. * "InstanceType":"ecs.g5.large", //The instance type that the new reserved instance can match. * "Scope":"Region", //The scope level of the new reserved instance, which must be the same as the scope level of the original reserved instance. * "InstanceAmount":1 //The number of pay-as-you-go instances of the specified instance type that each new reserved instance can match. * }, * { * "ReservedInstanceName":"testReservedInstanceName2", * "InstanceType":"ecs.g5.large", * "Scope":"Region", * "InstanceAmount":1 * } * ] * ``` * - **Sample request to merge reserved instance:**: Merge two zonal reserved instances that are scoped to Hangzhou Zone H and can match four pay-as-you-go instances of the ecs.g5.xlarge instance type into one zonal reserved instance that is scoped to Hangzhou Zone H and can match two pay-as-you-go instances of the ecs.g5.4xlarge instance type: * * ``` * "RegionId":"cn-hangzhou", //The ID of the region. * "ReservedInstanceId":["ecsri-bp1hd03e9uv16b75****",""ecsri-bp1hd03e9uv16b76****""], //The IDs of the reserved instances that you want to merge. * "Configuration":[ * { * "ReservedInstanceName":"testReservedInstanceName", //The name of the new reserved instance. * "InstanceType":"ecs.g5.4xlarge", //The instance type that the new reserved instance can match. * "Scope":"Zone", //The scope level of the new reserved instance, which must be the same as the scope level of the original reserved instances. * "ZoneId":"cn-hangzhou-h", // * "InstanceAmount":2 //The number of pay-as-you-go instances of the specified instance type that the new reserved instance can match. * } * ] * ``` * - **Sample request to change the scope of a reserved instance**: Change a regional reserved instance that is scoped to Hangzhou Zone H and can match six pay-as-you-go instances of the ecs.g5.xlarge instance type to a regional reserved instance that is scoped to the China (Hangzhou) region and can match three pay-as-you-go instances of the ecs.g5.2xlarge instance type. * * ``` * "RegionId":"cn-hangzhou", //The ID of the region. * "ReservedInstanceId":["ecsri-bp1hd03e9uv16b77****"], //The ID of the reserved instance whose scope you want to change. * "Configuration":[ * { * "ReservedInstanceName":"testReservedInstanceName", //The name of the new reserved instance. * "InstanceType":"ecs.g5.2xlarge", //The instance type that the new reserved instance can match. * "Scope":"Region", //The scope level of the new reserved instance. * "InstanceAmount":3 //The number of pay-as-you-go instances of the specified instance type that the new reserved instance can match. * } * ] * ``` * * @param request - ModifyReservedInstancesRequest * @returns ModifyReservedInstancesResponse */ async modifyReservedInstances(request: $_model.ModifyReservedInstancesRequest): Promise<$_model.ModifyReservedInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyReservedInstancesWithOptions(request, runtime); } /** * Modifies the attributes of a router interface. * * @deprecated OpenAPI ModifyRouterInterfaceAttribute is deprecated, please use Vpc::2016-04-28::ModifyRouterInterfaceAttribute instead. * * @param request - ModifyRouterInterfaceAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyRouterInterfaceAttributeResponse */ async modifyRouterInterfaceAttributeWithOptions(request: $_model.ModifyRouterInterfaceAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyRouterInterfaceAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.healthCheckSourceIp)) { query["HealthCheckSourceIp"] = request.healthCheckSourceIp; } if (!$dara.isNull(request.healthCheckTargetIp)) { query["HealthCheckTargetIp"] = request.healthCheckTargetIp; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.oppositeInterfaceId)) { query["OppositeInterfaceId"] = request.oppositeInterfaceId; } if (!$dara.isNull(request.oppositeInterfaceOwnerId)) { query["OppositeInterfaceOwnerId"] = request.oppositeInterfaceOwnerId; } if (!$dara.isNull(request.oppositeRouterId)) { query["OppositeRouterId"] = request.oppositeRouterId; } if (!$dara.isNull(request.oppositeRouterType)) { query["OppositeRouterType"] = request.oppositeRouterType; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.routerInterfaceId)) { query["RouterInterfaceId"] = request.routerInterfaceId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyRouterInterfaceAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyRouterInterfaceAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyRouterInterfaceAttributeResponse({})); } /** * Modifies the attributes of a router interface. * * @deprecated OpenAPI ModifyRouterInterfaceAttribute is deprecated, please use Vpc::2016-04-28::ModifyRouterInterfaceAttribute instead. * * @param request - ModifyRouterInterfaceAttributeRequest * @returns ModifyRouterInterfaceAttributeResponse */ // Deprecated async modifyRouterInterfaceAttribute(request: $_model.ModifyRouterInterfaceAttributeRequest): Promise<$_model.ModifyRouterInterfaceAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyRouterInterfaceAttributeWithOptions(request, runtime); } /** * Modifies the specification of a router interface. * * @deprecated OpenAPI ModifyRouterInterfaceSpec is deprecated, please use Vpc::2016-04-28::ModifyRouterInterfaceSpec instead. * * @param request - ModifyRouterInterfaceSpecRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyRouterInterfaceSpecResponse */ async modifyRouterInterfaceSpecWithOptions(request: $_model.ModifyRouterInterfaceSpecRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyRouterInterfaceSpecResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.routerInterfaceId)) { query["RouterInterfaceId"] = request.routerInterfaceId; } if (!$dara.isNull(request.spec)) { query["Spec"] = request.spec; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyRouterInterfaceSpec", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyRouterInterfaceSpecResponse>(await this.callApi(params, req, runtime), new $_model.ModifyRouterInterfaceSpecResponse({})); } /** * Modifies the specification of a router interface. * * @deprecated OpenAPI ModifyRouterInterfaceSpec is deprecated, please use Vpc::2016-04-28::ModifyRouterInterfaceSpec instead. * * @param request - ModifyRouterInterfaceSpecRequest * @returns ModifyRouterInterfaceSpecResponse */ // Deprecated async modifyRouterInterfaceSpec(request: $_model.ModifyRouterInterfaceSpecRequest): Promise<$_model.ModifyRouterInterfaceSpecResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyRouterInterfaceSpecWithOptions(request, runtime); } /** * Modifies the name or description of a specified security group. * * @param request - ModifySecurityGroupAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifySecurityGroupAttributeResponse */ async modifySecurityGroupAttributeWithOptions(request: $_model.ModifySecurityGroupAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifySecurityGroupAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.securityGroupName)) { query["SecurityGroupName"] = request.securityGroupName; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifySecurityGroupAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifySecurityGroupAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifySecurityGroupAttributeResponse({})); } /** * Modifies the name or description of a specified security group. * * @param request - ModifySecurityGroupAttributeRequest * @returns ModifySecurityGroupAttributeResponse */ async modifySecurityGroupAttribute(request: $_model.ModifySecurityGroupAttributeRequest): Promise<$_model.ModifySecurityGroupAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifySecurityGroupAttributeWithOptions(request, runtime); } /** * Modifies an outbound security group rule. * * @remarks * When you modify a security group rule by specifying the security group rule ID, take note of the following limits: * - The authorization object of a security group rule can be an IPv4 Classless Inter-Domain Routing (CIDR) block (or IP address), an IPv6 CIDR block (or IP address), a security group, or a prefix list. You cannot use this operation to change the type of the authorization object of an existing security group rule. For example, if the original authorization object type is an IPv4 CIDR block, you can change it to another IPv4 CIDR block (or IP address), but you cannot change it to an IPv6 CIDR block (or IP address), a security group, or a prefix list. * - You cannot change a field value from a non-empty value to an empty value. To modify security group rules in this case, increase a new rule and then delete the current rule. * * @param request - ModifySecurityGroupEgressRuleRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifySecurityGroupEgressRuleResponse */ async modifySecurityGroupEgressRuleWithOptions(request: $_model.ModifySecurityGroupEgressRuleRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifySecurityGroupEgressRuleResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.destCidrIp)) { query["DestCidrIp"] = request.destCidrIp; } if (!$dara.isNull(request.destGroupId)) { query["DestGroupId"] = request.destGroupId; } if (!$dara.isNull(request.destGroupOwnerAccount)) { query["DestGroupOwnerAccount"] = request.destGroupOwnerAccount; } if (!$dara.isNull(request.destGroupOwnerId)) { query["DestGroupOwnerId"] = request.destGroupOwnerId; } if (!$dara.isNull(request.destPrefixListId)) { query["DestPrefixListId"] = request.destPrefixListId; } if (!$dara.isNull(request.ipProtocol)) { query["IpProtocol"] = request.ipProtocol; } if (!$dara.isNull(request.ipv6DestCidrIp)) { query["Ipv6DestCidrIp"] = request.ipv6DestCidrIp; } if (!$dara.isNull(request.ipv6SourceCidrIp)) { query["Ipv6SourceCidrIp"] = request.ipv6SourceCidrIp; } if (!$dara.isNull(request.nicType)) { query["NicType"] = request.nicType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.policy)) { query["Policy"] = request.policy; } if (!$dara.isNull(request.portRange)) { query["PortRange"] = request.portRange; } if (!$dara.isNull(request.portRangeListId)) { query["PortRangeListId"] = request.portRangeListId; } if (!$dara.isNull(request.priority)) { query["Priority"] = request.priority; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.securityGroupRuleId)) { query["SecurityGroupRuleId"] = request.securityGroupRuleId; } if (!$dara.isNull(request.sourceCidrIp)) { query["SourceCidrIp"] = request.sourceCidrIp; } if (!$dara.isNull(request.sourcePortRange)) { query["SourcePortRange"] = request.sourcePortRange; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifySecurityGroupEgressRule", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifySecurityGroupEgressRuleResponse>(await this.callApi(params, req, runtime), new $_model.ModifySecurityGroupEgressRuleResponse({})); } /** * Modifies an outbound security group rule. * * @remarks * When you modify a security group rule by specifying the security group rule ID, take note of the following limits: * - The authorization object of a security group rule can be an IPv4 Classless Inter-Domain Routing (CIDR) block (or IP address), an IPv6 CIDR block (or IP address), a security group, or a prefix list. You cannot use this operation to change the type of the authorization object of an existing security group rule. For example, if the original authorization object type is an IPv4 CIDR block, you can change it to another IPv4 CIDR block (or IP address), but you cannot change it to an IPv6 CIDR block (or IP address), a security group, or a prefix list. * - You cannot change a field value from a non-empty value to an empty value. To modify security group rules in this case, increase a new rule and then delete the current rule. * * @param request - ModifySecurityGroupEgressRuleRequest * @returns ModifySecurityGroupEgressRuleResponse */ async modifySecurityGroupEgressRule(request: $_model.ModifySecurityGroupEgressRuleRequest): Promise<$_model.ModifySecurityGroupEgressRuleResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifySecurityGroupEgressRuleWithOptions(request, runtime); } /** * Modifies the intra-group connectivity policy of a basic security group. * * @remarks * - Advanced security groups do not support modifications to the intra-group connectivity policy. The default policy is **internal isolation**. * - You can call [DescribeSecurityGroupAttribute](https://help.aliyun.com/document_detail/25555.html) to query the current intra-group connectivity policy of a security group. * - When the intra-group connectivity policy of a security group is set to **intra-group connectivity**, other custom access rules are ignored, and all instances in custom security group are connected over the internal network by default. * - When the intra-group connectivity policy of a security group is set to **internal isolation**, all instances in custom security group are disconnected over the internal network by default if no other access rules are added. However, you can customize security group rules to change the internal network status. For example, you can call [AuthorizeSecurityGroup](https://help.aliyun.com/document_detail/25554.html) to enable network connectivity between two ECS instances in custom security group. * * @param request - ModifySecurityGroupPolicyRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifySecurityGroupPolicyResponse */ async modifySecurityGroupPolicyWithOptions(request: $_model.ModifySecurityGroupPolicyRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifySecurityGroupPolicyResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.innerAccessPolicy)) { query["InnerAccessPolicy"] = request.innerAccessPolicy; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifySecurityGroupPolicy", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifySecurityGroupPolicyResponse>(await this.callApi(params, req, runtime), new $_model.ModifySecurityGroupPolicyResponse({})); } /** * Modifies the intra-group connectivity policy of a basic security group. * * @remarks * - Advanced security groups do not support modifications to the intra-group connectivity policy. The default policy is **internal isolation**. * - You can call [DescribeSecurityGroupAttribute](https://help.aliyun.com/document_detail/25555.html) to query the current intra-group connectivity policy of a security group. * - When the intra-group connectivity policy of a security group is set to **intra-group connectivity**, other custom access rules are ignored, and all instances in custom security group are connected over the internal network by default. * - When the intra-group connectivity policy of a security group is set to **internal isolation**, all instances in custom security group are disconnected over the internal network by default if no other access rules are added. However, you can customize security group rules to change the internal network status. For example, you can call [AuthorizeSecurityGroup](https://help.aliyun.com/document_detail/25554.html) to enable network connectivity between two ECS instances in custom security group. * * @param request - ModifySecurityGroupPolicyRequest * @returns ModifySecurityGroupPolicyResponse */ async modifySecurityGroupPolicy(request: $_model.ModifySecurityGroupPolicyRequest): Promise<$_model.ModifySecurityGroupPolicyResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifySecurityGroupPolicyWithOptions(request, runtime); } /** * Modifies an inbound security group rule of a specified security group. * * @remarks * When you modify a security group rule by specifying the security group rule ID, take note of the following limits: * - The authorization object of a security group rule can be an IPv4 Classless Inter-Domain Routing (CIDR) block (or IP address), an IPv6 CIDR block (or IP address), a security group, or a prefix list. You cannot use this operation to change the type of the authorization object of an existing security group rule. For example, if the original authorization object type is an IPv4 CIDR block, you can change it to another IPv4 CIDR block (or IP address), but you cannot change it to an IPv6 CIDR block (or IP address), a security group, or a prefix list. * - You cannot change a field value from a non-empty value to an empty value. To modify security group rules in this case, increase a new rule and then delete the current rule. * * @param request - ModifySecurityGroupRuleRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifySecurityGroupRuleResponse */ async modifySecurityGroupRuleWithOptions(request: $_model.ModifySecurityGroupRuleRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifySecurityGroupRuleResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.destCidrIp)) { query["DestCidrIp"] = request.destCidrIp; } if (!$dara.isNull(request.ipProtocol)) { query["IpProtocol"] = request.ipProtocol; } if (!$dara.isNull(request.ipv6DestCidrIp)) { query["Ipv6DestCidrIp"] = request.ipv6DestCidrIp; } if (!$dara.isNull(request.ipv6SourceCidrIp)) { query["Ipv6SourceCidrIp"] = request.ipv6SourceCidrIp; } if (!$dara.isNull(request.nicType)) { query["NicType"] = request.nicType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.policy)) { query["Policy"] = request.policy; } if (!$dara.isNull(request.portRange)) { query["PortRange"] = request.portRange; } if (!$dara.isNull(request.portRangeListId)) { query["PortRangeListId"] = request.portRangeListId; } if (!$dara.isNull(request.priority)) { query["Priority"] = request.priority; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.securityGroupRuleId)) { query["SecurityGroupRuleId"] = request.securityGroupRuleId; } if (!$dara.isNull(request.sourceCidrIp)) { query["SourceCidrIp"] = request.sourceCidrIp; } if (!$dara.isNull(request.sourceGroupId)) { query["SourceGroupId"] = request.sourceGroupId; } if (!$dara.isNull(request.sourceGroupOwnerAccount)) { query["SourceGroupOwnerAccount"] = request.sourceGroupOwnerAccount; } if (!$dara.isNull(request.sourceGroupOwnerId)) { query["SourceGroupOwnerId"] = request.sourceGroupOwnerId; } if (!$dara.isNull(request.sourcePortRange)) { query["SourcePortRange"] = request.sourcePortRange; } if (!$dara.isNull(request.sourcePrefixListId)) { query["SourcePrefixListId"] = request.sourcePrefixListId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifySecurityGroupRule", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifySecurityGroupRuleResponse>(await this.callApi(params, req, runtime), new $_model.ModifySecurityGroupRuleResponse({})); } /** * Modifies an inbound security group rule of a specified security group. * * @remarks * When you modify a security group rule by specifying the security group rule ID, take note of the following limits: * - The authorization object of a security group rule can be an IPv4 Classless Inter-Domain Routing (CIDR) block (or IP address), an IPv6 CIDR block (or IP address), a security group, or a prefix list. You cannot use this operation to change the type of the authorization object of an existing security group rule. For example, if the original authorization object type is an IPv4 CIDR block, you can change it to another IPv4 CIDR block (or IP address), but you cannot change it to an IPv6 CIDR block (or IP address), a security group, or a prefix list. * - You cannot change a field value from a non-empty value to an empty value. To modify security group rules in this case, increase a new rule and then delete the current rule. * * @param request - ModifySecurityGroupRuleRequest * @returns ModifySecurityGroupRuleResponse */ async modifySecurityGroupRule(request: $_model.ModifySecurityGroupRuleRequest): Promise<$_model.ModifySecurityGroupRuleResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifySecurityGroupRuleWithOptions(request, runtime); } /** * Modifies the name, description, or retention period of a snapshot. * * @param request - ModifySnapshotAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifySnapshotAttributeResponse */ async modifySnapshotAttributeWithOptions(request: $_model.ModifySnapshotAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifySnapshotAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.disableInstantAccess)) { query["DisableInstantAccess"] = request.disableInstantAccess; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.retentionDays)) { query["RetentionDays"] = request.retentionDays; } if (!$dara.isNull(request.snapshotId)) { query["SnapshotId"] = request.snapshotId; } if (!$dara.isNull(request.snapshotName)) { query["SnapshotName"] = request.snapshotName; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifySnapshotAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifySnapshotAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifySnapshotAttributeResponse({})); } /** * Modifies the name, description, or retention period of a snapshot. * * @param request - ModifySnapshotAttributeRequest * @returns ModifySnapshotAttributeResponse */ async modifySnapshotAttribute(request: $_model.ModifySnapshotAttributeRequest): Promise<$_model.ModifySnapshotAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifySnapshotAttributeWithOptions(request, runtime); } /** * Modifies the snapshot type. You can call this operation to convert a standard snapshot to an archive snapshot. * * @remarks * * **Before you call this operation, make sure that you fully understand the billing methods and [pricing](https://www.aliyun.com/price/product?#/disk/detail/disk) of archive snapshots.** * - Archive snapshots cannot be reverted to standard snapshots. * - A standard snapshot must have been retained for at least 14 days after creation before it can be archived. * - Shared snapshots, snapshots managed by cloud services, and snapshots in CloudBox cannot be archived. * * @param request - ModifySnapshotCategoryRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifySnapshotCategoryResponse */ async modifySnapshotCategoryWithOptions(request: $_model.ModifySnapshotCategoryRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifySnapshotCategoryResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.category)) { query["Category"] = request.category; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.retentionDays)) { query["RetentionDays"] = request.retentionDays; } if (!$dara.isNull(request.snapshotId)) { query["SnapshotId"] = request.snapshotId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifySnapshotCategory", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifySnapshotCategoryResponse>(await this.callApi(params, req, runtime), new $_model.ModifySnapshotCategoryResponse({})); } /** * Modifies the snapshot type. You can call this operation to convert a standard snapshot to an archive snapshot. * * @remarks * * **Before you call this operation, make sure that you fully understand the billing methods and [pricing](https://www.aliyun.com/price/product?#/disk/detail/disk) of archive snapshots.** * - Archive snapshots cannot be reverted to standard snapshots. * - A standard snapshot must have been retained for at least 14 days after creation before it can be archived. * - Shared snapshots, snapshots managed by cloud services, and snapshots in CloudBox cannot be archived. * * @param request - ModifySnapshotCategoryRequest * @returns ModifySnapshotCategoryResponse */ async modifySnapshotCategory(request: $_model.ModifySnapshotCategoryRequest): Promise<$_model.ModifySnapshotCategoryResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifySnapshotCategoryWithOptions(request, runtime); } /** * Modifies the name and description of a snapshot-consistent group. * * @param request - ModifySnapshotGroupRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifySnapshotGroupResponse */ async modifySnapshotGroupWithOptions(request: $_model.ModifySnapshotGroupRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifySnapshotGroupResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.snapshotGroupId)) { query["SnapshotGroupId"] = request.snapshotGroupId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifySnapshotGroup", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifySnapshotGroupResponse>(await this.callApi(params, req, runtime), new $_model.ModifySnapshotGroupResponse({})); } /** * Modifies the name and description of a snapshot-consistent group. * * @param request - ModifySnapshotGroupRequest * @returns ModifySnapshotGroupResponse */ async modifySnapshotGroup(request: $_model.ModifySnapshotGroupRequest): Promise<$_model.ModifySnapshotGroupResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifySnapshotGroupWithOptions(request, runtime); } /** * Modifies the name or description of a storage capacity unit (SCU). * * @param request - ModifyStorageCapacityUnitAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyStorageCapacityUnitAttributeResponse */ async modifyStorageCapacityUnitAttributeWithOptions(request: $_model.ModifyStorageCapacityUnitAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyStorageCapacityUnitAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.storageCapacityUnitId)) { query["StorageCapacityUnitId"] = request.storageCapacityUnitId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyStorageCapacityUnitAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyStorageCapacityUnitAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyStorageCapacityUnitAttributeResponse({})); } /** * Modifies the name or description of a storage capacity unit (SCU). * * @param request - ModifyStorageCapacityUnitAttributeRequest * @returns ModifyStorageCapacityUnitAttributeResponse */ async modifyStorageCapacityUnitAttribute(request: $_model.ModifyStorageCapacityUnitAttributeRequest): Promise<$_model.ModifyStorageCapacityUnitAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyStorageCapacityUnitAttributeWithOptions(request, runtime); } /** * 修改指定的存储集信息 * * @param request - ModifyStorageSetAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyStorageSetAttributeResponse */ async modifyStorageSetAttributeWithOptions(request: $_model.ModifyStorageSetAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyStorageSetAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.storageSetId)) { query["StorageSetId"] = request.storageSetId; } if (!$dara.isNull(request.storageSetName)) { query["StorageSetName"] = request.storageSetName; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyStorageSetAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyStorageSetAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyStorageSetAttributeResponse({})); } /** * 修改指定的存储集信息 * * @param request - ModifyStorageSetAttributeRequest * @returns ModifyStorageSetAttributeResponse */ async modifyStorageSetAttribute(request: $_model.ModifyStorageSetAttributeRequest): Promise<$_model.ModifyStorageSetAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyStorageSetAttributeWithOptions(request, runtime); } /** * 修改计划内运维事件属性 * * @remarks * ## 接口说明 * - 只能修改状态为Scheduled的计划内运维事件。 * - 传入的NotBefore不早于当前时间。 * - 传入的NotBefore不晚于事件产生时初始的计划执行时间。 * * @param request - ModifySystemEventAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifySystemEventAttributeResponse */ async modifySystemEventAttributeWithOptions(request: $_model.ModifySystemEventAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifySystemEventAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.eventId)) { query["EventId"] = request.eventId; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.notBefore)) { query["NotBefore"] = request.notBefore; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifySystemEventAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifySystemEventAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifySystemEventAttributeResponse({})); } /** * 修改计划内运维事件属性 * * @remarks * ## 接口说明 * - 只能修改状态为Scheduled的计划内运维事件。 * - 传入的NotBefore不早于当前时间。 * - 传入的NotBefore不晚于事件产生时初始的计划执行时间。 * * @param request - ModifySystemEventAttributeRequest * @returns ModifySystemEventAttributeResponse */ async modifySystemEventAttribute(request: $_model.ModifySystemEventAttributeRequest): Promise<$_model.ModifySystemEventAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifySystemEventAttributeWithOptions(request, runtime); } /** * Modifies the default user-level attributes. * * @deprecated OpenAPI ModifyUserBusinessBehavior is deprecated * * @param request - ModifyUserBusinessBehaviorRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyUserBusinessBehaviorResponse */ async modifyUserBusinessBehaviorWithOptions(request: $_model.ModifyUserBusinessBehaviorRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyUserBusinessBehaviorResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.statusKey)) { query["statusKey"] = request.statusKey; } if (!$dara.isNull(request.statusValue)) { query["statusValue"] = request.statusValue; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyUserBusinessBehavior", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyUserBusinessBehaviorResponse>(await this.callApi(params, req, runtime), new $_model.ModifyUserBusinessBehaviorResponse({})); } /** * Modifies the default user-level attributes. * * @deprecated OpenAPI ModifyUserBusinessBehavior is deprecated * * @param request - ModifyUserBusinessBehaviorRequest * @returns ModifyUserBusinessBehaviorResponse */ // Deprecated async modifyUserBusinessBehavior(request: $_model.ModifyUserBusinessBehaviorRequest): Promise<$_model.ModifyUserBusinessBehaviorResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyUserBusinessBehaviorWithOptions(request, runtime); } /** * ModifyVRouterAttribute * * @deprecated OpenAPI ModifyVRouterAttribute is deprecated, please use Vpc::2016-04-28::ModifyVRouterAttribute instead. * * @param request - ModifyVRouterAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyVRouterAttributeResponse */ async modifyVRouterAttributeWithOptions(request: $_model.ModifyVRouterAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyVRouterAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.VRouterId)) { query["VRouterId"] = request.VRouterId; } if (!$dara.isNull(request.VRouterName)) { query["VRouterName"] = request.VRouterName; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyVRouterAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyVRouterAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyVRouterAttributeResponse({})); } /** * ModifyVRouterAttribute * * @deprecated OpenAPI ModifyVRouterAttribute is deprecated, please use Vpc::2016-04-28::ModifyVRouterAttribute instead. * * @param request - ModifyVRouterAttributeRequest * @returns ModifyVRouterAttributeResponse */ // Deprecated async modifyVRouterAttribute(request: $_model.ModifyVRouterAttributeRequest): Promise<$_model.ModifyVRouterAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyVRouterAttributeWithOptions(request, runtime); } /** * ModifyVSwitchAttribute * * @deprecated OpenAPI ModifyVSwitchAttribute is deprecated, please use Vpc::2016-04-28::ModifyVSwitchAttribute instead. * * @param request - ModifyVSwitchAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyVSwitchAttributeResponse */ async modifyVSwitchAttributeWithOptions(request: $_model.ModifyVSwitchAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyVSwitchAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.vSwitchId)) { query["VSwitchId"] = request.vSwitchId; } if (!$dara.isNull(request.vSwitchName)) { query["VSwitchName"] = request.vSwitchName; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyVSwitchAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyVSwitchAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyVSwitchAttributeResponse({})); } /** * ModifyVSwitchAttribute * * @deprecated OpenAPI ModifyVSwitchAttribute is deprecated, please use Vpc::2016-04-28::ModifyVSwitchAttribute instead. * * @param request - ModifyVSwitchAttributeRequest * @returns ModifyVSwitchAttributeResponse */ // Deprecated async modifyVSwitchAttribute(request: $_model.ModifyVSwitchAttributeRequest): Promise<$_model.ModifyVSwitchAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyVSwitchAttributeWithOptions(request, runtime); } /** * ModifyVirtualBorderRouterAttribute * * @deprecated OpenAPI ModifyVirtualBorderRouterAttribute is deprecated, please use Vpc::2016-04-28::ModifyVirtualBorderRouterAttribute instead. * * @param request - ModifyVirtualBorderRouterAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyVirtualBorderRouterAttributeResponse */ async modifyVirtualBorderRouterAttributeWithOptions(request: $_model.ModifyVirtualBorderRouterAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyVirtualBorderRouterAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.circuitCode)) { query["CircuitCode"] = request.circuitCode; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.localGatewayIp)) { query["LocalGatewayIp"] = request.localGatewayIp; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.peerGatewayIp)) { query["PeerGatewayIp"] = request.peerGatewayIp; } if (!$dara.isNull(request.peeringSubnetMask)) { query["PeeringSubnetMask"] = request.peeringSubnetMask; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } if (!$dara.isNull(request.vbrId)) { query["VbrId"] = request.vbrId; } if (!$dara.isNull(request.vlanId)) { query["VlanId"] = request.vlanId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyVirtualBorderRouterAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyVirtualBorderRouterAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyVirtualBorderRouterAttributeResponse({})); } /** * ModifyVirtualBorderRouterAttribute * * @deprecated OpenAPI ModifyVirtualBorderRouterAttribute is deprecated, please use Vpc::2016-04-28::ModifyVirtualBorderRouterAttribute instead. * * @param request - ModifyVirtualBorderRouterAttributeRequest * @returns ModifyVirtualBorderRouterAttributeResponse */ // Deprecated async modifyVirtualBorderRouterAttribute(request: $_model.ModifyVirtualBorderRouterAttributeRequest): Promise<$_model.ModifyVirtualBorderRouterAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyVirtualBorderRouterAttributeWithOptions(request, runtime); } /** * Modifies VPC attributes, such as its name and cidr block. * * @deprecated OpenAPI ModifyVpcAttribute is deprecated, please use Vpc::2016-04-28::ModifyVpcAttribute instead. * * @param request - ModifyVpcAttributeRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ModifyVpcAttributeResponse */ async modifyVpcAttributeWithOptions(request: $_model.ModifyVpcAttributeRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ModifyVpcAttributeResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.cidrBlock)) { query["CidrBlock"] = request.cidrBlock; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } if (!$dara.isNull(request.vpcId)) { query["VpcId"] = request.vpcId; } if (!$dara.isNull(request.vpcName)) { query["VpcName"] = request.vpcName; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ModifyVpcAttribute", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ModifyVpcAttributeResponse>(await this.callApi(params, req, runtime), new $_model.ModifyVpcAttributeResponse({})); } /** * Modifies VPC attributes, such as its name and cidr block. * * @deprecated OpenAPI ModifyVpcAttribute is deprecated, please use Vpc::2016-04-28::ModifyVpcAttribute instead. * * @param request - ModifyVpcAttributeRequest * @returns ModifyVpcAttributeResponse */ // Deprecated async modifyVpcAttribute(request: $_model.ModifyVpcAttributeRequest): Promise<$_model.ModifyVpcAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyVpcAttributeWithOptions(request, runtime); } /** * Activate the snapshot service. * * @param request - OpenSnapshotServiceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns OpenSnapshotServiceResponse */ async openSnapshotServiceWithOptions(request: $_model.OpenSnapshotServiceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.OpenSnapshotServiceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "OpenSnapshotService", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.OpenSnapshotServiceResponse>(await this.callApi(params, req, runtime), new $_model.OpenSnapshotServiceResponse({})); } /** * Activate the snapshot service. * * @param request - OpenSnapshotServiceRequest * @returns OpenSnapshotServiceResponse */ async openSnapshotService(request: $_model.OpenSnapshotServiceRequest): Promise<$_model.OpenSnapshotServiceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.openSnapshotServiceWithOptions(request, runtime); } /** * Purchases an elasticity assurance that is not in the Active state and for which resources are prepared. * * @remarks * Before you call this operation, familiarize yourself with the billing rules and [pricing](https://www.alibabacloud.com/zh?spm=5176.28117011.nav-v2-dropdown-language.exp-location-zh.9ae4165bF98IHz&_p_lc=1) of elasticity assurances. * Before you purchase an elasticity assurance, you can call the [DescribeElasticityAssurances](https://help.aliyun.com/document_detail/2679748.html) operation to query the elasticity assurances that you can purchase. * * @param request - PurchaseElasticityAssuranceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns PurchaseElasticityAssuranceResponse */ async purchaseElasticityAssuranceWithOptions(request: $_model.PurchaseElasticityAssuranceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.PurchaseElasticityAssuranceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "PurchaseElasticityAssurance", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.PurchaseElasticityAssuranceResponse>(await this.callApi(params, req, runtime), new $_model.PurchaseElasticityAssuranceResponse({})); } /** * Purchases an elasticity assurance that is not in the Active state and for which resources are prepared. * * @remarks * Before you call this operation, familiarize yourself with the billing rules and [pricing](https://www.alibabacloud.com/zh?spm=5176.28117011.nav-v2-dropdown-language.exp-location-zh.9ae4165bF98IHz&_p_lc=1) of elasticity assurances. * Before you purchase an elasticity assurance, you can call the [DescribeElasticityAssurances](https://help.aliyun.com/document_detail/2679748.html) operation to query the elasticity assurances that you can purchase. * * @param request - PurchaseElasticityAssuranceRequest * @returns PurchaseElasticityAssuranceResponse */ async purchaseElasticityAssurance(request: $_model.PurchaseElasticityAssuranceRequest): Promise<$_model.PurchaseElasticityAssuranceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.purchaseElasticityAssuranceWithOptions(request, runtime); } /** * Purchases a regional or zonal reserved instance to offset the bills of pay-as-you-go Elastic Compute Service (ECS) instances. * * @remarks * *Before you call this operation, make sure that you are familiar with the billing methods and [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl) of reserved instances.** * - Before you call this operation, make sure that you are familiar with the billing rules of reserved instances. For more information, see [Reserved instances](https://help.aliyun.com/document_detail/100371.html). * - You can retain up to 20 regional reserved instances in all regions per Alibaba Cloud account. * - You can retain up to 20 zonal reserved instances per zone per Alibaba Cloud account. * ## [](#)Sample requests * - Purchase a one-year regional reserved instance in the China (Hangzhou) region to offset the bills of three ecs.g5.large Linux pay-as-you-go instances. * * ``` * "RegionId":"cn-hangzhou", // Specify the China (Hangzhou) region."InstanceType":"ecs.g5.large", // Specify the instance type."Scope":"Region", // Set the scope of the reserved instance to regional."InstanceAmount":3, // Specify the reserved instance to match three pay-as-you-go instances of the same instance type."OfferingType":"All Upfront", // Specify the payment option. In this example, the default value is used, which is All Upfront."Platform":"Linux", // Specify the operating system platform of the ECS instances eligible for the reserved instance. In this example, the Linux or Unix-like operating system is used."Period":1, // Specify the term of the reserved instance. In this example, the one-year duration is used."PeriodUnit":"Year", // Set the unit of the term to year. * ``` * - Purchase a two-year zonal reserved instance in Hangzhou Zone H to offset the bills of five ecs.g5.large Windows pay-as-you-go instances. * * ``` * "RegionId":"cn-hangzhou", * "ZoneId":"cn-hangzhou-h", // Specify Hangzhou Zone H."InstanceType":"ecs.g5.large", * "Scope":"Zone", // Set the scope of the reserved instance to zonal."InstanceAmount":5, // Specify the reserved instance to match five pay-as-you-go instances of the same instance type."OfferingType":"All Upfront", * "Platform":"Windows", // Specify the operating system platform of the ECS instances eligible for the reserved instance. In this example, the Windows operating system is used."Period":2, // Specify the term of the reserved instance. In this example, the two-year duration is used."PeriodUnit":"Year", // Set the unit of the term to year. * ``` * * @param request - PurchaseReservedInstancesOfferingRequest * @param runtime - runtime options for this request RuntimeOptions * @returns PurchaseReservedInstancesOfferingResponse */ async purchaseReservedInstancesOfferingWithOptions(request: $_model.PurchaseReservedInstancesOfferingRequest, runtime: $dara.RuntimeOptions): Promise<$_model.PurchaseReservedInstancesOfferingResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoRenew)) { query["AutoRenew"] = request.autoRenew; } if (!$dara.isNull(request.autoRenewPeriod)) { query["AutoRenewPeriod"] = request.autoRenewPeriod; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.instanceAmount)) { query["InstanceAmount"] = request.instanceAmount; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.offeringType)) { query["OfferingType"] = request.offeringType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.platform)) { query["Platform"] = request.platform; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.reservedInstanceName)) { query["ReservedInstanceName"] = request.reservedInstanceName; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.scope)) { query["Scope"] = request.scope; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "PurchaseReservedInstancesOffering", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.PurchaseReservedInstancesOfferingResponse>(await this.callApi(params, req, runtime), new $_model.PurchaseReservedInstancesOfferingResponse({})); } /** * Purchases a regional or zonal reserved instance to offset the bills of pay-as-you-go Elastic Compute Service (ECS) instances. * * @remarks * *Before you call this operation, make sure that you are familiar with the billing methods and [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl) of reserved instances.** * - Before you call this operation, make sure that you are familiar with the billing rules of reserved instances. For more information, see [Reserved instances](https://help.aliyun.com/document_detail/100371.html). * - You can retain up to 20 regional reserved instances in all regions per Alibaba Cloud account. * - You can retain up to 20 zonal reserved instances per zone per Alibaba Cloud account. * ## [](#)Sample requests * - Purchase a one-year regional reserved instance in the China (Hangzhou) region to offset the bills of three ecs.g5.large Linux pay-as-you-go instances. * * ``` * "RegionId":"cn-hangzhou", // Specify the China (Hangzhou) region."InstanceType":"ecs.g5.large", // Specify the instance type."Scope":"Region", // Set the scope of the reserved instance to regional."InstanceAmount":3, // Specify the reserved instance to match three pay-as-you-go instances of the same instance type."OfferingType":"All Upfront", // Specify the payment option. In this example, the default value is used, which is All Upfront."Platform":"Linux", // Specify the operating system platform of the ECS instances eligible for the reserved instance. In this example, the Linux or Unix-like operating system is used."Period":1, // Specify the term of the reserved instance. In this example, the one-year duration is used."PeriodUnit":"Year", // Set the unit of the term to year. * ``` * - Purchase a two-year zonal reserved instance in Hangzhou Zone H to offset the bills of five ecs.g5.large Windows pay-as-you-go instances. * * ``` * "RegionId":"cn-hangzhou", * "ZoneId":"cn-hangzhou-h", // Specify Hangzhou Zone H."InstanceType":"ecs.g5.large", * "Scope":"Zone", // Set the scope of the reserved instance to zonal."InstanceAmount":5, // Specify the reserved instance to match five pay-as-you-go instances of the same instance type."OfferingType":"All Upfront", * "Platform":"Windows", // Specify the operating system platform of the ECS instances eligible for the reserved instance. In this example, the Windows operating system is used."Period":2, // Specify the term of the reserved instance. In this example, the two-year duration is used."PeriodUnit":"Year", // Set the unit of the term to year. * ``` * * @param request - PurchaseReservedInstancesOfferingRequest * @returns PurchaseReservedInstancesOfferingResponse */ async purchaseReservedInstancesOffering(request: $_model.PurchaseReservedInstancesOfferingRequest): Promise<$_model.PurchaseReservedInstancesOfferingResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.purchaseReservedInstancesOfferingWithOptions(request, runtime); } /** * Purchases one or more storage capacity units (SCUs). * * @remarks * \\*\\*Before you call this operation, make sure that you understand the [billing methods](https://help.aliyun.com/document_detail/137897.html) and [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl) of SCUs. * * @param request - PurchaseStorageCapacityUnitRequest * @param runtime - runtime options for this request RuntimeOptions * @returns PurchaseStorageCapacityUnitResponse */ async purchaseStorageCapacityUnitWithOptions(request: $_model.PurchaseStorageCapacityUnitRequest, runtime: $dara.RuntimeOptions): Promise<$_model.PurchaseStorageCapacityUnitResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.amount)) { query["Amount"] = request.amount; } if (!$dara.isNull(request.capacity)) { query["Capacity"] = request.capacity; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.fromApp)) { query["FromApp"] = request.fromApp; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "PurchaseStorageCapacityUnit", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.PurchaseStorageCapacityUnitResponse>(await this.callApi(params, req, runtime), new $_model.PurchaseStorageCapacityUnitResponse({})); } /** * Purchases one or more storage capacity units (SCUs). * * @remarks * \\*\\*Before you call this operation, make sure that you understand the [billing methods](https://help.aliyun.com/document_detail/137897.html) and [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl) of SCUs. * * @param request - PurchaseStorageCapacityUnitRequest * @returns PurchaseStorageCapacityUnitResponse */ async purchaseStorageCapacityUnit(request: $_model.PurchaseStorageCapacityUnitRequest): Promise<$_model.PurchaseStorageCapacityUnitResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.purchaseStorageCapacityUnitWithOptions(request, runtime); } /** * Restarts a pay-as-you-go ECS instance that has expired or been recycled due to an overdue payment. * * @remarks * After you settle the overdue bill for a pay-as-you-go instance, you do not need to call this operation to activate the instance. The system automatically restarts the instance and restores it to the state before the overdue payment. Automatic restarts may occasionally fail. Check whether the automatic restart succeeds. If the automatic restart fails, call this operation to manually restart the instance. * - After you settle the overdue bill, the total value of your Alibaba Cloud account balance (cash balance) and vouchers must be at least CNY 100.00. Otherwise, the instance cannot be restarted. * - The instance must be in the **expired** (`Stopped`) or **being recycled due to overdue payment** (`Stopped`) state. * - The instance must be in the **expired** (`Stopped`) state. * - Instances that are locked for security reasons cannot be started by calling this operation. For more information, see [Impact of resource security locks on API calls](https://help.aliyun.com/document_detail/25695.html). * * @param request - ReActivateInstancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ReActivateInstancesResponse */ async reActivateInstancesWithOptions(request: $_model.ReActivateInstancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ReActivateInstancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ReActivateInstances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ReActivateInstancesResponse>(await this.callApi(params, req, runtime), new $_model.ReActivateInstancesResponse({})); } /** * Restarts a pay-as-you-go ECS instance that has expired or been recycled due to an overdue payment. * * @remarks * After you settle the overdue bill for a pay-as-you-go instance, you do not need to call this operation to activate the instance. The system automatically restarts the instance and restores it to the state before the overdue payment. Automatic restarts may occasionally fail. Check whether the automatic restart succeeds. If the automatic restart fails, call this operation to manually restart the instance. * - After you settle the overdue bill, the total value of your Alibaba Cloud account balance (cash balance) and vouchers must be at least CNY 100.00. Otherwise, the instance cannot be restarted. * - The instance must be in the **expired** (`Stopped`) or **being recycled due to overdue payment** (`Stopped`) state. * - The instance must be in the **expired** (`Stopped`) state. * - Instances that are locked for security reasons cannot be started by calling this operation. For more information, see [Impact of resource security locks on API calls](https://help.aliyun.com/document_detail/25695.html). * * @param request - ReActivateInstancesRequest * @returns ReActivateInstancesResponse */ async reActivateInstances(request: $_model.ReActivateInstancesRequest): Promise<$_model.ReActivateInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.reActivateInstancesWithOptions(request, runtime); } /** * Reinitializes a disk to its initial state when it was created. * * @remarks * When you call this operation, take note of the following items: * - The disk must be in the **In Use** (`In_use`) state, and the ECS instance to which the disk is attached must be in the **Stopped** (`Stopped`) state. * - You cannot reinitialize a disk that is attached to an instance before the instance starts for the first time. * - You cannot reinitialize a disk that has local snapshots. * - You cannot reinitialize a disk that has the multi-attach feature enabled. * - For a system disk, the disk is reinitialized to the initial state of the image. If the source image used to create the disk has been deleted, the disk cannot be reinitialized. * - For a data disk that was created from scratch, the disk is reinitialized to an empty disk. For a data disk that was created from a snapshot, the disk is reinitialized to the snapshot state. If the source snapshot has been deleted, the disk cannot be reinitialized and an error is returned. * * @param request - ReInitDiskRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ReInitDiskResponse */ async reInitDiskWithOptions(request: $_model.ReInitDiskRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ReInitDiskResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoStartInstance)) { query["AutoStartInstance"] = request.autoStartInstance; } if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.keyPairName)) { query["KeyPairName"] = request.keyPairName; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.password)) { query["Password"] = request.password; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityEnhancementStrategy)) { query["SecurityEnhancementStrategy"] = request.securityEnhancementStrategy; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ReInitDisk", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ReInitDiskResponse>(await this.callApi(params, req, runtime), new $_model.ReInitDiskResponse({})); } /** * Reinitializes a disk to its initial state when it was created. * * @remarks * When you call this operation, take note of the following items: * - The disk must be in the **In Use** (`In_use`) state, and the ECS instance to which the disk is attached must be in the **Stopped** (`Stopped`) state. * - You cannot reinitialize a disk that is attached to an instance before the instance starts for the first time. * - You cannot reinitialize a disk that has local snapshots. * - You cannot reinitialize a disk that has the multi-attach feature enabled. * - For a system disk, the disk is reinitialized to the initial state of the image. If the source image used to create the disk has been deleted, the disk cannot be reinitialized. * - For a data disk that was created from scratch, the disk is reinitialized to an empty disk. For a data disk that was created from a snapshot, the disk is reinitialized to the snapshot state. If the source snapshot has been deleted, the disk cannot be reinitialized and an error is returned. * * @param request - ReInitDiskRequest * @returns ReInitDiskResponse */ async reInitDisk(request: $_model.ReInitDiskRequest): Promise<$_model.ReInitDiskResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.reInitDiskWithOptions(request, runtime); } /** * Restarts an Elastic Compute Service (ECS) instance. * * @remarks * 该接口为异步接口,实例的重启不是立即完成的,成功调用后,实例会先进入启动中(`Starting`)状态,你可以调用 [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) 查看实例状态,当返回的状态为`Running`时代表重启成功。 * ### 使用须知 * - 被安全锁定的实例不能通过调用该接口重启。更多信息,请参见[资源安全锁定对调用 API 的影响](https://help.aliyun.com/document_detail/25695.html)。 * - 您只能重启状态为**运行中**(`Running`)的 ECS 实例。 * * @param request - RebootInstanceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns RebootInstanceResponse */ async rebootInstanceWithOptions(request: $_model.RebootInstanceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.RebootInstanceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.forceStop)) { query["ForceStop"] = request.forceStop; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "RebootInstance", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.RebootInstanceResponse>(await this.callApi(params, req, runtime), new $_model.RebootInstanceResponse({})); } /** * Restarts an Elastic Compute Service (ECS) instance. * * @remarks * 该接口为异步接口,实例的重启不是立即完成的,成功调用后,实例会先进入启动中(`Starting`)状态,你可以调用 [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) 查看实例状态,当返回的状态为`Running`时代表重启成功。 * ### 使用须知 * - 被安全锁定的实例不能通过调用该接口重启。更多信息,请参见[资源安全锁定对调用 API 的影响](https://help.aliyun.com/document_detail/25695.html)。 * - 您只能重启状态为**运行中**(`Running`)的 ECS 实例。 * * @param request - RebootInstanceRequest * @returns RebootInstanceResponse */ async rebootInstance(request: $_model.RebootInstanceRequest): Promise<$_model.RebootInstanceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.rebootInstanceWithOptions(request, runtime); } /** * Restarts Elastic Compute Service (ECS) instances. When you call this operation, you can configure parameters to specify a batch operation mode and whether to forcefully restart the instances. * * @remarks * 该接口为异步接口,实例的重启不是立即完成的,成功调用后,实例会先进入启动中(`Starting`)状态,你可以调用 [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) 查看实例状态,当返回的状态为`Running`时代表重启成功。 * ### 使用须知 * - 被安全锁定的实例不能通过调用该接口重启。更多信息,请参见[资源安全锁定对调用 API 的影响](https://help.aliyun.com/document_detail/25695.html)。 * - ECS 实例的状态必须为**运行中**(`Running`)。 * * @param request - RebootInstancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns RebootInstancesResponse */ async rebootInstancesWithOptions(request: $_model.RebootInstancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.RebootInstancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.batchOptimization)) { query["BatchOptimization"] = request.batchOptimization; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.forceReboot)) { query["ForceReboot"] = request.forceReboot; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "RebootInstances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.RebootInstancesResponse>(await this.callApi(params, req, runtime), new $_model.RebootInstancesResponse({})); } /** * Restarts Elastic Compute Service (ECS) instances. When you call this operation, you can configure parameters to specify a batch operation mode and whether to forcefully restart the instances. * * @remarks * 该接口为异步接口,实例的重启不是立即完成的,成功调用后,实例会先进入启动中(`Starting`)状态,你可以调用 [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) 查看实例状态,当返回的状态为`Running`时代表重启成功。 * ### 使用须知 * - 被安全锁定的实例不能通过调用该接口重启。更多信息,请参见[资源安全锁定对调用 API 的影响](https://help.aliyun.com/document_detail/25695.html)。 * - ECS 实例的状态必须为**运行中**(`Running`)。 * * @param request - RebootInstancesRequest * @returns RebootInstancesResponse */ async rebootInstances(request: $_model.RebootInstancesRequest): Promise<$_model.RebootInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.rebootInstancesWithOptions(request, runtime); } /** * RecoverVirtualBorderRouter * * @deprecated OpenAPI RecoverVirtualBorderRouter is deprecated, please use Vpc::2016-04-28::RecoverVirtualBorderRouter instead. * * @param request - RecoverVirtualBorderRouterRequest * @param runtime - runtime options for this request RuntimeOptions * @returns RecoverVirtualBorderRouterResponse */ async recoverVirtualBorderRouterWithOptions(request: $_model.RecoverVirtualBorderRouterRequest, runtime: $dara.RuntimeOptions): Promise<$_model.RecoverVirtualBorderRouterResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } if (!$dara.isNull(request.vbrId)) { query["VbrId"] = request.vbrId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "RecoverVirtualBorderRouter", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.RecoverVirtualBorderRouterResponse>(await this.callApi(params, req, runtime), new $_model.RecoverVirtualBorderRouterResponse({})); } /** * RecoverVirtualBorderRouter * * @deprecated OpenAPI RecoverVirtualBorderRouter is deprecated, please use Vpc::2016-04-28::RecoverVirtualBorderRouter instead. * * @param request - RecoverVirtualBorderRouterRequest * @returns RecoverVirtualBorderRouterResponse */ // Deprecated async recoverVirtualBorderRouter(request: $_model.RecoverVirtualBorderRouterRequest): Promise<$_model.RecoverVirtualBorderRouterResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.recoverVirtualBorderRouterWithOptions(request, runtime); } /** * Migrates Elastic Compute Service (ECS) instances from a failed dedicated host. * * @remarks * If a dedicated host is in the `UnderAssessment` state, we recommend that you call this operation to migrate ECS instances away from the dedicated host to prevent permanent failures. You can call the [DescribeDedicatedHosts](https://help.aliyun.com/document_detail/134242.html) operation to query the status of a dedicated host. * * @param request - RedeployDedicatedHostRequest * @param runtime - runtime options for this request RuntimeOptions * @returns RedeployDedicatedHostResponse */ async redeployDedicatedHostWithOptions(request: $_model.RedeployDedicatedHostRequest, runtime: $dara.RuntimeOptions): Promise<$_model.RedeployDedicatedHostResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dedicatedHostId)) { query["DedicatedHostId"] = request.dedicatedHostId; } if (!$dara.isNull(request.migrationType)) { query["MigrationType"] = request.migrationType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "RedeployDedicatedHost", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.RedeployDedicatedHostResponse>(await this.callApi(params, req, runtime), new $_model.RedeployDedicatedHostResponse({})); } /** * Migrates Elastic Compute Service (ECS) instances from a failed dedicated host. * * @remarks * If a dedicated host is in the `UnderAssessment` state, we recommend that you call this operation to migrate ECS instances away from the dedicated host to prevent permanent failures. You can call the [DescribeDedicatedHosts](https://help.aliyun.com/document_detail/134242.html) operation to query the status of a dedicated host. * * @param request - RedeployDedicatedHostRequest * @returns RedeployDedicatedHostResponse */ async redeployDedicatedHost(request: $_model.RedeployDedicatedHostRequest): Promise<$_model.RedeployDedicatedHostResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.redeployDedicatedHostWithOptions(request, runtime); } /** * Invokes the RedeployInstance operation to redeploy an ECS instance when the ECS instance receives a system event notification. * * @remarks * ## Operation description * RedeployInstance is an asynchronous invocation that restarts and migrates an instance. After the redeployment succeeds, the instance enters the Running state. If the redeployment fails, the instance is returned to the original physical server and recovers to the state before the redeployment. * When you invoke this operation, take note of the following items: * - The target instance must be in the Running or Stopped state. The instance status changes after the operation is invoked: * - An instance in the Running (`Running`) state enters the Stopping (`Stopping`) state. * - An instance in the Stopped (`Stopped`) state enters the Starting (`Starting`) state. * - Instances on dedicated hosts cannot be redeployed. * - If the OperationLocks of an instance is marked with `"LockReason": "security"`, the instance cannot be redeployed. * - Simulated events created by invoking CreateSimulatedSystemEvent cannot be responded to. * - During the flow of isolating a local disk in a system event, you can also invoke RedeployInstance if the damaged local disk has been isolated but the SystemMaintenance.RebootAndReInitErrorDisk event has not been issued. For more information, see [Overview of system events for instances with local disks](https://help.aliyun.com/document_detail/107693.html). * The following table describes the system event types and event states that RedeployInstance can respond to. * | Event name and parameter | Event status | * | --- | --- | * | Instance restart due to system maintenance (SystemMaintenance.Reboot) | Inquiring, Scheduled | * | Instance redeployment due to system maintenance (SystemMaintenance.Redeploy) | Inquiring, Scheduled | * | Instance restart and damaged disk replacement due to system maintenance (SystemMaintenance.RebootAndIsolateErrorDisk) | Inquiring | * | Instance restart and damaged disk reinitialization due to system maintenance (SystemMaintenance.RebootAndReInitErrorDisk) | Inquiring | * | Instance redeployment due to system fault (SystemFailure.Redeploy) | Inquiring | * | For ECS instances with local disks only: instance restart due to system fault (SystemFailure.Reboot) | Executing | * | Damaged disk isolation due to system maintenance (SystemMaintenance.IsolateErrorDisk) | Inquiring | * | Damaged disk reinitialization due to system maintenance (SystemMaintenance.ReInitErrorDisk) | Inquiring | * > Redeploying an instance with local disks reinitializes the local disks, and all data on the storage devices is cleared. * * @param request - RedeployInstanceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns RedeployInstanceResponse */ async redeployInstanceWithOptions(request: $_model.RedeployInstanceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.RedeployInstanceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.forceStop)) { query["ForceStop"] = request.forceStop; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "RedeployInstance", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.RedeployInstanceResponse>(await this.callApi(params, req, runtime), new $_model.RedeployInstanceResponse({})); } /** * Invokes the RedeployInstance operation to redeploy an ECS instance when the ECS instance receives a system event notification. * * @remarks * ## Operation description * RedeployInstance is an asynchronous invocation that restarts and migrates an instance. After the redeployment succeeds, the instance enters the Running state. If the redeployment fails, the instance is returned to the original physical server and recovers to the state before the redeployment. * When you invoke this operation, take note of the following items: * - The target instance must be in the Running or Stopped state. The instance status changes after the operation is invoked: * - An instance in the Running (`Running`) state enters the Stopping (`Stopping`) state. * - An instance in the Stopped (`Stopped`) state enters the Starting (`Starting`) state. * - Instances on dedicated hosts cannot be redeployed. * - If the OperationLocks of an instance is marked with `"LockReason": "security"`, the instance cannot be redeployed. * - Simulated events created by invoking CreateSimulatedSystemEvent cannot be responded to. * - During the flow of isolating a local disk in a system event, you can also invoke RedeployInstance if the damaged local disk has been isolated but the SystemMaintenance.RebootAndReInitErrorDisk event has not been issued. For more information, see [Overview of system events for instances with local disks](https://help.aliyun.com/document_detail/107693.html). * The following table describes the system event types and event states that RedeployInstance can respond to. * | Event name and parameter | Event status | * | --- | --- | * | Instance restart due to system maintenance (SystemMaintenance.Reboot) | Inquiring, Scheduled | * | Instance redeployment due to system maintenance (SystemMaintenance.Redeploy) | Inquiring, Scheduled | * | Instance restart and damaged disk replacement due to system maintenance (SystemMaintenance.RebootAndIsolateErrorDisk) | Inquiring | * | Instance restart and damaged disk reinitialization due to system maintenance (SystemMaintenance.RebootAndReInitErrorDisk) | Inquiring | * | Instance redeployment due to system fault (SystemFailure.Redeploy) | Inquiring | * | For ECS instances with local disks only: instance restart due to system fault (SystemFailure.Reboot) | Executing | * | Damaged disk isolation due to system maintenance (SystemMaintenance.IsolateErrorDisk) | Inquiring | * | Damaged disk reinitialization due to system maintenance (SystemMaintenance.ReInitErrorDisk) | Inquiring | * > Redeploying an instance with local disks reinitializes the local disks, and all data on the storage devices is cleared. * * @param request - RedeployInstanceRequest * @returns RedeployInstanceResponse */ async redeployInstance(request: $_model.RedeployInstanceRequest): Promise<$_model.RedeployInstanceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.redeployInstanceWithOptions(request, runtime); } /** * Releases a capacity reservation. * * @remarks * If the release mode of a capacity reservation that takes effect immediately is set to manual release, you can call this operation to release the capacity reservation. * * @param request - ReleaseCapacityReservationRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ReleaseCapacityReservationResponse */ async releaseCapacityReservationWithOptions(request: $_model.ReleaseCapacityReservationRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ReleaseCapacityReservationResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ReleaseCapacityReservation", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ReleaseCapacityReservationResponse>(await this.callApi(params, req, runtime), new $_model.ReleaseCapacityReservationResponse({})); } /** * Releases a capacity reservation. * * @remarks * If the release mode of a capacity reservation that takes effect immediately is set to manual release, you can call this operation to release the capacity reservation. * * @param request - ReleaseCapacityReservationRequest * @returns ReleaseCapacityReservationResponse */ async releaseCapacityReservation(request: $_model.ReleaseCapacityReservationRequest): Promise<$_model.ReleaseCapacityReservationResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.releaseCapacityReservationWithOptions(request, runtime); } /** * Releases a pay-as-you-go Dedicated Host or an expired subscription Dedicated Host. * * @remarks * ## Usage notes * Before you release a pay-as-you-go dedicated host, make sure that no ECS instances are deployed on the dedicated host. * * @param request - ReleaseDedicatedHostRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ReleaseDedicatedHostResponse */ async releaseDedicatedHostWithOptions(request: $_model.ReleaseDedicatedHostRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ReleaseDedicatedHostResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dedicatedHostId)) { query["DedicatedHostId"] = request.dedicatedHostId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.terminateSubscription)) { query["TerminateSubscription"] = request.terminateSubscription; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ReleaseDedicatedHost", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ReleaseDedicatedHostResponse>(await this.callApi(params, req, runtime), new $_model.ReleaseDedicatedHostResponse({})); } /** * Releases a pay-as-you-go Dedicated Host or an expired subscription Dedicated Host. * * @remarks * ## Usage notes * Before you release a pay-as-you-go dedicated host, make sure that no ECS instances are deployed on the dedicated host. * * @param request - ReleaseDedicatedHostRequest * @returns ReleaseDedicatedHostResponse */ async releaseDedicatedHost(request: $_model.ReleaseDedicatedHostRequest): Promise<$_model.ReleaseDedicatedHostResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.releaseDedicatedHostWithOptions(request, runtime); } /** * ReleaseEipAddress * * @deprecated OpenAPI ReleaseEipAddress is deprecated, please use Vpc::2016-04-28::ReleaseEipAddress instead. * * @param request - ReleaseEipAddressRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ReleaseEipAddressResponse */ async releaseEipAddressWithOptions(request: $_model.ReleaseEipAddressRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ReleaseEipAddressResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.allocationId)) { query["AllocationId"] = request.allocationId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ReleaseEipAddress", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ReleaseEipAddressResponse>(await this.callApi(params, req, runtime), new $_model.ReleaseEipAddressResponse({})); } /** * ReleaseEipAddress * * @deprecated OpenAPI ReleaseEipAddress is deprecated, please use Vpc::2016-04-28::ReleaseEipAddress instead. * * @param request - ReleaseEipAddressRequest * @returns ReleaseEipAddressResponse */ // Deprecated async releaseEipAddress(request: $_model.ReleaseEipAddressRequest): Promise<$_model.ReleaseEipAddressResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.releaseEipAddressWithOptions(request, runtime); } /** * Releases a public IP from an instance. * * @deprecated OpenAPI ReleasePublicIpAddress is deprecated * * @param request - ReleasePublicIpAddressRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ReleasePublicIpAddressResponse */ async releasePublicIpAddressWithOptions(request: $_model.ReleasePublicIpAddressRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ReleasePublicIpAddressResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.publicIpAddress)) { query["PublicIpAddress"] = request.publicIpAddress; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ReleasePublicIpAddress", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ReleasePublicIpAddressResponse>(await this.callApi(params, req, runtime), new $_model.ReleasePublicIpAddressResponse({})); } /** * Releases a public IP from an instance. * * @deprecated OpenAPI ReleasePublicIpAddress is deprecated * * @param request - ReleasePublicIpAddressRequest * @returns ReleasePublicIpAddressResponse */ // Deprecated async releasePublicIpAddress(request: $_model.ReleasePublicIpAddressRequest): Promise<$_model.ReleasePublicIpAddressResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.releasePublicIpAddressWithOptions(request, runtime); } /** * RemoveBandwidthPackageIps * * @param request - RemoveBandwidthPackageIpsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns RemoveBandwidthPackageIpsResponse */ async removeBandwidthPackageIpsWithOptions(request: $_model.RemoveBandwidthPackageIpsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.RemoveBandwidthPackageIpsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.bandwidthPackageId)) { query["BandwidthPackageId"] = request.bandwidthPackageId; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.removedIpAddresses)) { query["RemovedIpAddresses"] = request.removedIpAddresses; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "RemoveBandwidthPackageIps", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.RemoveBandwidthPackageIpsResponse>(await this.callApi(params, req, runtime), new $_model.RemoveBandwidthPackageIpsResponse({})); } /** * RemoveBandwidthPackageIps * * @param request - RemoveBandwidthPackageIpsRequest * @returns RemoveBandwidthPackageIpsResponse */ async removeBandwidthPackageIps(request: $_model.RemoveBandwidthPackageIpsRequest): Promise<$_model.RemoveBandwidthPackageIpsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.removeBandwidthPackageIpsWithOptions(request, runtime); } /** * Calls RemoveTags to unbind one or more tags from resources such as instances, disks, snapshots, images, and security groups. * * @deprecated OpenAPI RemoveTags is deprecated, please use Ecs::2014-05-26::UntagResources instead. * * @param request - RemoveTagsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns RemoveTagsResponse */ async removeTagsWithOptions(request: $_model.RemoveTagsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.RemoveTagsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceId)) { query["ResourceId"] = request.resourceId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "RemoveTags", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.RemoveTagsResponse>(await this.callApi(params, req, runtime), new $_model.RemoveTagsResponse({})); } /** * Calls RemoveTags to unbind one or more tags from resources such as instances, disks, snapshots, images, and security groups. * * @deprecated OpenAPI RemoveTags is deprecated, please use Ecs::2014-05-26::UntagResources instead. * * @param request - RemoveTagsRequest * @returns RemoveTagsResponse */ // Deprecated async removeTags(request: $_model.RemoveTagsRequest): Promise<$_model.RemoveTagsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.removeTagsWithOptions(request, runtime); } /** * Renews one or more subscription dedicated hosts. * * @remarks * ## [](#)Usage notes * When you renew subscription dedicated hosts, vouchers are used first by default. Make sure that your account supports credit card payments or balance payments. * * @param request - RenewDedicatedHostsRequest * @param runtime - runtime options for this request RuntimeOptions * @returns RenewDedicatedHostsResponse */ async renewDedicatedHostsWithOptions(request: $_model.RenewDedicatedHostsRequest, runtime: $dara.RuntimeOptions): Promise<$_model.RenewDedicatedHostsResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.dedicatedHostIds)) { query["DedicatedHostIds"] = request.dedicatedHostIds; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "RenewDedicatedHosts", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.RenewDedicatedHostsResponse>(await this.callApi(params, req, runtime), new $_model.RenewDedicatedHostsResponse({})); } /** * Renews one or more subscription dedicated hosts. * * @remarks * ## [](#)Usage notes * When you renew subscription dedicated hosts, vouchers are used first by default. Make sure that your account supports credit card payments or balance payments. * * @param request - RenewDedicatedHostsRequest * @returns RenewDedicatedHostsResponse */ async renewDedicatedHosts(request: $_model.RenewDedicatedHostsRequest): Promise<$_model.RenewDedicatedHostsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.renewDedicatedHostsWithOptions(request, runtime); } /** * Renews one or more purchased elasticity assurance services. * * @param request - RenewElasticityAssurancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns RenewElasticityAssurancesResponse */ async renewElasticityAssurancesWithOptions(request: $_model.RenewElasticityAssurancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.RenewElasticityAssurancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoPay)) { query["AutoPay"] = request.autoPay; } if (!$dara.isNull(request.autoRenew)) { query["AutoRenew"] = request.autoRenew; } if (!$dara.isNull(request.autoRenewPeriod)) { query["AutoRenewPeriod"] = request.autoRenewPeriod; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "RenewElasticityAssurances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.RenewElasticityAssurancesResponse>(await this.callApi(params, req, runtime), new $_model.RenewElasticityAssurancesResponse({})); } /** * Renews one or more purchased elasticity assurance services. * * @param request - RenewElasticityAssurancesRequest * @returns RenewElasticityAssurancesResponse */ async renewElasticityAssurances(request: $_model.RenewElasticityAssurancesRequest): Promise<$_model.RenewElasticityAssurancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.renewElasticityAssurancesWithOptions(request, runtime); } /** * Renews a subscription Elastic Compute Service (ECS) instance. You can specify a renewal period or renew the instance to a unified expiration date. * * @remarks * *Before you call this operation, make sure that you are familiar with the billing methods and [pricing](https://www.alibabacloud.com/product/ecs#pricing) of ECS**. * - Make sure that your account balance or credit balance is sufficient. * - Only subscription instances are supported. If you call this operation for a pay-as-you-go instance, an error is returned. * - You must specify the renewal period-related parameter pair (`Period` and `PeriodUnit`) or `ExpectedRenewDay`, but not both. * * @param request - RenewInstanceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns RenewInstanceResponse */ async renewInstanceWithOptions(request: $_model.RenewInstanceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.RenewInstanceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.expectedRenewDay)) { query["ExpectedRenewDay"] = request.expectedRenewDay; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "RenewInstance", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.RenewInstanceResponse>(await this.callApi(params, req, runtime), new $_model.RenewInstanceResponse({})); } /** * Renews a subscription Elastic Compute Service (ECS) instance. You can specify a renewal period or renew the instance to a unified expiration date. * * @remarks * *Before you call this operation, make sure that you are familiar with the billing methods and [pricing](https://www.alibabacloud.com/product/ecs#pricing) of ECS**. * - Make sure that your account balance or credit balance is sufficient. * - Only subscription instances are supported. If you call this operation for a pay-as-you-go instance, an error is returned. * - You must specify the renewal period-related parameter pair (`Period` and `PeriodUnit`) or `ExpectedRenewDay`, but not both. * * @param request - RenewInstanceRequest * @returns RenewInstanceResponse */ async renewInstance(request: $_model.RenewInstanceRequest): Promise<$_model.RenewInstanceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.renewInstanceWithOptions(request, runtime); } /** * Renews one or more reserved instances. When you renew reserved instances, you can specify a validity period (renewal period) and whether to enable auto-renewal for the reserved instances. * * @remarks * *Before you call this operation, make sure that you are familiar with the billing and [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl) of reserved instances.** * - You can manually renew reserved instances or enable auto-renewal for reserved instances. For more information, see the [Renewal](~~100371#53bfc50b78sta~~) section of the "Reserved instances" topic. * - You can call the [DescribeReservedInstances](https://help.aliyun.com/document_detail/100065.html) operation to query the reserved instances that you purchased. * - You can call this operation to enable auto-renewal for reserved instances but cannot call this operation to disable auto-renewal for reserved instances. To disable auto-renewal for a reserved instance, call the [ModifyReservedInstanceAutoRenewAttribute](https://help.aliyun.com/document_detail/2679786.html) operation. * * @param request - RenewReservedInstancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns RenewReservedInstancesResponse */ async renewReservedInstancesWithOptions(request: $_model.RenewReservedInstancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.RenewReservedInstancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.autoRenew)) { query["AutoRenew"] = request.autoRenew; } if (!$dara.isNull(request.autoRenewPeriod)) { query["AutoRenewPeriod"] = request.autoRenewPeriod; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.reservedInstanceId)) { query["ReservedInstanceId"] = request.reservedInstanceId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "RenewReservedInstances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.RenewReservedInstancesResponse>(await this.callApi(params, req, runtime), new $_model.RenewReservedInstancesResponse({})); } /** * Renews one or more reserved instances. When you renew reserved instances, you can specify a validity period (renewal period) and whether to enable auto-renewal for the reserved instances. * * @remarks * *Before you call this operation, make sure that you are familiar with the billing and [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl) of reserved instances.** * - You can manually renew reserved instances or enable auto-renewal for reserved instances. For more information, see the [Renewal](~~100371#53bfc50b78sta~~) section of the "Reserved instances" topic. * - You can call the [DescribeReservedInstances](https://help.aliyun.com/document_detail/100065.html) operation to query the reserved instances that you purchased. * - You can call this operation to enable auto-renewal for reserved instances but cannot call this operation to disable auto-renewal for reserved instances. To disable auto-renewal for a reserved instance, call the [ModifyReservedInstanceAutoRenewAttribute](https://help.aliyun.com/document_detail/2679786.html) operation. * * @param request - RenewReservedInstancesRequest * @returns RenewReservedInstancesResponse */ async renewReservedInstances(request: $_model.RenewReservedInstancesRequest): Promise<$_model.RenewReservedInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.renewReservedInstancesWithOptions(request, runtime); } /** * Replaces the operating system (system disk) of an ECS instance. After the operating system of the ECS instance is replaced, the original system disk of the instance is released and a new system disk is generated for the instance. This causes the ID of the system disk to change. * * @remarks * 调用该接口前请您仔细阅读[更换系统盘(更换操作系统)](https://help.aliyun.com/document_detail/50134.html)。 * 更换系统盘时,您需要注意: * - 不支持变更系统盘计费方式。 * - 不支持更换系统盘的云盘类型。 * - 系统盘挂载的 ECS 实例不能有未支付的订单。 * - 实例的状态必须为已停止(`Stopped`)状态。 * > 仅适用于专有网络 VPC 类型实例。如果 ECS 实例为按量付费计费模式,且开启默认启用节省停机模式,为防止地域范围内的 ECS 实例库存不足,引起的更换系统盘后无法重启实例。您需要在停止该实例时设置为普通停机模式。具体操作,请参见 [StopInstance](https://help.aliyun.com/document_detail/25501.html) 。 * - 您可以通过参数`SystemDisk.Size`重新指定系统盘的容量大小(不能低于原系统盘容量)。 * - ECS 实例被安全锁定,即实例的`OperationLocks`参数值包含`"LockReason": "security"`,不支持更换系统盘。更多信息,请参见[安全锁定时的 API 行为](https://help.aliyun.com/document_detail/25695.html)。 * 更换系统盘后,可通过 [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) 接口查询更换系统盘的实例的状态验证是否更换成功。如果返回值`OperationLocks`为空,则表示更换系统盘的操作已完成。 * * @param request - ReplaceSystemDiskRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ReplaceSystemDiskResponse */ async replaceSystemDiskWithOptions(request: $_model.ReplaceSystemDiskRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ReplaceSystemDiskResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.architecture)) { query["Architecture"] = request.architecture; } if (!$dara.isNull(request.arn)) { query["Arn"] = request.arn; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.encryptAlgorithm)) { query["EncryptAlgorithm"] = request.encryptAlgorithm; } if (!$dara.isNull(request.encrypted)) { query["Encrypted"] = request.encrypted; } if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.KMSKeyId)) { query["KMSKeyId"] = request.KMSKeyId; } if (!$dara.isNull(request.keyPairName)) { query["KeyPairName"] = request.keyPairName; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.password)) { query["Password"] = request.password; } if (!$dara.isNull(request.passwordInherit)) { query["PasswordInherit"] = request.passwordInherit; } if (!$dara.isNull(request.platform)) { query["Platform"] = request.platform; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityEnhancementStrategy)) { query["SecurityEnhancementStrategy"] = request.securityEnhancementStrategy; } if (!$dara.isNull(request.useAdditionalService)) { query["UseAdditionalService"] = request.useAdditionalService; } if (!$dara.isNull(request.systemDisk)) { query["SystemDisk"] = request.systemDisk; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ReplaceSystemDisk", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ReplaceSystemDiskResponse>(await this.callApi(params, req, runtime), new $_model.ReplaceSystemDiskResponse({})); } /** * Replaces the operating system (system disk) of an ECS instance. After the operating system of the ECS instance is replaced, the original system disk of the instance is released and a new system disk is generated for the instance. This causes the ID of the system disk to change. * * @remarks * 调用该接口前请您仔细阅读[更换系统盘(更换操作系统)](https://help.aliyun.com/document_detail/50134.html)。 * 更换系统盘时,您需要注意: * - 不支持变更系统盘计费方式。 * - 不支持更换系统盘的云盘类型。 * - 系统盘挂载的 ECS 实例不能有未支付的订单。 * - 实例的状态必须为已停止(`Stopped`)状态。 * > 仅适用于专有网络 VPC 类型实例。如果 ECS 实例为按量付费计费模式,且开启默认启用节省停机模式,为防止地域范围内的 ECS 实例库存不足,引起的更换系统盘后无法重启实例。您需要在停止该实例时设置为普通停机模式。具体操作,请参见 [StopInstance](https://help.aliyun.com/document_detail/25501.html) 。 * - 您可以通过参数`SystemDisk.Size`重新指定系统盘的容量大小(不能低于原系统盘容量)。 * - ECS 实例被安全锁定,即实例的`OperationLocks`参数值包含`"LockReason": "security"`,不支持更换系统盘。更多信息,请参见[安全锁定时的 API 行为](https://help.aliyun.com/document_detail/25695.html)。 * 更换系统盘后,可通过 [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) 接口查询更换系统盘的实例的状态验证是否更换成功。如果返回值`OperationLocks`为空,则表示更换系统盘的操作已完成。 * * @param request - ReplaceSystemDiskRequest * @returns ReplaceSystemDiskResponse */ async replaceSystemDisk(request: $_model.ReplaceSystemDiskRequest): Promise<$_model.ReplaceSystemDiskResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.replaceSystemDiskWithOptions(request, runtime); } /** * Reports an exception on Elastic Compute Service (ECS) instances. You can report the same exception on multiple ECS instances or on multiple disks of an ECS instance. * * @param request - ReportInstancesStatusRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ReportInstancesStatusResponse */ async reportInstancesStatusWithOptions(request: $_model.ReportInstancesStatusRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ReportInstancesStatusResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.device)) { query["Device"] = request.device; } if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.endTime)) { query["EndTime"] = request.endTime; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.issueCategory)) { query["IssueCategory"] = request.issueCategory; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.reason)) { query["Reason"] = request.reason; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.startTime)) { query["StartTime"] = request.startTime; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ReportInstancesStatus", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ReportInstancesStatusResponse>(await this.callApi(params, req, runtime), new $_model.ReportInstancesStatusResponse({})); } /** * Reports an exception on Elastic Compute Service (ECS) instances. You can report the same exception on multiple ECS instances or on multiple disks of an ECS instance. * * @param request - ReportInstancesStatusRequest * @returns ReportInstancesStatusResponse */ async reportInstancesStatus(request: $_model.ReportInstancesStatusRequest): Promise<$_model.ReportInstancesStatusResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.reportInstancesStatusWithOptions(request, runtime); } /** * Rolls back a cloud disk to a snapshot from an earlier point in time. * * @remarks * Before you call this operation, read [Roll back a disk by using a snapshot](https://help.aliyun.com/document_detail/25450.html). * Take note of the following items: * - The cloud disk that you want to roll back must be in the In Use (`In_use`) or Unattached (`Available`) state. * - The instance to which the cloud disk is attached must be in the `Stopped` state. You can call the [StopInstances](https://help.aliyun.com/document_detail/155372.html) operation to stop the instance. * - The snapshot specified by `SnapshotId` must be created from the disk specified by `DiskId`. * - If the response contains `{"OperationLocks": {"LockReason" : "security"}}` when you query information about an instance by calling the [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) operation, the instance is locked for security reasons and no operations can be performed on the instance. * * @param request - ResetDiskRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ResetDiskResponse */ async resetDiskWithOptions(request: $_model.ResetDiskRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ResetDiskResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.snapshotId)) { query["SnapshotId"] = request.snapshotId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ResetDisk", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ResetDiskResponse>(await this.callApi(params, req, runtime), new $_model.ResetDiskResponse({})); } /** * Rolls back a cloud disk to a snapshot from an earlier point in time. * * @remarks * Before you call this operation, read [Roll back a disk by using a snapshot](https://help.aliyun.com/document_detail/25450.html). * Take note of the following items: * - The cloud disk that you want to roll back must be in the In Use (`In_use`) or Unattached (`Available`) state. * - The instance to which the cloud disk is attached must be in the `Stopped` state. You can call the [StopInstances](https://help.aliyun.com/document_detail/155372.html) operation to stop the instance. * - The snapshot specified by `SnapshotId` must be created from the disk specified by `DiskId`. * - If the response contains `{"OperationLocks": {"LockReason" : "security"}}` when you query information about an instance by calling the [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) operation, the instance is locked for security reasons and no operations can be performed on the instance. * * @param request - ResetDiskRequest * @returns ResetDiskResponse */ async resetDisk(request: $_model.ResetDiskRequest): Promise<$_model.ResetDiskResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.resetDiskWithOptions(request, runtime); } /** * Resets the Key Management Service (KMS) key used by Account-level Elastic Block Storage (EBS) Default Encryption in a region to the service key. * * @remarks * - You must grant the RAM user the `AliyunECSFullAccess` permissions. For information about how to grant permissions to a RAM user, see [Grant permissions to a RAM user](https://help.aliyun.com/document_detail/116146.html). * - Before you can call this operation in a region, make sure that the **Account-level Elastic Block Storage (EBS) Default Encryption** feature is enabled in the region. * * @param request - ResetDiskDefaultKMSKeyIdRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ResetDiskDefaultKMSKeyIdResponse */ async resetDiskDefaultKMSKeyIdWithOptions(request: $_model.ResetDiskDefaultKMSKeyIdRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ResetDiskDefaultKMSKeyIdResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ResetDiskDefaultKMSKeyId", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ResetDiskDefaultKMSKeyIdResponse>(await this.callApi(params, req, runtime), new $_model.ResetDiskDefaultKMSKeyIdResponse({})); } /** * Resets the Key Management Service (KMS) key used by Account-level Elastic Block Storage (EBS) Default Encryption in a region to the service key. * * @remarks * - You must grant the RAM user the `AliyunECSFullAccess` permissions. For information about how to grant permissions to a RAM user, see [Grant permissions to a RAM user](https://help.aliyun.com/document_detail/116146.html). * - Before you can call this operation in a region, make sure that the **Account-level Elastic Block Storage (EBS) Default Encryption** feature is enabled in the region. * * @param request - ResetDiskDefaultKMSKeyIdRequest * @returns ResetDiskDefaultKMSKeyIdResponse */ async resetDiskDefaultKMSKeyId(request: $_model.ResetDiskDefaultKMSKeyIdRequest): Promise<$_model.ResetDiskDefaultKMSKeyIdResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.resetDiskDefaultKMSKeyIdWithOptions(request, runtime); } /** * Restores one or more cloud disks from an instance snapshot. * * @remarks * This API is deprecated. Use [ResetDisk](https://help.aliyun.com/document_detail/25520.html) to roll back a cloud disk instead. * * @param request - ResetDisksRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ResetDisksResponse */ async resetDisksWithOptions(request: $_model.ResetDisksRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ResetDisksResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.disk)) { query["Disk"] = request.disk; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ResetDisks", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ResetDisksResponse>(await this.callApi(params, req, runtime), new $_model.ResetDisksResponse({})); } /** * Restores one or more cloud disks from an instance snapshot. * * @remarks * This API is deprecated. Use [ResetDisk](https://help.aliyun.com/document_detail/25520.html) to roll back a cloud disk instead. * * @param request - ResetDisksRequest * @returns ResetDisksResponse */ async resetDisks(request: $_model.ResetDisksRequest): Promise<$_model.ResetDisksResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.resetDisksWithOptions(request, runtime); } /** * Resizes a system disk or a data disk. * * @remarks * > 扩容前,请务必查询云盘采用的分区格式。如果是 MBR 格式,不支持扩容到 2TiB 以上,否则会造成数据丢失。对于 MBR 分区扩容,建议您重新创建并挂载一块数据盘,采用 GPT 分区格式后,再将已有数据拷贝至新的数据盘上。更多详情,请参见[扩容云盘容量](https://help.aliyun.com/document_detail/44986.html)。 * - 支持扩容的磁盘类型包括普通云盘(`cloud`)、高效云盘(`cloud_efficiency`)、SSD 云盘(`cloud_ssd`)、ESSD 云盘(`cloud_essd`)、ESSD Entry 云盘(cloud_essd_entry)、ESSD AutoPL 云盘(cloud_auto)、弹性临时盘-标准版(elastic_ephemeral_disk_standard)和弹性临时盘-高级版(elastic_ephemeral_disk_premium)、 ESSD 同城冗余云盘(cloud_regional_disk_auto)。 * - 正在创建快照的云盘不支持扩容。请您等待快照创建完成后,再开始执行扩容操作。 * - 该接口不能扩容分区和文件系统,您需要在扩容云盘容量后自行分配分区和文件系统,具体操作,请参见[扩容分区与文件系统(Linux)](~~2949817#bb3b1f02e51pj~~)和[扩容分区与文件系统(windows)](~~2932233#a9f9b78f3fujb~~)。 * - 开启多重挂载特性的云盘支持在线扩容和离线扩容,请确保磁盘挂载的实例满足以下条件: * - 在线扩容时,实例状态为**运行中**(`Running`)。 * - 离线扩容时,实例状态为**运行中**(`Running`)或**已停止**(`Stopped`)。 * - 请确保云盘满足以下条件: * - 云盘状态为使用中(`In Use`)或者待挂载(`Available`)。 * - (强烈建议)已为云盘创建快照,做好数据备份。具体操作,请参见[创建快照](https://help.aliyun.com/document_detail/25455.html)。 * - 如果您是全新购买的数据盘,请先完成初始化再执行扩容操作。更多信息,请参见[初始化概述](https://help.aliyun.com/document_detail/466323.html)。 * * @param request - ResizeDiskRequest * @param runtime - runtime options for this request RuntimeOptions * @returns ResizeDiskResponse */ async resizeDiskWithOptions(request: $_model.ResizeDiskRequest, runtime: $dara.RuntimeOptions): Promise<$_model.ResizeDiskResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.diskId)) { query["DiskId"] = request.diskId; } if (!$dara.isNull(request.newSize)) { query["NewSize"] = request.newSize; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.type)) { query["Type"] = request.type; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "ResizeDisk", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.ResizeDiskResponse>(await this.callApi(params, req, runtime), new $_model.ResizeDiskResponse({})); } /** * Resizes a system disk or a data disk. * * @remarks * > 扩容前,请务必查询云盘采用的分区格式。如果是 MBR 格式,不支持扩容到 2TiB 以上,否则会造成数据丢失。对于 MBR 分区扩容,建议您重新创建并挂载一块数据盘,采用 GPT 分区格式后,再将已有数据拷贝至新的数据盘上。更多详情,请参见[扩容云盘容量](https://help.aliyun.com/document_detail/44986.html)。 * - 支持扩容的磁盘类型包括普通云盘(`cloud`)、高效云盘(`cloud_efficiency`)、SSD 云盘(`cloud_ssd`)、ESSD 云盘(`cloud_essd`)、ESSD Entry 云盘(cloud_essd_entry)、ESSD AutoPL 云盘(cloud_auto)、弹性临时盘-标准版(elastic_ephemeral_disk_standard)和弹性临时盘-高级版(elastic_ephemeral_disk_premium)、 ESSD 同城冗余云盘(cloud_regional_disk_auto)。 * - 正在创建快照的云盘不支持扩容。请您等待快照创建完成后,再开始执行扩容操作。 * - 该接口不能扩容分区和文件系统,您需要在扩容云盘容量后自行分配分区和文件系统,具体操作,请参见[扩容分区与文件系统(Linux)](~~2949817#bb3b1f02e51pj~~)和[扩容分区与文件系统(windows)](~~2932233#a9f9b78f3fujb~~)。 * - 开启多重挂载特性的云盘支持在线扩容和离线扩容,请确保磁盘挂载的实例满足以下条件: * - 在线扩容时,实例状态为**运行中**(`Running`)。 * - 离线扩容时,实例状态为**运行中**(`Running`)或**已停止**(`Stopped`)。 * - 请确保云盘满足以下条件: * - 云盘状态为使用中(`In Use`)或者待挂载(`Available`)。 * - (强烈建议)已为云盘创建快照,做好数据备份。具体操作,请参见[创建快照](https://help.aliyun.com/document_detail/25455.html)。 * - 如果您是全新购买的数据盘,请先完成初始化再执行扩容操作。更多信息,请参见[初始化概述](https://help.aliyun.com/document_detail/466323.html)。 * * @param request - ResizeDiskRequest * @returns ResizeDiskResponse */ async resizeDisk(request: $_model.ResizeDiskRequest): Promise<$_model.ResizeDiskResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.resizeDiskWithOptions(request, runtime); } /** * Deletes one or more inbound security group rules from a specified security group. * * @remarks * >Notice: Starting July 8, 2024, Alibaba Cloud adjusted the validation rules for this operation. When you attempt to delete a security group rule that does not exist, the operation now returns the error code "InvalidParam.SecurityGroupRuleId" instead of a success response. Update your error code handling to be compatible accordingly to avoid impact on your production workloads. * You can use one of the following methods to pass parameters to delete rules: * - Specify security group rule IDs to delete rules (recommended). * - If a specified security group rule ID does not exist, the API invocation fails. * - Specify Permissions to delete rules. * - If no matching security group rule exists, the invocation succeeds but no rule is deleted. * - The following parameters are required to identify an inbound rule: * - Source settings: Set one of SourceCidrIp (IPv4 address), Ipv6SourceCidrIp (IPv6 address), SourcePrefixListId (prefix list ID), or SourceGroupId (source security group). * - Destination port range: PortRange. * - Protocol type: IpProtocol. * - Access policy: Policy. * > You cannot specify both security group rule IDs and Permissions at the same time. * ### Request examples * - Delete by specifying security group rule IDs. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4p****", // Specify the security group ID. * "SecurityGroupRuleId":["sgr-bpdfmk****","sgr-bpdfmg****"] // Specify the security group rule IDs. * ``` * - Delete by specifying an IP address range. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4p****", * "Permissions":[ * { * "SourceCidrIp":"10.0.0.0/8", // Specify the source IP address range. * "IpProtocol":"TCP", // Specify the protocol type. * "PortRange":"80/80", // Specify the destination port range. * "Policy":"accept" // Specify the access policy. * } * ] * ``` * - Delete by specifying another security group. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4p****", * "Permissions":[ * { * "SourceGroupId":"sg-bp67acfmxa123b****", // Specify the source security group ID. * "IpProtocol":"TCP," * "PortRange":"80/80", * "Policy":"accept" * ] * } * ``` * - Delete by specifying a prefix list. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4p****", * "Permissions":[ * { * "SourcePrefixListId":pl-x1j1k5ykzqlixdcy****", // Specify the source prefix list ID. * "IpProtocol":"TCP", * "PortRange":"80/80", * "Policy":"accept" * } * ] * ``` * * @param request - RevokeSecurityGroupRequest * @param runtime - runtime options for this request RuntimeOptions * @returns RevokeSecurityGroupResponse */ async revokeSecurityGroupWithOptions(request: $_model.RevokeSecurityGroupRequest, runtime: $dara.RuntimeOptions): Promise<$_model.RevokeSecurityGroupResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.destCidrIp)) { query["DestCidrIp"] = request.destCidrIp; } if (!$dara.isNull(request.ipProtocol)) { query["IpProtocol"] = request.ipProtocol; } if (!$dara.isNull(request.ipv6DestCidrIp)) { query["Ipv6DestCidrIp"] = request.ipv6DestCidrIp; } if (!$dara.isNull(request.ipv6SourceCidrIp)) { query["Ipv6SourceCidrIp"] = request.ipv6SourceCidrIp; } if (!$dara.isNull(request.nicType)) { query["NicType"] = request.nicType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.permissions)) { query["Permissions"] = request.permissions; } if (!$dara.isNull(request.policy)) { query["Policy"] = request.policy; } if (!$dara.isNull(request.portRange)) { query["PortRange"] = request.portRange; } if (!$dara.isNull(request.priority)) { query["Priority"] = request.priority; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.securityGroupRuleId)) { query["SecurityGroupRuleId"] = request.securityGroupRuleId; } if (!$dara.isNull(request.sourceCidrIp)) { query["SourceCidrIp"] = request.sourceCidrIp; } if (!$dara.isNull(request.sourceGroupId)) { query["SourceGroupId"] = request.sourceGroupId; } if (!$dara.isNull(request.sourceGroupOwnerAccount)) { query["SourceGroupOwnerAccount"] = request.sourceGroupOwnerAccount; } if (!$dara.isNull(request.sourceGroupOwnerId)) { query["SourceGroupOwnerId"] = request.sourceGroupOwnerId; } if (!$dara.isNull(request.sourcePortRange)) { query["SourcePortRange"] = request.sourcePortRange; } if (!$dara.isNull(request.sourcePrefixListId)) { query["SourcePrefixListId"] = request.sourcePrefixListId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "RevokeSecurityGroup", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.RevokeSecurityGroupResponse>(await this.callApi(params, req, runtime), new $_model.RevokeSecurityGroupResponse({})); } /** * Deletes one or more inbound security group rules from a specified security group. * * @remarks * >Notice: Starting July 8, 2024, Alibaba Cloud adjusted the validation rules for this operation. When you attempt to delete a security group rule that does not exist, the operation now returns the error code "InvalidParam.SecurityGroupRuleId" instead of a success response. Update your error code handling to be compatible accordingly to avoid impact on your production workloads. * You can use one of the following methods to pass parameters to delete rules: * - Specify security group rule IDs to delete rules (recommended). * - If a specified security group rule ID does not exist, the API invocation fails. * - Specify Permissions to delete rules. * - If no matching security group rule exists, the invocation succeeds but no rule is deleted. * - The following parameters are required to identify an inbound rule: * - Source settings: Set one of SourceCidrIp (IPv4 address), Ipv6SourceCidrIp (IPv6 address), SourcePrefixListId (prefix list ID), or SourceGroupId (source security group). * - Destination port range: PortRange. * - Protocol type: IpProtocol. * - Access policy: Policy. * > You cannot specify both security group rule IDs and Permissions at the same time. * ### Request examples * - Delete by specifying security group rule IDs. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4p****", // Specify the security group ID. * "SecurityGroupRuleId":["sgr-bpdfmk****","sgr-bpdfmg****"] // Specify the security group rule IDs. * ``` * - Delete by specifying an IP address range. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4p****", * "Permissions":[ * { * "SourceCidrIp":"10.0.0.0/8", // Specify the source IP address range. * "IpProtocol":"TCP", // Specify the protocol type. * "PortRange":"80/80", // Specify the destination port range. * "Policy":"accept" // Specify the access policy. * } * ] * ``` * - Delete by specifying another security group. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4p****", * "Permissions":[ * { * "SourceGroupId":"sg-bp67acfmxa123b****", // Specify the source security group ID. * "IpProtocol":"TCP," * "PortRange":"80/80", * "Policy":"accept" * ] * } * ``` * - Delete by specifying a prefix list. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4p****", * "Permissions":[ * { * "SourcePrefixListId":pl-x1j1k5ykzqlixdcy****", // Specify the source prefix list ID. * "IpProtocol":"TCP", * "PortRange":"80/80", * "Policy":"accept" * } * ] * ``` * * @param request - RevokeSecurityGroupRequest * @returns RevokeSecurityGroupResponse */ async revokeSecurityGroup(request: $_model.RevokeSecurityGroupRequest): Promise<$_model.RevokeSecurityGroupResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.revokeSecurityGroupWithOptions(request, runtime); } /** * Deletes one or more outbound security group rules from a specified security group. * * @remarks * >Notice: Alibaba Cloud adjusted the validation rules for this operation on July 8, 2024. When you attempt to delete a security group rule that does not exist, the operation now returns the error code "InvalidSecurityGroupRule.RuleNotExist" instead of a success response. Update your error code handling to be compatible with this change to avoid impacts on your production workloads. * You can use one of the following methods to pass parameters to delete security group rules: * - Delete rules by specifying security group rule IDs (recommended). * - If a specified security group rule ID does not exist, a fault is returned. * - Delete rules by specifying the Permissions parameter. * - If no matching security group rule exists, the invocation succeeds but no rule is deleted. * - The following parameters are required to delete a security group rule: * - Destination: Specify one of DestCidrIp (IPv4 address), Ipv6DestCidrIp (IPv6 address), DestPrefixListId (prefix list ID), or DestGroupId (destination security group). * - Destination port range: PortRange. * - Protocol type: IpProtocol. * - Access policy: Policy. * > You cannot specify both security group rule IDs and the Permissions parameter at the same time. * ### Request examples * - Delete by security group rule ID. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4p****", // Specify the security group ID. * "SecurityGroupRuleId":["sgr-bpdfmk****","sgr-bpdfmg****"] // Specify the security group rule IDs. * ``` * - Delete by IP CIDR block. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4ph***", * "Permissions":[ * { * "IpProtocol":"TCP", // Specify the protocol type. * "DestCidrIp":"10.0.0.0/8", // Specify the destination IP CIDR block. * "PortRange":"22/22", // Specify the destination port range. * "Policy":"accept" // Specify the authorization policy. * } * ] * ``` * * - Delete by destination security group. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4ph***", * "Permissions":[ * { * "DestGroupId":"sg-bp67acfmxa123b****", // Specify the destination security group ID. * "IpProtocol":"TCP", * "PortRange":"22/22", * "Policy":"accept" * } * ] * ``` * - Delete by prefix list. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4ph***", * "Permissions":[ * { * "IpProtocol":"TCP", * "DestPrefixListId":"pl-x1j1k5ykzqlixdcy****", // Specify the destination prefix list ID. * "PortRange":"22/22", * "Policy":"accept", * } * ] * ``` * * @param request - RevokeSecurityGroupEgressRequest * @param runtime - runtime options for this request RuntimeOptions * @returns RevokeSecurityGroupEgressResponse */ async revokeSecurityGroupEgressWithOptions(request: $_model.RevokeSecurityGroupEgressRequest, runtime: $dara.RuntimeOptions): Promise<$_model.RevokeSecurityGroupEgressResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.destCidrIp)) { query["DestCidrIp"] = request.destCidrIp; } if (!$dara.isNull(request.destGroupId)) { query["DestGroupId"] = request.destGroupId; } if (!$dara.isNull(request.destGroupOwnerAccount)) { query["DestGroupOwnerAccount"] = request.destGroupOwnerAccount; } if (!$dara.isNull(request.destGroupOwnerId)) { query["DestGroupOwnerId"] = request.destGroupOwnerId; } if (!$dara.isNull(request.destPrefixListId)) { query["DestPrefixListId"] = request.destPrefixListId; } if (!$dara.isNull(request.ipProtocol)) { query["IpProtocol"] = request.ipProtocol; } if (!$dara.isNull(request.ipv6DestCidrIp)) { query["Ipv6DestCidrIp"] = request.ipv6DestCidrIp; } if (!$dara.isNull(request.ipv6SourceCidrIp)) { query["Ipv6SourceCidrIp"] = request.ipv6SourceCidrIp; } if (!$dara.isNull(request.nicType)) { query["NicType"] = request.nicType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.permissions)) { query["Permissions"] = request.permissions; } if (!$dara.isNull(request.policy)) { query["Policy"] = request.policy; } if (!$dara.isNull(request.portRange)) { query["PortRange"] = request.portRange; } if (!$dara.isNull(request.priority)) { query["Priority"] = request.priority; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.securityGroupRuleId)) { query["SecurityGroupRuleId"] = request.securityGroupRuleId; } if (!$dara.isNull(request.sourceCidrIp)) { query["SourceCidrIp"] = request.sourceCidrIp; } if (!$dara.isNull(request.sourcePortRange)) { query["SourcePortRange"] = request.sourcePortRange; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "RevokeSecurityGroupEgress", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.RevokeSecurityGroupEgressResponse>(await this.callApi(params, req, runtime), new $_model.RevokeSecurityGroupEgressResponse({})); } /** * Deletes one or more outbound security group rules from a specified security group. * * @remarks * >Notice: Alibaba Cloud adjusted the validation rules for this operation on July 8, 2024. When you attempt to delete a security group rule that does not exist, the operation now returns the error code "InvalidSecurityGroupRule.RuleNotExist" instead of a success response. Update your error code handling to be compatible with this change to avoid impacts on your production workloads. * You can use one of the following methods to pass parameters to delete security group rules: * - Delete rules by specifying security group rule IDs (recommended). * - If a specified security group rule ID does not exist, a fault is returned. * - Delete rules by specifying the Permissions parameter. * - If no matching security group rule exists, the invocation succeeds but no rule is deleted. * - The following parameters are required to delete a security group rule: * - Destination: Specify one of DestCidrIp (IPv4 address), Ipv6DestCidrIp (IPv6 address), DestPrefixListId (prefix list ID), or DestGroupId (destination security group). * - Destination port range: PortRange. * - Protocol type: IpProtocol. * - Access policy: Policy. * > You cannot specify both security group rule IDs and the Permissions parameter at the same time. * ### Request examples * - Delete by security group rule ID. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4p****", // Specify the security group ID. * "SecurityGroupRuleId":["sgr-bpdfmk****","sgr-bpdfmg****"] // Specify the security group rule IDs. * ``` * - Delete by IP CIDR block. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4ph***", * "Permissions":[ * { * "IpProtocol":"TCP", // Specify the protocol type. * "DestCidrIp":"10.0.0.0/8", // Specify the destination IP CIDR block. * "PortRange":"22/22", // Specify the destination port range. * "Policy":"accept" // Specify the authorization policy. * } * ] * ``` * * - Delete by destination security group. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4ph***", * "Permissions":[ * { * "DestGroupId":"sg-bp67acfmxa123b****", // Specify the destination security group ID. * "IpProtocol":"TCP", * "PortRange":"22/22", * "Policy":"accept" * } * ] * ``` * - Delete by prefix list. * ``` * "SecurityGroupId":"sg-bp67acfmxazb4ph***", * "Permissions":[ * { * "IpProtocol":"TCP", * "DestPrefixListId":"pl-x1j1k5ykzqlixdcy****", // Specify the destination prefix list ID. * "PortRange":"22/22", * "Policy":"accept", * } * ] * ``` * * @param request - RevokeSecurityGroupEgressRequest * @returns RevokeSecurityGroupEgressResponse */ async revokeSecurityGroupEgress(request: $_model.RevokeSecurityGroupEgressRequest): Promise<$_model.RevokeSecurityGroupEgressResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.revokeSecurityGroupEgressWithOptions(request, runtime); } /** * Creates and runs a Cloud Assistant command, such as a Shell, PowerShell, or Bat script, on one or more ECS instances. This operation also supports scheduled execution, custom parameters, and execution in containers. * * @remarks * This is an asynchronous API. After a successful request, you can call [DescribeInvocations](https://help.aliyun.com/document_detail/2679916.html) or [DescribeInvocationResults](https://help.aliyun.com/document_detail/2679916.html) with the returned command ID or invocation ID to query the execution results. * ### Usage notes * - The target instance must be in the `Running` state. You can call [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) to query the instance status. * - The Cloud Assistant Agent must be pre-installed on the target instance. Otherwise, call [InstallCloudAssistant](https://help.aliyun.com/document_detail/64921.html) to install it and then call [DescribeCloudAssistantStatus](https://help.aliyun.com/document_detail/2679925.html) to query its installation status. * > By default, the Cloud Assistant Agent is pre-installed on ECS instances that are created from public images after December 1, 2017. * - When running PowerShell commands, make sure the PowerShell module is configured on the instance\\"s Windows operating system. * ### Precautions * - You can retain 500 to 50,000 Cloud Assistant commands in a single region. To request a higher quota, see [Quota Management](https://help.aliyun.com/document_detail/184116.html). * - To use new features for scheduled tasks, such as running tasks at fixed intervals, running a task only once at a specified time, or specifying a year or time zone for cron expression-based tasks, the Cloud Assistant Agent must be one of the following versions or later. If the `ClientNeedUpgrade` error code is returned, see [Upgrade or stop upgrading Cloud Assistant Agent](https://help.aliyun.com/document_detail/134383.html) to update the agent to the latest version. * ``` * - Linux: 2.2.3.282 * - Windows: 2.1.3.282 * ``` * - When you run a scheduled task based on a cron expression and specify a time zone, the task runs in the specified time zone. If you do not specify a time zone, the task runs in the system time zone of the ECS instance, and the execution time depends on the instance\\"s system clock. Ensure that the time and time zone of your ECS instance are set as expected. For more information about time zones, see [Set the time zone and NTP service for a Linux instance](https://help.aliyun.com/document_detail/92803.html) or [Set the NTP service for a Windows instance](https://help.aliyun.com/document_detail/51890.html). * ### Recommendations * - **Timeout settings**: You can specify the `Timeout` parameter to set the maximum execution timeout for a command on an ECS instance. If the command execution times out, the Cloud Assistant Agent forcibly terminates the process. * - If a one-time execution times out, its execution status ([InvokeRecordStatus](https://help.aliyun.com/document_detail/64845.html)) becomes Failed. * - For a scheduled task, the timeout period applies to each execution. A timeout in one execution does not affect the next. If an execution times out, its execution status ([InvokeRecordStatus](https://help.aliyun.com/document_detail/64845.html)) becomes Failed. * - **Execution failures**: A command can fail due to an abnormal instance state, network problems, or an unresponsive Cloud Assistant Agent. In these cases, no execution information is generated. For more information, see [Common errors and suggestions for fixing execution failures](https://help.aliyun.com/document_detail/87029.html). * - **Custom parameters**: To use custom parameters, set `EnableParameter` to `true`. You can then define parameters in `CommandContent` using the `{{parameter}}` format and pass their corresponding key-value pairs when you run the command. * * @param tmpReq - RunCommandRequest * @param runtime - runtime options for this request RuntimeOptions * @returns RunCommandResponse */ async runCommandWithOptions(tmpReq: $_model.RunCommandRequest, runtime: $dara.RuntimeOptions): Promise<$_model.RunCommandResponse> { tmpReq.validate(); let request = new $_model.RunCommandShrinkRequest({ }); OpenApiUtil.convert(tmpReq, request); if (!$dara.isNull(tmpReq.parameters)) { request.parametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.parameters, "Parameters", "json"); } let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.commandContent)) { query["CommandContent"] = request.commandContent; } if (!$dara.isNull(request.containerId)) { query["ContainerId"] = request.containerId; } if (!$dara.isNull(request.containerName)) { query["ContainerName"] = request.containerName; } if (!$dara.isNull(request.contentEncoding)) { query["ContentEncoding"] = request.contentEncoding; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.enableParameter)) { query["EnableParameter"] = request.enableParameter; } if (!$dara.isNull(request.frequency)) { query["Frequency"] = request.frequency; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.keepCommand)) { query["KeepCommand"] = request.keepCommand; } if (!$dara.isNull(request.launcher)) { query["Launcher"] = request.launcher; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.ossOutputDelivery)) { query["OssOutputDelivery"] = request.ossOutputDelivery; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.parametersShrink)) { query["Parameters"] = request.parametersShrink; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.repeatMode)) { query["RepeatMode"] = request.repeatMode; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourceTag)) { query["ResourceTag"] = request.resourceTag; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.terminationMode)) { query["TerminationMode"] = request.terminationMode; } if (!$dara.isNull(request.timed)) { query["Timed"] = request.timed; } if (!$dara.isNull(request.timeout)) { query["Timeout"] = request.timeout; } if (!$dara.isNull(request.type)) { query["Type"] = request.type; } if (!$dara.isNull(request.username)) { query["Username"] = request.username; } if (!$dara.isNull(request.windowsPasswordName)) { query["WindowsPasswordName"] = request.windowsPasswordName; } if (!$dara.isNull(request.workingDir)) { query["WorkingDir"] = request.workingDir; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "RunCommand", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.RunCommandResponse>(await this.callApi(params, req, runtime), new $_model.RunCommandResponse({})); } /** * Creates and runs a Cloud Assistant command, such as a Shell, PowerShell, or Bat script, on one or more ECS instances. This operation also supports scheduled execution, custom parameters, and execution in containers. * * @remarks * This is an asynchronous API. After a successful request, you can call [DescribeInvocations](https://help.aliyun.com/document_detail/2679916.html) or [DescribeInvocationResults](https://help.aliyun.com/document_detail/2679916.html) with the returned command ID or invocation ID to query the execution results. * ### Usage notes * - The target instance must be in the `Running` state. You can call [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) to query the instance status. * - The Cloud Assistant Agent must be pre-installed on the target instance. Otherwise, call [InstallCloudAssistant](https://help.aliyun.com/document_detail/64921.html) to install it and then call [DescribeCloudAssistantStatus](https://help.aliyun.com/document_detail/2679925.html) to query its installation status. * > By default, the Cloud Assistant Agent is pre-installed on ECS instances that are created from public images after December 1, 2017. * - When running PowerShell commands, make sure the PowerShell module is configured on the instance\\"s Windows operating system. * ### Precautions * - You can retain 500 to 50,000 Cloud Assistant commands in a single region. To request a higher quota, see [Quota Management](https://help.aliyun.com/document_detail/184116.html). * - To use new features for scheduled tasks, such as running tasks at fixed intervals, running a task only once at a specified time, or specifying a year or time zone for cron expression-based tasks, the Cloud Assistant Agent must be one of the following versions or later. If the `ClientNeedUpgrade` error code is returned, see [Upgrade or stop upgrading Cloud Assistant Agent](https://help.aliyun.com/document_detail/134383.html) to update the agent to the latest version. * ``` * - Linux: 2.2.3.282 * - Windows: 2.1.3.282 * ``` * - When you run a scheduled task based on a cron expression and specify a time zone, the task runs in the specified time zone. If you do not specify a time zone, the task runs in the system time zone of the ECS instance, and the execution time depends on the instance\\"s system clock. Ensure that the time and time zone of your ECS instance are set as expected. For more information about time zones, see [Set the time zone and NTP service for a Linux instance](https://help.aliyun.com/document_detail/92803.html) or [Set the NTP service for a Windows instance](https://help.aliyun.com/document_detail/51890.html). * ### Recommendations * - **Timeout settings**: You can specify the `Timeout` parameter to set the maximum execution timeout for a command on an ECS instance. If the command execution times out, the Cloud Assistant Agent forcibly terminates the process. * - If a one-time execution times out, its execution status ([InvokeRecordStatus](https://help.aliyun.com/document_detail/64845.html)) becomes Failed. * - For a scheduled task, the timeout period applies to each execution. A timeout in one execution does not affect the next. If an execution times out, its execution status ([InvokeRecordStatus](https://help.aliyun.com/document_detail/64845.html)) becomes Failed. * - **Execution failures**: A command can fail due to an abnormal instance state, network problems, or an unresponsive Cloud Assistant Agent. In these cases, no execution information is generated. For more information, see [Common errors and suggestions for fixing execution failures](https://help.aliyun.com/document_detail/87029.html). * - **Custom parameters**: To use custom parameters, set `EnableParameter` to `true`. You can then define parameters in `CommandContent` using the `{{parameter}}` format and pass their corresponding key-value pairs when you run the command. * * @param request - RunCommandRequest * @returns RunCommandResponse */ async runCommand(request: $_model.RunCommandRequest): Promise<$_model.RunCommandResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.runCommandWithOptions(request, runtime); } /** * This API is used to batch create ECS instances and supports automatic start, assigning public IP addresses, and setting automatic release time. * * @remarks * Creating instances incurs charges. Billable items include [instance type](https://help.aliyun.com/document_detail/25398.html), [image](https://help.aliyun.com/document_detail/179021.html), [block storage](https://help.aliyun.com/document_detail/179022.html), and [Internet bandwidth](https://help.aliyun.com/document_detail/25411.html). Before using this API, ensure that you fully understand the billing method of ECS products and their [pricing](https://www.aliyun.com/price/product#/ecs/detail). * Before using this API, ensure that you fully understand the billing method of ECS products and their [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl). * This API is asynchronous. After a successful request to create an instance, the instance ID is returned immediately. However, the creation and startup of the instance are not completed instantly. You can call [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to check the instance information. When the status in the response is `Running`, it indicates that the instance has been successfully created and started. * ### Prerequisites * * - Ensure that your account has passed identity verification. For more information, see [Account Identity Verification Documentation](https://help.aliyun.com/document_detail/48263.html). * - If insufficient resource inventory prevents the creation of the requested instance, Alibaba Cloud immediately sends a system event indicating instance creation failure (`SystemFailure.Delete`). You can use [DescribeInstanceHistoryEvents](https://help.aliyun.com/document_detail/2679897.html) to check for such events. For more information, see [Instance Creation Failure Events](https://help.aliyun.com/document_detail/2545990.html). * - Ensure that the total number of instances you create or the aggregate vCPU count across all instance types does not exceed your system quota. For more information, see [Quota Center](https://quotas.console.aliyun.com/products/ecs/quotas). * - Before creating an instance of the virtual private cloud (VPC) type, create a VPC in the corresponding Alibaba Cloud region in advance. For more information, see [create a VPC](https://help.aliyun.com/document_detail/65430.html). * ### Notes * - If the instance billing method is subscription (`PrePaid`), available coupons are automatically applied by default during payment. * - A single request can create up to 100 instances. If you need to create more than 100 instances, we recommend that you split the request into batches or make concurrent calls. * - If the value of the `InternetMaxBandwidthOut` parameter is greater than 0, a public IP address is automatically assigned to the instance. * > The total peak Internet bandwidth billed on a pay-by-bandwidth basis for a single Alibaba Cloud account in a single region is subject to limits. For more information, see [Internet Bandwidth Limits](~~25412#BandwidthQuota~~). * ### Recommendations * - **Testing Scenario**: You can send a dry run request by setting `DryRun=true`. * - **Release Instances**: You can set the automatic release time by using the `AutoReleaseTime` parameter, or manually release instances by calling [DeleteInstances](https://help.aliyun.com/document_detail/2679710.html). * - **Management and Retrieval**: We recommend that you assign tags (`Tag.N.Key` and `Tag.N.Value`) to each batch of instances you start, and add a sequential suffix (`UniqueSuffix`) to the hostname (`HostName`) and instance name (`InstanceName`). For more information, see [Batch Configure Sequential Instance Names or Hostnames](https://help.aliyun.com/document_detail/196048.html). * - **Launch Template**: Using a launch template eliminates the need to repeatedly specify numerous configuration parameters when creating instances. After creating a launch template via [CreateLaunchTemplate](https://help.aliyun.com/document_detail/2679729.html), you can specify `LaunchTemplateId` and `LaunchTemplateVersion` in your `RunInstances` request to use the template. * - **Disable Hyper-Threading**: In memory-intensive scenarios, you can improve the memory-to-vCPU ratio by setting `CpuOptions.ThreadsPerCore=1` to disable hyper-threading. * - **Enable Jumbo Frame**: You can enable the jumbo frame feature at instance creation by setting `NetworkOptions.EnableJumboFrame=true`. For more information, see [ECS Instance MTU](https://help.aliyun.com/document_detail/200512.html). * ## Request Example * Suppose you want to create several ECS instances in the China (Hangzhou) region. You intend to use a specific image, instance type, security group, and virtual switch, configure system and data disks of certain capacities, assign a public IP address, and set the instance name and password. The corresponding request parameters are as follows: * ``` * RegionId:"cn-hangzhou", // Set the region to China (Hangzhou) * ImageId:"aliyun_3_x64_20G_alibase_20221102.vhd", // Set the image ID * InstanceType:"ecs.g7.large", // Set the instance type * SecurityGroupId:"sg-bp150uqocpf9jj70****", // Set the security group ID * VSwitchId:"vsw-bp1qo7s91cbch5i4l****", // Set the virtual switch ID * SystemDisk:{ * Category:"cloud_essd", // Set the system disk category to enterprise SSD (ESSD) * Size:40, // Set the system disk size to 40 GiB * }, * DataDisk:[ * { * Category:"cloud_essd", // Set the data disk category to enterprise SSD (ESSD) * Size:100, // Set the data disk size to 100 GiB * } * ], * HostName:"ECS-test", // Set the instance hostname * Password:"ECS@test1234", // Set the logon password * InternetMaxBandwidthOut:10 // Set the outbound public bandwidth to 10 Mbit/s * ``` * Based on the above configuration, create different types of instances: *
* * Example: Create 5 auto-renewal subscription instances * * ``` * Amount:5, // Create 5 instances * InstanceChargeType:"PrePaid", // Indicates subscription billing * PeriodUnit:"Month", // Set the period unit to "Month" * Period:1, // Set the subscription duration to 1 month * AutoRenew:true, // Enable auto-renewal * AutoRenewPeriod:1 // Set the auto-renewal period to 1 month * ``` *
*
* * Example: Create 10 pay-as-you-go instances * * ``` * Amount:10, // Create 10 instances * InstanceChargeType:"PostPaid", // Indicates pay-as-you-go billing * SpotStrategy:"NoSpot" // Default value, indicating standard pay-as-you-go * ``` *
*
* * Example: Create 20 spot instances with bidding strategy and retention duration * * ``` * Amount:20, // Create 20 instances * InstanceChargeType:"PostPaid", * SpotStrategy:"SpotAsPriceGo", // Indicates bidding based on market price * SpotDuration:1 // Set the spot instance retention duration to 1 hour * ``` *
* Suppose you have already created a launch template using [CreateLaunchTemplate](https://help.aliyun.com/document_detail/2679729.html) and now want to use this template to create some ECS instances in the China (Hangzhou) region. The example is as follows: *
* * Example: Create 10 ECS instances using a launch template * * ``` * RegionId:"cn-hangzhou", // Set the region to China (Hangzhou) * Amount:10, // Create 10 instances * LaunchTemplateId:"lt-bp14xczpoxvb6rre****" // Specify the launch template ID * ``` *
* >Notice: * If both instance parameters and template parameters are specified, the instance parameters take precedence. For example, if the billing method in the template is subscription but `InstanceChargeType` is set to `PostPaid`, the created instance will be a pay-as-you-go instance. *
* * Example: Create 1 instance using a full image (a custom image that includes both system and data disks) * * ``` * RegionId:"cn-hangzhou", // Set the region to China (Hangzhou) * ImageId = m-bp13ohd32cvzpq9e****,// Custom image ID * InstanceType = ecs.u1-c1m1.large,// Instance type * SecurityGroupId = sg-bp10jztp6b0sdsyl****,// Security group ID * VSwitchId = vsw-bp19wo63nleroq22g****,// Virtual switch ID * SystemDisk.Size = 50,// Set the size of the system disk included in the full image * SystemDisk.Category = cloud_auto,// Set the disk category of the system disk included in the full image * DataDisk.0.Device = /dev/xvdb,// Set the mount target of the data disk included in the full image * DataDisk.0.Size = 50,// Set the size of the data disk included in the full image * DataDisk.0.Category = cloud_essd,// Set the disk category of the data disk included in the full image * DataDisk.1.Device = /dev/xvdc,// Mount target of an additional data disk; to replace the data disk included in the full image, set DataDisk.1.Device = /dev/xvdb (the default mount target in the full image). * DataDisk.1.Size = 70,// Size of the additional data disk * DataDisk.1.Category = cloud_auto,// Disk category of the additional data disk * ``` *
* * @param request - RunInstancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns RunInstancesResponse */ async runInstancesWithOptions(request: $_model.RunInstancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.RunInstancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.affinity)) { query["Affinity"] = request.affinity; } if (!$dara.isNull(request.amount)) { query["Amount"] = request.amount; } if (!$dara.isNull(request.arn)) { query["Arn"] = request.arn; } if (!$dara.isNull(request.autoPay)) { query["AutoPay"] = request.autoPay; } if (!$dara.isNull(request.autoReleaseTime)) { query["AutoReleaseTime"] = request.autoReleaseTime; } if (!$dara.isNull(request.autoRenew)) { query["AutoRenew"] = request.autoRenew; } if (!$dara.isNull(request.autoRenewPeriod)) { query["AutoRenewPeriod"] = request.autoRenewPeriod; } if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.clockOptions)) { query["ClockOptions"] = request.clockOptions; } if (!$dara.isNull(request.creditSpecification)) { query["CreditSpecification"] = request.creditSpecification; } if (!$dara.isNull(request.dataDisk)) { query["DataDisk"] = request.dataDisk; } if (!$dara.isNull(request.dedicatedHostId)) { query["DedicatedHostId"] = request.dedicatedHostId; } if (!$dara.isNull(request.deletionProtection)) { query["DeletionProtection"] = request.deletionProtection; } if (!$dara.isNull(request.deploymentSetGroupNo)) { query["DeploymentSetGroupNo"] = request.deploymentSetGroupNo; } if (!$dara.isNull(request.deploymentSetId)) { query["DeploymentSetId"] = request.deploymentSetId; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.hostName)) { query["HostName"] = request.hostName; } if (!$dara.isNull(request.hostNames)) { query["HostNames"] = request.hostNames; } if (!$dara.isNull(request.hpcClusterId)) { query["HpcClusterId"] = request.hpcClusterId; } if (!$dara.isNull(request.httpEndpoint)) { query["HttpEndpoint"] = request.httpEndpoint; } if (!$dara.isNull(request.httpPutResponseHopLimit)) { query["HttpPutResponseHopLimit"] = request.httpPutResponseHopLimit; } if (!$dara.isNull(request.httpTokens)) { query["HttpTokens"] = request.httpTokens; } if (!$dara.isNull(request.imageFamily)) { query["ImageFamily"] = request.imageFamily; } if (!$dara.isNull(request.imageId)) { query["ImageId"] = request.imageId; } if (!$dara.isNull(request.imageOptions)) { query["ImageOptions"] = request.imageOptions; } if (!$dara.isNull(request.instanceChargeType)) { query["InstanceChargeType"] = request.instanceChargeType; } if (!$dara.isNull(request.instanceName)) { query["InstanceName"] = request.instanceName; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.internetChargeType)) { query["InternetChargeType"] = request.internetChargeType; } if (!$dara.isNull(request.internetMaxBandwidthIn)) { query["InternetMaxBandwidthIn"] = request.internetMaxBandwidthIn; } if (!$dara.isNull(request.internetMaxBandwidthOut)) { query["InternetMaxBandwidthOut"] = request.internetMaxBandwidthOut; } if (!$dara.isNull(request.ioOptimized)) { query["IoOptimized"] = request.ioOptimized; } if (!$dara.isNull(request.ipv6Address)) { query["Ipv6Address"] = request.ipv6Address; } if (!$dara.isNull(request.ipv6AddressCount)) { query["Ipv6AddressCount"] = request.ipv6AddressCount; } if (!$dara.isNull(request.isp)) { query["Isp"] = request.isp; } if (!$dara.isNull(request.keyPairName)) { query["KeyPairName"] = request.keyPairName; } if (!$dara.isNull(request.launchTemplateId)) { query["LaunchTemplateId"] = request.launchTemplateId; } if (!$dara.isNull(request.launchTemplateName)) { query["LaunchTemplateName"] = request.launchTemplateName; } if (!$dara.isNull(request.launchTemplateVersion)) { query["LaunchTemplateVersion"] = request.launchTemplateVersion; } if (!$dara.isNull(request.minAmount)) { query["MinAmount"] = request.minAmount; } if (!$dara.isNull(request.networkInterface)) { query["NetworkInterface"] = request.networkInterface; } if (!$dara.isNull(request.networkInterfaceQueueNumber)) { query["NetworkInterfaceQueueNumber"] = request.networkInterfaceQueueNumber; } if (!$dara.isNull(request.networkOptions)) { query["NetworkOptions"] = request.networkOptions; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.password)) { query["Password"] = request.password; } if (!$dara.isNull(request.passwordInherit)) { query["PasswordInherit"] = request.passwordInherit; } if (!$dara.isNull(request.period)) { query["Period"] = request.period; } if (!$dara.isNull(request.periodUnit)) { query["PeriodUnit"] = request.periodUnit; } if (!$dara.isNull(request.privateDnsNameOptions)) { query["PrivateDnsNameOptions"] = request.privateDnsNameOptions; } if (!$dara.isNull(request.privateIpAddress)) { query["PrivateIpAddress"] = request.privateIpAddress; } if (!$dara.isNull(request.ramRoleName)) { query["RamRoleName"] = request.ramRoleName; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.securityEnhancementStrategy)) { query["SecurityEnhancementStrategy"] = request.securityEnhancementStrategy; } if (!$dara.isNull(request.securityGroupId)) { query["SecurityGroupId"] = request.securityGroupId; } if (!$dara.isNull(request.securityGroupIds)) { query["SecurityGroupIds"] = request.securityGroupIds; } if (!$dara.isNull(request.spotDuration)) { query["SpotDuration"] = request.spotDuration; } if (!$dara.isNull(request.spotInterruptionBehavior)) { query["SpotInterruptionBehavior"] = request.spotInterruptionBehavior; } if (!$dara.isNull(request.spotPriceLimit)) { query["SpotPriceLimit"] = request.spotPriceLimit; } if (!$dara.isNull(request.spotStrategy)) { query["SpotStrategy"] = request.spotStrategy; } if (!$dara.isNull(request.storageSetId)) { query["StorageSetId"] = request.storageSetId; } if (!$dara.isNull(request.storageSetPartitionNumber)) { query["StorageSetPartitionNumber"] = request.storageSetPartitionNumber; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.tenancy)) { query["Tenancy"] = request.tenancy; } if (!$dara.isNull(request.uniqueSuffix)) { query["UniqueSuffix"] = request.uniqueSuffix; } if (!$dara.isNull(request.userData)) { query["UserData"] = request.userData; } if (!$dara.isNull(request.vSwitchId)) { query["VSwitchId"] = request.vSwitchId; } if (!$dara.isNull(request.zoneId)) { query["ZoneId"] = request.zoneId; } if (!$dara.isNull(request.cpuOptions)) { query["CpuOptions"] = request.cpuOptions; } if (!$dara.isNull(request.hibernationOptions)) { query["HibernationOptions"] = request.hibernationOptions; } if (!$dara.isNull(request.privatePoolOptions)) { query["PrivatePoolOptions"] = request.privatePoolOptions; } if (!$dara.isNull(request.schedulerOptions)) { query["SchedulerOptions"] = request.schedulerOptions; } if (!$dara.isNull(request.securityOptions)) { query["SecurityOptions"] = request.securityOptions; } if (!$dara.isNull(request.systemDisk)) { query["SystemDisk"] = request.systemDisk; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "RunInstances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.RunInstancesResponse>(await this.callApi(params, req, runtime), new $_model.RunInstancesResponse({})); } /** * This API is used to batch create ECS instances and supports automatic start, assigning public IP addresses, and setting automatic release time. * * @remarks * Creating instances incurs charges. Billable items include [instance type](https://help.aliyun.com/document_detail/25398.html), [image](https://help.aliyun.com/document_detail/179021.html), [block storage](https://help.aliyun.com/document_detail/179022.html), and [Internet bandwidth](https://help.aliyun.com/document_detail/25411.html). Before using this API, ensure that you fully understand the billing method of ECS products and their [pricing](https://www.aliyun.com/price/product#/ecs/detail). * Before using this API, ensure that you fully understand the billing method of ECS products and their [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl). * This API is asynchronous. After a successful request to create an instance, the instance ID is returned immediately. However, the creation and startup of the instance are not completed instantly. You can call [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to check the instance information. When the status in the response is `Running`, it indicates that the instance has been successfully created and started. * ### Prerequisites * * - Ensure that your account has passed identity verification. For more information, see [Account Identity Verification Documentation](https://help.aliyun.com/document_detail/48263.html). * - If insufficient resource inventory prevents the creation of the requested instance, Alibaba Cloud immediately sends a system event indicating instance creation failure (`SystemFailure.Delete`). You can use [DescribeInstanceHistoryEvents](https://help.aliyun.com/document_detail/2679897.html) to check for such events. For more information, see [Instance Creation Failure Events](https://help.aliyun.com/document_detail/2545990.html). * - Ensure that the total number of instances you create or the aggregate vCPU count across all instance types does not exceed your system quota. For more information, see [Quota Center](https://quotas.console.aliyun.com/products/ecs/quotas). * - Before creating an instance of the virtual private cloud (VPC) type, create a VPC in the corresponding Alibaba Cloud region in advance. For more information, see [create a VPC](https://help.aliyun.com/document_detail/65430.html). * ### Notes * - If the instance billing method is subscription (`PrePaid`), available coupons are automatically applied by default during payment. * - A single request can create up to 100 instances. If you need to create more than 100 instances, we recommend that you split the request into batches or make concurrent calls. * - If the value of the `InternetMaxBandwidthOut` parameter is greater than 0, a public IP address is automatically assigned to the instance. * > The total peak Internet bandwidth billed on a pay-by-bandwidth basis for a single Alibaba Cloud account in a single region is subject to limits. For more information, see [Internet Bandwidth Limits](~~25412#BandwidthQuota~~). * ### Recommendations * - **Testing Scenario**: You can send a dry run request by setting `DryRun=true`. * - **Release Instances**: You can set the automatic release time by using the `AutoReleaseTime` parameter, or manually release instances by calling [DeleteInstances](https://help.aliyun.com/document_detail/2679710.html). * - **Management and Retrieval**: We recommend that you assign tags (`Tag.N.Key` and `Tag.N.Value`) to each batch of instances you start, and add a sequential suffix (`UniqueSuffix`) to the hostname (`HostName`) and instance name (`InstanceName`). For more information, see [Batch Configure Sequential Instance Names or Hostnames](https://help.aliyun.com/document_detail/196048.html). * - **Launch Template**: Using a launch template eliminates the need to repeatedly specify numerous configuration parameters when creating instances. After creating a launch template via [CreateLaunchTemplate](https://help.aliyun.com/document_detail/2679729.html), you can specify `LaunchTemplateId` and `LaunchTemplateVersion` in your `RunInstances` request to use the template. * - **Disable Hyper-Threading**: In memory-intensive scenarios, you can improve the memory-to-vCPU ratio by setting `CpuOptions.ThreadsPerCore=1` to disable hyper-threading. * - **Enable Jumbo Frame**: You can enable the jumbo frame feature at instance creation by setting `NetworkOptions.EnableJumboFrame=true`. For more information, see [ECS Instance MTU](https://help.aliyun.com/document_detail/200512.html). * ## Request Example * Suppose you want to create several ECS instances in the China (Hangzhou) region. You intend to use a specific image, instance type, security group, and virtual switch, configure system and data disks of certain capacities, assign a public IP address, and set the instance name and password. The corresponding request parameters are as follows: * ``` * RegionId:"cn-hangzhou", // Set the region to China (Hangzhou) * ImageId:"aliyun_3_x64_20G_alibase_20221102.vhd", // Set the image ID * InstanceType:"ecs.g7.large", // Set the instance type * SecurityGroupId:"sg-bp150uqocpf9jj70****", // Set the security group ID * VSwitchId:"vsw-bp1qo7s91cbch5i4l****", // Set the virtual switch ID * SystemDisk:{ * Category:"cloud_essd", // Set the system disk category to enterprise SSD (ESSD) * Size:40, // Set the system disk size to 40 GiB * }, * DataDisk:[ * { * Category:"cloud_essd", // Set the data disk category to enterprise SSD (ESSD) * Size:100, // Set the data disk size to 100 GiB * } * ], * HostName:"ECS-test", // Set the instance hostname * Password:"ECS@test1234", // Set the logon password * InternetMaxBandwidthOut:10 // Set the outbound public bandwidth to 10 Mbit/s * ``` * Based on the above configuration, create different types of instances: *
* * Example: Create 5 auto-renewal subscription instances * * ``` * Amount:5, // Create 5 instances * InstanceChargeType:"PrePaid", // Indicates subscription billing * PeriodUnit:"Month", // Set the period unit to "Month" * Period:1, // Set the subscription duration to 1 month * AutoRenew:true, // Enable auto-renewal * AutoRenewPeriod:1 // Set the auto-renewal period to 1 month * ``` *
*
* * Example: Create 10 pay-as-you-go instances * * ``` * Amount:10, // Create 10 instances * InstanceChargeType:"PostPaid", // Indicates pay-as-you-go billing * SpotStrategy:"NoSpot" // Default value, indicating standard pay-as-you-go * ``` *
*
* * Example: Create 20 spot instances with bidding strategy and retention duration * * ``` * Amount:20, // Create 20 instances * InstanceChargeType:"PostPaid", * SpotStrategy:"SpotAsPriceGo", // Indicates bidding based on market price * SpotDuration:1 // Set the spot instance retention duration to 1 hour * ``` *
* Suppose you have already created a launch template using [CreateLaunchTemplate](https://help.aliyun.com/document_detail/2679729.html) and now want to use this template to create some ECS instances in the China (Hangzhou) region. The example is as follows: *
* * Example: Create 10 ECS instances using a launch template * * ``` * RegionId:"cn-hangzhou", // Set the region to China (Hangzhou) * Amount:10, // Create 10 instances * LaunchTemplateId:"lt-bp14xczpoxvb6rre****" // Specify the launch template ID * ``` *
* >Notice: * If both instance parameters and template parameters are specified, the instance parameters take precedence. For example, if the billing method in the template is subscription but `InstanceChargeType` is set to `PostPaid`, the created instance will be a pay-as-you-go instance. *
* * Example: Create 1 instance using a full image (a custom image that includes both system and data disks) * * ``` * RegionId:"cn-hangzhou", // Set the region to China (Hangzhou) * ImageId = m-bp13ohd32cvzpq9e****,// Custom image ID * InstanceType = ecs.u1-c1m1.large,// Instance type * SecurityGroupId = sg-bp10jztp6b0sdsyl****,// Security group ID * VSwitchId = vsw-bp19wo63nleroq22g****,// Virtual switch ID * SystemDisk.Size = 50,// Set the size of the system disk included in the full image * SystemDisk.Category = cloud_auto,// Set the disk category of the system disk included in the full image * DataDisk.0.Device = /dev/xvdb,// Set the mount target of the data disk included in the full image * DataDisk.0.Size = 50,// Set the size of the data disk included in the full image * DataDisk.0.Category = cloud_essd,// Set the disk category of the data disk included in the full image * DataDisk.1.Device = /dev/xvdc,// Mount target of an additional data disk; to replace the data disk included in the full image, set DataDisk.1.Device = /dev/xvdb (the default mount target in the full image). * DataDisk.1.Size = 70,// Size of the additional data disk * DataDisk.1.Category = cloud_auto,// Disk category of the additional data disk * ``` *
* * @param request - RunInstancesRequest * @returns RunInstancesResponse */ async runInstances(request: $_model.RunInstancesRequest): Promise<$_model.RunInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.runInstancesWithOptions(request, runtime); } /** * Sends a file to one or more Elastic Compute Service (ECS) instances. * * @remarks * ## API Guide * - The target ECS instances must be in the running (`Running`) status. * - The target ECS instances must have the [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html) installed in advance. * - The Cloud Assistant Agent version must be higher than the following versions to support file delivery. If the response returns the `ClientNeedUpgrade` error code, update the client to the latest version: * - Linux: 1.0.2.569 * - Windows: 1.0.0.149 * - After Base64 encoding, the file content size must not exceed 32 KB. * - File delivery might fail due to abnormal status of the target ECS instance, network issues, or Cloud Assistant Agent abnormalities. To troubleshoot, invoke [DescribeSendFileResults](https://help.aliyun.com/document_detail/184117.html) or refer to [Common errors and troubleshooting suggestions for execution failures](https://help.aliyun.com/document_detail/87029.html). * * @param request - SendFileRequest * @param runtime - runtime options for this request RuntimeOptions * @returns SendFileResponse */ async sendFileWithOptions(request: $_model.SendFileRequest, runtime: $dara.RuntimeOptions): Promise<$_model.SendFileResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.content)) { query["Content"] = request.content; } if (!$dara.isNull(request.contentType)) { query["ContentType"] = request.contentType; } if (!$dara.isNull(request.description)) { query["Description"] = request.description; } if (!$dara.isNull(request.fileGroup)) { query["FileGroup"] = request.fileGroup; } if (!$dara.isNull(request.fileMode)) { query["FileMode"] = request.fileMode; } if (!$dara.isNull(request.fileOwner)) { query["FileOwner"] = request.fileOwner; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.name)) { query["Name"] = request.name; } if (!$dara.isNull(request.overwrite)) { query["Overwrite"] = request.overwrite; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceGroupId)) { query["ResourceGroupId"] = request.resourceGroupId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.targetDir)) { query["TargetDir"] = request.targetDir; } if (!$dara.isNull(request.timeout)) { query["Timeout"] = request.timeout; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "SendFile", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.SendFileResponse>(await this.callApi(params, req, runtime), new $_model.SendFileResponse({})); } /** * Sends a file to one or more Elastic Compute Service (ECS) instances. * * @remarks * ## API Guide * - The target ECS instances must be in the running (`Running`) status. * - The target ECS instances must have the [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html) installed in advance. * - The Cloud Assistant Agent version must be higher than the following versions to support file delivery. If the response returns the `ClientNeedUpgrade` error code, update the client to the latest version: * - Linux: 1.0.2.569 * - Windows: 1.0.0.149 * - After Base64 encoding, the file content size must not exceed 32 KB. * - File delivery might fail due to abnormal status of the target ECS instance, network issues, or Cloud Assistant Agent abnormalities. To troubleshoot, invoke [DescribeSendFileResults](https://help.aliyun.com/document_detail/184117.html) or refer to [Common errors and troubleshooting suggestions for execution failures](https://help.aliyun.com/document_detail/87029.html). * * @param request - SendFileRequest * @returns SendFileResponse */ async sendFile(request: $_model.SendFileRequest): Promise<$_model.SendFileResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.sendFileWithOptions(request, runtime); } /** * Executes an image creation task (image building task) by using an image template. * * @remarks * - After you create an image template, you can call the StartImagePipelineExecution operation to create a pipeline task. The system creates, copies, and shares images based on the parameters configured in the image template. * - You can execute only one pipeline task for each image template. * * @param request - StartImagePipelineExecutionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns StartImagePipelineExecutionResponse */ async startImagePipelineExecutionWithOptions(request: $_model.StartImagePipelineExecutionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.StartImagePipelineExecutionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.imagePipelineId)) { query["ImagePipelineId"] = request.imagePipelineId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } if (!$dara.isNull(request.templateTag)) { query["TemplateTag"] = request.templateTag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "StartImagePipelineExecution", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.StartImagePipelineExecutionResponse>(await this.callApi(params, req, runtime), new $_model.StartImagePipelineExecutionResponse({})); } /** * Executes an image creation task (image building task) by using an image template. * * @remarks * - After you create an image template, you can call the StartImagePipelineExecution operation to create a pipeline task. The system creates, copies, and shares images based on the parameters configured in the image template. * - You can execute only one pipeline task for each image template. * * @param request - StartImagePipelineExecutionRequest * @returns StartImagePipelineExecutionResponse */ async startImagePipelineExecution(request: $_model.StartImagePipelineExecutionRequest): Promise<$_model.StartImagePipelineExecutionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.startImagePipelineExecutionWithOptions(request, runtime); } /** * Starts an Elastic Compute Service (ECS) instance. You can specify the ID of an ECS instance and parameters, such as InitLocalDisk, in the request based on your business requirements to start the instance. * * @remarks * This operation is an asynchronous operation. After you call this operation to start an ECS instance, the operation sets the status of the ECS instance to Starting and begins the startup process. You can call the [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) operation to query the status of the ECS instance. When the status of the ECS instance changes to `Running`, the instance is started. * ### [](#)Precautions * - You cannot call this operation to start an ECS instance that is locked for security reasons. For more information, see [API behavior when an instance is locked for security reasons](https://help.aliyun.com/document_detail/25695.html). * - The ECS instance that you want to start must be in the **Stopped** (`Stopped`) state. * - If an ECS instance is stopped in economical mode, the instance may fail to be started due to insufficient resources. * * @param request - StartInstanceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns StartInstanceResponse */ async startInstanceWithOptions(request: $_model.StartInstanceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.StartInstanceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.initLocalDisk)) { query["InitLocalDisk"] = request.initLocalDisk; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "StartInstance", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.StartInstanceResponse>(await this.callApi(params, req, runtime), new $_model.StartInstanceResponse({})); } /** * Starts an Elastic Compute Service (ECS) instance. You can specify the ID of an ECS instance and parameters, such as InitLocalDisk, in the request based on your business requirements to start the instance. * * @remarks * This operation is an asynchronous operation. After you call this operation to start an ECS instance, the operation sets the status of the ECS instance to Starting and begins the startup process. You can call the [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) operation to query the status of the ECS instance. When the status of the ECS instance changes to `Running`, the instance is started. * ### [](#)Precautions * - You cannot call this operation to start an ECS instance that is locked for security reasons. For more information, see [API behavior when an instance is locked for security reasons](https://help.aliyun.com/document_detail/25695.html). * - The ECS instance that you want to start must be in the **Stopped** (`Stopped`) state. * - If an ECS instance is stopped in economical mode, the instance may fail to be started due to insufficient resources. * * @param request - StartInstanceRequest * @returns StartInstanceResponse */ async startInstance(request: $_model.StartInstanceRequest): Promise<$_model.StartInstanceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.startInstanceWithOptions(request, runtime); } /** * Starts Elastic Compute Service (ECS) instances that are in the Stopped state. * * @remarks * This operation is an asynchronous operation. After you call this operation to start ECS instances, the operation sets the status of the ECS instances to Starting and begins the startup process. You can call the [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) operation to query the status of the instances. When the status of the ECS instances changes to `Running`, the instances are started. * ### [](#)Precautions * - You cannot call this operation to start ECS instances that are locked for security reasons. For more information, see [API behavior when an instance is locked for security reasons](https://help.aliyun.com/document_detail/25695.html). * - The ECS instances that you want to start must be in the **Stopped** (`Stopped`) state. * - ECS instances stopped in economical mode may fail to be started due to insufficient resources. * * @param request - StartInstancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns StartInstancesResponse */ async startInstancesWithOptions(request: $_model.StartInstancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.StartInstancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.batchOptimization)) { query["BatchOptimization"] = request.batchOptimization; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "StartInstances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.StartInstancesResponse>(await this.callApi(params, req, runtime), new $_model.StartInstancesResponse({})); } /** * Starts Elastic Compute Service (ECS) instances that are in the Stopped state. * * @remarks * This operation is an asynchronous operation. After you call this operation to start ECS instances, the operation sets the status of the ECS instances to Starting and begins the startup process. You can call the [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) operation to query the status of the instances. When the status of the ECS instances changes to `Running`, the instances are started. * ### [](#)Precautions * - You cannot call this operation to start ECS instances that are locked for security reasons. For more information, see [API behavior when an instance is locked for security reasons](https://help.aliyun.com/document_detail/25695.html). * - The ECS instances that you want to start must be in the **Stopped** (`Stopped`) state. * - ECS instances stopped in economical mode may fail to be started due to insufficient resources. * * @param request - StartInstancesRequest * @returns StartInstancesResponse */ async startInstances(request: $_model.StartInstancesRequest): Promise<$_model.StartInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.startInstancesWithOptions(request, runtime); } /** * Invokes StartTerminalSession to create a session based on the session management feature. You can establish a WebSocket session with an ECS instance by specifying the instance ID. The WebSocketUrl returned by this operation can be used to establish a remote connection to the ECS instance. * * @remarks * ## Operation description * When you customize a remote connection client by using code, you can invoke this operation to obtain the WebSocketUrl for establishing a remote connection to an ECS instance. Take note of the following items: * - The specified ECS instance must be in the Running state. * - Cloud Assistant Agent must be installed on the specified ECS instance. You can invoke [DescribeCloudAssistantStatus](https://help.aliyun.com/document_detail/87346.html) to check whether Cloud Assistant Agent is installed on the ECS instance and query the version number of Cloud Assistant Agent. * - If Cloud Assistant Agent is not installed on the ECS instance, invoke [InstallCloudAssistant](https://help.aliyun.com/document_detail/85916.html) to install it. * - The version number of Cloud Assistant Agent must be later than the following versions to support the session management feature. To upgrade Cloud Assistant Agent, see [Update or disable updates for Cloud Assistant Agent](https://help.aliyun.com/document_detail/134383.html). * - Linux operating system: 2.2.3.256 * - Windows operating system: 2.1.3.256 * - After this operation is invoked, the WebSocketUrl is valid for 10 minutes. * - After a session is established, Cloud Assistant closes the connection if no data is transmitted for 3 minutes. * - In a single region, a maximum of 100 sessions can be created and active. A maximum of 20 sessions can be in the connected state for a single ECS instance. The bandwidth limit for a single session is 200 KB/s. * - The port forwarding feature supports only TCP port forwarding. UDP is not supported. * - To permanently shutdown a session and invalidate the WebSocketUrl, invoke the EndTerminalSession operation. * * @param tmpReq - StartTerminalSessionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns StartTerminalSessionResponse */ async startTerminalSessionWithOptions(tmpReq: $_model.StartTerminalSessionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.StartTerminalSessionResponse> { tmpReq.validate(); let request = new $_model.StartTerminalSessionShrinkRequest({ }); OpenApiUtil.convert(tmpReq, request); if (!$dara.isNull(tmpReq.encryptionOptions)) { request.encryptionOptionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.encryptionOptions, "EncryptionOptions", "json"); } let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.commandLine)) { query["CommandLine"] = request.commandLine; } if (!$dara.isNull(request.connectionType)) { query["ConnectionType"] = request.connectionType; } if (!$dara.isNull(request.encryptionOptionsShrink)) { query["EncryptionOptions"] = request.encryptionOptionsShrink; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.passwordName)) { query["PasswordName"] = request.passwordName; } if (!$dara.isNull(request.portNumber)) { query["PortNumber"] = request.portNumber; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.targetServer)) { query["TargetServer"] = request.targetServer; } if (!$dara.isNull(request.username)) { query["Username"] = request.username; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "StartTerminalSession", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.StartTerminalSessionResponse>(await this.callApi(params, req, runtime), new $_model.StartTerminalSessionResponse({})); } /** * Invokes StartTerminalSession to create a session based on the session management feature. You can establish a WebSocket session with an ECS instance by specifying the instance ID. The WebSocketUrl returned by this operation can be used to establish a remote connection to the ECS instance. * * @remarks * ## Operation description * When you customize a remote connection client by using code, you can invoke this operation to obtain the WebSocketUrl for establishing a remote connection to an ECS instance. Take note of the following items: * - The specified ECS instance must be in the Running state. * - Cloud Assistant Agent must be installed on the specified ECS instance. You can invoke [DescribeCloudAssistantStatus](https://help.aliyun.com/document_detail/87346.html) to check whether Cloud Assistant Agent is installed on the ECS instance and query the version number of Cloud Assistant Agent. * - If Cloud Assistant Agent is not installed on the ECS instance, invoke [InstallCloudAssistant](https://help.aliyun.com/document_detail/85916.html) to install it. * - The version number of Cloud Assistant Agent must be later than the following versions to support the session management feature. To upgrade Cloud Assistant Agent, see [Update or disable updates for Cloud Assistant Agent](https://help.aliyun.com/document_detail/134383.html). * - Linux operating system: 2.2.3.256 * - Windows operating system: 2.1.3.256 * - After this operation is invoked, the WebSocketUrl is valid for 10 minutes. * - After a session is established, Cloud Assistant closes the connection if no data is transmitted for 3 minutes. * - In a single region, a maximum of 100 sessions can be created and active. A maximum of 20 sessions can be in the connected state for a single ECS instance. The bandwidth limit for a single session is 200 KB/s. * - The port forwarding feature supports only TCP port forwarding. UDP is not supported. * - To permanently shutdown a session and invalidate the WebSocketUrl, invoke the EndTerminalSession operation. * * @param request - StartTerminalSessionRequest * @returns StartTerminalSessionResponse */ async startTerminalSession(request: $_model.StartTerminalSessionRequest): Promise<$_model.StartTerminalSessionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.startTerminalSessionWithOptions(request, runtime); } /** * Stops an Elastic Compute Service (ECS) instance. You can specify different stop strategies, stop modes, and batch operation modes to stop the ECS instance. * * @remarks * This is an asynchronous operation. The ECS instance is not stopped immediately after a successful invocation. The ECS instance first enters the Stopping state. You can invoke [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query the instance status. When the returned status is `Stopped`, the ECS instance is stopped. * ### Before you begin * - ECS instances that are locked for security reasons cannot be stopped by invoking this operation. For more information, see [Impact of resource security locks on API calls](https://help.aliyun.com/document_detail/25695.html). * - After you enable the economical mode for VPC-connected instances, you can set `StoppedMode=KeepCharging` to enable the standard stop mode. The ECS instance continues billing after it is stopped, and the ECS instance type inventory and Internet IP address are retained. * * @param request - StopInstanceRequest * @param runtime - runtime options for this request RuntimeOptions * @returns StopInstanceResponse */ async stopInstanceWithOptions(request: $_model.StopInstanceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.StopInstanceResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.confirmStop)) { query["ConfirmStop"] = request.confirmStop; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.forceStop)) { query["ForceStop"] = request.forceStop; } if (!$dara.isNull(request.hibernate)) { query["Hibernate"] = request.hibernate; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.stoppedMode)) { query["StoppedMode"] = request.stoppedMode; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "StopInstance", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.StopInstanceResponse>(await this.callApi(params, req, runtime), new $_model.StopInstanceResponse({})); } /** * Stops an Elastic Compute Service (ECS) instance. You can specify different stop strategies, stop modes, and batch operation modes to stop the ECS instance. * * @remarks * This is an asynchronous operation. The ECS instance is not stopped immediately after a successful invocation. The ECS instance first enters the Stopping state. You can invoke [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query the instance status. When the returned status is `Stopped`, the ECS instance is stopped. * ### Before you begin * - ECS instances that are locked for security reasons cannot be stopped by invoking this operation. For more information, see [Impact of resource security locks on API calls](https://help.aliyun.com/document_detail/25695.html). * - After you enable the economical mode for VPC-connected instances, you can set `StoppedMode=KeepCharging` to enable the standard stop mode. The ECS instance continues billing after it is stopped, and the ECS instance type inventory and Internet IP address are retained. * * @param request - StopInstanceRequest * @returns StopInstanceResponse */ async stopInstance(request: $_model.StopInstanceRequest): Promise<$_model.StopInstanceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.stopInstanceWithOptions(request, runtime); } /** * Stops one or more ECS instances. You can specify the stop method, stop mode, and batch operation mode. * * @remarks * This is an asynchronous operation. After a successful call, the instance enters the Stopping state. Call [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query the instance status. When the returned status is `Stopped`, the instance is stopped. * ### Before you begin * - After an instance is stopped, it becomes unavailable. Make sure that stopping the instance does not affect your business. Call [StartInstance](https://help.aliyun.com/document_detail/2679679.html) or [StartInstances](https://help.aliyun.com/document_detail/2679680.html) to start the instance. * - Instances that are locked for security reasons cannot be stopped by calling this operation. For more information, see [Impacts of resource security locks on API calls](https://help.aliyun.com/document_detail/25695.html). * * @param request - StopInstancesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns StopInstancesResponse */ async stopInstancesWithOptions(request: $_model.StopInstancesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.StopInstancesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.batchOptimization)) { query["BatchOptimization"] = request.batchOptimization; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.forceStop)) { query["ForceStop"] = request.forceStop; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.stoppedMode)) { query["StoppedMode"] = request.stoppedMode; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "StopInstances", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.StopInstancesResponse>(await this.callApi(params, req, runtime), new $_model.StopInstancesResponse({})); } /** * Stops one or more ECS instances. You can specify the stop method, stop mode, and batch operation mode. * * @remarks * This is an asynchronous operation. After a successful call, the instance enters the Stopping state. Call [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query the instance status. When the returned status is `Stopped`, the instance is stopped. * ### Before you begin * - After an instance is stopped, it becomes unavailable. Make sure that stopping the instance does not affect your business. Call [StartInstance](https://help.aliyun.com/document_detail/2679679.html) or [StartInstances](https://help.aliyun.com/document_detail/2679680.html) to start the instance. * - Instances that are locked for security reasons cannot be stopped by calling this operation. For more information, see [Impacts of resource security locks on API calls](https://help.aliyun.com/document_detail/25695.html). * * @param request - StopInstancesRequest * @returns StopInstancesResponse */ async stopInstances(request: $_model.StopInstancesRequest): Promise<$_model.StopInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.stopInstancesWithOptions(request, runtime); } /** * \\\\\\\\* If you stop the process of a command that runs only once, the executions that have started are not interrupted. The executions that have not started are canceled. * \\\\\\\\* If you stop the process of a scheduled invocation command, the executions that have started are not interrupted. However, the execution does not start in the next period. * * @remarks * ## 接口说明 * - 停止单次命令进程后,已经开始执行的实例会继续执行,未开始执行的实例将不再执行。 * - 停止周期命令进程后,已经开始执行的命令将继续执行,但后续将不会再进行下一次的执行。 * * @param request - StopInvocationRequest * @param runtime - runtime options for this request RuntimeOptions * @returns StopInvocationResponse */ async stopInvocationWithOptions(request: $_model.StopInvocationRequest, runtime: $dara.RuntimeOptions): Promise<$_model.StopInvocationResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.invokeId)) { query["InvokeId"] = request.invokeId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "StopInvocation", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.StopInvocationResponse>(await this.callApi(params, req, runtime), new $_model.StopInvocationResponse({})); } /** * \\\\\\\\* If you stop the process of a command that runs only once, the executions that have started are not interrupted. The executions that have not started are canceled. * \\\\\\\\* If you stop the process of a scheduled invocation command, the executions that have started are not interrupted. However, the execution does not start in the next period. * * @remarks * ## 接口说明 * - 停止单次命令进程后,已经开始执行的实例会继续执行,未开始执行的实例将不再执行。 * - 停止周期命令进程后,已经开始执行的命令将继续执行,但后续将不会再进行下一次的执行。 * * @param request - StopInvocationRequest * @returns StopInvocationResponse */ async stopInvocation(request: $_model.StopInvocationRequest): Promise<$_model.StopInvocationResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.stopInvocationWithOptions(request, runtime); } /** * Creates and adds tags to Elastic Compute Service (ECS) resources. * * @remarks * ## [](#)Usage notes * Before you add tags to a resource, Alibaba Cloud checks the number of existing tags of the resource. If the maximum number of tags is reached, an error message is returned. For more information, see [Tag limits](https://help.aliyun.com/document_detail/25412.html). * * @param request - TagResourcesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns TagResourcesResponse */ async tagResourcesWithOptions(request: $_model.TagResourcesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.TagResourcesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceId)) { query["ResourceId"] = request.resourceId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } if (!$dara.isNull(request.tag)) { query["Tag"] = request.tag; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "TagResources", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.TagResourcesResponse>(await this.callApi(params, req, runtime), new $_model.TagResourcesResponse({})); } /** * Creates and adds tags to Elastic Compute Service (ECS) resources. * * @remarks * ## [](#)Usage notes * Before you add tags to a resource, Alibaba Cloud checks the number of existing tags of the resource. If the maximum number of tags is reached, an error message is returned. For more information, see [Tag limits](https://help.aliyun.com/document_detail/25412.html). * * @param request - TagResourcesRequest * @returns TagResourcesResponse */ async tagResources(request: $_model.TagResourcesRequest): Promise<$_model.TagResourcesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.tagResourcesWithOptions(request, runtime); } /** * Terminates a physical connection. * * @deprecated OpenAPI TerminatePhysicalConnection is deprecated, please use Vpc::2016-04-28::TerminatePhysicalConnection instead. * * @param request - TerminatePhysicalConnectionRequest * @param runtime - runtime options for this request RuntimeOptions * @returns TerminatePhysicalConnectionResponse */ async terminatePhysicalConnectionWithOptions(request: $_model.TerminatePhysicalConnectionRequest, runtime: $dara.RuntimeOptions): Promise<$_model.TerminatePhysicalConnectionResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.physicalConnectionId)) { query["PhysicalConnectionId"] = request.physicalConnectionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "TerminatePhysicalConnection", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.TerminatePhysicalConnectionResponse>(await this.callApi(params, req, runtime), new $_model.TerminatePhysicalConnectionResponse({})); } /** * Terminates a physical connection. * * @deprecated OpenAPI TerminatePhysicalConnection is deprecated, please use Vpc::2016-04-28::TerminatePhysicalConnection instead. * * @param request - TerminatePhysicalConnectionRequest * @returns TerminatePhysicalConnectionResponse */ // Deprecated async terminatePhysicalConnection(request: $_model.TerminatePhysicalConnectionRequest): Promise<$_model.TerminatePhysicalConnectionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.terminatePhysicalConnectionWithOptions(request, runtime); } /** * Terminates a virtual border router (VBR). * * @deprecated OpenAPI TerminateVirtualBorderRouter is deprecated, please use Vpc::2016-04-28::TerminateVirtualBorderRouter instead. * * @param request - TerminateVirtualBorderRouterRequest * @param runtime - runtime options for this request RuntimeOptions * @returns TerminateVirtualBorderRouterResponse */ async terminateVirtualBorderRouterWithOptions(request: $_model.TerminateVirtualBorderRouterRequest, runtime: $dara.RuntimeOptions): Promise<$_model.TerminateVirtualBorderRouterResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.userCidr)) { query["UserCidr"] = request.userCidr; } if (!$dara.isNull(request.vbrId)) { query["VbrId"] = request.vbrId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "TerminateVirtualBorderRouter", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.TerminateVirtualBorderRouterResponse>(await this.callApi(params, req, runtime), new $_model.TerminateVirtualBorderRouterResponse({})); } /** * Terminates a virtual border router (VBR). * * @deprecated OpenAPI TerminateVirtualBorderRouter is deprecated, please use Vpc::2016-04-28::TerminateVirtualBorderRouter instead. * * @param request - TerminateVirtualBorderRouterRequest * @returns TerminateVirtualBorderRouterResponse */ // Deprecated async terminateVirtualBorderRouter(request: $_model.TerminateVirtualBorderRouterRequest): Promise<$_model.TerminateVirtualBorderRouterResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.terminateVirtualBorderRouterWithOptions(request, runtime); } /** * Unassigns one or more IPv6 addresses from an Elastic Network Interface (ENI). * * @remarks * ## Operation description * When you invoke this operation, take note of the following items: * - The Elastic Network Interface (ENI) must be in the **Active** or **InUse** state. * - If you are operating on a primary network interface controller (NIC), the ECS instance to which the NIC is attached must be in the **Running** or **Stopped** state. * * @param request - UnassignIpv6AddressesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns UnassignIpv6AddressesResponse */ async unassignIpv6AddressesWithOptions(request: $_model.UnassignIpv6AddressesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.UnassignIpv6AddressesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ipv6Address)) { query["Ipv6Address"] = request.ipv6Address; } if (!$dara.isNull(request.ipv6Prefix)) { query["Ipv6Prefix"] = request.ipv6Prefix; } if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "UnassignIpv6Addresses", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.UnassignIpv6AddressesResponse>(await this.callApi(params, req, runtime), new $_model.UnassignIpv6AddressesResponse({})); } /** * Unassigns one or more IPv6 addresses from an Elastic Network Interface (ENI). * * @remarks * ## Operation description * When you invoke this operation, take note of the following items: * - The Elastic Network Interface (ENI) must be in the **Active** or **InUse** state. * - If you are operating on a primary network interface controller (NIC), the ECS instance to which the NIC is attached must be in the **Running** or **Stopped** state. * * @param request - UnassignIpv6AddressesRequest * @returns UnassignIpv6AddressesResponse */ async unassignIpv6Addresses(request: $_model.UnassignIpv6AddressesRequest): Promise<$_model.UnassignIpv6AddressesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.unassignIpv6AddressesWithOptions(request, runtime); } /** * Unassigns secondary private IP addresses from an elastic network interface (ENI). * * @remarks * ## [](#)Usage notes * - The ENI from which to unassign secondary private IP addresses must be in the **Available** (Available) or **InUse** (InUse) state. * - If the ENI is a primary ENI, the Elastic Compute Service (ECS) instance to which the ENI is attached must be in the **Running** (Running) or **Stopped** (Stopped) state. * * @param request - UnassignPrivateIpAddressesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns UnassignPrivateIpAddressesResponse */ async unassignPrivateIpAddressesWithOptions(request: $_model.UnassignPrivateIpAddressesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.UnassignPrivateIpAddressesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.ipv4Prefix)) { query["Ipv4Prefix"] = request.ipv4Prefix; } if (!$dara.isNull(request.networkInterfaceId)) { query["NetworkInterfaceId"] = request.networkInterfaceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.privateIpAddress)) { query["PrivateIpAddress"] = request.privateIpAddress; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "UnassignPrivateIpAddresses", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.UnassignPrivateIpAddressesResponse>(await this.callApi(params, req, runtime), new $_model.UnassignPrivateIpAddressesResponse({})); } /** * Unassigns secondary private IP addresses from an elastic network interface (ENI). * * @remarks * ## [](#)Usage notes * - The ENI from which to unassign secondary private IP addresses must be in the **Available** (Available) or **InUse** (InUse) state. * - If the ENI is a primary ENI, the Elastic Compute Service (ECS) instance to which the ENI is attached must be in the **Running** (Running) or **Stopped** (Stopped) state. * * @param request - UnassignPrivateIpAddressesRequest * @returns UnassignPrivateIpAddressesResponse */ async unassignPrivateIpAddresses(request: $_model.UnassignPrivateIpAddressesRequest): Promise<$_model.UnassignPrivateIpAddressesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.unassignPrivateIpAddressesWithOptions(request, runtime); } /** * UnassociateEipAddress * * @deprecated OpenAPI UnassociateEipAddress is deprecated, please use Vpc::2016-04-28::UnassociateEipAddress instead. * * @param request - UnassociateEipAddressRequest * @param runtime - runtime options for this request RuntimeOptions * @returns UnassociateEipAddressResponse */ async unassociateEipAddressWithOptions(request: $_model.UnassociateEipAddressRequest, runtime: $dara.RuntimeOptions): Promise<$_model.UnassociateEipAddressResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.allocationId)) { query["AllocationId"] = request.allocationId; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.instanceType)) { query["InstanceType"] = request.instanceType; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "UnassociateEipAddress", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.UnassociateEipAddressResponse>(await this.callApi(params, req, runtime), new $_model.UnassociateEipAddressResponse({})); } /** * UnassociateEipAddress * * @deprecated OpenAPI UnassociateEipAddress is deprecated, please use Vpc::2016-04-28::UnassociateEipAddress instead. * * @param request - UnassociateEipAddressRequest * @returns UnassociateEipAddressResponse */ // Deprecated async unassociateEipAddress(request: $_model.UnassociateEipAddressRequest): Promise<$_model.UnassociateEipAddressResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.unassociateEipAddressWithOptions(request, runtime); } /** * Disassociates a high-availability virtual IP address (HaVip) from an ECS instance. * * @deprecated OpenAPI UnassociateHaVip is deprecated, please use Vpc::2016-04-28::UnassociateHaVip instead. * * @param request - UnassociateHaVipRequest * @param runtime - runtime options for this request RuntimeOptions * @returns UnassociateHaVipResponse */ async unassociateHaVipWithOptions(request: $_model.UnassociateHaVipRequest, runtime: $dara.RuntimeOptions): Promise<$_model.UnassociateHaVipResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.force)) { query["Force"] = request.force; } if (!$dara.isNull(request.haVipId)) { query["HaVipId"] = request.haVipId; } if (!$dara.isNull(request.instanceId)) { query["InstanceId"] = request.instanceId; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "UnassociateHaVip", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.UnassociateHaVipResponse>(await this.callApi(params, req, runtime), new $_model.UnassociateHaVipResponse({})); } /** * Disassociates a high-availability virtual IP address (HaVip) from an ECS instance. * * @deprecated OpenAPI UnassociateHaVip is deprecated, please use Vpc::2016-04-28::UnassociateHaVip instead. * * @param request - UnassociateHaVipRequest * @returns UnassociateHaVipResponse */ // Deprecated async unassociateHaVip(request: $_model.UnassociateHaVipRequest): Promise<$_model.UnassociateHaVipResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.unassociateHaVipWithOptions(request, runtime); } /** * Unlock snapshots that are locked in compliance mode but are still in a cooling-off period. If the snapshot is locked in compliance mode and the cooling-off period has ended, it cannot be unlocked. * * @param request - UnlockSnapshotRequest * @param runtime - runtime options for this request RuntimeOptions * @returns UnlockSnapshotResponse */ async unlockSnapshotWithOptions(request: $_model.UnlockSnapshotRequest, runtime: $dara.RuntimeOptions): Promise<$_model.UnlockSnapshotResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.clientToken)) { query["ClientToken"] = request.clientToken; } if (!$dara.isNull(request.dryRun)) { query["DryRun"] = request.dryRun; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.snapshotId)) { query["SnapshotId"] = request.snapshotId; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "UnlockSnapshot", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.UnlockSnapshotResponse>(await this.callApi(params, req, runtime), new $_model.UnlockSnapshotResponse({})); } /** * Unlock snapshots that are locked in compliance mode but are still in a cooling-off period. If the snapshot is locked in compliance mode and the cooling-off period has ended, it cannot be unlocked. * * @param request - UnlockSnapshotRequest * @returns UnlockSnapshotResponse */ async unlockSnapshot(request: $_model.UnlockSnapshotRequest): Promise<$_model.UnlockSnapshotResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.unlockSnapshotWithOptions(request, runtime); } /** * Removes tags from Elastic Compute Service (ECS) resources. After a tag is removed from a resource, the tag is automatically deleted if it is not added to other resources. * * @param request - UntagResourcesRequest * @param runtime - runtime options for this request RuntimeOptions * @returns UntagResourcesResponse */ async untagResourcesWithOptions(request: $_model.UntagResourcesRequest, runtime: $dara.RuntimeOptions): Promise<$_model.UntagResourcesResponse> { request.validate(); let query = { }; if (!$dara.isNull(request.all)) { query["All"] = request.all; } if (!$dara.isNull(request.ownerAccount)) { query["OwnerAccount"] = request.ownerAccount; } if (!$dara.isNull(request.ownerId)) { query["OwnerId"] = request.ownerId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.regionId)) { query["RegionId"] = request.regionId; } if (!$dara.isNull(request.resourceId)) { query["ResourceId"] = request.resourceId; } if (!$dara.isNull(request.resourceOwnerAccount)) { query["ResourceOwnerAccount"] = request.resourceOwnerAccount; } if (!$dara.isNull(request.resourceOwnerId)) { query["ResourceOwnerId"] = request.resourceOwnerId; } if (!$dara.isNull(request.resourceType)) { query["ResourceType"] = request.resourceType; } if (!$dara.isNull(request.tagKey)) { query["TagKey"] = request.tagKey; } let req = new $OpenApiUtil.OpenApiRequest({ query: OpenApiUtil.query(query), }); let params = new $OpenApiUtil.Params({ action: "UntagResources", version: "2014-05-26", protocol: "HTTPS", pathname: "/", method: "POST", authType: "AK", style: "RPC", reqBodyType: "formData", bodyType: "json", }); return $dara.cast<$_model.UntagResourcesResponse>(await this.callApi(params, req, runtime), new $_model.UntagResourcesResponse({})); } /** * Removes tags from Elastic Compute Service (ECS) resources. After a tag is removed from a resource, the tag is automatically deleted if it is not added to other resources. * * @param request - UntagResourcesRequest * @returns UntagResourcesResponse */ async untagResources(request: $_model.UntagResourcesRequest): Promise<$_model.UntagResourcesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.untagResourcesWithOptions(request, runtime); } }