// 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-1': "ecs.ap-southeast-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 a system event 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 a system event 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 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 key-value pairs. * - If the tag key (Tag.N.Key) already exists on the specified resource, the new tag value (Tag.N.Value) automatically overwrites the original tag 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 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 key-value pairs. * - If the tag key (Tag.N.Key) already exists on the specified resource, the new tag value (Tag.N.Value) automatically overwrites the original tag 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 one or more pay-as-you-go or subscription dedicated hosts. A dedicated host is a physical server exclusively used by a single tenant. You can create ECS instances on a dedicated host and view the attributes of the physical server. * * @remarks * Before you create a dedicated host, invoke [DescribeAvailableResource](https://help.aliyun.com/document_detail/66186.html) to query the available resources in a specific region or zone. * Creating a dedicated host incurs fees. Familiarize yourself with the billing method of the resources in advance. For more details, see [Billing overview](https://help.aliyun.com/document_detail/68978.html). * - You can create up to 100 subscription or pay-as-you-go dedicated hosts at a time. * - After the dedicated hosts are created, you can use the returned dedicated host IDs as request parameters and invoke [DescribeDedicatedHosts](https://help.aliyun.com/document_detail/134242.html) to query the status of the new dedicated hosts. * - After you commit a request to create dedicated hosts, a fault is returned if the specified parameter values are invalid or the resources are insufficient. For more information about fault causes, see the error codes section. * - After you create a dedicated host, you can invoke [ModifyInstanceDeployment](https://help.aliyun.com/document_detail/134248.html) to perform migration of ECS instances from a shared host to the dedicated host, or adjust instance deployment between two dedicated hosts. * * @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 one or more pay-as-you-go or subscription dedicated hosts. A dedicated host is a physical server exclusively used by a single tenant. You can create ECS instances on a dedicated host and view the attributes of the physical server. * * @remarks * Before you create a dedicated host, invoke [DescribeAvailableResource](https://help.aliyun.com/document_detail/66186.html) to query the available resources in a specific region or zone. * Creating a dedicated host incurs fees. Familiarize yourself with the billing method of the resources in advance. For more details, see [Billing overview](https://help.aliyun.com/document_detail/68978.html). * - You can create up to 100 subscription or pay-as-you-go dedicated hosts at a time. * - After the dedicated hosts are created, you can use the returned dedicated host IDs as request parameters and invoke [DescribeDedicatedHosts](https://help.aliyun.com/document_detail/134242.html) to query the status of the new dedicated hosts. * - After you commit a request to create dedicated hosts, a fault is returned if the specified parameter values are invalid or the resources are insufficient. For more information about fault causes, see the error codes section. * - After you create a dedicated host, you can invoke [ModifyInstanceDeployment](https://help.aliyun.com/document_detail/134248.html) to perform migration of ECS instances from a shared host to the dedicated host, or adjust instance deployment between two dedicated hosts. * * @param request - AllocateDedicatedHostsRequest * @returns AllocateDedicatedHostsResponse */ async allocateDedicatedHosts(request: $_model.AllocateDedicatedHostsRequest): Promise<$_model.AllocateDedicatedHostsResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.allocateDedicatedHostsWithOptions(request, runtime); } /** * Allocates an elastic IP address (EIP). * * @remarks * > This operation has been upgraded. We recommend that you no longer use this operation. For more information about the new operation, 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({})); } /** * Allocates an elastic IP address (EIP). * * @remarks * > This operation has been upgraded. We recommend that you no longer use this operation. For more information about the new operation, 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 public IP address to an ECS instance. We recommend that you call the ModifyInstanceNetworkSpec operation to assign a public IP address. * * @remarks * ### Before you begin * - Before you assign a public IP address, the instance must be in the **Running** (`Running`) or **Stopped** (`Stopped`) state. * - If `"LockReason" : "security"` is included in the `OperationLocks` of an instance that is locked for [security reasons](https://help.aliyun.com/document_detail/25695.html), you cannot assign a public IP address to the instance. * - Make sure that the instance bandwidth is greater than 0 when you call this operation. You can call the [ModifyInstanceNetworkSpec](https://help.aliyun.com/document_detail/2679879.html) operation to adjust the bandwidth. * ### Settings * - Only users in the whitelist can specify the public IP address by using the `IpAddress` parameter. If the public bandwidth is greater than 0, you can set `InstanceId` to randomly allocate a public IP address. If the public bandwidth is 0, invoke the [ModifyInstanceNetworkSpec](https://help.aliyun.com/document_detail/2679879.html) operation to adjust the bandwidth before you invoke this operation to allocate a public IP address. * - Only one public IP address can be allocated to an instance. If the instance already has a public IP address, the existing attached public IP address `IpAddress` is returned. * - The new public IP address takes effect after you 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)). * In addition to assigning a public IP address, you can associate an Elastic IP Address (EIP) with a VPC-connected ECS 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 public IP address to an ECS instance. We recommend that you call the ModifyInstanceNetworkSpec operation to assign a public IP address. * * @remarks * ### Before you begin * - Before you assign a public IP address, the instance must be in the **Running** (`Running`) or **Stopped** (`Stopped`) state. * - If `"LockReason" : "security"` is included in the `OperationLocks` of an instance that is locked for [security reasons](https://help.aliyun.com/document_detail/25695.html), you cannot assign a public IP address to the instance. * - Make sure that the instance bandwidth is greater than 0 when you call this operation. You can call the [ModifyInstanceNetworkSpec](https://help.aliyun.com/document_detail/2679879.html) operation to adjust the bandwidth. * ### Settings * - Only users in the whitelist can specify the public IP address by using the `IpAddress` parameter. If the public bandwidth is greater than 0, you can set `InstanceId` to randomly allocate a public IP address. If the public bandwidth is 0, invoke the [ModifyInstanceNetworkSpec](https://help.aliyun.com/document_detail/2679879.html) operation to adjust the bandwidth before you invoke this operation to allocate a public IP address. * - Only one public IP address can be allocated to an instance. If the instance already has a public IP address, the existing attached public IP address `IpAddress` is returned. * - The new public IP address takes effect after you 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)). * In addition to assigning a public IP address, you can associate an Elastic IP Address (EIP) with a VPC-connected ECS 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 cloud disks. * * @remarks * - Each cloud disk supports up to 10 automatic snapshot policies. * - If the target cloud disk already has an automatic snapshot policy applied, invoking this operation adds new policies without replacing existing ones. * >Cancel any unnecessary automatic snapshot policies to avoid unexpected costs. * * @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 cloud disks. * * @remarks * - Each cloud disk supports up to 10 automatic snapshot policies. * - If the target cloud disk already has an automatic snapshot policy applied, invoking this operation adds new policies without replacing existing ones. * >Cancel any unnecessary automatic snapshot policies to avoid unexpected costs. * * @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 to enable automatic creation of IPv6 addresses. 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, up to 10 IPv6 addresses can be allocated. * - 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 to enable automatic creation of IPv6 addresses. 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, up to 10 IPv6 addresses can be allocated. * - 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 idle private IP addresses within the vSwitch to which the ENI belongs, or specify the number of private endpoint addresses to automatically allocate private IP addresses. * * @remarks * ## Operation description * - Only ENIs in the Available or InUse state are supported. * - When you operate the primary network interface controller (NIC), the instance to which the NIC is attached must be in the Running or Stopped state. * - When an Elastic Network Interface (ENI) is in the active (`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 to the ENI is subject to the instance family. For more information, see [Instance families](https://help.aliyun.com/document_detail/25378.html). * - After you successfully invoke 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 idle private IP addresses within the vSwitch to which the ENI belongs, or specify the number of private endpoint addresses to automatically allocate private IP addresses. * * @remarks * ## Operation description * - Only ENIs in the Available or InUse state are supported. * - When you operate the primary network interface controller (NIC), the instance to which the NIC is attached must be in the Running or Stopped state. * - When an Elastic Network Interface (ENI) is in the active (`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 to the ENI is subject to the instance family. For more information, see [Instance families](https://help.aliyun.com/document_detail/25378.html). * - After you successfully invoke 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 an ECS instance or an elastic network interface (ENI). * * @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 an ECS instance or an elastic network interface (ENI). * * @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); } /** * Invokes AttachClassicLinkVpc to connect a classic network type instance to a virtual private cloud (VPC) so that the instance can communicate with cloud resources in the VPC through private network peering. * * @remarks * When you invoke this operation, take note of the following items: * - Before you connect a classic network type instance, the instance must be in the **Running** or **Stopped** state. * - The destination VPC must have ClassicLink enabled. For more information, see [Enable ClassicLink feature](https://help.aliyun.com/document_detail/65413.html). * - The classic network type instance and the VPC must be 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({})); } /** * Invokes AttachClassicLinkVpc to connect a classic network type instance to a virtual private cloud (VPC) so that the instance can communicate with cloud resources in the VPC through private network peering. * * @remarks * When you invoke this operation, take note of the following items: * - Before you connect a classic network type instance, the instance must be in the **Running** or **Stopped** state. * - The destination VPC must have ClassicLink enabled. For more information, see [Enable ClassicLink feature](https://help.aliyun.com/document_detail/65413.html). * - The classic network type instance and the VPC must be 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 billing method 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 billing method 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 RAM role to one or more ECS instances. * * @remarks * You can call [DescribeInstanceRamRole](https://help.aliyun.com/document_detail/2679686.html) to query the [instance RAM role](https://help.aliyun.com/document_detail/61175.html) attached to an instance. * > If the instance already has an instance RAM role attached, an error is returned indicating that you cannot attach a new role. * * @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 RAM role to one or more ECS instances. * * @remarks * You can call [DescribeInstanceRamRole](https://help.aliyun.com/document_detail/2679686.html) to query the [instance RAM role](https://help.aliyun.com/document_detail/61175.html) attached to an instance. * > If the instance already has an instance RAM role attached, an error is returned indicating that you cannot attach a new role. * * @param request - AttachInstanceRamRoleRequest * @returns AttachInstanceRamRoleResponse */ async attachInstanceRamRole(request: $_model.AttachInstanceRamRoleRequest): Promise<$_model.AttachInstanceRamRoleResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.attachInstanceRamRoleWithOptions(request, runtime); } /** * Attaches 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 attach an SSH key pair, authentication by using a username and password is disabled. * - If an 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 an 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 instance already has an SSH key pair attached, 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({})); } /** * Attaches 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 attach an SSH key pair, authentication by using a username and password is disabled. * - If an 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 an 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 instance already has an SSH key pair attached, 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); } /** * Attaches an Elastic Network Interface (ENI) to a VPC-type ECS instance by calling the AttachNetworkInterface operation with 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 ENI. * - The instance must be in the Running or Stopped state. Some instance types require the instance to be in the Stopped state when you attach an Elastic Network Interface (ENI). For more information, see the ECS instance types that require instance stop section 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 Elastic Network Interface (ENI) 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 ENI belongs must be in the same zone and VPC as the instance. * - This is an asynchronous operation. After you send a successful request, you can check the Elastic Network Interface (ENI) status or listen for network interface controller (NIC) operation events to obtain the operation 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 attach ENI request has been sent and the ENI is being attached to the ECS instance. * - InUse indicates that the ENI is attached to the ECS instance. * - Available indicates that the ENI failed to be attached to the ECS instance. * **For details about sample code, see** [Attach an Elastic Network Interface (ENI)](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({})); } /** * Attaches an Elastic Network Interface (ENI) to a VPC-type ECS instance by calling the AttachNetworkInterface operation with 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 ENI. * - The instance must be in the Running or Stopped state. Some instance types require the instance to be in the Stopped state when you attach an Elastic Network Interface (ENI). For more information, see the ECS instance types that require instance stop section 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 Elastic Network Interface (ENI) 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 ENI belongs must be in the same zone and VPC as the instance. * - This is an asynchronous operation. After you send a successful request, you can check the Elastic Network Interface (ENI) status or listen for network interface controller (NIC) operation events to obtain the operation 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 attach ENI request has been sent and the ENI is being attached to the ECS instance. * - InUse indicates that the ENI is attached to the ECS instance. * - Available indicates that the ENI failed to be attached to the ECS instance. * **For details about sample code, see** [Attach an Elastic Network Interface (ENI)](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 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 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 for rules with the same priority. * ### Usage 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 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 specified security group in the China (Hangzhou) region: * - Add access permissions for a specified IP address range. * ``` * "RegionId":"ap-southeast-1", //Set the region * "SecurityGroupId":"sg-bp67acfmxazb4p****", //Set the security group * "Permissions":[ * { * "SourceCidrIp":"10.0.0.0/8", //Set the source IPv4 address * "PortRange":"22/22", //Set the port range * "IpProtocol":"TCP", //Set the protocol type * "Policy":"Accept" //Set the access policy * } * ] * ``` * - Add access permissions for another security group and a prefix list. * ``` * "RegionId":"ap-southeast-1", * "SecurityGroupId":"sg-bp67acfmxazb4p****", * "Permissions":[ * { * "SourceGroupId":"sg-bp17vs63txqxbd****", //Set the source security group * "PortRange":"22/22", * "IpProtocol":"TCP", * "Policy":"Drop" * },{ * "SourcePrefixListId":"pl-x1j1k5ykzqlixdcy****", //Set 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 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 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 for rules with the same priority. * ### Usage 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 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 specified security group in the China (Hangzhou) region: * - Add access permissions for a specified IP address range. * ``` * "RegionId":"ap-southeast-1", //Set the region * "SecurityGroupId":"sg-bp67acfmxazb4p****", //Set the security group * "Permissions":[ * { * "SourceCidrIp":"10.0.0.0/8", //Set the source IPv4 address * "PortRange":"22/22", //Set the port range * "IpProtocol":"TCP", //Set the protocol type * "Policy":"Accept" //Set the access policy * } * ] * ``` * - Add access permissions for another security group and a prefix list. * ``` * "RegionId":"ap-southeast-1", * "SecurityGroupId":"sg-bp67acfmxazb4p****", * "Permissions":[ * { * "SourceGroupId":"sg-bp17vs63txqxbd****", //Set the source security group * "PortRange":"22/22", * "IpProtocol":"TCP", * "Policy":"Drop" * },{ * "SourcePrefixListId":"pl-x1j1k5ykzqlixdcy****", //Set 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. This operation allows you to specify outbound access permissions for a security group to allow or deny instances in the security group from sending outbound traffic to other devices, enabling fine-grained control over network access. * * @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, refer to [Security group limits](~~25412#SecurityGroupQuota1~~). * - **Priority settings:** The priority (Priority) of outbound rule ranges from 1 to 100. A smaller number indicates a higher priority. When two rules have the same priority, the deny (drop) rule takes precedence. * ### Before you begin * If the specified security group rule already exists, the call succeeds but no rule is added. * ### How rules are determined * The following parameters are required to define 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. * - Authorization policy: Policy. * > Advanced security groups do not support authorization to other security groups. 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. This operation allows you to specify outbound access permissions for a security group to allow or deny instances in the security group from sending outbound traffic to other devices, enabling fine-grained control over network access. * * @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, refer to [Security group limits](~~25412#SecurityGroupQuota1~~). * - **Priority settings:** The priority (Priority) of outbound rule ranges from 1 to 100. A smaller number indicates a higher priority. When two rules have the same priority, the deny (drop) rule takes precedence. * ### Before you begin * If the specified security group rule already exists, the call succeeds but no rule is added. * ### How rules are determined * The following parameters are required to define 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. * - Authorization policy: Policy. * > Advanced security groups do not support authorization to other security groups. 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 is being created in the destination region is automatically deleted, and the source image remains unchanged. * - If the image has already been copied, 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 is being created in the destination region is automatically deleted, and the source image remains unchanged. * - If the image has already been copied, 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 running image import tasks (ImportImage) and image export tasks (ExportImage). * * @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 running image import tasks (ImportImage) and image export tasks (ExportImage). * * @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 the cloned disk is attached to an instance, you can quickly replicate business data or horizontally scale services. * * @remarks * > The disk cloning feature itself is free of charge, but the cloned disk 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 * - 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 disk` supports only ESSD series disk types. * - Non-regional disks can only be cloned to non-regional types. Regional disks can only be cloned to regional disk types. * - Local disks and elastic ephemeral disks cannot be cloned or used as clone sources. * - You can specify the `cloned disk` type and performance level. * - You can specify the `cloned disk` capacity, but the capacity must be greater than or equal to that of the `source disk`. * - You can configure provisioned performance and performance burst for the `cloned disk`, provided that the target disk type supports provisioned performance and performance burst. * - You can specify encryption or change the encryption key for the `cloned disk`. 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`. Even if the subscription disk has expired, it can still be used as the `source disk`. * - The `cloned disk` does not support reinitialization. * - Cloning does not support storage sets or dedicated block storage clusters, but disks in them 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 the cloned disk is attached to an instance, you can quickly replicate business data or horizontally scale services. * * @remarks * > The disk cloning feature itself is free of charge, but the cloned disk 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 * - 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 disk` supports only ESSD series disk types. * - Non-regional disks can only be cloned to non-regional types. Regional disks can only be cloned to regional disk types. * - Local disks and elastic ephemeral disks cannot be cloned or used as clone sources. * - You can specify the `cloned disk` type and performance level. * - You can specify the `cloned disk` capacity, but the capacity must be greater than or equal to that of the `source disk`. * - You can configure provisioned performance and performance burst for the `cloned disk`, provided that the target disk type supports provisioned performance and performance burst. * - You can specify encryption or change the encryption key for the `cloned disk`. 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`. Even if the subscription disk has expired, it can still be used as the `source disk`. * - The `cloned disk` does not support reinitialization. * - Cloning does not support storage sets or dedicated block storage clusters, but disks in them 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 public IP address (PublicIP) of a VPC-type ECS instance to an Elastic IP Address (EIP). * * @remarks * ## Operation description * After a public IP address is converted to an EIP, the EIP is billed separately. Make sure that you fully understand the [billable methods of EIPs](https://help.aliyun.com/document_detail/122035.html). * When you invoke this operation, the ECS instance must meet the following requirements: * - The instance is in the **Stopped** (`Stopped`) or **Running** (`Running`) state. * - No EIP is attached to the instance. * - The instance has no pending configuration change nodes. * - The public bandwidth cannot be 0 Mbit/s. * - For subscription instances, the billing method for public bandwidth must be `pay-by-traffic`. Public IP addresses that use the `pay-by-bandwidth` billing method cannot be transformed to EIPs. Pay-as-you-go instances are not affected by this rule. For more information, refer to [Transform the public bandwidth billing method](https://help.aliyun.com/document_detail/178883.html). * - The VPC-type subscription ECS 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 public IP address (PublicIP) of a VPC-type ECS instance to an Elastic IP Address (EIP). * * @remarks * ## Operation description * After a public IP address is converted to an EIP, the EIP is billed separately. Make sure that you fully understand the [billable methods of EIPs](https://help.aliyun.com/document_detail/122035.html). * When you invoke this operation, the ECS instance must meet the following requirements: * - The instance is in the **Stopped** (`Stopped`) or **Running** (`Running`) state. * - No EIP is attached to the instance. * - The instance has no pending configuration change nodes. * - The public bandwidth cannot be 0 Mbit/s. * - For subscription instances, the billing method for public bandwidth must be `pay-by-traffic`. Public IP addresses that use the `pay-by-bandwidth` billing method cannot be transformed to EIPs. Pay-as-you-go instances are not affected by this rule. For more information, refer to [Transform the public bandwidth billing method](https://help.aliyun.com/document_detail/178883.html). * - The VPC-type subscription ECS 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. You can use this operation to deploy ECS instances across regions or replicate ECS instances across regions. * * @remarks * ## Operation description * You can use the copied image in the destination region to create ECS instances ([RunInstances](https://help.aliyun.com/document_detail/25499.html)) or replace system disks of instances ([ReplaceSystemDisk](https://help.aliyun.com/document_detail/25521.html)). * When you call this operation, take note of the following items: * - The custom image must be in the **Available** (`Available`) state. * - If the image is a custom image under your account, you can copy it across regions. If the image is shared with you by another user, you can copy it only within the same region. * - During the image copy process, you cannot directly delete ([DeleteImage](https://help.aliyun.com/document_detail/25537.html)) the image being copied. However, you can cancel the copy task ([CancelCopyImage](https://help.aliyun.com/document_detail/25539.html)) to delete the image being copied. * - A maximum of five image copy tasks can run concurrently in the same region. Additional tasks are queued and run in sequence after any of the preceding tasks are completed. * - You can use the `ResourceGroupId` parameter to specify the resource group to which the copied image belongs. If you do not set the `ResourceGroupId` parameter, the copied image belongs 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. You can use this operation to deploy ECS instances across regions or replicate ECS instances across regions. * * @remarks * ## Operation description * You can use the copied image in the destination region to create ECS instances ([RunInstances](https://help.aliyun.com/document_detail/25499.html)) or replace system disks of instances ([ReplaceSystemDisk](https://help.aliyun.com/document_detail/25521.html)). * When you call this operation, take note of the following items: * - The custom image must be in the **Available** (`Available`) state. * - If the image is a custom image under your account, you can copy it across regions. If the image is shared with you by another user, you can copy it only within the same region. * - During the image copy process, you cannot directly delete ([DeleteImage](https://help.aliyun.com/document_detail/25537.html)) the image being copied. However, you can cancel the copy task ([CancelCopyImage](https://help.aliyun.com/document_detail/25539.html)) to delete the image being copied. * - A maximum of five image copy tasks can run concurrently in the same region. Additional tasks are queued and run in sequence after any of the preceding tasks are completed. * - You can use the `ResourceGroupId` parameter to specify the resource group to which the copied image belongs. If you do not set the `ResourceGroupId` parameter, the copied image belongs 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 non-Alibaba Cloud server must run one of the following operating system versions and 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 * - Windows Server 2012/2016/2019 and later * In each Alibaba Cloud region, you can have up to 10 activation codes for managed instances. Each activation code can be used to register up to 10 instances. The maximum validity period of a single activation code is 4 hours. * > On the **Elastic Compute Service (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 non-Alibaba Cloud server must run one of the following operating system versions and 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 * - Windows Server 2012/2016/2019 and later * In each Alibaba Cloud region, you can have up to 10 activation codes for managed instances. Each activation code can be used to register up to 10 instances. The maximum validity period of a single activation code is 4 hours. * > On the **Elastic Compute Service (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 auto provisioning groups to provide stable computing power and mitigate the instability caused by the revoke mechanism of spot instances. * - Auto provisioning is a free feature, but you are charged for the instance resources created by auto provisioning groups. 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 auto provisioning groups to provide stable computing power and mitigate the instability caused by the revoke mechanism of spot instances. * - Auto provisioning is a free feature, but you are charged for the instance resources created by auto provisioning groups. 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). * When you call this operation, take note of the following items: * - You can create a maximum of 100 automatic snapshot policies per 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 encrypted 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 the target 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.associationType)) { query["AssociationType"] = request.associationType; } 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.targetTags)) { query["TargetTags"] = request.targetTags; } 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). * When you call this operation, take note of the following items: * - You can create a maximum of 100 automatic snapshot policies per 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 encrypted 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 the target 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); } /** * Creates a capacity reservation by specifying the instance type, total quantity, effective mode, and zone. * * @remarks * ## Operation description * You can use the resource reservation service to reserve resources that match specified properties such as zone and instance type. The system reserves the resources as a private pool. For more information, see [Overview of immediate resource reservations](https://help.aliyun.com/document_detail/193633.html). * - Currently, only the immediate pattern is supported. After you purchase an immediate resource reservation, the instance type is billed on a pay-as-you-go basis, regardless of whether you actually create pay-as-you-go instances. Billing continues until you manually release the resource reservation (manual release) or it is automatically released upon expiration (automatic release). * - When you create an instance by invoking [CreateInstance](https://help.aliyun.com/document_detail/25499.html) or [RunInstances](https://help.aliyun.com/document_detail/63440.html), you can configure the private pool capacity options. You can also invoke [ModifyInstanceAttachmentAttributes](https://help.aliyun.com/document_detail/190006.html) to modify the private pool capacity options of an instance. After an instance matches the private pool capacity, you are charged for the instance type, disks, public bandwidth, and other resources based on your instance configurations. * - If no pay-as-you-go instance is actually created, you are charged only for the instance type. * - The matched instances and unused capacity of an immediate resource reservation support hourly bill offset by savings plans and regional reserved instances, but do not support hourly bill offset by zonal reserved instances. Purchase reserved instances or savings plans first, and then use the immediate resource reservation service with the coverage of reserved instances or savings plans. This way, you can obtain resource availability assurance at no additional cost. * > You can create only immediate resource reservations by invoking this API operation. You can create immediate or scheduled resource reservations in the ECS console. For more information, see [Resource Assurance](~~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({})); } /** * Creates a capacity reservation by specifying the instance type, total quantity, effective mode, and zone. * * @remarks * ## Operation description * You can use the resource reservation service to reserve resources that match specified properties such as zone and instance type. The system reserves the resources as a private pool. For more information, see [Overview of immediate resource reservations](https://help.aliyun.com/document_detail/193633.html). * - Currently, only the immediate pattern is supported. After you purchase an immediate resource reservation, the instance type is billed on a pay-as-you-go basis, regardless of whether you actually create pay-as-you-go instances. Billing continues until you manually release the resource reservation (manual release) or it is automatically released upon expiration (automatic release). * - When you create an instance by invoking [CreateInstance](https://help.aliyun.com/document_detail/25499.html) or [RunInstances](https://help.aliyun.com/document_detail/63440.html), you can configure the private pool capacity options. You can also invoke [ModifyInstanceAttachmentAttributes](https://help.aliyun.com/document_detail/190006.html) to modify the private pool capacity options of an instance. After an instance matches the private pool capacity, you are charged for the instance type, disks, public bandwidth, and other resources based on your instance configurations. * - If no pay-as-you-go instance is actually created, you are charged only for the instance type. * - The matched instances and unused capacity of an immediate resource reservation support hourly bill offset by savings plans and regional reserved instances, but do not support hourly bill offset by zonal reserved instances. Purchase reserved instances or savings plans first, and then use the immediate resource reservation service with the coverage of reserved instances or savings plans. This way, you can obtain resource availability assurance at no additional cost. * > You can create only immediate resource reservations by invoking this API operation. You can create immediate or scheduled resource reservations in the ECS console. For more information, see [Resource Assurance](~~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 the execution record changes to Failed. * - The timeout of a previous execution does not affect the next execution. * - You can retain 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, see [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 the `/root` directory. For Windows instances, the default path is the directory where the Cloud Assistant Agent process is located, such as `C:\\Windows\\System32`. * - You can specify EnableParameter=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 a command `echo {{name}}` and pass in the key-value pair `` through the Parameters parameter when you call InvokeCommand, the custom parameter is automatically replaced. A new command `echo Jack` is generated and 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 the execution record changes to Failed. * - The timeout of a previous execution does not affect the next execution. * - You can retain 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, see [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 the `/root` directory. For Windows instances, the default path is the directory where the Cloud Assistant Agent process is located, such as `C:\\Windows\\System32`. * - You can specify EnableParameter=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 a command `echo {{name}}` and pass in the key-value pair `` through the Parameters parameter when you call InvokeCommand, the custom parameter is automatically replaced. A new command `echo Jack` is generated and 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 cluster. * * @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 cluster. * * @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 for resources. You can flexibly combine diagnostic metrics as needed. * * @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 for resources. You can flexibly combine diagnostic metrics as needed. * * @param request - CreateDiagnosticMetricSetRequest * @returns CreateDiagnosticMetricSetResponse */ async createDiagnosticMetricSet(request: $_model.CreateDiagnosticMetricSetRequest): Promise<$_model.CreateDiagnosticMetricSetResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.createDiagnosticMetricSetWithOptions(request, runtime); } /** * Creates a resource diagnostic report. Based on the diagnostic metric set ID that you specify, a diagnostic report is generated for multiple diagnostic metrics. You can call DescribeDiagnosticReportAttributes with the returned diagnostic report ID to query the details of the resource diagnostic report. * * @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({})); } /** * Creates a resource diagnostic report. Based on the diagnostic metric set ID that you specify, a diagnostic report is generated for multiple diagnostic metrics. You can call DescribeDiagnosticReportAttributes with the returned diagnostic report ID to query the details of the resource diagnostic report. * * @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 feature (`MultiAttach`) when you create a disk. We recommend that you learn about this feature and its usage limits. For more information, see [NVMe-enabled ESSDs](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 ESSDs, ESSD AutoPL disks, elastic ephemeral disks - Standard Edition, and elastic ephemeral disks - Advanced Edition. * - You must complete real-name registration before you can create a disk. Go to the [Real-name registration](https://account.console.aliyun.com/#/auth/home) page in the Account Center. * - Creating a disk incurs fees. 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). * - When you create a disk, the following default settings apply: * - Automatic snapshots of the disk are deleted when the disk is deleted. The `DeleteAutoSnapshot` parameter 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 parameter. * * @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 feature (`MultiAttach`) when you create a disk. We recommend that you learn about this feature and its usage limits. For more information, see [NVMe-enabled ESSDs](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 ESSDs, ESSD AutoPL disks, elastic ephemeral disks - Standard Edition, and elastic ephemeral disks - Advanced Edition. * - You must complete real-name registration before you can create a disk. Go to the [Real-name registration](https://account.console.aliyun.com/#/auth/home) page in the Account Center. * - Creating a disk incurs fees. 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). * - When you create a disk, the following default settings apply: * - Automatic snapshots of the disk are deleted when the disk is deleted. The `DeleteAutoSnapshot` parameter 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 parameter. * * @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 service by specifying parameters such as the zone, instance type, purchase duration, and auto-renewal settings within the region of the elasticity assurance service. * * @remarks * Elasticity assurance provides a new resource purchase and usage method that balances flexibility and certainty. It is a resource reservation service that provides guaranteed resources for pay-as-you-go ECS instances. For more information, see [Overview of Elasticity Assurance](https://help.aliyun.com/document_detail/193630.html). * - After you purchase an elasticity assurance service, refunds are supported for regular elasticity assurance services but not for time-sharing elasticity assurance services. For billing information, see [Resource Assurance](https://help.aliyun.com/document_detail/432502.html). * - Elasticity assurance can be used to create only ECS instances whose billable methods are pay-as-you-go. * - Currently, only the unlimited pattern is available for elasticity assurance times. This means that the `AssuranceTimes` parameter supports only the `Unlimited` value. An elasticity assurance service in unlimited pattern automatically starts after the assurance takes effect. * * @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 service by specifying parameters such as the zone, instance type, purchase duration, and auto-renewal settings within the region of the elasticity assurance service. * * @remarks * Elasticity assurance provides a new resource purchase and usage method that balances flexibility and certainty. It is a resource reservation service that provides guaranteed resources for pay-as-you-go ECS instances. For more information, see [Overview of Elasticity Assurance](https://help.aliyun.com/document_detail/193630.html). * - After you purchase an elasticity assurance service, refunds are supported for regular elasticity assurance services but not for time-sharing elasticity assurance services. For billing information, see [Resource Assurance](https://help.aliyun.com/document_detail/432502.html). * - Elasticity assurance can be used to create only ECS instances whose billable methods are pay-as-you-go. * - Currently, only the unlimited pattern is available for elasticity assurance times. This means that the `AssuranceTimes` parameter supports only the `Unlimited` value. An elasticity assurance service in unlimited pattern automatically starts after the assurance takes effect. * * @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. * * @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. * * @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 * ### Precautions * - 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 completed. 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. * - We recommend that you configure the image detection parameter `DetectionStrategy` when creating an image. This helps the system optimize your image. For more information, see [Image detection overview](https://help.aliyun.com/document_detail/439819.html). * The following section 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. We recommend that you stop the instance ([StopInstances](https://help.aliyun.com/document_detail/155372.html)) before creating an 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**: This requires establishing data associations among multiple disks (`DiskDeviceMapping`). * - Only one system disk snapshot can be specified. * - Multiple data disk snapshots can be specified, 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.secureBootOptions)) { query["SecureBootOptions"] = request.secureBootOptions; } 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 * ### Precautions * - 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 completed. 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. * - We recommend that you configure the image detection parameter `DetectionStrategy` when creating an image. This helps the system optimize your image. For more information, see [Image detection overview](https://help.aliyun.com/document_detail/439819.html). * The following section 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. We recommend that you stop the instance ([StopInstances](https://help.aliyun.com/document_detail/155372.html)) before creating an 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**: This requires establishing data associations among multiple disks (`DiskDeviceMapping`). * - Only one system disk snapshot can be specified. * - Multiple data disk snapshots can be specified, 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: * - You can create only custom image components. * - Component version numbers must be unique for components with the same name. When you use 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: * - You can create only custom image components. * - Component version numbers must be unique for components with the same name. When you use 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); } /** * Creates an image template. Image templates can be used to build images. * * @remarks * ## Operation description. * * @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.repairItem)) { query["RepairItem"] = request.repairItem; } 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({})); } /** * Creates an image template. Image templates can be used to build images. * * @remarks * ## Operation description. * * @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. You can use this operation to flexibly configure various parameters based on your requirements to create a customized instance. * * @remarks * > This operation is no longer maintained. We recommend that you use the [RunInstances](https://help.aliyun.com/document_detail/2679677.html) operation. * ### Before you begin. * ### Precautions. * ### Recommendations. * * @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. You can use this operation to flexibly configure various parameters based on your requirements to create a customized instance. * * @remarks * > This operation is no longer maintained. We recommend that you use the [RunInstances](https://help.aliyun.com/document_detail/2679677.html) operation. * ### Before you begin. * ### Precautions. * ### Recommendations. * * @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 private key in unencrypted PEM-encoded PKCS#8 format. 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 an Alibaba Cloud region. The uploaded key pair is used in the same way as a key pair created by the system. * You can have a maximum of 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 private key in unencrypted PEM-encoded PKCS#8 format. 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 an Alibaba Cloud region. The uploaded key pair is used in the same way as a key pair created by the system. * You can have a maximum of 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 by calling `CreateLaunchTemplateVersion`, with version numbers incrementing sequentially from 1. If you do not specify a template version number when creating an instance ([RunInstances](https://help.aliyun.com/document_detail/63440.html)), the default version is used. * A launch template version contains the configurations used to create instances, such as the region, image ID, instance type, security group ID, and public bandwidth. If a specific instance configuration is not specified in the version, you must specify it when you create the instance. * Before you begin: * - 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. Parameter values are validated only when you actually create an instance. * - If a configuration is set in the launch template, it cannot be filtered out when you create an instance ([RunInstances](https://help.aliyun.com/document_detail/63440.html)). For example, if the template sets `HostName=LocalHost` and the `HostName` value in `RunInstances` is left empty, 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 by calling `CreateLaunchTemplateVersion`, with version numbers incrementing sequentially from 1. If you do not specify a template version number when creating an instance ([RunInstances](https://help.aliyun.com/document_detail/63440.html)), the default version is used. * A launch template version contains the configurations used to create instances, such as the region, image ID, instance type, security group ID, and public bandwidth. If a specific instance configuration is not specified in the version, you must specify it when you create the instance. * Before you begin: * - 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. Parameter values are validated only when you actually create an instance. * - If a configuration is set in the launch template, it cannot be filtered out when you create an instance ([RunInstances](https://help.aliyun.com/document_detail/63440.html)). For example, if the template sets `HostName=LocalHost` and the `HostName` value in `RunInstances` is left empty, 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 of 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 of 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); } /** * Creates an Elastic Network Interface (ENI) with support for specifying a primary private IP address. * * @remarks * Take note of the following items when you call this operation: * ### Request example. * * @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.enablePrimaryIPv6)) { query["EnablePrimaryIPv6"] = request.enablePrimaryIPv6; } 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({})); } /** * Creates an Elastic Network Interface (ENI) with support for specifying a primary private IP address. * * @remarks * Take note of the following items when you call this operation: * ### Request example. * * @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 that can be associated 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 that can be associated 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 * - By default, the internal connectivity policy of a basic security group created by calling this operation is **intra-group connectivity**. You can call [ModifySecurityGroupPolicy](https://help.aliyun.com/document_detail/2679846.html) to modify the policy. * - By default, the internal connectivity policy of an advanced security group created by calling this operation is **internal isolation**, and the 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 Virtual Private Cloud (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 * - By default, the internal connectivity policy of a basic security group created by calling this operation is **intra-group connectivity**. You can call [ModifySecurityGroupPolicy](https://help.aliyun.com/document_detail/2679846.html) to modify the policy. * - By default, the internal connectivity policy of an advanced security group created by calling this operation is **internal isolation**, and the 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 Virtual Private Cloud (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 serve as event drills and do not actually execute events or affect ECS instances. * * @remarks * After you schedule a simulated event, you can view the scheduled simulated system event in the ECS console, by calling an [ECS API operation](https://help.aliyun.com/document_detail/63962.html), or by using monitoring. * The following table describes the lifecycle of a simulated system event: * - Scheduled: After you schedule a simulated system event, the event undergoes automatic switchover to the Scheduled state. * - Executed: Without manual intervention, the simulated system event automatically switches to 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 switches to the Canceled state. * - Avoided: For a simulated system event of the SystemMaintenance.Reboot type, you can [restart the instance](https://help.aliyun.com/document_detail/25502.html) before the specified point in time to switch 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 serve as event drills and do not actually execute events or affect ECS instances. * * @remarks * After you schedule a simulated event, you can view the scheduled simulated system event in the ECS console, by calling an [ECS API operation](https://help.aliyun.com/document_detail/63962.html), or by using monitoring. * The following table describes the lifecycle of a simulated system event: * - Scheduled: After you schedule a simulated system event, the event undergoes automatic switchover to the Scheduled state. * - Executed: Without manual intervention, the simulated system event automatically switches to 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 switches to the Canceled state. * - Avoided: For a simulated system event of the SystemMaintenance.Reboot type, you can [restart the instance](https://help.aliyun.com/document_detail/25502.html) before the specified point in time to switch 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 the write order consistency of data across multiple disks in a business system and guarantee crash consistency. 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 brief read and write performance latency may occur. * - 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 included in the backup to the snapshot. * - If the disk is attached to an ECS instance, do not change the instance status, such as stopping or restarting the ECS instance, during snapshot creation. Otherwise, the snapshot creation will be 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 scheduled 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 the write order consistency of data across multiple disks in a business system and guarantee crash consistency. 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 brief read and write performance latency may occur. * - 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 included in the backup to the snapshot. * - If the disk is attached to an ECS instance, do not change the instance status, such as stopping or restarting the ECS instance, during snapshot creation. Otherwise, the snapshot creation will be 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 scheduled 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 in 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 in 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 **Unattached** (`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 **Unattached** (`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 128 disks (including system disks and data disks) with a total snapshot size of no more than 256 TiB. * - User-created snapshots are retained until you delete them. Delete snapshots that are no longer needed on a regular basis to avoid ongoing snapshot storage fees. * - Disks with the multi-attach attribute enabled do not support snapshot-consistent groups. If an instance has a disk with the multi-attach attribute enabled, 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 in 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 in 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 **Unattached** (`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 **Unattached** (`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 128 disks (including system disks and data disks) with a total snapshot size of no more than 256 TiB. * - User-created snapshots are retained until you delete them. Delete snapshots that are no longer needed on a regular basis to avoid ongoing snapshot storage fees. * - Disks with the multi-attach attribute enabled do not support snapshot-consistent groups. If an instance has a disk with the multi-attach attribute enabled, 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); } /** * Creates a virtual border router (VBR). * * @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({})); } /** * Creates a virtual border router (VBR). * * @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); } /** * Creates a Virtual Storage Channel (VSC) for an ECS instance. * * @remarks * - To create a VSC, the instance type must support VSC, and VSC must be enabled on the instance. * - Only one Primary VSC can be created on a single instance. * * @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({})); } /** * Creates a Virtual Storage Channel (VSC) for an ECS instance. * * @remarks * - To create a VSC, the instance type must support VSC, and VSC must be enabled on the instance. * - Only one Primary VSC can be created on a single instance. * * @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 * ## Operation description * The activation code must be unused, meaning that the number of managed instances registered with the activation code is 0. * * @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 * ## Operation description * The activation code must be unused, meaning that the number of managed instances registered with the activation code is 0. * * @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 by specifying the AutoProvisioningGroupId and TerminateInstances parameters. * * @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 by specifying the AutoProvisioningGroupId and TerminateInstances parameters. * * @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. If the target automatic snapshot policy has been applied to cloud disks, the cloud disks no longer execute the policy after it is deleted. * * @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. If the target automatic snapshot policy has been applied to cloud disks, the cloud disks no longer execute the policy after it is deleted. * * @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. You cannot delete a command that is being executed. * * @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. You cannot delete a command that is being executed. * * @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 cluster. Before you perform this operation, migrate the dedicated hosts in the dedicated host cluster to another dedicated host cluster. * * @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 cluster. Before you perform this operation, migrate the dedicated hosts in the dedicated host cluster to another dedicated host cluster. * * @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 exist in the deployment set. If instances exist, remove or release them before you 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 exist in the deployment set. If instances exist, remove or release them before you 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 for resources. * * @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 for resources. * * @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 resource diagnostic reports. * * @remarks * Reports that are being generated cannot be deleted. * * @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 resource diagnostic reports. * * @remarks * Reports that are being generated cannot be deleted. * * @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 whether to retain or release automatic snapshots together with the disk. Delete unnecessary snapshots promptly to maintain sufficient snapshot quota for periodic automatic snapshot policies. * - 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 whether to retain or release automatic snapshots together with the disk. Delete unnecessary snapshots promptly to maintain sufficient snapshot quota for periodic automatic snapshot policies. * - 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); } /** * Deletes an HaVip instance. * * @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({})); } /** * Deletes an HaVip instance. * * @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); } /** * Deletes 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({})); } /** * Deletes 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); } /** * Deletes a custom image. You can specify the ImageId and Force parameters. * * @remarks * For information about scenarios in which you cannot delete a custom image and considerations 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({})); } /** * Deletes a custom image. You can specify the ImageId and Force parameters. * * @remarks * For information about scenarios in which you cannot delete a custom image and considerations 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 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](~~DescribeImagePipelineExecutions~~) 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 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](~~DescribeImagePipelineExecutions~~) 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 recycled. 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 during creation. Before releasing 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: * - `DeleteWithInstance=false`: The disk is converted to a pay-as-you-go disk and retained. Otherwise, the disk is released along with the instance. * - `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 security-locked instances, 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 recycled. 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 during creation. Before releasing 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: * - `DeleteWithInstance=false`: The disk is converted to a pay-as-you-go disk and retained. Otherwise, the disk is released along with the instance. * - `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 security-locked instances, 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); } /** * Releases multiple pay-as-you-go instances or expired subscription instances in a batch. You can specify whether to release or convert associated disks to pay-as-you-go disks. * * @remarks * >Warning: * After an instance is released, all physical resources used by the instance are recycled. All related data is permanently lost and cannot be recovered. * - Manual snapshots of disks are retained and continue to incur fees. You can call [DeleteSnapshot](https://help.aliyun.com/document_detail/2679824.html) to delete them. * - Whether disks and automatic snapshots attached to the instance are released depends on the parameter settings specified when they were created. Before releasing 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 security-locked instances, 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 - 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({})); } /** * Releases multiple pay-as-you-go instances or expired subscription instances in a batch. You can specify whether to release or convert associated disks to pay-as-you-go disks. * * @remarks * >Warning: * After an instance is released, all physical resources used by the instance are recycled. All related data is permanently lost and cannot be recovered. * - Manual snapshots of disks are retained and continue to incur fees. You can call [DeleteSnapshot](https://help.aliyun.com/document_detail/2679824.html) to delete them. * - Whether disks and automatic snapshots attached to the instance are released depends on the parameter settings specified when they were created. Before releasing 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 security-locked instances, 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 - DeleteInstancesRequest * @returns DeleteInstancesResponse */ async deleteInstances(request: $_model.DeleteInstancesRequest): Promise<$_model.DeleteInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteInstancesWithOptions(request, runtime); } /** * Deletes one or more SSH key pairs. * * @remarks * After you delete an SSH key pair, take note of the following items: * - The SSH key pair cannot be queried 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({})); } /** * Deletes one or more SSH key pairs. * * @remarks * After you delete an SSH key pair, take note of the following items: * - The SSH key pair cannot be queried 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 * When you call this operation, 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 * When you call this operation, 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 delete the default version. * - If the version you want to delete is the default version, call [ModifyLaunchTemplateDefaultVersion](https://help.aliyun.com/document_detail/2679734.html) or switch the default version in the **Launch Templates** console before you perform the deletion. * - Deleting a version does not affect instances that were already created by using 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 delete the default version. * - If the version you want to delete is the default version, call [ModifyLaunchTemplateDefaultVersion](https://help.aliyun.com/document_detail/2679734.html) or switch the default version in the **Launch Templates** console before you perform the deletion. * - Deleting a version does not affect instances that were already created by using 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); } /** * Asynchronously deletes an Elastic Network Interface (ENI). * * @remarks * When you call this operation, take note of the following items: * - The Elastic Network Interface (ENI) must be in the Available state. * - If the ENI is attached to an ECS instance, you must first detach it from the instance ([DetachNetworkInterface](https://help.aliyun.com/document_detail/58514.html)) before you can delete the ENI. * - After the ENI is deleted: * - All private addresses of the ENI, including the primary private IP address and secondary private IP addresses, are automatically released. * - The deleted ENI is removed from all associated security groups. * - This is an asynchronous operation. After you successfully invoke the operation, you can check the ENI status or listen for network interface controller (NIC) operation events to determine 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/20221208/xual/DeleteNetworkInterface.jpg) * - The Deleting state indicates that the delete request was sent successfully and the ENI is being deleted. * - If the ENI can no longer be found, the ENI is deleted. * - If the ENI remains in the Deleting state for an extended period, the deletion failed. In this case, you can invoke a new delete request for the ENI. * **For details, 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({})); } /** * Asynchronously deletes an Elastic Network Interface (ENI). * * @remarks * When you call this operation, take note of the following items: * - The Elastic Network Interface (ENI) must be in the Available state. * - If the ENI is attached to an ECS instance, you must first detach it from the instance ([DetachNetworkInterface](https://help.aliyun.com/document_detail/58514.html)) before you can delete the ENI. * - After the ENI is deleted: * - All private addresses of the ENI, including the primary private IP address and secondary private IP addresses, are automatically released. * - The deleted ENI is removed from all associated security groups. * - This is an asynchronous operation. After you successfully invoke the operation, you can check the ENI status or listen for network interface controller (NIC) operation events to determine 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/20221208/xual/DeleteNetworkInterface.jpg) * - The Deleting state indicates that the delete request was sent successfully and the ENI is being deleted. * - If the ENI can no longer be found, the ENI is deleted. * - If the ENI remains in the Deleting state for an extended period, the deletion failed. In this case, you can invoke a new delete request for the ENI. * **For details, 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 the permission to operate an Elastic Network Interface (ENI). * * @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 the permission to operate an Elastic Network Interface (ENI). * * @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); } /** * DeletePhysicalConnection. * * @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({})); } /** * DeletePhysicalConnection. * * @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 an O&M 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 an O&M 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 specified port list. All port list entries in the port list are also deleted. * * @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 specified port list. All port list entries in the port list are also deleted. * * @param request - DeletePortRangeListRequest * @returns DeletePortRangeListResponse */ async deletePortRangeList(request: $_model.DeletePortRangeListRequest): Promise<$_model.DeletePortRangeListResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deletePortRangeListWithOptions(request, runtime); } /** * Deletes 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 resources first, and then delete it. You can call [DescribePrefixListAssociations](https://help.aliyun.com/document_detail/204724.html) to query the resources that are 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({})); } /** * Deletes 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 resources first, and then delete it. You can call [DescribePrefixListAssociations](https://help.aliyun.com/document_detail/204724.html) to query the resources that are 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); } /** * Deletes a router interface. * * @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({})); } /** * Deletes a router interface. * * @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 within it. * * @remarks * - Make sure that no ECS instances exist in the security group. You can call [DescribeInstances](https://help.aliyun.com/document_detail/2679689.html) to check. * - Make sure that no Elastic Network Interfaces (ENIs) exist in the security group. You can call [DescribeNetworkInterfaces](https://help.aliyun.com/document_detail/2679884.html) to check. * - Make sure that no other security groups have authorization dependencies on this security group. You can call [DescribeSecurityGroupReferences](https://help.aliyun.com/document_detail/57320.html) to check. * - If the error code `InvalidOperation.DeletionProtection` is returned when you call this operation, the deletion protection feature is enabled for the security group. When you create an ACK cluster, deletion protection is automatically enabled for the associated security group to prevent accidental deletion. The deletion protection feature cannot be manually disabled. It is automatically disabled only after the associated ACK cluster is deleted. For more information, see [Disable deletion protection for a security group](https://help.aliyun.com/document_detail/353191.html). * * @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 within it. * * @remarks * - Make sure that no ECS instances exist in the security group. You can call [DescribeInstances](https://help.aliyun.com/document_detail/2679689.html) to check. * - Make sure that no Elastic Network Interfaces (ENIs) exist in the security group. You can call [DescribeNetworkInterfaces](https://help.aliyun.com/document_detail/2679884.html) to check. * - Make sure that no other security groups have authorization dependencies on this security group. You can call [DescribeSecurityGroupReferences](https://help.aliyun.com/document_detail/57320.html) to check. * - If the error code `InvalidOperation.DeletionProtection` is returned when you call this operation, the deletion protection feature is enabled for the security group. When you create an ACK cluster, deletion protection is automatically enabled for the associated security group to prevent accidental deletion. The deletion protection feature cannot be manually disabled. It is automatically disabled only after the associated ACK cluster is deleted. For more information, see [Disable deletion protection for a security group](https://help.aliyun.com/document_detail/353191.html). * * @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 force delete the snapshot, set `Force=true`. 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 force delete the snapshot, set `Force=true`. 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); } /** * Deletes a virtual storage channel (VSC). * * @remarks * When you call this operation, take note of the following items: * - Disassociate the VSC from file systems such as Cloud Parallel File Storage (CPFS) before you delete the VSC. * - When you call this operation to release a VSC, the instance operating system must respond. If the operating system does not respond, the VSC deletion fails and the VSC enters the DetachFailed state. Check whether the operating system is running properly, or stop the instance and try again. * - When you release an instance, VSCs attached to the instance are released together with the instance. * * @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({})); } /** * Deletes a virtual storage channel (VSC). * * @remarks * When you call this operation, take note of the following items: * - Disassociate the VSC from file systems such as Cloud Parallel File Storage (CPFS) before you delete the VSC. * - When you call this operation to release a VSC, the instance operating system must respond. If the operating system does not respond, the VSC deletion fails and the VSC enters the DetachFailed state. Check whether the operating system is running properly, or stop the instance and try again. * - When you release an instance, VSCs attached to the instance are released together with the instance. * * @param request - DeleteVscRequest * @returns DeleteVscResponse */ async deleteVsc(request: $_model.DeleteVscRequest): Promise<$_model.DeleteVscResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.deleteVscWithOptions(request, runtime); } /** * Calls DeregisterManagedInstance to unregister a managed instance. After the instance is unregistered, 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({})); } /** * Calls DeregisterManagedInstance to unregister a managed instance. After the instance is unregistered, 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); } /** * DescribeAccessPoints. * * @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({})); } /** * DescribeAccessPoints. * * @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 resource quotas that you can create in an Alibaba Cloud region. The quotas include the maximum numbers of security groups, Elastic Network Interfaces (ENIs), pay-as-you-go instance vCPUs, spot instance vCPUs, pay-as-you-go cloud disk capacity, dedicated hosts, network interface controllers (NICs), network types, and whether the account has completed real-name registration. * * @remarks * After you [register](https://account.aliyun.com/register/register.htm) an Alibaba Cloud account, you can create a specific number of ECS resources in different Alibaba Cloud regions. For more information, see [Limits](https://help.aliyun.com/document_detail/25412.html). * After you [register](https://account.alibabacloud.com/register/intl_register.htm) an Alibaba Cloud account, you can create a specific number of ECS resources in different Alibaba Cloud regions. For more information, see [Limits](https://help.aliyun.com/document_detail/25412.html). * You can also request a quota increase in the [Quota Center](https://quotas.console.aliyun.com/products) based on your needs. * * @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 resource quotas that you can create in an Alibaba Cloud region. The quotas include the maximum numbers of security groups, Elastic Network Interfaces (ENIs), pay-as-you-go instance vCPUs, spot instance vCPUs, pay-as-you-go cloud disk capacity, dedicated hosts, network interface controllers (NICs), network types, and whether the account has completed real-name registration. * * @remarks * After you [register](https://account.aliyun.com/register/register.htm) an Alibaba Cloud account, you can create a specific number of ECS resources in different Alibaba Cloud regions. For more information, see [Limits](https://help.aliyun.com/document_detail/25412.html). * After you [register](https://account.alibabacloud.com/register/intl_register.htm) an Alibaba Cloud account, you can create a specific number of ECS resources in different Alibaba Cloud regions. For more information, see [Limits](https://help.aliyun.com/document_detail/25412.html). * You can also request a quota increase in the [Quota Center](https://quotas.console.aliyun.com/products) based on your needs. * * @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 the activation codes that you have created and the usage of the activation codes. * * @remarks * ## Operation description * You can use one of the following methods to view the returned data: * - Method 1: When paged query the first page, set only `MaxResults` to limit the number of entries to return. The `NextToken` value in the response can be used to query subsequent pages. When paged query subsequent pages, set `NextToken` to the value obtained from the previous response and set `MaxResults` to limit the number of entries to return. * - Method 2: Use `PageSize` to specify the number of entries per page and `PageNumber` to specify the page number. You can use only one of the two methods. If you set `MaxResults` or `NextToken`, the `PageSize` and `PageNumber` request parameters do not take effect, and `TotalCount` in the response 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 the activation codes that you have created and the usage of the activation codes. * * @remarks * ## Operation description * You can use one of the following methods to view the returned data: * - Method 1: When paged query the first page, set only `MaxResults` to limit the number of entries to return. The `NextToken` value in the response can be used to query subsequent pages. When paged query subsequent pages, set `NextToken` to the value obtained from the previous response and set `MaxResults` to limit the number of entries to return. * - Method 2: Use `PageSize` to specify the number of entries per page and `PageNumber` to specify the page number. You can use only one of the two methods. If you set `MaxResults` or `NextToken`, the `PageSize` and `PageNumber` request parameters do not take effect, and `TotalCount` in the response 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); } /** * Invokes DescribeAutoProvisioningGroupHistory to query the scheduling node information of 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({})); } /** * Invokes DescribeAutoProvisioningGroupHistory to query the scheduling node information of 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 the 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 the 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 sufficiently stocked in a specific zone before you create instances (RunInstances) or modify instance specifications (ModifyInstanceSpec). * * @remarks * The DestinationResource parameter has different logic and requirements for its values. In the following ordered list, lower-order values require more parameters to be set, and you cannot use a lower-order value to filter higher-order resource categories. * - Value order: `Zone > IoOptimized > InstanceType = Network = ddh > SystemDisk > DataDisk` * - Value examples: * - If DestinationResource is set to `DataDisk`: * - If `ResourceType` is set to `disk`, the query retrieves data disk types that are not associated with ECS instance types, and the InstanceType parameter is not required. * - If `ResourceType` is set to `instance`, the query retrieves data disk types that can be attached to ECS instances. 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 list of zones that have ecs.g5.large in stock in a specified region: `RegionId=ap-southeast-1 &DestinationResource=Zone &IoOptimized=optimized &InstanceType=ecs.g5.large`. *
* Query the list of active zones that supply the ecs.g5.large instance type in the Singapore region. * ``` * "RegionId": "ap-southeast-1", * "DestinationResource": "Zone", * "InstanceType": "ecs.g5.large" * ``` *
*
* Query the inventory of ecs.g5.large across all zones in the Singapore region. * ``` * "RegionId": "ap-southeast-1", * "DestinationResource": "InstanceType", * "InstanceType": "ecs.g5.large" * ``` *
*
* [Purchase data disk only] Query the inventory of cloud_efficiency data disks in Zone B of the Singapore region. * ``` * "RegionId": "ap-southeast-1", * "ZoneId": "ap-southeast-1b", * "ResourceType": "disk", * "DestinationResource": "DataDisk" * ``` *
*
* [Purchase ECS instance and system disk] Query the inventory of ecs.g7.large instances with cloud_essd system disks in Zone B of the Singapore region. * ``` * "RegionId": "ap-southeast-1", * "ZoneId": "ap-southeast-1b", * "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 sufficiently stocked in a specific zone before you create instances (RunInstances) or modify instance specifications (ModifyInstanceSpec). * * @remarks * The DestinationResource parameter has different logic and requirements for its values. In the following ordered list, lower-order values require more parameters to be set, and you cannot use a lower-order value to filter higher-order resource categories. * - Value order: `Zone > IoOptimized > InstanceType = Network = ddh > SystemDisk > DataDisk` * - Value examples: * - If DestinationResource is set to `DataDisk`: * - If `ResourceType` is set to `disk`, the query retrieves data disk types that are not associated with ECS instance types, and the InstanceType parameter is not required. * - If `ResourceType` is set to `instance`, the query retrieves data disk types that can be attached to ECS instances. 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 list of zones that have ecs.g5.large in stock in a specified region: `RegionId=ap-southeast-1 &DestinationResource=Zone &IoOptimized=optimized &InstanceType=ecs.g5.large`. *
* Query the list of active zones that supply the ecs.g5.large instance type in the Singapore region. * ``` * "RegionId": "ap-southeast-1", * "DestinationResource": "Zone", * "InstanceType": "ecs.g5.large" * ``` *
*
* Query the inventory of ecs.g5.large across all zones in the Singapore region. * ``` * "RegionId": "ap-southeast-1", * "DestinationResource": "InstanceType", * "InstanceType": "ecs.g5.large" * ``` *
*
* [Purchase data disk only] Query the inventory of cloud_efficiency data disks in Zone B of the Singapore region. * ``` * "RegionId": "ap-southeast-1", * "ZoneId": "ap-southeast-1b", * "ResourceType": "disk", * "DestinationResource": "DataDisk" * ``` *
*
* [Purchase ECS instance and system disk] Query the inventory of ecs.g7.large instances with cloud_essd system disks in Zone B of the Singapore region. * ``` * "RegionId": "ap-southeast-1", * "ZoneId": "ap-southeast-1b", * "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); } /** * Queries 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({})); } /** * Queries 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); } /** * Queries bandwidth packages. * * @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({})); } /** * Queries bandwidth packages. * * @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 list of 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 list of 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); } /** * Queries the details of one or more capacity reservations, such as the status, effective and expiration time, private pool mode, and number of used instances. * * @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({})); } /** * Queries the details of one or more capacity reservations, such as the status, effective and expiration time, private pool mode, and number of used instances. * * @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 one or more classic network type instances that are connected to a virtual private cloud (VPC). * * @remarks * When you invoke this operation, take note of the following items: * - This operation supports only classic network type instances. * - You can query up to 100 classic network type instances at a time. * - The `VpcId` and `InstanceId` parameters cannot both be empty. * * @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 one or more classic network type instances that are connected to a virtual private cloud (VPC). * * @remarks * When you invoke this operation, take note of the following items: * - This operation supports only classic network type instances. * - You can query up to 100 classic network type instances at a time. * - The `VpcId` and `InstanceId` parameters cannot both be empty. * * @param request - DescribeClassicLinkInstancesRequest * @returns DescribeClassicLinkInstancesResponse */ async describeClassicLinkInstances(request: $_model.DescribeClassicLinkInstancesRequest): Promise<$_model.DescribeClassicLinkInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeClassicLinkInstancesWithOptions(request, runtime); } /** * Queries Cloud Assistant service configurations. * * @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({})); } /** * Queries Cloud Assistant service configurations. * * @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 one or more instances. If Cloud Assistant is installed, the response also includes the total number of command executions, the number of ongoing executions, and the time of the most recent command execution. * * @remarks * ## Operation description * - Call this operation paged query the Cloud Assistant status of an instance. Run commands or send files only when CloudAssistantStatus is true, especially for newly created instances. * - When you call this operation paged query the first page of results, set only `MaxResults` to limit the number of entries to return. The `NextToken` value returned in the response can be used paged query subsequent pages. When you query subsequent pages, set `NextToken` to the value returned in the previous response and set `MaxResults` to limit the number of entries to return. * * @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 one or more instances. If Cloud Assistant is installed, the response also includes the total number of command executions, the number of ongoing executions, and the time of the most recent command execution. * * @remarks * ## Operation description * - Call this operation paged query the Cloud Assistant status of an instance. Run commands or send files only when CloudAssistantStatus is true, especially for newly created instances. * - When you call this operation paged query the first page of results, set only `MaxResults` to limit the number of entries to return. The `NextToken` value returned in the response can be used paged query subsequent pages. When you query subsequent pages, set `NextToken` to the value returned in the previous response and set `MaxResults` to limit the number of entries to return. * * @param request - DescribeCloudAssistantStatusRequest * @returns DescribeCloudAssistantStatusResponse */ async describeCloudAssistantStatus(request: $_model.DescribeCloudAssistantStatusRequest): Promise<$_model.DescribeCloudAssistantStatusResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeCloudAssistantStatusWithOptions(request, runtime); } /** * Queries a cluster. * * @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({})); } /** * Queries a cluster. * * @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); } /** * Queries Cloud Assistant commands that you manually created or public commands provided by Alibaba Cloud. * * @remarks * ## Operation description * - If you specify only the Action and RegionId parameters without specifying other request parameters, all available commands (CommandId) that you manually created are queried by default. * - When paged query the first page of results, set only MaxResults to limit the number of entries to return. The NextToken value returned in the response serves as the token for querying subsequent pages. When paged query subsequent pages, set NextToken to the value obtained from the previous response and set MaxResults to limit the number of entries to return. * * @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({})); } /** * Queries Cloud Assistant commands that you manually created or public commands provided by Alibaba Cloud. * * @remarks * ## Operation description * - If you specify only the Action and RegionId parameters without specifying other request parameters, all available commands (CommandId) that you manually created are queried by default. * - When paged query the first page of results, set only MaxResults to limit the number of entries to return. The NextToken value returned in the response serves as the token for querying subsequent pages. When paged query subsequent pages, set NextToken to the value obtained from the previous response and set MaxResults to limit the number of entries to return. * * @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 clusters. * * @remarks * ## Operation description * The request parameters act as filters. Filters have a logical AND relationship. If a parameter is empty, the filter does not take effect. However, if the value of `DedicatedHostClusterIds` is an empty JSON array (`[]`), the filter is considered valid 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 clusters. * * @remarks * ## Operation description * The request parameters act as filters. Filters have a logical AND relationship. If a parameter is empty, the filter does not take effect. However, if the value of `DedicatedHostClusterIds` is an empty JSON array (`[]`), the filter is considered valid 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); } /** * Invokes DescribeDedicatedHostTypes to query the detailed parameters of dedicated host types supported in a specified region, or queries the ECS instance families supported by dedicated hosts. * * @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({})); } /** * Invokes DescribeDedicatedHostTypes to query the detailed parameters of dedicated host types supported in a specified region, or queries the ECS instance families supported by dedicated hosts. * * @param request - DescribeDedicatedHostTypesRequest * @returns DescribeDedicatedHostTypesResponse */ async describeDedicatedHostTypes(request: $_model.DescribeDedicatedHostTypesRequest): Promise<$_model.DescribeDedicatedHostTypesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeDedicatedHostTypesWithOptions(request, runtime); } /** * Queries the details of one or more dedicated hosts. You can retrieve information such as the physical performance metrics, machine ID, usage status, and the list of ECS instances created on the dedicated hosts. You can filter results by specifying parameters such as dedicated host IDs, dedicated host cluster ID, hostname, and status to precisely query the details you need, providing support for efficient management and optimization of cloud computing compute resources. * * @remarks * ## Operation description * You can query the details of one or more dedicated hosts by using one of the following methods: * - Specify `DedicatedHostIds` to query the details of dedicated hosts. * - Specify `DedicatedHostClusterId` to query the details of 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({})); } /** * Queries the details of one or more dedicated hosts. You can retrieve information such as the physical performance metrics, machine ID, usage status, and the list of ECS instances created on the dedicated hosts. You can filter results by specifying parameters such as dedicated host IDs, dedicated host cluster ID, hostname, and status to precisely query the details you need, providing support for efficient management and optimization of cloud computing compute resources. * * @remarks * ## Operation description * You can query the details of one or more dedicated hosts by using one of the following methods: * - Specify `DedicatedHostIds` to query the details of dedicated hosts. * - Specify `DedicatedHostClusterId` to query the details of 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); } /** * Calls DescribeDeploymentSetSupportedInstanceTypeFamily to query the instance families that support each deployment set strategy by specifying the RegionId and Strategy parameters. * * @remarks * ## Operation description * For more information about instance families, see [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({})); } /** * Calls DescribeDeploymentSetSupportedInstanceTypeFamily to query the instance families that support each deployment set strategy by specifying the RegionId and Strategy parameters. * * @remarks * ## Operation description * For more information about instance families, see [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); } /** * Queries the details of 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({})); } /** * Queries the details of 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 the list of resource diagnostic metric sets by calling DescribeDiagnosticMetricSets. * * @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 the list of resource diagnostic metric sets by calling DescribeDiagnosticMetricSets. * * @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 a list of 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 a list of 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); } /** * Queries the details of a resource diagnostic report. * * @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({})); } /** * Queries the details of a resource diagnostic report. * * @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 a list of 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 a list of 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 cloud disk within a specified time 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 usage information only for basic disks in the In Use (`In_use`) state. For more information, see [Basic disk status](https://help.aliyun.com/document_detail/25689.html). * > If the returned information contains missing content, the usage information for that time period cannot be obtained because the basic disk was not in the In Use (`In_use`) state. * - A maximum of 400 data entries can be returned at a time. The condition `(EndTime – StartTime) / Period` must be less than or equal to 400. In other words, the response parameter `TotalCount` cannot exceed 400. Otherwise, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query monitoring information only for 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 the disk whose ID is `d-bp14emm68wx98vjk****` in the China (Hangzhou) region at 600-second intervals from `2025-02-17T00:00:00Z` to `2025-02-18T10:00:00Z`. Configure the request parameters as follows: * ``` * RegionId:"ap-southeast-1", //Set the 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 cloud disk within a specified time 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 usage information only for basic disks in the In Use (`In_use`) state. For more information, see [Basic disk status](https://help.aliyun.com/document_detail/25689.html). * > If the returned information contains missing content, the usage information for that time period cannot be obtained because the basic disk was not in the In Use (`In_use`) state. * - A maximum of 400 data entries can be returned at a time. The condition `(EndTime – StartTime) / Period` must be less than or equal to 400. In other words, the response parameter `TotalCount` cannot exceed 400. Otherwise, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query monitoring information only for 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 the disk whose ID is `d-bp14emm68wx98vjk****` in the China (Hangzhou) region at 600-second intervals from `2025-02-17T00:00:00Z` to `2025-02-18T10:00:00Z`. Configure the request parameters as follows: * ``` * RegionId:"ap-southeast-1", //Set the 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 disks, local disks, and elastic ephemeral disks. * * @remarks * - The request parameters RegionId, ZoneId, DiskIds, and InstanceId are filters. The parameters have AND relationships. * - The DiskIds request parameter is a JSON format array. If DiskIds is not specified, the filter does not take effect. If DiskIds is set to an empty JSON array, the filter is considered valid and an empty result is returned. * - Token-based paged query is supported. Set NextToken to the pagination token. The value is the NextToken value returned in the previous invoke of DescribeDisks. Then, use MaxResults to settings the maximum number of entries per page. * - A disk with the multi-attach feature enabled can be attached to multiple instances. You can check the Attachment list in the response to view all attachment information of the disk. * 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 disks, local disks, and elastic ephemeral disks. * * @remarks * - The request parameters RegionId, ZoneId, DiskIds, and InstanceId are filters. The parameters have AND relationships. * - The DiskIds request parameter is a JSON format array. If DiskIds is not specified, the filter does not take effect. If DiskIds is set to an empty JSON array, the filter is considered valid and an empty result is returned. * - Token-based paged query is supported. Set NextToken to the pagination token. The value is the NextToken value returned in the previous invoke of DescribeDisks. Then, use MaxResults to settings the maximum number of entries per page. * - A disk with the multi-attach feature enabled can be attached to multiple instances. You can check the Attachment list in the response to view all attachment information of the disk. * 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 of one or more block storage devices. * * @remarks * - The full status information of a block storage device includes the block storage lifecycle status (`Status`), block storage health status (`HealthStatus`), and block storage event type (`EventType`). * - Because the publish time, scheduled execution time, and actual execution time of block storage-related events are the same, you can specify a time period (`EventTime.Start` to `EventTime.End`) to query all historical events that occurred during that period. You can query historical events from the last seven days at most. * * @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 of one or more block storage devices. * * @remarks * - The full status information of a block storage device includes the block storage lifecycle status (`Status`), block storage health status (`HealthStatus`), and block storage event type (`EventType`). * - Because the publish time, scheduled execution time, and actual execution time of block storage-related events are the same, you can specify a time period (`EventTime.Start` to `EventTime.End`) to query all historical events that occurred during that period. You can query historical events from the last seven days at most. * * @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 list of running instances that are matched to an elasticity assurance. * * @remarks * After an elasticity assurance expires, the matching data between instances and the private pool associated with the elasticity assurance also becomes invalid. If you call this operation to query an expired elasticity assurance, an empty result 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 list of running instances that are matched to an elasticity assurance. * * @remarks * After an elasticity assurance expires, the matching data between instances and the private pool associated with the elasticity assurance also becomes invalid. If you call this operation to query an expired elasticity assurance, an empty result 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); } /** * Queries the details of an elasticity assurance service, such as the status, matching mode, effective method, expiration time, and 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({})); } /** * Queries the details of an elasticity assurance service, such as the status, matching mode, effective method, expiration time, and 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 traffic information of a secondary ENI within a specified time period. * * @remarks * ## Operation description * The traffic information that you can query about a secondary ENI includes the number of packets sent and received by the secondary ENI, the internal network inbound and outbound traffic, and the number of packets dropped by the secondary ENI. If some information is missing from the response, the system may have failed to obtain the corresponding information. For example, the information cannot be obtained when the instance is in the Stopped state or when the secondary ENI is not attached to an instance and is in the Available state. Take note of the following items when you call this operation: * - A maximum of 400 data entries can be returned at a time. Make sure that the value of `(EndTime–StartTime)/Period` is less than or equal to 400, which means the value of the response parameter `TotalCount` cannot exceed 400. Otherwise, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query monitoring information only within the last 30 days. The value of `StartTime` cannot be more than 30 days before the current time. * * @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 traffic information of a secondary ENI within a specified time period. * * @remarks * ## Operation description * The traffic information that you can query about a secondary ENI includes the number of packets sent and received by the secondary ENI, the internal network inbound and outbound traffic, and the number of packets dropped by the secondary ENI. If some information is missing from the response, the system may have failed to obtain the corresponding information. For example, the information cannot be obtained when the instance is in the Stopped state or when the secondary ENI is not attached to an instance and is in the Available state. Take note of the following items when you call this operation: * - A maximum of 400 data entries can be returned at a time. Make sure that the value of `(EndTime–StartTime)/Period` is less than or equal to 400, which means the value of the response parameter `TotalCount` cannot exceed 400. Otherwise, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query monitoring information only within the last 30 days. The value of `StartTime` cannot be more than 30 days before the current time. * * @param request - DescribeEniMonitorDataRequest * @returns DescribeEniMonitorDataResponse */ async describeEniMonitorData(request: $_model.DescribeEniMonitorDataRequest): Promise<$_model.DescribeEniMonitorDataResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeEniMonitorDataWithOptions(request, runtime); } /** * Queries DNAT entries in a DNAT table. * * @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({})); } /** * Queries DNAT entries in a DNAT table. * * @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); } /** * Queries the details of high-availability virtual IP addresses (HAVIPs). * * @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({})); } /** * Queries the details of high-availability virtual IP addresses (HAVIPs). * * @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 HPC clusters. The request parameters are used as filters. The 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 HPC clusters. The request parameters are used as filters. The 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 in 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 in 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 the latest available custom image in a specified image family. * * @remarks * ## Operation description * If no available images exist in the specified 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 the latest available custom image in a specified image family. * * @remarks * ## Operation description * If no available images exist in the specified 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); } /** * Queries the details of an image build task. * * @remarks * ## Operation description * - The specified image template ID (ImagePipelineId) cannot be a deleted image template. Deleted image templates also delete the corresponding build tasks. * - The image template ID (ImagePipelineId) and the build task ID (ExecutionId) cannot both be empty. * - You can set NextToken to the value of NextToken returned in the previous call to DescribeImagePipelineExecutions, and set MaxResults to specify the maximum number of entries 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({})); } /** * Queries the details of an image build task. * * @remarks * ## Operation description * - The specified image template ID (ImagePipelineId) cannot be a deleted image template. Deleted image templates also delete the corresponding build tasks. * - The image template ID (ImagePipelineId) and the build task ID (ExecutionId) cannot both be empty. * - You can set NextToken to the value of NextToken returned in the previous call to DescribeImagePipelineExecutions, and set MaxResults to specify the maximum number of entries 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); } /** * Queries the details of one or more image templates. * * @remarks * You can set `NextToken` to the value of `NextToken` returned by the previous call to `DescribeImagePipelines`, and set `MaxResults` to specify the maximum number of entries per page for the query. * * @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({})); } /** * Queries the details of one or more image templates. * * @remarks * You can set `NextToken` to the value of `NextToken` returned by the previous call to `DescribeImagePipelines`, and set `MaxResults` to specify the maximum number of entries per page for the query. * * @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 has been shared. The results are displayed by page, 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 has been shared. The results are displayed by page, 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 available image resources based on specified 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. * * @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 available image resources based on specified 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. * * @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 private pool information matched by instances, such as the matching mode and private pool ID. * * @remarks * ## Operation description * A private pool is generated after an elasticity assurance or capacity reservation is created. The private pool is associated with information about instances that match the private pool. You can configure a private pool when you create an instance. The instance is then matched with an elasticity assurance or capacity reservation. * After a private pool expires, the matching association data between the instance and the private pool also becomes invalid. If you call this operation at that point, the private pool information in the response is empty. * * @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 private pool information matched by instances, such as the matching mode and private pool ID. * * @remarks * ## Operation description * A private pool is generated after an elasticity assurance or capacity reservation is created. The private pool is associated with information about instances that match the private pool. You can configure a private pool when you create an instance. The instance is then matched with an elasticity assurance or capacity reservation. * After a private pool expires, the matching association data between the instance and the private pool also becomes invalid. If you call this operation at that point, the private pool information in the response is empty. * * @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); } /** * Queries the auto-renewal attributes of one or more subscription ECS instances, including whether auto-renewal is enabled and the renewal period. * * @remarks * - Only subscription instances are supported. An error is returned if you call this operation for pay-as-you-go instances. * - Before you configure auto-renewal or manual renewal, you can query the renewal status of instances to check whether 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({})); } /** * Queries the auto-renewal attributes of one or more subscription ECS instances, including whether auto-renewal is enabled and the renewal period. * * @remarks * - Only subscription instances are supported. An error is returned if you call this operation for pay-as-you-go instances. * - Before you configure auto-renewal or manual renewal, you can query the renewal status of instances to check whether 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 the system event information of 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 the system event information of 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 * Queries the configured maintenance policy, which includes two maintenance properties: * - Maintenance time window: A time window that you specify during which maintenance is performed. * - Maintenance action: An instance downtime handling policy that you specify. * * @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 * Queries the configured maintenance policy, which includes two maintenance properties: * - Maintenance time window: A time window that you specify during which maintenance is performed. * - Maintenance action: An instance downtime handling policy that you specify. * * @param request - DescribeInstanceMaintenanceAttributesRequest * @returns DescribeInstanceMaintenanceAttributesResponse */ async describeInstanceMaintenanceAttributes(request: $_model.DescribeInstanceMaintenanceAttributesRequest): Promise<$_model.DescribeInstanceMaintenanceAttributesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeInstanceMaintenanceAttributesWithOptions(request, runtime); } /** * Queries the price of upgrading the target instance type or adding subscription data disks for an unexpired subscription ECS instance. * * @remarks * - Only the price for upgrading unexpired subscription ECS instances is supported. Querying the price for downgrading instances is not supported. * - Querying the price for changing the configurations of pay-as-you-go ECS instances is not supported. Because the price of a pay-as-you-go ECS instance after a configuration change is the same as the price of a new instance, you can call [DescribePrice](https://help.aliyun.com/document_detail/107829.html) to query the latest price of an ECS instance. * - Before you upgrade an instance, call [DescribeResourcesModification](https://help.aliyun.com/document_detail/66187.html) to query the instance types available for upgrade in a specified 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({})); } /** * Queries the price of upgrading the target instance type or adding subscription data disks for an unexpired subscription ECS instance. * * @remarks * - Only the price for upgrading unexpired subscription ECS instances is supported. Querying the price for downgrading instances is not supported. * - Querying the price for changing the configurations of pay-as-you-go ECS instances is not supported. Because the price of a pay-as-you-go ECS instance after a configuration change is the same as the price of a new instance, you can call [DescribePrice](https://help.aliyun.com/document_detail/107829.html) to query the latest price of an ECS instance. * - Before you upgrade an instance, call [DescribeResourcesModification](https://help.aliyun.com/document_detail/66187.html) to query the instance types available for upgrade in a specified 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 information of an ECS instance. Queryable metrics include vCPU usage, burstable instance credits, inbound data traffic, outbound data traffic, and average bandwidth. * * @remarks * ## Operation description * When you call this operation, take note of the following items: * - A maximum of 400 data entries can be returned at a time. The condition `(EndTime – StartTime) / Period` must be less than or equal to 400, which means the response parameter `TotalCount` cannot exceed 400. Otherwise, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query monitoring information only for the last 30 days. The `StartTime` parameter cannot be more than 30 days earlier than the current time. * - When some content is missing from the returned information, the system may not have obtained the corresponding information. For example, the instance was in the Stopped state at that time. * - This operation cannot retrieve basic CPU monitoring information for ECS Bare Metal instances. Install the CloudMonitor agent to obtain CPU monitoring information. For more information, see [Install the CloudMonitor agent](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 information of an ECS instance. Queryable metrics include vCPU usage, burstable instance credits, inbound data traffic, outbound data traffic, and average bandwidth. * * @remarks * ## Operation description * When you call this operation, take note of the following items: * - A maximum of 400 data entries can be returned at a time. The condition `(EndTime – StartTime) / Period` must be less than or equal to 400, which means the response parameter `TotalCount` cannot exceed 400. Otherwise, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query monitoring information only for the last 30 days. The `StartTime` parameter cannot be more than 30 days earlier than the current time. * - When some content is missing from the returned information, the system may not have obtained the corresponding information. For example, the instance was in the Stopped state at that time. * - This operation cannot retrieve basic CPU monitoring information for ECS Bare Metal instances. Install the CloudMonitor agent to obtain CPU monitoring information. For more information, see [Install the CloudMonitor agent](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 RAM roles that are assigned to one or more ECS instances by instance ID, or queries the instances that are assigned a specific instance RAM role by role name. * * @remarks * ## Operation description * When you invoke this operation by using Cloud Assistant CLI, request parameters of different data types must follow format requirements. For more information, see [Parameter format overview](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 RAM roles that are assigned to one or more ECS instances by instance ID, or queries the instances that are assigned a specific instance RAM role by role name. * * @remarks * ## Operation description * When you invoke this operation by using Cloud Assistant CLI, request parameters of different data types must follow format requirements. For more information, see [Parameter format overview](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 information of one or more specified ECS instances and supports querying instance lists based on specified conditions. * * @remarks * For more information about the lifecycle states of ECS instances, see [Instance states](https://help.aliyun.com/document_detail/25687.html). * ## Request examples * - Query instances and instance status information by **specified region**. Sample request parameters: * ``` * "RegionID": "ap-southeast-1" * ``` * - Query instances and instance status information in a **specific zone** within a **specified region**. Sample request parameters: * ``` * "RegionID": "ap-southeast-1", * "ZoneID": "ap-southeast-1a" * ``` * - Query the status information of instances by **specified region** and **instance IDs**. Sample request parameters: * ``` * "RegionID": "ap-southeast-1", * "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 information of one or more specified ECS instances and supports querying instance lists based on specified conditions. * * @remarks * For more information about the lifecycle states of ECS instances, see [Instance states](https://help.aliyun.com/document_detail/25687.html). * ## Request examples * - Query instances and instance status information by **specified region**. Sample request parameters: * ``` * "RegionID": "ap-southeast-1" * ``` * - Query instances and instance status information in a **specific zone** within a **specified region**. Sample request parameters: * ``` * "RegionID": "ap-southeast-1", * "ZoneID": "ap-southeast-1a" * ``` * - Query the status information of instances by **specified region** and **instance IDs**. Sample request parameters: * ``` * "RegionID": "ap-southeast-1", * "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 list of instance families provided by Alibaba Cloud ECS. This operation retrieves instance family information across different series to help you understand available instance type resources and select appropriate instance types for creating 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 list of instance families provided by Alibaba Cloud ECS. This operation retrieves instance family information across different series to help you understand available instance type resources and select appropriate instance types for creating 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 list of all instance types provided by Elastic Compute Service (ECS) and retrieves detailed information about instance types. You can also perform a conditional query for specific instance types to understand the configurations and performance of different instance types and select instances that meet your business requirements. * * @remarks * - **Paged query**: You can set the MaxResults parameter to limit the number of instance type entries returned. If only some of the queried instance type entries are returned, the NextToken parameter value is also returned. Invoke this operation again with the NextToken parameter value returned from the previous invocation and the MaxResults parameter to implement paging for instance type information. * - If you call this operation without specifying the NextToken parameter for paginated retrieval, only the first page (up to 100 entries) of data is returned by default. To retrieve more data, specify the NextToken parameter for paginated retrieval or specify filter conditions to limit the scope of returned data. * > The maximum number of entries (MaxResults parameter) is 100. For users who invoked this operation before 2022, the maximum value of MaxResults remains 1600. On and after November 15, 2023, the maximum value of MaxResults is reduced to 100 for all users and 1600 is no longer 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). * * * * @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 list of all instance types provided by Elastic Compute Service (ECS) and retrieves detailed information about instance types. You can also perform a conditional query for specific instance types to understand the configurations and performance of different instance types and select instances that meet your business requirements. * * @remarks * - **Paged query**: You can set the MaxResults parameter to limit the number of instance type entries returned. If only some of the queried instance type entries are returned, the NextToken parameter value is also returned. Invoke this operation again with the NextToken parameter value returned from the previous invocation and the MaxResults parameter to implement paging for instance type information. * - If you call this operation without specifying the NextToken parameter for paginated retrieval, only the first page (up to 100 entries) of data is returned by default. To retrieve more data, specify the NextToken parameter for paginated retrieval or specify filter conditions to limit the scope of returned data. * > The maximum number of entries (MaxResults parameter) is 100. For users who invoked this operation before 2022, the maximum value of MaxResults remains 1600. On and after November 15, 2023, the maximum value of MaxResults is reduced to 100 for all users and 1600 is no longer 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). * * * * @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 returned VNC logon URL (VncUrl) cannot be used directly. You can access the instance by using 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?`. Separate 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 a non-Windows operating system. * >- Passwordless VNC connections are now 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 returned VNC logon URL (VncUrl) cannot be used directly. You can access the instance by using 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?`. Separate 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 a non-Windows operating system. * >- Passwordless VNC connections are now 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 performs a conditional query to associate and retrieve the detailed information of the instances. * * @remarks * ### Before you begin. * * @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 performs a conditional query to associate and retrieve the detailed information of the instances. * * @remarks * ### Before you begin. * * @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 ECS instances. The full status information includes the instance status and instance system event status. The instance status refers to the lifecycle status of the instance, and the instance system event refers to the health status of maintenance events. * * @remarks * ## Operation description * The response includes the instance status and instance system events in the Scheduled state. * If you specify a time range, events are filtered based on the time range. * * @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 ECS instances. The full status information includes the instance status and instance system event status. The instance status refers to the lifecycle status of the instance, and the instance system event refers to the health status of maintenance events. * * @remarks * ## Operation description * The response includes the instance status and instance system events in the Scheduled state. * If you specify a time range, events are filtered based on the time range. * * @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, specifically the actual execution results on ECS instances. * * @remarks * ## Operation description * - After you execute a command, the command is not guaranteed to succeed or produce the expected results. Use this operation to check the actual execution results, which serve as the definitive output. * - 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, avoiding frequent polling and improving efficiency. * - When performing a paging query for the first page, set only `MaxResults` to limit the number of entries returned. The `NextToken` in the response serves as the credential for querying subsequent pages. When querying subsequent pages, set the `NextToken` parameter to the `NextToken` value obtained from the previous response, and set `MaxResults` to limit the number of entries returned. * - Differences between `DescribeInvocations` and `DescribeInvocationResults`: * - When a single `RunCommand`/`InvokeCommand` call specifies multiple instances: * - `DescribeInvocations` returns the execution status on each instance and the aggregation status across multiple instances. * - `DescribeInvocationResults` returns only the individual execution status on each instance, without the aggregation status across multiple instances. * - When a single `RunCommand`/`InvokeCommand` call specifies one instance: * - `DescribeInvocations` and `DescribeInvocationResults` are largely interchangeable, and you can replace one with the other. * - When you need to view the execution history of scheduled (periodic) tasks or tasks that execute on each system startup (`RepeatMode=Period, EveryReboot`), only `DescribeInvocationResults` can retrieve past execution history records (by specifying `IncludeHistory=true`), whereas `DescribeInvocations` returns only the latest task status. * - When you need to view the command content or 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, specifically the actual execution results on ECS instances. * * @remarks * ## Operation description * - After you execute a command, the command is not guaranteed to succeed or produce the expected results. Use this operation to check the actual execution results, which serve as the definitive output. * - 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, avoiding frequent polling and improving efficiency. * - When performing a paging query for the first page, set only `MaxResults` to limit the number of entries returned. The `NextToken` in the response serves as the credential for querying subsequent pages. When querying subsequent pages, set the `NextToken` parameter to the `NextToken` value obtained from the previous response, and set `MaxResults` to limit the number of entries returned. * - Differences between `DescribeInvocations` and `DescribeInvocationResults`: * - When a single `RunCommand`/`InvokeCommand` call specifies multiple instances: * - `DescribeInvocations` returns the execution status on each instance and the aggregation status across multiple instances. * - `DescribeInvocationResults` returns only the individual execution status on each instance, without the aggregation status across multiple instances. * - When a single `RunCommand`/`InvokeCommand` call specifies one instance: * - `DescribeInvocations` and `DescribeInvocationResults` are largely interchangeable, and you can replace one with the other. * - When you need to view the execution history of scheduled (periodic) tasks or tasks that execute on each system startup (`RepeatMode=Period, EveryReboot`), only `DescribeInvocationResults` can retrieve past execution history records (by specifying `IncludeHistory=true`), whereas `DescribeInvocations` returns only the latest task status. * - When you need to view the command content or 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 response elements and the actual output. * - You can query execution information from the last 30 days. A maximum of 10,000 execution records are 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 of results, set only MaxResults to limit the number of entries to return. The NextToken value returned in the response serves as the token for querying subsequent pages. When paged query subsequent pages, set NextToken to the 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 (by specifying `IncludeHistory=true`). `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 response elements and the actual output. * - You can query execution information from the last 30 days. A maximum of 10,000 execution records are 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 of results, set only MaxResults to limit the number of entries to return. The NextToken value returned in the response serves as the token for querying subsequent pages. When paged query subsequent pages, set NextToken to the 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 (by specifying `IncludeHistory=true`). `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 SSH 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 SSH 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 instance 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 instance 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 to query information about one or more launch templates. You can specify parameters such as TemplateTag, TemplateResourceGroupId, and LaunchTemplateId. The returned information includes the total number of launch templates, template creation time, and latest template 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 to query information about one or more launch templates. You can specify parameters such as TemplateTag, TemplateResourceGroupId, and LaunchTemplateId. The returned information includes the total number of launch templates, template creation time, and latest template 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 account limits. * * @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 account limits. * * @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 information of snapshots, such as the lock status and lock configurations. * * @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 information of snapshots, such as the lock status and lock configurations. * * @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 the list of managed instances. * * @remarks * When performing 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 credential for querying subsequent pages. When querying subsequent pages, set the `NextToken` parameter to the `NextToken` value obtained from the previous response as the query credential, and set `MaxResults` to limit the number of entries returned. * * @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 the list of managed instances. * * @remarks * When performing 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 credential for querying subsequent pages. When querying subsequent pages, set the `NextToken` parameter to the `NextToken` value obtained from the previous response as the query credential, and set `MaxResults` to limit the number of entries returned. * * @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); } /** * Queries the details of an Elastic Network Interface (ENI) by specifying the ENI ID. * * @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({})); } /** * Queries the details of an Elastic Network Interface (ENI) by specifying the ENI ID. * * @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 Interfaces (ENIs). * * @remarks * ## Operation description. * * @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 Interfaces (ENIs). * * @remarks * ## Operation description. * * @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) in the new BGP (Multi-ISP) network. * * @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) in the new BGP (Multi-ISP) network. * * @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); } /** * DescribePhysicalConnections. * * @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({})); } /** * DescribePhysicalConnections. * * @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 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 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 associated with a specified port range 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 associated with a specified port range 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 a list of port range 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 a list of port range 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 the information about resources associated with a specified prefix list, such as resource IDs and resource 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 the information about resources associated with a specified prefix list, such as resource IDs and resource 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 specified prefix list, including the name, address family, maximum number of entries, and entry details. * * @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 specified prefix list, including the name, address family, maximum number of entries, and entry details. * * @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 about one or more prefix lists. * * @remarks * The request parameters `AddressFamily`, `PrefixListId.N`, and `PrefixListName` act as filters and have a logical AND relationship. If a parameter is empty, the corresponding filter does not take effect. * * @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 about one or more prefix lists. * * @remarks * The request parameters `AddressFamily`, `PrefixListId.N`, and `PrefixListName` act as filters and have a logical AND relationship. If a parameter is empty, the corresponding filter does not take effect. * * @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 retired or soon-to-be-retired instance types, 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 retired or soon-to-be-retired instance types, 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 a list of regions based on parameters such as billing method and resource type. * * @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 a list of regions based on parameters such as billing method and resource type. * * @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 queried 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 queried 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 list of reserved instances that you have purchased in a specified region. You can filter reserved instances by tags, reserved instance attributes, and other parameters. * * @remarks * ### Scenarios * - Query all reserved instances in a specified region. * - Query the details of a reserved instance by its ID or name. * - Filter purchased reserved instances by instance type or instance family. * - Filter purchased reserved instances by scope or status. * ### Request examples *
* Example: Query all purchased reserved instances in the Singapore region * ``` * "Region":"ap-southeast-1" //Set the region to Singapore * ``` *
*
* Example: Query the details of the reserved instance with the ID ecsri-bp129enntoynwwj5**** in the Singapore region * ``` * "Region":"ap-southeast-1", //Set the region to Singapore * "ReservedInstanceId":"ecsri-bp129enntoynwwj5****" //Set the reserved instance ID * ``` *
*
* Example: Query reserved instances that can be applied to the ecs.c5.2xlarge instance type in the Singapore region * ``` * "Region":"ap-southeast-1", //Set the region to Singapore * "InstanceType":"ecs.c5.2xlarge" //Set the instance type * ``` *
*
* Example: Query active region-level reserved instances in the Singapore region * ``` * "Region":"ap-southeast-1", //Set the region to Singapore * "Scope":"Region", //Set the reserved instance scope * "Status":["Active"] //Set the status to Active * ``` *
* * @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 list of reserved instances that you have purchased in a specified region. You can filter reserved instances by tags, reserved instance attributes, and other parameters. * * @remarks * ### Scenarios * - Query all reserved instances in a specified region. * - Query the details of a reserved instance by its ID or name. * - Filter purchased reserved instances by instance type or instance family. * - Filter purchased reserved instances by scope or status. * ### Request examples *
* Example: Query all purchased reserved instances in the Singapore region * ``` * "Region":"ap-southeast-1" //Set the region to Singapore * ``` *
*
* Example: Query the details of the reserved instance with the ID ecsri-bp129enntoynwwj5**** in the Singapore region * ``` * "Region":"ap-southeast-1", //Set the region to Singapore * "ReservedInstanceId":"ecsri-bp129enntoynwwj5****" //Set the reserved instance ID * ``` *
*
* Example: Query reserved instances that can be applied to the ecs.c5.2xlarge instance type in the Singapore region * ``` * "Region":"ap-southeast-1", //Set the region to Singapore * "InstanceType":"ecs.c5.2xlarge" //Set the instance type * ``` *
*
* Example: Query active region-level reserved instances in the Singapore region * ``` * "Region":"ap-southeast-1", //Set the region to Singapore * "Scope":"Region", //Set the reserved instance scope * "Status":["Active"] //Set the status to Active * ``` *
* * @param request - DescribeReservedInstancesRequest * @returns DescribeReservedInstancesResponse */ async describeReservedInstances(request: $_model.DescribeReservedInstancesRequest): Promise<$_model.DescribeReservedInstancesResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.describeReservedInstancesWithOptions(request, runtime); } /** * Retrieves resources based on tags. You can retrieve resources by tag or by 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({})); } /** * Retrieves resources based on tags. You can retrieve resources by tag or by 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 scenarios: * ### Example 1: Query instance types supported for specification change * 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 supported after changing the disk type * 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). This means that instance i-bp67acfmxazb4p**** must change 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 scenarios: * ### Example 1: Query instance types supported for specification change * 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 supported after changing the disk type * 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). This means that instance i-bp67acfmxazb4p**** must change 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 parameter query conditions. * * @remarks * - **Paged query**: Use `MaxResults` and `NextToken` for paging. * - If the response does not contain `NextToken`, the current page is the last page. * - 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. * - For subsequent pages, set `NextToken` to the value obtained from the previous response and set `MaxResults` to limit the number of entries returned. * - When you invoke this operation by using Cloud Assistant CLI, specify request parameters in their required formats. For more information, see [Parameter format overview](https://help.aliyun.com/document_detail/110340.html). * > Settings for request parameters of different data types must follow specific format requirements when calling the API through Alibaba Cloud CLI. * * @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 parameter query conditions. * * @remarks * - **Paged query**: Use `MaxResults` and `NextToken` for paging. * - If the response does not contain `NextToken`, the current page is the last page. * - 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. * - For subsequent pages, set `NextToken` to the value obtained from the previous response and set `MaxResults` to limit the number of entries returned. * - When you invoke this operation by using Cloud Assistant CLI, specify request parameters in their required formats. For more information, see [Parameter format overview](https://help.aliyun.com/document_detail/110340.html). * > Settings for request parameters of different data types must follow specific format requirements when calling the API through Alibaba Cloud CLI. * * @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 sending result based on the return value of this operation. * - You can query execution information from the last day. A maximum of 1,000 entries of execution information can be retained. * - When paged query the first page of results, set only MaxResults to limit the number of entries to return. The NextToken value returned in the result serves as the token for querying subsequent pages. When paged query subsequent pages, set NextToken to the value obtained from the previous response and set MaxResults to limit the number of entries to return. * * @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 sending result based on the return value of this operation. * - You can query execution information from the last day. A maximum of 1,000 entries of execution information can be retained. * - When paged query the first page of results, set only MaxResults to limit the number of entries to return. The NextToken value returned in the result serves as the token for querying subsequent pages. When paged query subsequent pages, set NextToken to the value obtained from the previous response and set MaxResults to limit the number of entries to return. * * @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, instance ID, and snapshot creation progress. * * @remarks * InstanceId, SnapshotGroupId.N, and Status.N are not required request parameters, but you can use them 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, instance ID, and snapshot creation progress. * * @remarks * InstanceId, SnapshotGroupId.N, and Status.N are not required request parameters, but you can use them 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 RegionId, DiskIds, and InstanceId act as filters. These parameters have a logical AND relationship. * - 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 RegionId, DiskIds, and InstanceId act as filters. These parameters have a logical AND relationship. * - 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 size changes within the last 30 days in a region. * * @remarks * ## Operation description * When you call this operation, take note of the following items: * - A maximum of 400 data entries can be returned at a time. Make sure that the value of `(EndTime–StartTime)/Period` is less than or equal to 400. In other words, the response parameter `TotalCount` cannot exceed 400. Otherwise, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query monitoring data only within the last 30 days. The `StartTime` parameter cannot be more than 30 days earlier than the current time. * * @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 size changes within the last 30 days in a region. * * @remarks * ## Operation description * When you call this operation, take note of the following items: * - A maximum of 400 data entries can be returned at a time. Make sure that the value of `(EndTime–StartTime)/Period` is less than or equal to 400. In other words, the response parameter `TotalCount` cannot exceed 400. Otherwise, the `InvalidParameter.TooManyDataQueried` error is returned. * - You can query monitoring data only within the last 30 days. The `StartTime` parameter cannot be more than 30 days earlier than the current time. * * @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 have purchased in a region. Storage plans can be used to offset the storage capacity of standard snapshots but do not support offsetting 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 have purchased in a region. Storage plans can be used to offset the storage capacity of standard snapshots but do not support offsetting 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 have a logical AND relationship. * When you invoke an API operation by using Cloud Assistant CLI, specify request parameters of different data types in the required formats. For details, see [CLI parameter format](https://help.aliyun.com/document_detail/110340.html). * Request examples: *
* Query the snapshot list of all disks of 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 snapshot ID array 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 have a logical AND relationship. * When you invoke an API operation by using Cloud Assistant CLI, specify request parameters of different data types in the required formats. For details, see [CLI parameter format](https://help.aliyun.com/document_detail/110340.html). * Request examples: *
* Query the snapshot list of all disks of 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 snapshot ID array 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 and the total snapshot size in a region. * * @remarks * ## Operation description * To view the snapshot usage of each cloud disk in the current region, call [DescribeSnapshotLinks](https://help.aliyun.com/document_detail/55837.html) to query snapshot chains. * * @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 and the total snapshot size in a region. * * @remarks * ## Operation description * To view the snapshot usage of each cloud disk in the current region, call [DescribeSnapshotLinks](https://help.aliyun.com/document_detail/55837.html) to query snapshot chains. * * @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 the average release rate, average discount rate, and other information about spot instances in a specified region over the last 30 days. * * @remarks * - Only spot instances that are deployed in VPCs and are I/O optimized are supported. * - You can call this operation by using one of the following methods: * - Set the `Cores` and `Memory` parameters or the `MinCores` and `MinMemory` parameters to query instance types that meet the vCPU and memory requirements. * - Set the `InstanceTypes.N` parameter to query specified instance types. * - Set the `Cores` and `Memory` parameters or the `MinCores` and `MinMemory` parameters, and then set the `InstanceTypeFamily` or `InstanceFamilyLevel` parameter to query instance types that meet the vCPU and memory requirements within a specific instance family or at a specific level. * - You can calculate the average price of spot instances based on the average discount rate and the price of pay-as-you-go instances. * * @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 the average release rate, average discount rate, and other information about spot instances in a specified region over the last 30 days. * * @remarks * - Only spot instances that are deployed in VPCs and are I/O optimized are supported. * - You can call this operation by using one of the following methods: * - Set the `Cores` and `Memory` parameters or the `MinCores` and `MinMemory` parameters to query instance types that meet the vCPU and memory requirements. * - Set the `InstanceTypes.N` parameter to query specified instance types. * - Set the `Cores` and `Memory` parameters or the `MinCores` and `MinMemory` parameters, and then set the `InstanceTypeFamily` or `InstanceFamilyLevel` parameter to query instance types that meet the vCPU and memory requirements within a specific instance family or at a specific level. * - You can calculate the average price of spot instances based on the average discount rate and the price of pay-as-you-go instances. * * @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 for up to 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 returned data may be paginated. If the returned data contains the `NextOffset` parameter, set the `Offset` request parameter to the `NextOffset` value to query subsequent 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 for up to 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 returned data may be paginated. If the returned data contains the `NextOffset` parameter, set the `Offset` request parameter to the `NextOffset` value to query subsequent 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 detailed information list of storage capacity units (SCUs). You can filter results by name, status, and capacity. * * @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 detailed information list of storage capacity units (SCUs). You can filter results by name, status, and capacity. * * @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 by resource type, resource ID, tag key, or tag value. The filter conditions are evaluated by using a logical AND (&&) operator, and only tags that match all filter conditions are returned. * * @remarks * If you specify a tag key (Tag.N.Key) but do not specify a tag value (Tag.N.Value), all tag key-value pairs that contain the specified 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 by resource type, resource ID, tag key, or tag value. The filter conditions are evaluated by using a logical AND (&&) operator, and only tags that match all filter conditions are returned. * * @remarks * If you specify a tag key (Tag.N.Key) but do not specify a tag value (Tag.N.Value), all tag key-value pairs that contain the specified 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, you can query the following asynchronous tasks: 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, you can query the following asynchronous tasks: 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); } /** * Queries 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({})); } /** * Queries 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); } /** * Retrieves the default attributes at the user level. * * @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({})); } /** * Retrieves the default attributes at the user level. * * @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 ECS instance. * * @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 ECS instance. * * @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 a list of routers. * * @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 a list of routers. * * @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); } /** * Queries the details of vSwitches. * * @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({})); } /** * Queries the details of vSwitches. * * @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); } /** * Queries a VPC. * * @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({})); } /** * Queries a VPC. * * @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); } /** * Queries virtual storage channels (VSCs). You can filter results by VscId, instance, status, or tags. * * @remarks * If you specify a tag key (Tag.N.Key) but do not specify a tag value (Tag.N.Value), all tag key-value pairs that contain the specified tag key are queried. If you specify a tag key-value pair, only the tags that exact match the key-value pair are queried. * * @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({})); } /** * Queries virtual storage channels (VSCs). You can filter results by VscId, instance, status, or tags. * * @remarks * If you specify a tag key (Tag.N.Key) but do not specify a tag value (Tag.N.Value), all tag key-value pairs that contain the specified tag key are queried. If you specify a tag key-value pair, only the tags that exact match the key-value pair are queried. * * @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 zones based on parameter query conditions 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 zones based on parameter query conditions 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); } /** * Invokes DetachClassicLinkVpc to disconnect a classic network type ECS instance from a virtual private cloud (VPC) by removing the ClassicLink connection. After the ClassicLink connection is removed, the classic network type instance cannot 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({})); } /** * Invokes DetachClassicLinkVpc to disconnect a classic network type ECS instance from a virtual private cloud (VPC) by removing the ClassicLink connection. After the ClassicLink connection is removed, the classic network type instance cannot 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 system disk from an ECS instance. * * @remarks * When you call this operation, take note of the following items: * - This is an asynchronous operation. After a successful call, wait approximately one minute for the detachment to complete. * - The instance to which the disk is attached must not be locked with `"LockReason" : "security"` in `OperationLocks`. * - After an elastic ephemeral disk is detached, it can only be re-attached to its original 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 system disk from an ECS instance. * * @remarks * When you call this operation, take note of the following items: * - This is an asynchronous operation. After a successful call, wait approximately one minute for the detachment to complete. * - The instance to which the disk is attached must not be locked with `"LockReason" : "security"` in `OperationLocks`. * - After an elastic ephemeral disk is detached, it can only be re-attached to its original 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 RAM roles from one or more 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 RAM roles from one or more 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 * When you call this operation, take note of the following items: * - After you unbind an SSH key pair, you must 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 * When you call this operation, take note of the following items: * - After you unbind an SSH key pair, you must 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); } /** * Detaches an Elastic Network Interface (ENI) from an ECS instance. * * @remarks * When you call this operation, take note of the following items: * - You cannot detach the primary ENI of an instance. * - The network interface controller (NIC) must be in the Detaching or InUse state. * - The instance must be in the Running or Stopped state. * - This is an asynchronous operation. After you invoke the operation, you can check the Elastic Network Interface (ENI) status or listen for network interface controller (NIC) operation events to obtain the result. The following figure shows the ENI state machine: * ![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20221124/mvga/DetachNetworkInterface.jpg) * - The Detaching state indicates that the detach Elastic Network Interface (ENI) request has been sent successfully and the network interface controller (NIC) is being detached from the ECS instance. * - The Available state indicates that the network interface controller (NIC) has been detached from the ECS instance. * - If the Elastic Network Interface (ENI) remains in the Detaching state for an extended period, the detachment may have failed because the operating system inside the instance did not respond to the network interface controller (NIC) detach request. In this case, initiate a new detach request for the ENI. If the issue persists, restart the instance and retry. * **For details, see** [Detach an Elastic Network Interface (ENI)](https://help.aliyun.com/document_detail/471551.html). To invoke this operation, refer to the sample code. * * @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({})); } /** * Detaches an Elastic Network Interface (ENI) from an ECS instance. * * @remarks * When you call this operation, take note of the following items: * - You cannot detach the primary ENI of an instance. * - The network interface controller (NIC) must be in the Detaching or InUse state. * - The instance must be in the Running or Stopped state. * - This is an asynchronous operation. After you invoke the operation, you can check the Elastic Network Interface (ENI) status or listen for network interface controller (NIC) operation events to obtain the result. The following figure shows the ENI state machine: * ![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20221124/mvga/DetachNetworkInterface.jpg) * - The Detaching state indicates that the detach Elastic Network Interface (ENI) request has been sent successfully and the network interface controller (NIC) is being detached from the ECS instance. * - The Available state indicates that the network interface controller (NIC) has been detached from the ECS instance. * - If the Elastic Network Interface (ENI) remains in the Detaching state for an extended period, the detachment may have failed because the operating system inside the instance did not respond to the network interface controller (NIC) detach request. In this case, initiate a new detach request for the ENI. If the issue persists, restart the instance and retry. * **For details, see** [Detach an Elastic Network Interface (ENI)](https://help.aliyun.com/document_detail/471551.html). To invoke this operation, refer to the sample code. * * @param request - DetachNetworkInterfaceRequest * @returns DetachNetworkInterfaceResponse */ async detachNetworkInterface(request: $_model.DetachNetworkInterfaceRequest): Promise<$_model.DetachNetworkInterfaceResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.detachNetworkInterfaceWithOptions(request, runtime); } /** * Disables a specified activation code. * * @remarks * ## Operation description * If you are concerned that a created activation code may be leaked, call this operation to disable the activation code. After the activation code is disabled, it can no longer be used to register new managed instances, but existing managed instances that were 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({})); } /** * Disables a specified activation code. * * @remarks * ## Operation description * If you are concerned that a created activation code may be leaked, call this operation to disable the activation code. After the activation code is disabled, it can no longer be used to register new managed instances, but existing managed instances that were 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 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 grant 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 a cloud disk. * * @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 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 grant 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 a cloud disk. * * @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 the QoS rate limiting settings for an Elastic Network Interface (ENI). * * @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 the QoS rate limiting settings for an Elastic Network Interface (ENI). * * @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 account-level default encryption for block storage in a specified region. * * @remarks * * > The EBS account-level default encryption feature is available only in specific regions and for specific users. If you want to use this feature, [submit a ticket](https://selfservice.console.aliyun.com/ticket/createIndex). * * > The EBS account-level default encryption feature is available only in specific regions and for specific users. If you want to use this feature, [submit a ticket](https://smartservice.console.aliyun.com/service/create-ticket-intl). * - **Before you begin** * - Resource Access Management (RAM) users require the `AliyunECSFullAccess` permission. For details about the authorization operation, see [Grant permissions to a RAM user](https://help.aliyun.com/document_detail/116146.html). * - Before enabling account-level default encryption for block storage, activate [Key Management Service (KMS)](https://help.aliyun.com/document_detail/480156.html). * - After account-level default encryption for block storage is enabled, only encrypted cloud disks can be created. For details, see [Encrypted cloud disks - Limits](~~59643#50de175230erj~~). * - **Notes** * - After account-level default encryption for block storage is enabled, all newly created pay-as-you-go or subscription cloud disks must be encrypted cloud disks. You can use the KMS key ID configured for account-level default encryption for block storage, or specify a different KMS key ID. * - When account-level default encryption for block storage is enabled for the first time, the service key is used by default. * - **Recommendations** * - You can call [DescribeDiskEncryptionByDefaultStatus](https://help.aliyun.com/document_detail/2851493.html) and [DescribeDiskDefaultKMSKeyId](https://help.aliyun.com/document_detail/2851490.html) to query whether account-level default encryption for block storage is enabled in a specified region and the KMS key ID in use. * - You can call [ModifyDiskDefaultKMSKeyId](https://help.aliyun.com/document_detail/2851492.html) or [ResetDiskDefaultKMSKeyId](https://help.aliyun.com/document_detail/2851539.html) to modify or reset the KMS key used for account-level default encryption for block storage. * - You can call [DisableDiskEncryptionByDefault](https://help.aliyun.com/document_detail/2851491.html) to disable account-level default encryption for block storage in a specified 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 account-level default encryption for block storage in a specified region. * * @remarks * * > The EBS account-level default encryption feature is available only in specific regions and for specific users. If you want to use this feature, [submit a ticket](https://selfservice.console.aliyun.com/ticket/createIndex). * * > The EBS account-level default encryption feature is available only in specific regions and for specific users. If you want to use this feature, [submit a ticket](https://smartservice.console.aliyun.com/service/create-ticket-intl). * - **Before you begin** * - Resource Access Management (RAM) users require the `AliyunECSFullAccess` permission. For details about the authorization operation, see [Grant permissions to a RAM user](https://help.aliyun.com/document_detail/116146.html). * - Before enabling account-level default encryption for block storage, activate [Key Management Service (KMS)](https://help.aliyun.com/document_detail/480156.html). * - After account-level default encryption for block storage is enabled, only encrypted cloud disks can be created. For details, see [Encrypted cloud disks - Limits](~~59643#50de175230erj~~). * - **Notes** * - After account-level default encryption for block storage is enabled, all newly created pay-as-you-go or subscription cloud disks must be encrypted cloud disks. You can use the KMS key ID configured for account-level default encryption for block storage, or specify a different KMS key ID. * - When account-level default encryption for block storage is enabled for the first time, the service key is used by default. * - **Recommendations** * - You can call [DescribeDiskEncryptionByDefaultStatus](https://help.aliyun.com/document_detail/2851493.html) and [DescribeDiskDefaultKMSKeyId](https://help.aliyun.com/document_detail/2851490.html) to query whether account-level default encryption for block storage is enabled in a specified region and the KMS key ID in use. * - You can call [ModifyDiskDefaultKMSKeyId](https://help.aliyun.com/document_detail/2851492.html) or [ResetDiskDefaultKMSKeyId](https://help.aliyun.com/document_detail/2851539.html) to modify or reset the KMS key used for account-level default encryption for block storage. * - You can call [DisableDiskEncryptionByDefault](https://help.aliyun.com/document_detail/2851491.html) to disable account-level default encryption for block storage in a specified 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); } /** * Enables or modifies the QoS rate limiting settings of an Elastic Network Interface (ENI). * * @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({})); } /** * Enables or modifies the QoS rate limiting settings of an Elastic Network Interface (ENI). * * @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); } /** * Exports a custom image to an OSS bucket in the same region as the custom image. * * @remarks * Before you export an image: * - Learn about the prerequisites and considerations. For more information, see [Export images](https://help.aliyun.com/document_detail/58181.html). * - The ImageFormat parameter for specifying the image export format is available only in specific regions, including Japan (Tokyo), Indonesia (Jakarta), Germany (Frankfurt), UAE (Dubai), US (Virginia), UK (London), Singapore, Malaysia (Kuala Lumpur), and US (Silicon Valley). In regions where this parameter is not supported, images are exported in RAW format by default. * - Grant Elastic Compute Service (ECS) the permission to write to OSS by using RAM authorization. Perform the following steps: * - Create a role named `AliyunECSImageExportDefaultRole` (no other role name is valid) and configure the following trust policy for the role: * ``` * { * "Statement": [ * { * "Action": "sts:AssumeRole", * "Effect": "Allow", * "Principal": { * "Service": [ * "ecs.aliyuncs.com" * ] * } * } * ], * "Version": "1" * } * - Attach the default system access policy `AliyunECSImageExportRolePolicy` to the `AliyunECSImageExportDefaultRole` role. This policy is the default policy provided by Elastic Compute Service (ECS) for image export. For more details, see [Cloud resource access authorization](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 access 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 you export an image: * The custom image is saved to the specified OSS bucket. You can then download the custom image. For more information, 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({})); } /** * Exports a custom image to an OSS bucket in the same region as the custom image. * * @remarks * Before you export an image: * - Learn about the prerequisites and considerations. For more information, see [Export images](https://help.aliyun.com/document_detail/58181.html). * - The ImageFormat parameter for specifying the image export format is available only in specific regions, including Japan (Tokyo), Indonesia (Jakarta), Germany (Frankfurt), UAE (Dubai), US (Virginia), UK (London), Singapore, Malaysia (Kuala Lumpur), and US (Silicon Valley). In regions where this parameter is not supported, images are exported in RAW format by default. * - Grant Elastic Compute Service (ECS) the permission to write to OSS by using RAM authorization. Perform the following steps: * - Create a role named `AliyunECSImageExportDefaultRole` (no other role name is valid) and configure the following trust policy for the role: * ``` * { * "Statement": [ * { * "Action": "sts:AssumeRole", * "Effect": "Allow", * "Principal": { * "Service": [ * "ecs.aliyuncs.com" * ] * } * } * ], * "Version": "1" * } * - Attach the default system access policy `AliyunECSImageExportRolePolicy` to the `AliyunECSImageExportDefaultRole` role. This policy is the default policy provided by Elastic Compute Service (ECS) for image export. For more details, see [Cloud resource access authorization](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 access 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 you export an image: * The custom image is saved to the specified OSS bucket. You can then download the custom image. For more information, 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 ddasd. * * @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 ddasd. * * @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. * - You cannot retrieve the system command line output of [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. * - You cannot retrieve the system command line output of [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); } /** * Retrieves the screenshot information of an instance. * * @remarks * Elastic Compute Service (ECS) returns the instance screenshot as a Base64-encoded JPG image. You must decode the image on your own. You can call this operation to troubleshoot faults. Note the following items: * - The instance must be in the Running state. * - You cannot retrieve screenshot information for [retired instance types](https://help.aliyun.com/document_detail/55263.html). * - If you call this operation multiple times on the same instance, wait at least 10 seconds between calls. 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({})); } /** * Retrieves the screenshot information of an instance. * * @remarks * Elastic Compute Service (ECS) returns the instance screenshot as a Base64-encoded JPG image. You must decode the image on your own. You can call this operation to troubleshoot faults. Note the following items: * - The instance must be in the Running state. * - You cannot retrieve screenshot information for [retired instance types](https://help.aliyun.com/document_detail/55263.html). * - If you call this operation multiple times on the same instance, wait at least 10 seconds between calls. 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 objects](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 a virtio driver](https://help.aliyun.com/document_detail/62423.html). * - When you import an image for the first time, you must use Resource Access Management (RAM) to authorize ECS to access your OSS bucket. Otherwise, the `NoSetRoletoECSServiceAccount` or `InvalidOperation.CloudBoxImageImportRoleRequired` error is reported. The following two scenarios apply: * - **Import an image file without using CloudBox**: You can complete RAM authorization with one click in the RAM console. For RAM authorization page, 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` (this exact name is required, otherwise the image import fails). The policy for the role is: * ``` * { * "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 must include 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 with one click in the RAM console. For RAM authorization page, 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` (this exact name is required, otherwise the image import fails). The policy for the role is: * ``` * { * "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 must include 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 to which the image is imported 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. N=1 indicates the system disk. N=2 to 17 indicates data disks. 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 enable the imported image to support password configuration or key pair modification, the image must meet the following conditions: * - 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 enable the imported image to support disk resizing and file system resizing, the image must meet the following conditions: * - 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 depending on the 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). * - We strongly recommend that you configure image detection parameters when importing an image. This helps the system optimize your image. For more information, see [Overview of image detection](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 objects](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 a virtio driver](https://help.aliyun.com/document_detail/62423.html). * - When you import an image for the first time, you must use Resource Access Management (RAM) to authorize ECS to access your OSS bucket. Otherwise, the `NoSetRoletoECSServiceAccount` or `InvalidOperation.CloudBoxImageImportRoleRequired` error is reported. The following two scenarios apply: * - **Import an image file without using CloudBox**: You can complete RAM authorization with one click in the RAM console. For RAM authorization page, 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` (this exact name is required, otherwise the image import fails). The policy for the role is: * ``` * { * "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 must include 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 with one click in the RAM console. For RAM authorization page, 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` (this exact name is required, otherwise the image import fails). The policy for the role is: * ``` * { * "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 must include 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 to which the image is imported 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. N=1 indicates the system disk. N=2 to 17 indicates data disks. 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 enable the imported image to support password configuration or key pair modification, the image must meet the following conditions: * - 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 enable the imported image to support disk resizing and file system resizing, the image must meet the following conditions: * - 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 depending on the 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). * - We strongly recommend that you configure image detection parameters when importing an image. This helps the system optimize your image. For more information, see [Overview of image detection](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 of an RSA key pair generated by another tool. After you import the key pair, Alibaba Cloud stores the public key. You must store the private key on your own. * * @remarks * ## Operation 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 of an RSA key pair generated by another tool. After you import the key pair, Alibaba Cloud stores the public key. You must store the private key on your own. * * @remarks * ## Operation 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 one or more ECS instances. You must restart the instances to complete the installation. * * @remarks * ## Operation description * After you call the InstallCloudAssistant operation, call [RebootInstance](https://help.aliyun.com/document_detail/25502.html) to make the Cloud Assistant Agent 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 one or more ECS instances. You must restart the instances to complete the installation. * * @remarks * ## Operation description * After you call the InstallCloudAssistant operation, call [RebootInstance](https://help.aliyun.com/document_detail/25502.html) to make the Cloud Assistant Agent 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); } /** * Triggers a Cloud Assistant command on one or more ECS instances by specifying parameters such as CommandId, InstanceId, and ResourceGroupId. * * @remarks * ## Operation description * * - The following limits apply to the target ECS instances. If you select multiple ECS instances and one of them does not meet the execution conditions, you must call the operation again. * - Target instance must be in the Running state. You can call [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) to query target instance status. * - [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html) must be installed on target instance in advance. * - To run a PowerShell command, target instance must have the PowerShell module configured. * - One-time execution: The command is run only once. * - Scheduled execution: * - The command is run at the frequency specified by the Frequency parameter. The result of the previous execution does not affect the next execution. * - If you run 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 is determined by the system time of target instance. Make sure that the time or time zone of the ECS instance is consistent with your expected time. For more information about time zones, see [Manage time synchronization services](https://help.aliyun.com/document_detail/92704.html). * Cloud Assistant Agent must be at or later than the following versions to support the new features of scheduled tasks (execution at fixed intervals, one-time execution at a specified time, and specifying a year or time zone for Cron expression-based scheduled execution). If the ClientNeedUpgrade error code is returned, see [Upgrade or disable upgrades for 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 * - A command may fail to be run due to abnormal instance status, network exceptions, or Cloud Assistant Agent exceptions. No execution information is generated when a command fails to be run. For more information, see [Common errors and solutions for execution failures](https://help.aliyun.com/document_detail/87029.html). * - If you enabled the custom parameter feature when you created the command, you must pass in custom parameters (`Parameters`) when you run the command. * - Call [DescribeCloudAssistantStatus](https://help.aliyun.com/document_detail/87346.html) to query the Cloud Assistant status of target instance. Run the command only when CloudAssistantStatus is true, especially for newly purchased instances. * * - The following limits apply to the target ECS instances. If you select multiple ECS instances and one of them does not meet the execution conditions, you must call the operation again. * - Target instance must be in the Running state. You can call [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) to query target instance status. * - [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html) must be installed on target instance in advance. * - To run a PowerShell command, target instance must have the PowerShell module configured. * - One-time execution: The command is run only once. * - Scheduled execution: * - The command is run at the frequency specified by the Frequency parameter. The result of the previous execution does not affect the next execution. * - If you run 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 is determined by the system time of target instance. Make sure that the time or time zone of the ECS instance is consistent with your expected time. For more information about time zones, see [Manage time synchronization services](https://help.aliyun.com/document_detail/92704.html). * Cloud Assistant Agent must be at or later than the following versions to support the new features of scheduled tasks (execution at fixed intervals, one-time execution at a specified time, and specifying a year or time zone for Cron expression-based scheduled execution). If the ClientNeedUpgrade error code is returned, see [Upgrade or disable upgrades for 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 * - A command may fail to be run due to abnormal instance status, network exceptions, or Cloud Assistant Agent exceptions. No execution information is generated when a command fails to be run. For more information, see [Common errors and solutions for execution failures](https://help.aliyun.com/document_detail/87029.html). * - If you enabled the custom parameter feature when you created the command, you must pass in custom parameters (`Parameters`) when you run the command. * - Call [DescribeCloudAssistantStatus](https://help.aliyun.com/document_detail/87346.html) to query the Cloud Assistant status of target instance. Run 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({})); } /** * Triggers a Cloud Assistant command on one or more ECS instances by specifying parameters such as CommandId, InstanceId, and ResourceGroupId. * * @remarks * ## Operation description * * - The following limits apply to the target ECS instances. If you select multiple ECS instances and one of them does not meet the execution conditions, you must call the operation again. * - Target instance must be in the Running state. You can call [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) to query target instance status. * - [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html) must be installed on target instance in advance. * - To run a PowerShell command, target instance must have the PowerShell module configured. * - One-time execution: The command is run only once. * - Scheduled execution: * - The command is run at the frequency specified by the Frequency parameter. The result of the previous execution does not affect the next execution. * - If you run 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 is determined by the system time of target instance. Make sure that the time or time zone of the ECS instance is consistent with your expected time. For more information about time zones, see [Manage time synchronization services](https://help.aliyun.com/document_detail/92704.html). * Cloud Assistant Agent must be at or later than the following versions to support the new features of scheduled tasks (execution at fixed intervals, one-time execution at a specified time, and specifying a year or time zone for Cron expression-based scheduled execution). If the ClientNeedUpgrade error code is returned, see [Upgrade or disable upgrades for 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 * - A command may fail to be run due to abnormal instance status, network exceptions, or Cloud Assistant Agent exceptions. No execution information is generated when a command fails to be run. For more information, see [Common errors and solutions for execution failures](https://help.aliyun.com/document_detail/87029.html). * - If you enabled the custom parameter feature when you created the command, you must pass in custom parameters (`Parameters`) when you run the command. * - Call [DescribeCloudAssistantStatus](https://help.aliyun.com/document_detail/87346.html) to query the Cloud Assistant status of target instance. Run the command only when CloudAssistantStatus is true, especially for newly purchased instances. * * - The following limits apply to the target ECS instances. If you select multiple ECS instances and one of them does not meet the execution conditions, you must call the operation again. * - Target instance must be in the Running state. You can call [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) to query target instance status. * - [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html) must be installed on target instance in advance. * - To run a PowerShell command, target instance must have the PowerShell module configured. * - One-time execution: The command is run only once. * - Scheduled execution: * - The command is run at the frequency specified by the Frequency parameter. The result of the previous execution does not affect the next execution. * - If you run 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 is determined by the system time of target instance. Make sure that the time or time zone of the ECS instance is consistent with your expected time. For more information about time zones, see [Manage time synchronization services](https://help.aliyun.com/document_detail/92704.html). * Cloud Assistant Agent must be at or later than the following versions to support the new features of scheduled tasks (execution at fixed intervals, one-time execution at a specified time, and specifying a year or time zone for Cron expression-based scheduled execution). If the ClientNeedUpgrade error code is returned, see [Upgrade or disable upgrades for 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 * - A command may fail to be run due to abnormal instance status, network exceptions, or Cloud Assistant Agent exceptions. No execution information is generated when a command fails to be run. For more information, see [Common errors and solutions for execution failures](https://help.aliyun.com/document_detail/87029.html). * - If you enabled the custom parameter feature when you created the command, you must pass in custom parameters (`Parameters`) when you run the command. * - Call [DescribeCloudAssistantStatus](https://help.aliyun.com/document_detail/87346.html) to query the Cloud Assistant status of target instance. Run 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); } /** * Adds an ECS resource or service to a resource group. * * @remarks * ## Operation description * A resource is a cloud service entity that you create on Alibaba Cloud. For example, an ECS instance, an ECS Elastic Network Interface (ENI), or an ECS image can each be a resource. A resource group is a collection of infrastructure for projects, environments, or stacks. Managing resources in resource groups allows you to monitor and run tasks in a centralized manner, without the need to switch 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({})); } /** * Adds an ECS resource or service to a resource group. * * @remarks * ## Operation description * A resource is a cloud service entity that you create on Alibaba Cloud. For example, an ECS instance, an ECS Elastic Network Interface (ENI), or an ECS image can each be a resource. A resource group is a collection of infrastructure for projects, environments, or stacks. Managing resources in resource groups allows you to monitor and run tasks in a centralized manner, without the need to switch 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 (ENI) to a specified security group. * * @remarks * > This API operation is deprecated. Invoke [ModifyInstanceAttribute](https://help.aliyun.com/document_detail/25503.html) to add an ECS instance to or remove it from a security group. Invoke [ModifyNetworkInterfaceAttribute](https://help.aliyun.com/document_detail/58513.html) to add an Elastic Network Interface (ENI) to or remove it from a security group. * - This operation does not support adding both an instance and an ENI to a security group at the same time. The InstanceId and NetworkInterfaceId parameters cannot be specified at the same time. * - The security group and the instance must belong to the same region. * - The security group and the instance must have the same network type. If the network type is Virtual Private Cloud (VPC), the security group and the instance must belong to the same VPC. * - Before joining a security group, the instance must be in the **Stopped** or **Running** state. * - An instance or an ENI can be added to up to five security groups. For more information, see [Security group limits](~~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 (ENI) to a specified security group. * * @remarks * > This API operation is deprecated. Invoke [ModifyInstanceAttribute](https://help.aliyun.com/document_detail/25503.html) to add an ECS instance to or remove it from a security group. Invoke [ModifyNetworkInterfaceAttribute](https://help.aliyun.com/document_detail/58513.html) to add an Elastic Network Interface (ENI) to or remove it from a security group. * - This operation does not support adding both an instance and an ENI to a security group at the same time. The InstanceId and NetworkInterfaceId parameters cannot be specified at the same time. * - The security group and the instance must belong to the same region. * - The security group and the instance must have the same network type. If the network type is Virtual Private Cloud (VPC), the security group and the instance must belong to the same VPC. * - Before joining a security group, the instance must be in the **Stopped** or **Running** state. * - An instance or an ENI can be added to up to five security groups. For more information, see [Security group limits](~~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 ECS instance or an Elastic Network Interface (ENI) from a specified security group. * * @remarks * > This API operation is no longer recommended. Invoke [ModifyInstanceAttribute](https://help.aliyun.com/document_detail/25503.html) to add an ECS instance to or remove it from a security group. Invoke [ModifyNetworkInterfaceAttribute](https://help.aliyun.com/document_detail/58513.html) to add an Elastic Network Interface (ENI) to or remove it from a security group. * >Notice: Alibaba Cloud adjusted the validation rules for this operation on July 8, 2024. When you attempt to remove an instance or network interface controller (NIC) that is not in the specified security group, the operation now returns the error code InvalidSecurityGroupAssociation.NotFound instead of a success response. Update your code to be compatible with this error code to avoid impact on your production workloads. * - You cannot remove an instance and an Elastic Network Interface (ENI) from a security group at the same time. The InstanceId and NetworkInterfaceId parameters are mutually exclusive. * - Before you remove an instance from a security group, the instance must be in the **Stopped** or **Running** state. * - An instance or Elastic Network Interface (ENI) must belong to at least one security group. If the instance or ENI belongs to only one security group, the removal request fails. * - If the instance or network interface controller (NIC) is not in the specified security group, the removal request fails. * * @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 ECS instance or an Elastic Network Interface (ENI) from a specified security group. * * @remarks * > This API operation is no longer recommended. Invoke [ModifyInstanceAttribute](https://help.aliyun.com/document_detail/25503.html) to add an ECS instance to or remove it from a security group. Invoke [ModifyNetworkInterfaceAttribute](https://help.aliyun.com/document_detail/58513.html) to add an Elastic Network Interface (ENI) to or remove it from a security group. * >Notice: Alibaba Cloud adjusted the validation rules for this operation on July 8, 2024. When you attempt to remove an instance or network interface controller (NIC) that is not in the specified security group, the operation now returns the error code InvalidSecurityGroupAssociation.NotFound instead of a success response. Update your code to be compatible with this error code to avoid impact on your production workloads. * - You cannot remove an instance and an Elastic Network Interface (ENI) from a security group at the same time. The InstanceId and NetworkInterfaceId parameters are mutually exclusive. * - Before you remove an instance from a security group, the instance must be in the **Stopped** or **Running** state. * - An instance or Elastic Network Interface (ENI) must belong to at least one security group. If the instance or ENI belongs to only one security group, the removal request fails. * - If the instance or network interface controller (NIC) is not in the specified security group, the removal request fails. * * @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 status of Cloud Assistant plugins on instances. * * @remarks * - The Cloud Assistant Agent version on the instance must be at least the following version for the Cloud Assistant plugin status to be queried: * - Linux: 2.2.3.344. * - Windows: 2.1.3.344. * - When you perform a paging query for the first page, set only `MaxResults` to limit the number of entries to return. The `NextToken` value returned in the result is used as the credential to query subsequent pages. When you perform a paging query for subsequent pages, set the `NextToken` parameter to the `NextToken` value obtained from the previous response and set `MaxResults` to limit the number of entries to return. * * @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 status of Cloud Assistant plugins on instances. * * @remarks * - The Cloud Assistant Agent version on the instance must be at least the following version for the Cloud Assistant plugin status to be queried: * - Linux: 2.2.3.344. * - Windows: 2.1.3.344. * - When you perform a paging query for the first page, set only `MaxResults` to limit the number of entries to return. The `NextToken` value returned in the result is used as the credential to query subsequent pages. When you perform a paging query for subsequent pages, set the `NextToken` parameter to the `NextToken` value obtained from the previous response and set `MaxResults` to limit the number of entries to return. * * @param request - ListPluginStatusRequest * @returns ListPluginStatusResponse */ async listPluginStatus(request: $_model.ListPluginStatusRequest): Promise<$_model.ListPluginStatusResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.listPluginStatusWithOptions(request, runtime); } /** * Queries the tags that are bound to one or more ECS resources. * * @remarks * ## Operation description * Specify at least one of the following parameters in the request to determine the query object. * - `ResourceId.N` * - `Tag.N` (`Tag.N.Key` and `Tag.N.Value`) * - `TagFilter.N` * If you specify the following parameters at the same time, the response contains only ECS resources that meet both 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({})); } /** * Queries the tags that are bound to one or more ECS resources. * * @remarks * ## Operation description * Specify at least one of the following parameters in the request to determine the query object. * - `ResourceId.N` * - `Tag.N` (`Tag.N.Key` and `Tag.N.Value`) * - `TagFilter.N` * If you specify the following parameters at the same time, the response contains only ECS resources that meet both 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); } /** * Locks a snapshot in compliance mode to prevent the snapshot from being accidentally or maliciously deleted. During the lock period, no user can delete the snapshot. * * @remarks * You can also use this operation to reconfigure a locked snapshot. The configurable items depend on the lock mode and lock status: * - If the snapshot is locked in compliance mode and is within the cool-off period, you can extend or shorten the cool-off period and extend or shorten the lock duration. * - If the snapshot is locked in compliance mode and the cool-off period has elapsed, you can only extend the lock duration. * > When you reconfigure a locked snapshot during the cool-off period, the system treats this as a re-lock operation. All lock parameters are reset rather than individually adjusted. * * @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({})); } /** * Locks a snapshot in compliance mode to prevent the snapshot from being accidentally or maliciously deleted. During the lock period, no user can delete the snapshot. * * @remarks * You can also use this operation to reconfigure a locked snapshot. The configurable items depend on the lock mode and lock status: * - If the snapshot is locked in compliance mode and is within the cool-off period, you can extend or shorten the cool-off period and extend or shorten the lock duration. * - If the snapshot is locked in compliance mode and the cool-off period has elapsed, you can only extend the lock duration. * > When you reconfigure a locked snapshot during the cool-off period, the system treats this as a re-lock operation. All lock parameters are reset rather than individually adjusted. * * @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 modify an auto provisioning group, take note of the following items: * - If you modify the capacity or capacity-related settings of the group, the group executes a scheduling node after the modification is complete. * - If the auto provisioning group is being deleted, you cannot modify the group. * * @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 modify an auto provisioning group, take note of the following items: * - If you modify the capacity or capacity-related settings of the group, the group executes a scheduling node after the modification is complete. * - If the auto provisioning group is being deleted, you cannot modify the group. * * @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 days, 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.targetTags)) { query["TargetTags"] = request.targetTags; } 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 days, 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 partial information of a capacity reservation, including the name, description, expiration method, and total number of reserved instances. * * @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 partial information of a capacity reservation, including the name, description, expiration method, and total number of reserved instances. * * @param request - ModifyCapacityReservationRequest * @returns ModifyCapacityReservationResponse */ async modifyCapacityReservation(request: $_model.ModifyCapacityReservationRequest): Promise<$_model.ModifyCapacityReservationResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyCapacityReservationWithOptions(request, runtime); } /** * Modifies the Cloud Assistant service configurations. * * @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({})); } /** * Modifies the Cloud Assistant service configurations. * * @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 service availability attributes. * * @remarks * ## Operation description * - To modify the CPU overcommit ratio, all ECS instances on the dedicated host must be in the Stopped (`Stopped`) state. * - Modifying the CPU overcommit ratio does not affect the running state of the dedicated host. However, the number of allocated vCPUs on the dedicated host cannot exceed the new total number of vCPUs after the modification. Otherwise, the excess ECS instances cannot be started. * * @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 service availability attributes. * * @remarks * ## Operation description * - To modify the CPU overcommit ratio, all ECS instances on the dedicated host must be in the Stopped (`Stopped`) state. * - Modifying the CPU overcommit ratio does not affect the running state of the dedicated host. However, the number of allocated vCPUs on the dedicated host cannot exceed the new total number of vCPUs after the modification. Otherwise, the excess ECS instances cannot be started. * * @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 or cancels the automatic release time for a pay-as-you-go dedicated host. * * @remarks * ## Operation description * When the specified automatic release time is reached, the pay-as-you-go dedicated host is automatically released. Make sure that you no longer use the dedicated host and have backed up application data as needed. * * @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 or cancels the automatic release time for a pay-as-you-go dedicated host. * * @remarks * ## Operation description * When the specified automatic release time is reached, the pay-as-you-go dedicated host is automatically released. Make sure that you no longer use the dedicated host and have backed up application data as needed. * * @param request - ModifyDedicatedHostAutoReleaseTimeRequest * @returns ModifyDedicatedHostAutoReleaseTimeResponse */ async modifyDedicatedHostAutoReleaseTime(request: $_model.ModifyDedicatedHostAutoReleaseTimeRequest): Promise<$_model.ModifyDedicatedHostAutoReleaseTimeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyDedicatedHostAutoReleaseTimeWithOptions(request, runtime); } /** * Configures auto-renewal for one or more subscription dedicated hosts, or cancels the auto-renewal that has been configured. * * @remarks * - After you enable the auto-renewal feature for a subscription dedicated host, the system automatically renews the host nine days before expiration. The fee is automatically executed at 08:00:00 (UTC+8). If the deduction failed on the previous day, the system retries at the same time the next day. The automatic deduction stops after the fee is successfully deducted or after the dedicated host expires and is locked nine days later. During this period, make sure that your payment method has a sufficient balance. * - Subscription dedicated hosts support auto-renewal that follows the subscription ECS instances on the host. For more information, see the metric 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({})); } /** * Configures auto-renewal for one or more subscription dedicated hosts, or cancels the auto-renewal that has been configured. * * @remarks * - After you enable the auto-renewal feature for a subscription dedicated host, the system automatically renews the host nine days before expiration. The fee is automatically executed at 08:00:00 (UTC+8). If the deduction failed on the previous day, the system retries at the same time the next day. The automatic deduction stops after the fee is successfully deducted or after the dedicated host expires and is locked nine days later. During this period, make sure that your payment method has a sufficient balance. * - Subscription dedicated hosts support auto-renewal that follows the subscription ECS instances on the host. For more information, see the metric 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 some information about a dedicated host cluster, including the name, description, and properties of the dedicated host cluster. * * @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 some information about a dedicated host cluster, including the name, description, and properties of the dedicated host cluster. * * @param request - ModifyDedicatedHostClusterAttributeRequest * @returns ModifyDedicatedHostClusterAttributeResponse */ async modifyDedicatedHostClusterAttribute(request: $_model.ModifyDedicatedHostClusterAttributeRequest): Promise<$_model.ModifyDedicatedHostClusterAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyDedicatedHostClusterAttributeWithOptions(request, runtime); } /** * Modifies 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({})); } /** * Modifies 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 resource 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 resource 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 in a batch. * * @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 in a batch. * * @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 data disks attached to a subscription ECS instance between pay-as-you-go and subscription. * * @remarks * Before you convert the billing method of a data disk, read [Convert the billing method of a disk](https://help.aliyun.com/document_detail/145018.html). * Take note of the following items when you call this operation: * - You cannot change the billing method of data disks attached to pay-as-you-go instances. Pay-as-you-go instances support only pay-as-you-go disks. * - The instance to which the data disk is attached cannot be in the expired and stopped state. * - The price difference before and after the billing method conversion is refunded to your original payment method. Used coupons are not refundable. * - After the billing method of a disk is successfully changed, you cannot change it again within five minutes. * - Disks with the multi-attach attribute enabled support only the pay-as-you-go billing method and cannot be converted to subscription. * After the billing method is changed, automatic payment is enabled by default. Make sure that your account balance is sufficient. Otherwise, an abnormal order is generated, and you can only void the order. If your account balance is insufficient, you can set the AutoPay parameter to false. In this case, an unpaid order is generated. You can log on to the Alibaba Cloud **Expenses and Costs** console and go to the [Orders](https://usercenter2.aliyun.com/order/list)[Orders](https://usercenter2-intl.aliyun.com/order/list) page to complete the payment. * * @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 data disks attached to a subscription ECS instance between pay-as-you-go and subscription. * * @remarks * Before you convert the billing method of a data disk, read [Convert the billing method of a disk](https://help.aliyun.com/document_detail/145018.html). * Take note of the following items when you call this operation: * - You cannot change the billing method of data disks attached to pay-as-you-go instances. Pay-as-you-go instances support only pay-as-you-go disks. * - The instance to which the data disk is attached cannot be in the expired and stopped state. * - The price difference before and after the billing method conversion is refunded to your original payment method. Used coupons are not refundable. * - After the billing method of a disk is successfully changed, you cannot change it again within five minutes. * - Disks with the multi-attach attribute enabled support only the pay-as-you-go billing method and cannot be converted to subscription. * After the billing method is changed, automatic payment is enabled by default. Make sure that your account balance is sufficient. Otherwise, an abnormal order is generated, and you can only void the order. If your account balance is insufficient, you can set the AutoPay parameter to false. In this case, an unpaid order is generated. You can log on to the Alibaba Cloud **Expenses and Costs** console and go to the [Orders](https://usercenter2.aliyun.com/order/list)[Orders](https://usercenter2-intl.aliyun.com/order/list) page to complete the payment. * * @param request - ModifyDiskChargeTypeRequest * @returns ModifyDiskChargeTypeResponse */ async modifyDiskChargeType(request: $_model.ModifyDiskChargeTypeRequest): Promise<$_model.ModifyDiskChargeTypeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyDiskChargeTypeWithOptions(request, runtime); } /** * Modifies the KMS key ID used for block storage account-level default encryption in a specified region. * * @remarks * - Resource Access Management (RAM) users require the `AliyunECSFullAccess` permission. For information about how to perform authorization, see [Grant permissions to a RAM user](https://help.aliyun.com/document_detail/116146.html). * - The block storage account-level default encryption feature must be enabled in the specified region. * - Before using a master key for the first time, grant ECS the `AliyunECSDiskEncryptDefaultRole` role to allow ECS to access KMS resources. For details, see [Grant permissions to access KMS keys by using a RAM role](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({})); } /** * Modifies the KMS key ID used for block storage account-level default encryption in a specified region. * * @remarks * - Resource Access Management (RAM) users require the `AliyunECSFullAccess` permission. For information about how to perform authorization, see [Grant permissions to a RAM user](https://help.aliyun.com/document_detail/116146.html). * - The block storage account-level default encryption feature must be enabled in the specified region. * - Before using a master key for the first time, grant ECS the `AliyunECSDiskEncryptDefaultRole` role to allow ECS to access KMS resources. For details, see [Grant permissions to access KMS keys by using a RAM role](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); } /** * Migrates a disk into or out of a dedicated block storage cluster, or migrates a disk between dedicated block storage clusters. * * @remarks * > The dedicated block storage cluster feature is currently supported in the China (Hangzhou), China (Shanghai), China (Beijing), China (Zhangjiakou), China (Ulanqab), China (Shenzhen), China (Heyuan), Indonesia (Jakarta), Germany (Frankfurt), and China South 1 Finance regions. * Before you invoke this operation, make sure that you fully understand the billing methods and pricing of disks and dedicated block storage clusters, and that the dedicated block storage cluster has not expired and the account does not have an overdue payment. For more information, see [Dedicated block storage cluster billing](https://help.aliyun.com/document_detail/208883.html) and [Block storage billing](https://help.aliyun.com/document_detail/179022.html). * Take note of the following items when you invoke this operation: * - The disk and the dedicated block storage cluster must be in the same zone. * - Only pay-as-you-go disks are supported. Subscription disks must be converted to pay-as-you-go disks first. For more information, see [Change the billing method of a disk](https://help.aliyun.com/document_detail/145018.html). * - The disk type must be consistent with the disk type supported by the destination cluster. When migrating between different dedicated block storage clusters, you can change the disk type to match the disk type supported by the destination cluster. * - The disk must be in the **In Use** (In_use) or **Active** (Available) state. * - If the disk is attached to an ECS instance, the instance must be in the **Running** (Running) or **Stopped** (Stopped) state. The ECS instance cannot be expired. * - Because the ESSD performance level is limited by its capacity, if you cannot upgrade the performance level, expand the disk and try again. For more information, see [ResizeDisk](https://help.aliyun.com/document_detail/25522.html) and [Enterprise SSDs](https://help.aliyun.com/document_detail/122389.html). * - A maximum of five disk migration tasks can run concurrently in the same region for a single account. * - During the migration, you cannot cancel the migration, create snapshots, perform Upgrade/Downgrade, expand, attach, detach, or reinitialize the disk. * > After the disk is migrated, the billing method, disk type, and capabilities of the destination cluster take effect immediately. Alibaba Cloud charges you based on the new disk type and performance level. For more information, see [Dedicated block storage cluster billing](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({})); } /** * Migrates a disk into or out of a dedicated block storage cluster, or migrates a disk between dedicated block storage clusters. * * @remarks * > The dedicated block storage cluster feature is currently supported in the China (Hangzhou), China (Shanghai), China (Beijing), China (Zhangjiakou), China (Ulanqab), China (Shenzhen), China (Heyuan), Indonesia (Jakarta), Germany (Frankfurt), and China South 1 Finance regions. * Before you invoke this operation, make sure that you fully understand the billing methods and pricing of disks and dedicated block storage clusters, and that the dedicated block storage cluster has not expired and the account does not have an overdue payment. For more information, see [Dedicated block storage cluster billing](https://help.aliyun.com/document_detail/208883.html) and [Block storage billing](https://help.aliyun.com/document_detail/179022.html). * Take note of the following items when you invoke this operation: * - The disk and the dedicated block storage cluster must be in the same zone. * - Only pay-as-you-go disks are supported. Subscription disks must be converted to pay-as-you-go disks first. For more information, see [Change the billing method of a disk](https://help.aliyun.com/document_detail/145018.html). * - The disk type must be consistent with the disk type supported by the destination cluster. When migrating between different dedicated block storage clusters, you can change the disk type to match the disk type supported by the destination cluster. * - The disk must be in the **In Use** (In_use) or **Active** (Available) state. * - If the disk is attached to an ECS instance, the instance must be in the **Running** (Running) or **Stopped** (Stopped) state. The ECS instance cannot be expired. * - Because the ESSD performance level is limited by its capacity, if you cannot upgrade the performance level, expand the disk and try again. For more information, see [ResizeDisk](https://help.aliyun.com/document_detail/25522.html) and [Enterprise SSDs](https://help.aliyun.com/document_detail/122389.html). * - A maximum of five disk migration tasks can run concurrently in the same region for a single account. * - During the migration, you cannot cancel the migration, create snapshots, perform Upgrade/Downgrade, expand, attach, detach, or reinitialize the disk. * > After the disk is migrated, the billing method, disk type, and capabilities of the destination cluster take effect immediately. Alibaba Cloud charges you based on the new disk type and performance level. For more information, see [Dedicated block storage cluster billing](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 type of a disk or modifies the performance level (PL) of an enterprise SSD (ESSD). Regional Enterprise SSD (ESSD), basic disks, elastic ephemeral disks, and local disks do not support disk type changes. * * @remarks * Before you use this operation, make sure that you fully understand the billing and [pricing](https://www.aliyun.com/price/product#/disk/detail) of disks. * To minimize the impact of specification changes on your workloads, perform specification changes during off-peak hours. * Take note of the following items when you call this operation: * - To modify the performance level (PL) of an ESSD disk: * - Subscription ESSD disks support only performance level (PL) upgrades. * - Pay-as-you-go ESSD disks support both upgrades and downgrades of performance levels (PLs), but cannot be downgraded to PL0. * - The ESSD disk must be in the **In Use** (In_use) or **Unattached** (Available) state. * - If the ESSD disk is attached to an ECS instance, the instance must be in the **Running** (Running) or **Stopped** (Stopped) state and must not be expired or have an overdue payment. * - Because the ESSD performance level of an ESSD disk is limited by its capacity, if you cannot upgrade the performance level (PL), expand the disk by calling [ResizeDisk](https://help.aliyun.com/document_detail/25522.html) and try again. For more information, see [ESSD disks](https://help.aliyun.com/document_detail/122389.html). * - For precautions about changing the type of a disk, see [Change the disk type](~~161980#section_s4a_to0_1jx~~). * - For information about supported disk type changes, see [Supported disk type changes](~~161980#eb8bb54032nho~~). * * Disks with the multi-attach attribute enabled do not support disk type changes. * After a disk type change, billing changes are as follows: * - Pay-as-you-go disks: billed based on the new disk type. * - Subscription disks: within the billing cycle, the additional fee is calculated based on the price difference between the old and new configurations and the remaining days (from 00:00 of the next day to the end of the subscription period). * For billing information about disks, see [Block storage billing](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 type of a disk or modifies the performance level (PL) of an enterprise SSD (ESSD). Regional Enterprise SSD (ESSD), basic disks, elastic ephemeral disks, and local disks do not support disk type changes. * * @remarks * Before you use this operation, make sure that you fully understand the billing and [pricing](https://www.aliyun.com/price/product#/disk/detail) of disks. * To minimize the impact of specification changes on your workloads, perform specification changes during off-peak hours. * Take note of the following items when you call this operation: * - To modify the performance level (PL) of an ESSD disk: * - Subscription ESSD disks support only performance level (PL) upgrades. * - Pay-as-you-go ESSD disks support both upgrades and downgrades of performance levels (PLs), but cannot be downgraded to PL0. * - The ESSD disk must be in the **In Use** (In_use) or **Unattached** (Available) state. * - If the ESSD disk is attached to an ECS instance, the instance must be in the **Running** (Running) or **Stopped** (Stopped) state and must not be expired or have an overdue payment. * - Because the ESSD performance level of an ESSD disk is limited by its capacity, if you cannot upgrade the performance level (PL), expand the disk by calling [ResizeDisk](https://help.aliyun.com/document_detail/25522.html) and try again. For more information, see [ESSD disks](https://help.aliyun.com/document_detail/122389.html). * - For precautions about changing the type of a disk, see [Change the disk type](~~161980#section_s4a_to0_1jx~~). * - For information about supported disk type changes, see [Supported disk type changes](~~161980#eb8bb54032nho~~). * * Disks with the multi-attach attribute enabled do not support disk type changes. * After a disk type change, billing changes are as follows: * - Pay-as-you-go disks: billed based on the new disk type. * - Subscription disks: within the billing cycle, the additional fee is calculated based on the price difference between the old and new configurations and the remaining days (from 00:00 of the next day to the end of the subscription period). * For billing information about disks, see [Block storage billing](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 some information about an elasticity assurance, including its name, description, and capacity (only capacity reduction 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 some information about an elasticity assurance, including its name, description, and capacity (only capacity reduction 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 attributes of one or more elasticity assurance services. * * @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 attributes of one or more elasticity assurance services. * * @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 specified HAVIP instance. * * @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 specified HAVIP instance. * * @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); } /** * Modifies the attributes of a custom image, such as the image family, name, boot mode, status, and NVMe support, by calling the ModifyImageAttribute operation with parameters such as ImageId and ImageFamily. * * @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({})); } /** * Modifies the attributes of a custom image, such as the image family, name, boot mode, status, and NVMe support, by calling the ModifyImageAttribute operation with parameters such as ImageId and ImageFamily. * * @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); } /** * Manages image sharing permissions. You can share your custom images with other Alibaba Cloud accounts or publish them as community images for others to use. * * @remarks * Before you invoke this operation, read [Share a custom image](https://help.aliyun.com/document_detail/25463.html). * When you call this operation, take note of the following sharing rules: * - **Sharing limits**: You can share only custom images that you created under your account. Each image can be shared with up to 50 Alibaba Cloud accounts, and up to 10 Alibaba Cloud accounts at a time. * - **Impact on instances**: After an ECS instance is created from a shared image ([RunInstances](https://help.aliyun.com/document_detail/63440.html)), if the image owner cancels the image sharing relationship or deletes the custom image ([DeleteImage](https://help.aliyun.com/document_detail/25537.html)), the instance cannot perform initialization of its system disk ([ReInitDisk](https://help.aliyun.com/document_detail/25519.html)). * >Notice: Rule change for sharing encrypted images in Elastic Compute Service (ECS): Only images encrypted with a customer master key (CMK) can be shared. Images encrypted with a service key can no longer be shared and will return an error during sharing. If you have images encrypted with a service key and plan to share them, use CopyImage to copy the image and change the encryption key to a CMK. The server will reject sharing requests for service key-encrypted images. * To publish or delist a community image, take note of the following: * - **Responsibilities and agreements**: The owner of a community image is responsible for its quality and iterative updates. Alibaba Cloud provides only platform support. Before publishing, make sure that you have read and signed the community image agreement. Otherwise, publishing is not allowed. For more information, see [Publish a community image](https://help.aliyun.com/document_detail/208370.html). * - **Encryption limits**: Encrypted images cannot be published as community images. * - **Visibility**: Community images are fully public. All Alibaba Cloud accounts in the region where the image resides can use the image. * - **Feature limits**: Community images do not support sharing, export, or copying. * - **Impact of delisting**: After a community image is delisted, it is no longer publicly available to other Alibaba Cloud accounts. However, existing sharing relationships are retained. * * @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({})); } /** * Manages image sharing permissions. You can share your custom images with other Alibaba Cloud accounts or publish them as community images for others to use. * * @remarks * Before you invoke this operation, read [Share a custom image](https://help.aliyun.com/document_detail/25463.html). * When you call this operation, take note of the following sharing rules: * - **Sharing limits**: You can share only custom images that you created under your account. Each image can be shared with up to 50 Alibaba Cloud accounts, and up to 10 Alibaba Cloud accounts at a time. * - **Impact on instances**: After an ECS instance is created from a shared image ([RunInstances](https://help.aliyun.com/document_detail/63440.html)), if the image owner cancels the image sharing relationship or deletes the custom image ([DeleteImage](https://help.aliyun.com/document_detail/25537.html)), the instance cannot perform initialization of its system disk ([ReInitDisk](https://help.aliyun.com/document_detail/25519.html)). * >Notice: Rule change for sharing encrypted images in Elastic Compute Service (ECS): Only images encrypted with a customer master key (CMK) can be shared. Images encrypted with a service key can no longer be shared and will return an error during sharing. If you have images encrypted with a service key and plan to share them, use CopyImage to copy the image and change the encryption key to a CMK. The server will reject sharing requests for service key-encrypted images. * To publish or delist a community image, take note of the following: * - **Responsibilities and agreements**: The owner of a community image is responsible for its quality and iterative updates. Alibaba Cloud provides only platform support. Before publishing, make sure that you have read and signed the community image agreement. Otherwise, publishing is not allowed. For more information, see [Publish a community image](https://help.aliyun.com/document_detail/208370.html). * - **Encryption limits**: Encrypted images cannot be published as community images. * - **Visibility**: Community images are fully public. All Alibaba Cloud accounts in the region where the image resides can use the image. * - **Feature limits**: Community images do not support sharing, export, or copying. * - **Impact of delisting**: After a community image is delisted, it is no longer publicly available to other Alibaba Cloud accounts. However, existing sharing relationships are retained. * * @param request - ModifyImageSharePermissionRequest * @returns ModifyImageSharePermissionResponse */ async modifyImageSharePermission(request: $_model.ModifyImageSharePermissionRequest): Promise<$_model.ModifyImageSharePermissionResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyImageSharePermissionWithOptions(request, runtime); } /** * Modifies the private pool matching mode of an instance. * * @remarks * A private pool is generated after an elasticity assurance or capacity reservation is created. The private pool is associated with instance information that matches the private pool. When you create an instance, you can specify whether to use a private pool to launch the instance. The instance is then matched with an elasticity assurance or capacity reservation. * - After you call this operation to modify the private pool attributes of an instance, you do not need to restart the instance. * - When you call the following operations, the system re-matches the private pool of the instance. If the instance has already been matched with a specified private pool, the call may fail because the private pool capacity is exhausted or the private pool has expired. If the call fails, call the ModifyInstanceAttachmentAttributes operation to change the private pool matching mode to `Open`. * - [StartInstance - Restart an instance that has the economical mode enabled.](https://help.aliyun.com/document_detail/2679679.html) * - [ReActivateInstances - Restart an expired or overdue instance.](https://help.aliyun.com/document_detail/2679707.html) * - [ModifyInstanceChargeType - Change the billing method of an instance.](https://help.aliyun.com/document_detail/2679704.html) * - [ModifyPrepayInstanceSpec - Upgrade or downgrade the instance type of an instance.](https://help.aliyun.com/document_detail/2679706.html) * - [ReplaceSystemDisk - Replace the operating system.](https://help.aliyun.com/document_detail/2679771.html) * * @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({})); } /** * Modifies the private pool matching mode of an instance. * * @remarks * A private pool is generated after an elasticity assurance or capacity reservation is created. The private pool is associated with instance information that matches the private pool. When you create an instance, you can specify whether to use a private pool to launch the instance. The instance is then matched with an elasticity assurance or capacity reservation. * - After you call this operation to modify the private pool attributes of an instance, you do not need to restart the instance. * - When you call the following operations, the system re-matches the private pool of the instance. If the instance has already been matched with a specified private pool, the call may fail because the private pool capacity is exhausted or the private pool has expired. If the call fails, call the ModifyInstanceAttachmentAttributes operation to change the private pool matching mode to `Open`. * - [StartInstance - Restart an instance that has the economical mode enabled.](https://help.aliyun.com/document_detail/2679679.html) * - [ReActivateInstances - Restart an expired or overdue instance.](https://help.aliyun.com/document_detail/2679707.html) * - [ModifyInstanceChargeType - Change the billing method of an instance.](https://help.aliyun.com/document_detail/2679704.html) * - [ModifyPrepayInstanceSpec - Upgrade or downgrade the instance type of an instance.](https://help.aliyun.com/document_detail/2679706.html) * - [ReplaceSystemDisk - Replace the operating system.](https://help.aliyun.com/document_detail/2679771.html) * * @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 the attributes of an ECS instance, including the password, instance name, hostname, security groups, 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 the attributes of an ECS instance, including the password, instance name, hostname, security groups, 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); } /** * Modifies the automatic release time of a specified pay-as-you-go or spot instance, and supports canceling the automatic release feature. * * @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({})); } /** * Modifies the automatic release time of a specified pay-as-you-go or spot instance, and supports canceling the automatic release feature. * * @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 to help reduce the maintenance costs of expiring resources. * * @remarks * *Before you invoke this operation, make sure that 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 that your account balance or credit limit is sufficient. * - Only subscription instances are supported. Invoking this operation for pay-as-you-go instances returns an error. * - Auto-renewal deduction occurs on the ninth day before the instance expires. Deduction starts to execute at 08:00:00 (UTC+8). * - If the auto-renewal deduction failed on the previous day, the system retries the deduction at the scheduled time on the next day until the deduction succeeds or the instance is locked after 9 days. * * - If the purchase duration of a new instance is one week, the auto-renewal deduction is performed 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 to help reduce the maintenance costs of expiring resources. * * @remarks * *Before you invoke this operation, make sure that 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 that your account balance or credit limit is sufficient. * - Only subscription instances are supported. Invoking this operation for pay-as-you-go instances returns an error. * - Auto-renewal deduction occurs on the ninth day before the instance expires. Deduction starts to execute at 08:00:00 (UTC+8). * - If the auto-renewal deduction failed on the previous day, the system retries the deduction at the scheduled time on the next day until the deduction succeeds or the instance is locked after 9 days. * * - If the purchase duration of a new instance is one week, the auto-renewal deduction is performed 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); } /** * Modifies the billing method of ECS instances. Batch modification is supported. * * @remarks * ### Before you begin * - 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 the [pricing](https://www.aliyun.com/price/product#/ecs/detail)[pricing](https://www.alibabacloud.com/product/ecs#pricing) of Elastic Compute Service (ECS). * - Make sure that the target instances are in the **Running** (`Running`) or **Stopped** (`Stopped`) state and that your account has no overdue payments. * - After the billing method is changed, automatic payment is enabled by default. Make sure that your account balance is sufficient. Otherwise, abnormal orders are generated, and you can only cancel the orders. If your account balance is insufficient, set the AutoPay parameter to `false`. In this case, unpaid orders are generated. You can log on to the [ECS console](https://ecs.console.aliyun.com/) to complete the payment. * ### Before you begin * - **Subscription to pay-as-you-go**: * * - When you transform a subscription instance to a pay-as-you-go instance, the new billing method overwrites the entire lifecycle of the instance. You receive a refund for the price difference. The refund is returned to your original payment method. Consumed coupons are not refunded. * * - When you transform a subscription instance to a pay-as-you-go instance, the new billing method overwrites the entire lifecycle of the instance. You receive a refund for the price difference. The refund is returned to your original payment method. Consumed coupons are not refunded. * - **Refund rules**: The refund amount that you can claim each month is limited and does not carry over to the next month. After the refund quota is exhausted, you must wait until the next month to switch the billing method. The refund quota consumed by each billing method change is calculated by using the following formula: **vCPUs × (Refund days × 24 ± Floating hours)**. For more information, see [Switch the billing method from subscription to pay-as-you-go](https://help.aliyun.com/document_detail/85517.html). * - **Pay-as-you-go to subscription**: * - All pay-as-you-go data disks attached to the instance can be transformed to subscription data disks at the same time. * - If a release time is set for the pay-as-you-go instance, you cannot call this operation. For more information, see [Switch the billing method from pay-as-you-go to subscription](https://help.aliyun.com/document_detail/49884.html). * - If the instance is in economical mode, start the instance first. * * @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({})); } /** * Modifies the billing method of ECS instances. Batch modification is supported. * * @remarks * ### Before you begin * - 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 the [pricing](https://www.aliyun.com/price/product#/ecs/detail)[pricing](https://www.alibabacloud.com/product/ecs#pricing) of Elastic Compute Service (ECS). * - Make sure that the target instances are in the **Running** (`Running`) or **Stopped** (`Stopped`) state and that your account has no overdue payments. * - After the billing method is changed, automatic payment is enabled by default. Make sure that your account balance is sufficient. Otherwise, abnormal orders are generated, and you can only cancel the orders. If your account balance is insufficient, set the AutoPay parameter to `false`. In this case, unpaid orders are generated. You can log on to the [ECS console](https://ecs.console.aliyun.com/) to complete the payment. * ### Before you begin * - **Subscription to pay-as-you-go**: * * - When you transform a subscription instance to a pay-as-you-go instance, the new billing method overwrites the entire lifecycle of the instance. You receive a refund for the price difference. The refund is returned to your original payment method. Consumed coupons are not refunded. * * - When you transform a subscription instance to a pay-as-you-go instance, the new billing method overwrites the entire lifecycle of the instance. You receive a refund for the price difference. The refund is returned to your original payment method. Consumed coupons are not refunded. * - **Refund rules**: The refund amount that you can claim each month is limited and does not carry over to the next month. After the refund quota is exhausted, you must wait until the next month to switch the billing method. The refund quota consumed by each billing method change is calculated by using the following formula: **vCPUs × (Refund days × 24 ± Floating hours)**. For more information, see [Switch the billing method from subscription to pay-as-you-go](https://help.aliyun.com/document_detail/85517.html). * - **Pay-as-you-go to subscription**: * - All pay-as-you-go data disks attached to the instance can be transformed to subscription data disks at the same time. * - If a release time is set for the pay-as-you-go instance, you cannot call this operation. For more information, see [Switch the billing method from pay-as-you-go to subscription](https://help.aliyun.com/document_detail/49884.html). * - If the instance is in economical mode, start the instance first. * * @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 clock options of an instance as needed. * * @remarks * When you call this operation, take note of the following items: * - This is an asynchronous operation. After you call this operation, an asynchronous task ID is returned. You can query the asynchronous task result to determine whether the execution is complete. * - To modify PtpStatus, the instance type must support the settings for this parameter. For information about supported instance types, call the [DescribeInstanceTypes](https://help.aliyun.com/document_detail/25620.html) operation. * * @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 clock options of an instance as needed. * * @remarks * When you call this operation, take note of the following items: * - This is an asynchronous operation. After you call this operation, an asynchronous task ID is returned. You can query the asynchronous task result to determine whether the execution is complete. * - To modify PtpStatus, the instance type must support the settings for this parameter. For information about supported instance types, call the [DescribeInstanceTypes](https://help.aliyun.com/document_detail/25620.html) operation. * * @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 * Modifies the maintenance policy of an instance. The policy contains two maintenance properties: * - Maintenance time window: A time period that you specify. Maintenance is performed only within this period. * - Maintenance action: The action that you specify to handle instance downtime. * * @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 * Modifies the maintenance policy of an instance. The policy contains two maintenance properties: * - Maintenance time window: A time period that you specify. Maintenance is performed only within this period. * - Maintenance action: The action that you specify to handle instance downtime. * * @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 settings for an instance in a specified region, including whether to enable the metadata access channel and whether to enable the security hardening mode for metadata access. * * @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 settings for an instance in a specified region, including whether to enable the metadata access channel and whether to enable the security hardening mode for metadata access. * * @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 the network options of an instance. * * @remarks * Take note of the following items when you invoke this operation: * - This is an asynchronous operation. After you invoke this operation, an asynchronous task ID is returned. You can query the asynchronous task result to determine whether the operation has been executed. * - Each call supports modifying only one property. To modify multiple properties, invoke this operation multiple times. * - To modify BandwidthWeighting, the instance type must support settings for this parameter. You can call [DescribeInstanceTypes](https://help.aliyun.com/document_detail/2679699.html) to check whether the current instance type supports bandwidth weighting and to query the supported bandwidth weight values. * * @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 the network options of an instance. * * @remarks * Take note of the following items when you invoke this operation: * - This is an asynchronous operation. After you invoke this operation, an asynchronous task ID is returned. You can query the asynchronous task result to determine whether the operation has been executed. * - Each call supports modifying only one property. To modify multiple properties, invoke this operation multiple times. * - To modify BandwidthWeighting, the instance type must support settings for this parameter. You can call [DescribeInstanceTypes](https://help.aliyun.com/document_detail/2679699.html) to check whether the current instance type supports bandwidth weighting and to query the supported bandwidth weight values. * * @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 an Internet IP address, or transforms the network billing method. Both upgrades and downgrades are supported. * * @remarks * - When you modify the bandwidth configuration of a subscription (PrePaid) instance and the outbound public bandwidth (InternetMaxBandwidthOut) is upgraded from 0 Mbit/s to a non-zero value, a public IP address is automatically assigned. * - When you modify the bandwidth configuration of a pay-as-you-go (PostPaid) instance and the outbound public bandwidth (InternetMaxBandwidthOut) is upgraded from 0 Mbit/s to a non-zero value, a public IP address is not automatically assigned. You must set the `AllocatePublicIp` parameter to `true` to assign a public IP address. * > 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~~). * * - Fees: * * - After the bandwidth is upgraded, fees are automatically deducted by default. Make sure that your payment method has a sufficient balance. Otherwise, an abnormal order is generated, and you can only void the order. If your account balance is insufficient, you can set the AutoPay parameter to false. A normal unpaid order is generated, and you can log on to the ECS console to complete the payment. * - After the bandwidth is downgraded, the price difference is refunded to the original payment method. Vouchers that have been used are not refunded. * * @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 an Internet IP address, or transforms the network billing method. Both upgrades and downgrades are supported. * * @remarks * - When you modify the bandwidth configuration of a subscription (PrePaid) instance and the outbound public bandwidth (InternetMaxBandwidthOut) is upgraded from 0 Mbit/s to a non-zero value, a public IP address is automatically assigned. * - When you modify the bandwidth configuration of a pay-as-you-go (PostPaid) instance and the outbound public bandwidth (InternetMaxBandwidthOut) is upgraded from 0 Mbit/s to a non-zero value, a public IP address is not automatically assigned. You must set the `AllocatePublicIp` parameter to `true` to assign a public IP address. * > 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~~). * * - Fees: * * - After the bandwidth is upgraded, fees are automatically deducted by default. Make sure that your payment method has a sufficient balance. Otherwise, an abnormal order is generated, and you can only void the order. If your account balance is insufficient, you can set the AutoPay parameter to false. A normal unpaid order is generated, and you can log on to the ECS console to complete the payment. * - After the bandwidth is downgraded, the price difference is refunded to the original payment method. Vouchers that have been used are not refunded. * * @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. * **Precautions** * - The account must not have overdue payments. * > In a single region, the total peak public bandwidth billed on a pay-by-bandwidth basis 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. * **Precautions** * - The account must not have overdue payments. * > In a single region, the total peak public bandwidth billed on a pay-by-bandwidth basis 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); } /** * Modifies the VNC logon password of an ECS instance. * * @remarks * - The password must be six characters in length and can contain only uppercase letters, lowercase letters, and digits. All three character types are required. * - After you modify the password: * - For I/O optimized instances, the new password takes effect immediately without the need to restart the instance. * - For non-I/O optimized instances, you must [restart the instance](https://help.aliyun.com/document_detail/25440.html) in the console or call [RebootInstance](https://help.aliyun.com/document_detail/25502.html) 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({})); } /** * Modifies the VNC logon password of an ECS instance. * * @remarks * - The password must be six characters in length and can contain only uppercase letters, lowercase letters, and digits. All three character types are required. * - After you modify the password: * - For I/O optimized instances, the new password takes effect immediately without the need to restart the instance. * - For non-I/O optimized instances, you must [restart the instance](https://help.aliyun.com/document_detail/25440.html) in the console or call [RebootInstance](https://help.aliyun.com/document_detail/25502.html) 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); } /** * Modifies the VPC, private IP address, security group, or vSwitch of a VPC-type ECS instance in a virtual private cloud (VPC) network type. * * @remarks * When you call this operation, the ECS instance must be in the **Stopped** state. * - When you modify the private IP address or vSwitch of an instance, take note of the following items: * - A newly created ECS instance must be restarted before you can call this operation. * - After a successful modification, the ECS instance must be restarted before you can call this operation again. * - When you modify the VPC of an instance, take note of the following items: * - **Instance:** * - Instance status: The instance cannot be locked, pending release, expired, in expiration recycling, or in overdue payment recycling. For more information, see [Instance lifetime](https://help.aliyun.com/document_detail/25380.html). * - ECS instances that are associated with load balancing instances are not supported. * - The instance cannot be in use by other cloud services. For example, the instance cannot be in migration, cannot have already initiated a VPC change, or cannot have its database managed by Data Transmission Service (DTS). * * - **Network:** * - Instances configured with EIP in network interface controller (NIC) visible pattern or multi-EIP to NIC visible pattern are not supported. * - Instances attached to a high availability virtual IP address (HaVip) are not supported. * - Instances whose vSwitch is associated with a custom route table are not supported. * - Instances with Global Accelerator (GA) enabled are not supported. * - Instances attached to secondary Elastic Network Interfaces (ENIs) are not supported. * - Instances that have been allocated IPv6 addresses are not supported. * - Instances whose primary NIC has multiple IP addresses are not supported. * - The specified vSwitch must belong to the destination VPC. * - The zone of the vSwitch must remain the same before and after the modification. * - If you specify a private IP for the primary NIC, the IP address must be active and within the CIDR block of the vSwitch. If you do not specify one, an IP address is randomly allocated. Make sure that the destination vSwitch has a sufficient available IP address count. * - If you use a VPC shared by another account, make sure that the destination security group was created by your account in the shared VPC, not by the VPC owner\\"s account. * * @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({})); } /** * Modifies the VPC, private IP address, security group, or vSwitch of a VPC-type ECS instance in a virtual private cloud (VPC) network type. * * @remarks * When you call this operation, the ECS instance must be in the **Stopped** state. * - When you modify the private IP address or vSwitch of an instance, take note of the following items: * - A newly created ECS instance must be restarted before you can call this operation. * - After a successful modification, the ECS instance must be restarted before you can call this operation again. * - When you modify the VPC of an instance, take note of the following items: * - **Instance:** * - Instance status: The instance cannot be locked, pending release, expired, in expiration recycling, or in overdue payment recycling. For more information, see [Instance lifetime](https://help.aliyun.com/document_detail/25380.html). * - ECS instances that are associated with load balancing instances are not supported. * - The instance cannot be in use by other cloud services. For example, the instance cannot be in migration, cannot have already initiated a VPC change, or cannot have its database managed by Data Transmission Service (DTS). * * - **Network:** * - Instances configured with EIP in network interface controller (NIC) visible pattern or multi-EIP to NIC visible pattern are not supported. * - Instances attached to a high availability virtual IP address (HaVip) are not supported. * - Instances whose vSwitch is associated with a custom route table are not supported. * - Instances with Global Accelerator (GA) enabled are not supported. * - Instances attached to secondary Elastic Network Interfaces (ENIs) are not supported. * - Instances that have been allocated IPv6 addresses are not supported. * - Instances whose primary NIC has multiple IP addresses are not supported. * - The specified vSwitch must belong to the destination VPC. * - The zone of the vSwitch must remain the same before and after the modification. * - If you specify a private IP for the primary NIC, the IP address must be active and within the CIDR block of the vSwitch. If you do not specify one, an IP address is randomly allocated. Make sure that the destination vSwitch has a sufficient available IP address count. * - If you use a VPC shared by another account, make sure that the destination security group was created by your account in the shared VPC, not by the VPC owner\\"s account. * * @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 task, including the command content, scheduled execution mode, and adding ECS instances or managed instances to the task. * * @remarks * - You can modify tasks with the following execution modes (see the `RepeatMode` value returned by [DescribeInvocations](https://help.aliyun.com/document_detail/2679916.html)): * - Period: periodic execution. * - NextRebootOnly: automatically executes the command the next time the instance starts. * - EveryReboot: automatically executes the command every time the instance starts. * - You can modify tasks in the following states (see the `InvocationStatus` value returned by [DescribeInvocations](https://help.aliyun.com/document_detail/2679916.html)): * - Pending: The system is verifying or sending the command. If the command execution state on at least one instance is Pending, the overall execution state is Pending. * - Running: The command is running on the instance. If the command execution state on at least one instance is Running, the overall execution state is Running. * - Scheduled: The scheduled command has been sent and is waiting to run. If the command execution state on at least one instance is Scheduled, the overall execution state is Scheduled. * - Stopping: The task is being stopped. If the command execution state on at least one instance is Stopping, the overall execution state is Stopping. * - Before modifying the scheduled task execution information (including command content, custom parameters, and execution frequency), the Cloud Assistant Agent version on the ECS instances or managed instances that have already executed the task must be later than the following versions: * - Linux: 2.2.3.541 * - Windows: 2.1.3.541 * - If the call result returns the `InvalidOperation.CloudAssistantVersionUnsupported` error code, update the Cloud Assistant Agent to the latest version. * - When you execute a Cloud Assistant common command, you cannot modify the command content `CommandContent`. * - When you modify the command content `CommandContent`, and the task was created by calling [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 is created and retained permanently, which counts toward your Cloud Assistant command quota. 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, 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 task, including the command content, scheduled execution mode, and adding ECS instances or managed instances to the task. * * @remarks * - You can modify tasks with the following execution modes (see the `RepeatMode` value returned by [DescribeInvocations](https://help.aliyun.com/document_detail/2679916.html)): * - Period: periodic execution. * - NextRebootOnly: automatically executes the command the next time the instance starts. * - EveryReboot: automatically executes the command every time the instance starts. * - You can modify tasks in the following states (see the `InvocationStatus` value returned by [DescribeInvocations](https://help.aliyun.com/document_detail/2679916.html)): * - Pending: The system is verifying or sending the command. If the command execution state on at least one instance is Pending, the overall execution state is Pending. * - Running: The command is running on the instance. If the command execution state on at least one instance is Running, the overall execution state is Running. * - Scheduled: The scheduled command has been sent and is waiting to run. If the command execution state on at least one instance is Scheduled, the overall execution state is Scheduled. * - Stopping: The task is being stopped. If the command execution state on at least one instance is Stopping, the overall execution state is Stopping. * - Before modifying the scheduled task execution information (including command content, custom parameters, and execution frequency), the Cloud Assistant Agent version on the ECS instances or managed instances that have already executed the task must be later than the following versions: * - Linux: 2.2.3.541 * - Windows: 2.1.3.541 * - If the call result returns the `InvalidOperation.CloudAssistantVersionUnsupported` error code, update the Cloud Assistant Agent to the latest version. * - When you execute a Cloud Assistant common command, you cannot modify the command content `CommandContent`. * - When you modify the command content `CommandContent`, and the task was created by calling [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 is created and retained permanently, which counts toward your Cloud Assistant command quota. 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, 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 * ## Operation description * Currently, the ModifyManagedInstance operation only supports modifying the name of a 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 * ## Operation description * Currently, the ModifyManagedInstance operation only supports modifying the name of a 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); } /** * Modifies the attributes of an Elastic Network Interface (ENI), such as the queue number, associated security groups, queue depth, communication mode, and whether to retain the ENI when the associated instance is released. * * @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.enablePrimaryIPv6)) { query["EnablePrimaryIPv6"] = request.enablePrimaryIPv6; } 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({})); } /** * Modifies the attributes of an Elastic Network Interface (ENI), such as the queue number, associated security groups, queue depth, communication mode, and whether to retain the ENI when the associated instance is released. * * @param request - ModifyNetworkInterfaceAttributeRequest * @returns ModifyNetworkInterfaceAttributeResponse */ async modifyNetworkInterfaceAttribute(request: $_model.ModifyNetworkInterfaceAttributeRequest): Promise<$_model.ModifyNetworkInterfaceAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyNetworkInterfaceAttributeWithOptions(request, runtime); } /** * Modifies the attributes of a physical connection. * * @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({})); } /** * Modifies the attributes of a physical connection. * * @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 an underlying hardware risk is detected 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 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 an underlying hardware risk is detected 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 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 specified port range list. You can add, modify, and delete entries. * * @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 specified port range list. You can add, modify, and delete entries. * * @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, and other attributes of a specified prefix list, and supports adding, modifying, and deleting entries. * * @remarks * ## Operation description * - The specified Classless Inter-Domain Routing (CIDR) block must be in standard form. For example, 10.0.0.0/8 is a valid CIDR block, whereas 10.0.0.1/8 is a fault form. For more information, see [What is CIDR?](~~40637#section-jua-0tj-q5m~~). * - When you add or delete entries, do not specify duplicate CIDR blocks. Examples: * - For IPv4 CIDR blocks: You cannot specify two entries that both have the CIDR block 10.0.0.0/8. You cannot specify two entries whose CIDR blocks are 10.0.0.1/32 and 10.0.0.1 respectively because these two CIDR blocks are duplicates. * - For IPv6 CIDR blocks: You cannot specify two entries whose CIDR blocks are 2001:fd01:0:0:0:0:0:0/32 and 2001:fd01::/32 respectively because these two CIDR blocks are duplicates. * - The CIDR blocks of entries to be added cannot be the same as those of entries to be deleted. For example, when you add an entry whose CIDR block is 10.0.0.0/8, the entries to be deleted cannot contain the CIDR block 10.0.0.0/8. * - To modify the description of an entry, specify the CIDR block of the entry (`AddEntry.N.Cidr`) and the new description (`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, and other attributes of a specified prefix list, and supports adding, modifying, and deleting entries. * * @remarks * ## Operation description * - The specified Classless Inter-Domain Routing (CIDR) block must be in standard form. For example, 10.0.0.0/8 is a valid CIDR block, whereas 10.0.0.1/8 is a fault form. For more information, see [What is CIDR?](~~40637#section-jua-0tj-q5m~~). * - When you add or delete entries, do not specify duplicate CIDR blocks. Examples: * - For IPv4 CIDR blocks: You cannot specify two entries that both have the CIDR block 10.0.0.0/8. You cannot specify two entries whose CIDR blocks are 10.0.0.1/32 and 10.0.0.1 respectively because these two CIDR blocks are duplicates. * - For IPv6 CIDR blocks: You cannot specify two entries whose CIDR blocks are 2001:fd01:0:0:0:0:0:0/32 and 2001:fd01::/32 respectively because these two CIDR blocks are duplicates. * - The CIDR blocks of entries to be added cannot be the same as those of entries to be deleted. For example, when you add an entry whose CIDR block is 10.0.0.0/8, the entries to be deleted cannot contain the CIDR block 10.0.0.0/8. * - To modify the description of an entry, specify the CIDR block of the entry (`AddEntry.N.Cidr`) and the new description (`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 modified instance type takes effect for the entire lifecycle of the instance. * * @remarks * * **Before you use this operation, make sure that you fully understand the billing methods, [pricing](https://www.aliyun.com/price/product#/ecs/detail), and [refund rules for specification downgrades](https://help.aliyun.com/document_detail/116043.html) of ECS.** * * **Before you use this operation, make sure that you fully understand the billing methods, [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl), and [refund rules for specification downgrades](https://help.aliyun.com/document_detail/476339.html) of ECS.** * This is an asynchronous operation. The configuration change is complete 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** * - Upgrade the instance type: * * @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 modified instance type takes effect for the entire lifecycle of the instance. * * @remarks * * **Before you use this operation, make sure that you fully understand the billing methods, [pricing](https://www.aliyun.com/price/product#/ecs/detail), and [refund rules for specification downgrades](https://help.aliyun.com/document_detail/116043.html) of ECS.** * * **Before you use this operation, make sure that you fully understand the billing methods, [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl), and [refund rules for specification downgrades](https://help.aliyun.com/document_detail/476339.html) of ECS.** * This is an asynchronous operation. The configuration change is complete 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** * - Upgrade the instance type: * * @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, including its name and description. * * @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, including its name and description. * * @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 one or more reserved instances, allowing you to cancel or disable auto-renewal. * * @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 one or more reserved instances, allowing you to cancel or disable auto-renewal. * * @param request - ModifyReservedInstanceAutoRenewAttributeRequest * @returns ModifyReservedInstanceAutoRenewAttributeResponse */ async modifyReservedInstanceAutoRenewAttribute(request: $_model.ModifyReservedInstanceAutoRenewAttributeRequest): Promise<$_model.ModifyReservedInstanceAutoRenewAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifyReservedInstanceAutoRenewAttributeWithOptions(request, runtime); } /** * Splits, merges, or changes the scope of reserved instances by modifying configurations such as instance type, quantity, and zone. * * @remarks * This is an asynchronous operation. After a successful call, the IDs of the new reserved instances are returned. The original reserved instances enter the `Updating` state and eventually become `Expired`. At the same time, new reserved instances in the Creating state are generated and eventually become Active. You can call [DescribeReservedInstances](https://help.aliyun.com/document_detail/2679781.html) to query the status. * - Reserved instances can be modified only when they are in the **Active** state. * - Ensure that the [normalization factor](~~140660#2742f3844abzz~~) remains unchanged before and after the modification. Otherwise, the request fails. * - Splitting, merging, and scope changes of reserved instances cannot be performed simultaneously. * For more information, see [Split, merge, or modify reserved instances](https://help.aliyun.com/document_detail/100375.html). * ## Request examples * - **Split**: Split a reserved instance in the China (Hangzhou) region with instance type ecs.g5.xlarge and a quantity of 2 into two reserved instances with instance type ecs.g5.large and a quantity of 1 each. * ``` * "RegionId":"ap-southeast-1", // Set the region * "ReservedInstanceId":["ecsri-bp1hd03e9uv19e75****"], // ID of the reserved instance to split * "Configuration":[ * { * "ReservedInstanceName":"testReservedInstanceName1", // Name of the new reserved instance * "InstanceType":"ecs.g5.large", // Set the new instance type * "Scope":"Region", // The scope of the reserved instance cannot be changed * "InstanceAmount":1 // The reserved instance can match 1 pay-as-you-go instance of the same type * }, * { * "ReservedInstanceName":"testReservedInstanceName2", * "InstanceType":"ecs.g5.large", * "Scope":"Region", * "InstanceAmount":1 * } * ] * ``` * - **Merge**: Merge two reserved instances in Zone H of the China (Hangzhou) region with instance type ecs.g5.xlarge and a quantity of 4 into one reserved instance with instance type ecs.g5.4xlarge and a quantity of 2. * ``` * "RegionId":"ap-southeast-1", // Set the region * "ReservedInstanceId":["ecsri-bp1hd03e9uv16b75****",""ecsri-bp1hd03e9uv16b76****""], // IDs of the reserved instances to merge * "Configuration":[ * { * "ReservedInstanceName":"testReservedInstanceName", // Name of the new reserved instance * "InstanceType":"ecs.g5.4xlarge", // Set the new instance type * "Scope":"Zone", // The scope of the reserved instance cannot be changed * "ZoneId":"ap-southeast-1a", // * "InstanceAmount":2 // The reserved instance can match 2 pay-as-you-go instances of the same type * } * ] * ``` * - **Change scope**: Change a reserved instance in Zone H of the China (Hangzhou) region with instance type ecs.g5.xlarge and a quantity of 6 to a region-level reserved instance in the China (Hangzhou) region with instance type ecs.g5.2xlarge and a quantity of 3. * ``` * "RegionId":"ap-southeast-1", // Set the region * "ReservedInstanceId":["ecsri-bp1hd03e9uv16b77****"], // ID of the reserved instance whose scope you want to change * "Configuration":[ * { * "ReservedInstanceName":"testReservedInstanceName", // Name of the reserved instance after the scope change * "InstanceType":"ecs.g5.2xlarge", // Set the new instance type * "Scope":"Region", // The scope of the reserved instance after the change * "InstanceAmount":3 // The reserved instance can match 3 pay-as-you-go instances of the same type * } * ] * ``` * * @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({})); } /** * Splits, merges, or changes the scope of reserved instances by modifying configurations such as instance type, quantity, and zone. * * @remarks * This is an asynchronous operation. After a successful call, the IDs of the new reserved instances are returned. The original reserved instances enter the `Updating` state and eventually become `Expired`. At the same time, new reserved instances in the Creating state are generated and eventually become Active. You can call [DescribeReservedInstances](https://help.aliyun.com/document_detail/2679781.html) to query the status. * - Reserved instances can be modified only when they are in the **Active** state. * - Ensure that the [normalization factor](~~140660#2742f3844abzz~~) remains unchanged before and after the modification. Otherwise, the request fails. * - Splitting, merging, and scope changes of reserved instances cannot be performed simultaneously. * For more information, see [Split, merge, or modify reserved instances](https://help.aliyun.com/document_detail/100375.html). * ## Request examples * - **Split**: Split a reserved instance in the China (Hangzhou) region with instance type ecs.g5.xlarge and a quantity of 2 into two reserved instances with instance type ecs.g5.large and a quantity of 1 each. * ``` * "RegionId":"ap-southeast-1", // Set the region * "ReservedInstanceId":["ecsri-bp1hd03e9uv19e75****"], // ID of the reserved instance to split * "Configuration":[ * { * "ReservedInstanceName":"testReservedInstanceName1", // Name of the new reserved instance * "InstanceType":"ecs.g5.large", // Set the new instance type * "Scope":"Region", // The scope of the reserved instance cannot be changed * "InstanceAmount":1 // The reserved instance can match 1 pay-as-you-go instance of the same type * }, * { * "ReservedInstanceName":"testReservedInstanceName2", * "InstanceType":"ecs.g5.large", * "Scope":"Region", * "InstanceAmount":1 * } * ] * ``` * - **Merge**: Merge two reserved instances in Zone H of the China (Hangzhou) region with instance type ecs.g5.xlarge and a quantity of 4 into one reserved instance with instance type ecs.g5.4xlarge and a quantity of 2. * ``` * "RegionId":"ap-southeast-1", // Set the region * "ReservedInstanceId":["ecsri-bp1hd03e9uv16b75****",""ecsri-bp1hd03e9uv16b76****""], // IDs of the reserved instances to merge * "Configuration":[ * { * "ReservedInstanceName":"testReservedInstanceName", // Name of the new reserved instance * "InstanceType":"ecs.g5.4xlarge", // Set the new instance type * "Scope":"Zone", // The scope of the reserved instance cannot be changed * "ZoneId":"ap-southeast-1a", // * "InstanceAmount":2 // The reserved instance can match 2 pay-as-you-go instances of the same type * } * ] * ``` * - **Change scope**: Change a reserved instance in Zone H of the China (Hangzhou) region with instance type ecs.g5.xlarge and a quantity of 6 to a region-level reserved instance in the China (Hangzhou) region with instance type ecs.g5.2xlarge and a quantity of 3. * ``` * "RegionId":"ap-southeast-1", // Set the region * "ReservedInstanceId":["ecsri-bp1hd03e9uv16b77****"], // ID of the reserved instance whose scope you want to change * "Configuration":[ * { * "ReservedInstanceName":"testReservedInstanceName", // Name of the reserved instance after the scope change * "InstanceType":"ecs.g5.2xlarge", // Set the new instance type * "Scope":"Region", // The scope of the reserved instance after the change * "InstanceAmount":3 // The reserved instance can match 3 pay-as-you-go instances of the same type * } * ] * ``` * * @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 modifying 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. * - If the intra-group connectivity policy of a security group is **intra-group connectivity**, other custom access rules are ignored, and all instances in custom security group are connected over the internal network by default. * - If the intra-group connectivity policy of a security group is **internal isolation**, all instances in custom security group are disconnected over the internal network by default when 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 allow two ECS instances in custom security group to communicate with each other over the internal network. * * @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 modifying 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. * - If the intra-group connectivity policy of a security group is **intra-group connectivity**, other custom access rules are ignored, and all instances in custom security group are connected over the internal network by default. * - If the intra-group connectivity policy of a security group is **internal isolation**, all instances in custom security group are disconnected over the internal network by default when 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 allow two ECS instances in custom security group to communicate with each other over the internal network. * * @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, note 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 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, note 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 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 type of a snapshot. You can call this operation to convert a standard snapshot to an archived snapshot. * * @remarks * * **Before you call this operation, make sure that you fully understand the billing method and [pricing](https://www.aliyun.com/price/product?#/disk/detail/disk) of archived snapshots.** * - Archived snapshots cannot be reverted to standard snapshots. * - A standard snapshot can be archived only after it has been retained for at least 14 days since its creation. * - 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 type of a snapshot. You can call this operation to convert a standard snapshot to an archived snapshot. * * @remarks * * **Before you call this operation, make sure that you fully understand the billing method and [pricing](https://www.aliyun.com/price/product?#/disk/detail/disk) of archived snapshots.** * - Archived snapshots cannot be reverted to standard snapshots. * - A standard snapshot can be archived only after it has been retained for at least 14 days since its creation. * - 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); } /** * Modifies the properties of a scheduled O&M event. Currently, you can modify the planned execute time of a scheduled O&M event. * * @remarks * ## Operation description * - You can modify only scheduled O&M events that are in the Scheduled state. * - The value of NotBefore cannot be earlier than the current time. * - The value of NotBefore cannot be later than the initial planned execution time that was set when the event was created. * * @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({})); } /** * Modifies the properties of a scheduled O&M event. Currently, you can modify the planned execute time of a scheduled O&M event. * * @remarks * ## Operation description * - You can modify only scheduled O&M events that are in the Scheduled state. * - The value of NotBefore cannot be earlier than the current time. * - The value of NotBefore cannot be later than the initial planned execution time that was set when the event was created. * * @param request - ModifySystemEventAttributeRequest * @returns ModifySystemEventAttributeResponse */ async modifySystemEventAttribute(request: $_model.ModifySystemEventAttributeRequest): Promise<$_model.ModifySystemEventAttributeResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.modifySystemEventAttributeWithOptions(request, runtime); } /** * Sets user-level default properties. * * @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({})); } /** * Sets user-level default properties. * * @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); } /** * Activates 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({})); } /** * Activates 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 elastic capacity reservation service that is ready but not yet activated. * * @remarks * Make sure that you fully understand the billing methods and [pricing](https://www.aliyun.com/price/product#/ecs/detail)[pricing](https://www.alibabacloud.com/zh?spm=5176.28117011.nav-v2-dropdown-language.exp-location-zh.9ae4165bF98IHz&_p_lc=1) of elastic capacity reservations before you call this operation. * Before you purchase an elastic capacity reservation service, you can call [DescribeElasticityAssurances](https://help.aliyun.com/document_detail/2679748.html) to query available elastic capacity reservation services. * * @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 elastic capacity reservation service that is ready but not yet activated. * * @remarks * Make sure that you fully understand the billing methods and [pricing](https://www.aliyun.com/price/product#/ecs/detail)[pricing](https://www.alibabacloud.com/zh?spm=5176.28117011.nav-v2-dropdown-language.exp-location-zh.9ae4165bF98IHz&_p_lc=1) of elastic capacity reservations before you call this operation. * Before you purchase an elastic capacity reservation service, you can call [DescribeElasticityAssurances](https://help.aliyun.com/document_detail/2679748.html) to query available elastic capacity reservation services. * * @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 reserved instance to offset bills of pay-as-you-go instances that match the specified instance type at the regional or zonal level. * * @remarks * * **Before you call this operation, make sure that you fully understand the billing method and [pricing](https://www.aliyun.com/price/product#/ecs/detail) of reserved instances.** * * **Before you call this operation, make sure that you fully understand the billing method and [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl) of reserved instances.** * - Before you call this operation, make sure that you fully understand the billing rules of reserved instances. For more information, see [Reserved instances](https://help.aliyun.com/document_detail/100371.html). * - You can hold up to 20 regional reserved instances across all regions. * - You can hold up to 20 zonal reserved instances in each zone. * ## Request examples * - Purchase a one-year regional reserved instance in the China (Hangzhou) region to offset bills of three pay-as-you-go instances of the ecs.g5.large instance type that run Linux. * ``` * "RegionId":"cn-hangzhou", // Set the region to China (Hangzhou). * "InstanceType":"ecs.g5.large", // Set the instance type. * "Scope":"Region", // Set the scope of the reserved instance to regional. * "InstanceAmount":3, // The reserved instance can match three pay-as-you-go instances of the same instance type. * "OfferingType":"All Upfront", // Default value. The payment type is all upfront. * "Platform":"Linux", // The operating system type of the image used by the instance is Linux or Unix-like. * "Period":1, // The term of the reserved instance is one year. * "PeriodUnit":"Year", // Set the unit of the term to year. * ``` * - Purchase a two-year zonal reserved instance in Zone H of the China (Hangzhou) region to offset bills of five pay-as-you-go instances of the ecs.g5.large instance type that run Windows. * ``` * "RegionId":"cn-hangzhou", * "ZoneId":"cn-hangzhou-h", // Set the zone to Zone H. * "InstanceType":"ecs.g5.large", * "Scope":"Zone", // Set the scope of the reserved instance to zonal. * "InstanceAmount":5, // The reserved instance can match five pay-as-you-go instances of the same instance type. * "OfferingType":"All Upfront", * "Platform":"Windows", // The operating system type of the image used by the instance is Windows. * "Period":2, // The term of the reserved instance is two years. * "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 reserved instance to offset bills of pay-as-you-go instances that match the specified instance type at the regional or zonal level. * * @remarks * * **Before you call this operation, make sure that you fully understand the billing method and [pricing](https://www.aliyun.com/price/product#/ecs/detail) of reserved instances.** * * **Before you call this operation, make sure that you fully understand the billing method and [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl) of reserved instances.** * - Before you call this operation, make sure that you fully understand the billing rules of reserved instances. For more information, see [Reserved instances](https://help.aliyun.com/document_detail/100371.html). * - You can hold up to 20 regional reserved instances across all regions. * - You can hold up to 20 zonal reserved instances in each zone. * ## Request examples * - Purchase a one-year regional reserved instance in the China (Hangzhou) region to offset bills of three pay-as-you-go instances of the ecs.g5.large instance type that run Linux. * ``` * "RegionId":"cn-hangzhou", // Set the region to China (Hangzhou). * "InstanceType":"ecs.g5.large", // Set the instance type. * "Scope":"Region", // Set the scope of the reserved instance to regional. * "InstanceAmount":3, // The reserved instance can match three pay-as-you-go instances of the same instance type. * "OfferingType":"All Upfront", // Default value. The payment type is all upfront. * "Platform":"Linux", // The operating system type of the image used by the instance is Linux or Unix-like. * "Period":1, // The term of the reserved instance is one year. * "PeriodUnit":"Year", // Set the unit of the term to year. * ``` * - Purchase a two-year zonal reserved instance in Zone H of the China (Hangzhou) region to offset bills of five pay-as-you-go instances of the ecs.g5.large instance type that run Windows. * ``` * "RegionId":"cn-hangzhou", * "ZoneId":"cn-hangzhou-h", // Set the zone to Zone H. * "InstanceType":"ecs.g5.large", * "Scope":"Zone", // Set the scope of the reserved instance to zonal. * "InstanceAmount":5, // The reserved instance can match five pay-as-you-go instances of the same instance type. * "OfferingType":"All Upfront", * "Platform":"Windows", // The operating system type of the image used by the instance is Windows. * "Period":2, // The term of the reserved instance is two years. * "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 fully understand the [billing](https://help.aliyun.com/document_detail/137897.html) and [pricing](https://www.aliyun.com/price/product#/ecs/detail) of storage capacity units (SCUs).** * * **Before you call this operation, make sure that you fully understand the [billing](https://help.aliyun.com/document_detail/137897.html) and [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl) of storage capacity units (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 fully understand the [billing](https://help.aliyun.com/document_detail/137897.html) and [pricing](https://www.aliyun.com/price/product#/ecs/detail) of storage capacity units (SCUs).** * * **Before you call this operation, make sure that you fully understand the [billing](https://help.aliyun.com/document_detail/137897.html) and [pricing](https://www.alibabacloud.com/zh/pricing-calculator#/commodity/vm_intl) of storage capacity units (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 overdue bills 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 restart may occasionally fail. Check whether the automatic restart is successful. If the automatic restart fails, call this operation to manually restart the instance. * - After you settle overdue bills, the total value of your Alibaba Cloud account balance (cash balance) and vouchers must be no less than CNY 100.00. Otherwise, the instance cannot be restarted. * - The instance must be in the **expired** (`Stopped`) or **overdue and being recycled** (`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 overdue bills 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 restart may occasionally fail. Check whether the automatic restart is successful. If the automatic restart fails, call this operation to manually restart the instance. * - After you settle overdue bills, the total value of your Alibaba Cloud account balance (cash balance) and vouchers must be no less than CNY 100.00. Otherwise, the instance cannot be restarted. * - The instance must be in the **expired** (`Stopped`) or **overdue and being recycled** (`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); } /** * Re-initializes 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 re-initialize a disk that is attached to an instance before the instance starts for the first time. * - A disk that has local snapshots cannot be re-initialized. * - A disk with the multi-attach feature enabled cannot be re-initialized. * - For a system disk, the disk is re-initialized to the initial state of the image. If the source image used to create the disk has been deleted, the disk cannot be re-initialized. * - For a data disk that was created as an empty disk, the disk is re-initialized to an empty state. For a data disk that was created from a snapshot, the disk is re-initialized to the snapshot state. If the source snapshot has been deleted, the disk cannot be re-initialized 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({})); } /** * Re-initializes 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 re-initialize a disk that is attached to an instance before the instance starts for the first time. * - A disk that has local snapshots cannot be re-initialized. * - A disk with the multi-attach feature enabled cannot be re-initialized. * - For a system disk, the disk is re-initialized to the initial state of the image. If the source image used to create the disk has been deleted, the disk cannot be re-initialized. * - For a data disk that was created as an empty disk, the disk is re-initialized to an empty state. For a data disk that was created from a snapshot, the disk is re-initialized to the snapshot state. If the source snapshot has been deleted, the disk cannot be re-initialized 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 ECS instance. * * @remarks * This is an asynchronous operation. After the instance is restarted, it enters the Starting state. You can call [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query the instance status. When the returned status is `Running`, the instance is restarted. * ### Before you begin * - You cannot restart an instance that is locked for security reasons. For more information, see [Impacts of security lock on API operations](https://help.aliyun.com/document_detail/25695.html). * - You can restart only ECS instances that are in the **Running** (`Running`) state. * * @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 ECS instance. * * @remarks * This is an asynchronous operation. After the instance is restarted, it enters the Starting state. You can call [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query the instance status. When the returned status is `Running`, the instance is restarted. * ### Before you begin * - You cannot restart an instance that is locked for security reasons. For more information, see [Impacts of security lock on API operations](https://help.aliyun.com/document_detail/25695.html). * - You can restart only ECS instances that are in the **Running** (`Running`) state. * * @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 one or more ECS instances. You can specify whether to force restart instances and set different batch operation modes. * * @remarks * This is an asynchronous operation. Instance restarts are not completed immediately. After a successful call, the instance enters the Starting state. You can call [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query the instance status. When the returned status is `Running`, the restart is successful. * ### Before you begin * - Instances that are locked for security reasons cannot be restarted by calling this operation. For more information, see [Impact of resource security locks on API calls](https://help.aliyun.com/document_detail/25695.html). * - The ECS instance must be in the **Running** state. * * @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 one or more ECS instances. You can specify whether to force restart instances and set different batch operation modes. * * @remarks * This is an asynchronous operation. Instance restarts are not completed immediately. After a successful call, the instance enters the Starting state. You can call [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query the instance status. When the returned status is `Running`, the restart is successful. * ### Before you begin * - Instances that are locked for security reasons cannot be restarted by calling this operation. For more information, see [Impact of resource security locks on API calls](https://help.aliyun.com/document_detail/25695.html). * - The ECS instance must be in the **Running** state. * * @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); } /** * Performs fault migration for a dedicated host. * * @remarks * When a dedicated host is in the alert state (`UnderAssessment`), which indicates a latent fault, call this operation to perform fault migration for the dedicated host to prevent permanent failures. You can call [DescribeDedicatedHosts](https://help.aliyun.com/document_detail/134242.html) 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({})); } /** * Performs fault migration for a dedicated host. * * @remarks * When a dedicated host is in the alert state (`UnderAssessment`), which indicates a latent fault, call this operation to perform fault migration for the dedicated host to prevent permanent failures. You can call [DescribeDedicatedHosts](https://help.aliyun.com/document_detail/134242.html) 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 deployment succeeds, the instance enters the Running state. If the deployment failed, the instance is returned to the original physical server and recovers to the state before the deployment. * 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 state enters the Stopping state. * - An instance in the Stopped state enters the Starting state. * - Instances on dedicated hosts cannot be redeployed. * - If `"LockReason": "security"` is marked in the OperationLocks of a security-controlled instance, 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 when the damaged local disk has been isolated but the **SystemMaintenance.RebootAndReInitErrorDisk** event has not been sent. For more information, see [Overview of local disk instance system events](https://help.aliyun.com/document_detail/107693.html). * The following table describes the system event types and event states that RedeployInstance can response 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 | * | Only for ECS instances with local disks: 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 deployment succeeds, the instance enters the Running state. If the deployment failed, the instance is returned to the original physical server and recovers to the state before the deployment. * 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 state enters the Stopping state. * - An instance in the Stopped state enters the Starting state. * - Instances on dedicated hosts cannot be redeployed. * - If `"LockReason": "security"` is marked in the OperationLocks of a security-controlled instance, 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 when the damaged local disk has been isolated but the **SystemMaintenance.RebootAndReInitErrorDisk** event has not been sent. For more information, see [Overview of local disk instance system events](https://help.aliyun.com/document_detail/107693.html). * The following table describes the system event types and event states that RedeployInstance can response 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 | * | Only for ECS instances with local disks: 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 * For an immediately effective capacity reservation whose release mode is set to manual release, you can call this operation to directly 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 * For an immediately effective capacity reservation whose release mode is set to manual release, you can call this operation to directly 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 * Before releasing a pay-as-you-go dedicated host, make sure that no ECS instances exist on the 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 * Before releasing a pay-as-you-go dedicated host, make sure that no ECS instances exist on the 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); } /** * Releases a specified Elastic IP Address (EIP). * * @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({})); } /** * Releases a specified Elastic IP Address (EIP). * * @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); } /** * Unbinds one or more tags from resources such as instances, cloud disks, snapshots, images, or 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({})); } /** * Unbinds one or more tags from resources such as instances, cloud disks, snapshots, images, or 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 * ## Operation description * When you renew a dedicated host, deductible vouchers are used first. Your account must support balance payment or credit payment. * When you renew a dedicated host, deductible vouchers are used first. Your account must support balance payment or credit payment. * * @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 * ## Operation description * When you renew a dedicated host, deductible vouchers are used first. Your account must support balance payment or credit payment. * When you renew a dedicated host, deductible vouchers are used first. Your account must support balance payment or credit payment. * * @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 the renewal period or renew the instance to a unified expiration date. * * @remarks * *Before you use this operation, make sure that you fully understand the billing and [pricing](https://www.aliyun.com/price/product#/ecs/detail)[pricing](https://www.alibabacloud.com/product/ecs#pricing) of Elastic Compute Service.** * - Make sure that your account balance or credit limit is sufficient. * - Only subscription instances are supported. Invoking this operation for pay-as-you-go instances returns an error. * - You must specify either the renewal period parameters (`Period` and `PeriodUnit`) or the unified expiration date parameter (`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 the renewal period or renew the instance to a unified expiration date. * * @remarks * *Before you use this operation, make sure that you fully understand the billing and [pricing](https://www.aliyun.com/price/product#/ecs/detail)[pricing](https://www.alibabacloud.com/product/ecs#pricing) of Elastic Compute Service.** * - Make sure that your account balance or credit limit is sufficient. * - Only subscription instances are supported. Invoking this operation for pay-as-you-go instances returns an error. * - You must specify either the renewal period parameters (`Period` and `PeriodUnit`) or the unified expiration date parameter (`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. You can specify the purchase duration and auto-renewal attribute during renewal. * * @remarks * * **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 reserved instances.** * * **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 reserved instances.** * - Reserved instances support both manual renewal and auto-renewal. For more information, see [Renewal policy for reserved instances](~~100371#53bfc50b78sta~~). * - You can invoke [DescribeReservedInstances](https://help.aliyun.com/document_detail/100065.html) to query purchased reserved instances. * - This operation supports enabling auto-renewal but does not support disabling auto-renewal. You can invoke [ModifyReservedInstanceAutoRenewAttribute](https://help.aliyun.com/document_detail/2679786.html) to disable auto-renewal. * * @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. You can specify the purchase duration and auto-renewal attribute during renewal. * * @remarks * * **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 reserved instances.** * * **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 reserved instances.** * - Reserved instances support both manual renewal and auto-renewal. For more information, see [Renewal policy for reserved instances](~~100371#53bfc50b78sta~~). * - You can invoke [DescribeReservedInstances](https://help.aliyun.com/document_detail/100065.html) to query purchased reserved instances. * - This operation supports enabling auto-renewal but does not support disabling auto-renewal. You can invoke [ModifyReservedInstanceAutoRenewAttribute](https://help.aliyun.com/document_detail/2679786.html) to disable auto-renewal. * * @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 of an ECS instance by replacing the system disk. After the replacement, the disk ID of the system disk changes and the original disk is released. * * @remarks * Before you call this operation, read [Replace a system disk (change the operating system)](https://help.aliyun.com/document_detail/50134.html). * When you replace the system disk, take note of the following items: * - You cannot change the billing method of the system disk. * - You cannot change the disk type of the system disk. * - The ECS instance to which the system disk is attached must not have unpaid orders. * * - The instance must be in the Stopped state. * > This applies only to instances in virtual private clouds (VPCs). If the ECS instance uses the pay-as-you-go billing method and the economical mode is enabled by default, to prevent the instance from failing to restart after the system disk is replaced due to insufficient instance inventory in the region, stop the instance in standard stop mode. For more information, see [StopInstance](https://help.aliyun.com/document_detail/25501.html). * - You can use the `SystemDisk.Size` parameter to specify a new capacity for the system disk. The new capacity cannot be smaller than the original capacity. * - If the ECS instance is locked for security purposes, which means the `OperationLocks` parameter of the instance contains `"LockReason": "security"`, the system disk cannot be replaced. For more information, see [API behavior when an instance is locked for security reasons](https://help.aliyun.com/document_detail/25695.html). * After the system disk is replaced, you can call the [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) operation to check the status of the instance and verify whether the replacement is successful. If the `OperationLocks` response parameter is empty, the system disk replacement is complete. * * @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 of an ECS instance by replacing the system disk. After the replacement, the disk ID of the system disk changes and the original disk is released. * * @remarks * Before you call this operation, read [Replace a system disk (change the operating system)](https://help.aliyun.com/document_detail/50134.html). * When you replace the system disk, take note of the following items: * - You cannot change the billing method of the system disk. * - You cannot change the disk type of the system disk. * - The ECS instance to which the system disk is attached must not have unpaid orders. * * - The instance must be in the Stopped state. * > This applies only to instances in virtual private clouds (VPCs). If the ECS instance uses the pay-as-you-go billing method and the economical mode is enabled by default, to prevent the instance from failing to restart after the system disk is replaced due to insufficient instance inventory in the region, stop the instance in standard stop mode. For more information, see [StopInstance](https://help.aliyun.com/document_detail/25501.html). * - You can use the `SystemDisk.Size` parameter to specify a new capacity for the system disk. The new capacity cannot be smaller than the original capacity. * - If the ECS instance is locked for security purposes, which means the `OperationLocks` parameter of the instance contains `"LockReason": "security"`, the system disk cannot be replaced. For more information, see [API behavior when an instance is locked for security reasons](https://help.aliyun.com/document_detail/25695.html). * After the system disk is replaced, you can call the [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) operation to check the status of the instance and verify whether the replacement is successful. If the `OperationLocks` response parameter is empty, the system disk replacement is complete. * * @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 anomalous issues for one or more ECS instances. You can report the same issue that occurs on multiple ECS instances or the same issue that occurs on multiple disks attached to a single 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 anomalous issues for one or more ECS instances. You can report the same issue that occurs on multiple ECS instances or the same issue that occurs on multiple disks attached to a single 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 previous state by using a cloud disk snapshot. * * @remarks * Before you call this operation, read [Roll back a disk by using a snapshot](https://help.aliyun.com/document_detail/25450.html). * When you call this operation, take note of the following items: * - The cloud disk must be in the In Use (`In_use`) or Available (`Available`) state. * - The instance to which the cloud disk is attached must be in the Stopped (`Stopped`) state. You can call [StopInstances](https://help.aliyun.com/document_detail/155372.html) to stop an instance. * - The specified `SnapshotId` parameter must be a historical snapshot created from the cloud disk specified by `DiskId`. * - When you call [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) to query ECS instance information, if the response contains `{"OperationLocks": {"LockReason" : "security"}}`, all operations are prohibited. * * @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 previous state by using a cloud disk snapshot. * * @remarks * Before you call this operation, read [Roll back a disk by using a snapshot](https://help.aliyun.com/document_detail/25450.html). * When you call this operation, take note of the following items: * - The cloud disk must be in the In Use (`In_use`) or Available (`Available`) state. * - The instance to which the cloud disk is attached must be in the Stopped (`Stopped`) state. You can call [StopInstances](https://help.aliyun.com/document_detail/155372.html) to stop an instance. * - The specified `SnapshotId` parameter must be a historical snapshot created from the cloud disk specified by `DiskId`. * - When you call [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) to query ECS instance information, if the response contains `{"OperationLocks": {"LockReason" : "security"}}`, all operations are prohibited. * * @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 KMS key ID used for account-level default encryption of block storage in a specified region to the service key. * * @remarks * - Resource Access Management (RAM) users require the `AliyunECSFullAccess` permission. For more information about authorization, see [Grant permissions to a RAM user](https://help.aliyun.com/document_detail/116146.html). * - The **account-level default encryption of block storage** feature must be enabled in the specified 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 KMS key ID used for account-level default encryption of block storage in a specified region to the service key. * * @remarks * - Resource Access Management (RAM) users require the `AliyunECSFullAccess` permission. For more information about authorization, see [Grant permissions to a RAM user](https://help.aliyun.com/document_detail/116146.html). * - The **account-level default encryption of block storage** feature must be enabled in the specified 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); } /** * Rolls back one or more cloud disks by using an instance snapshot. * * @remarks * This operation is about to be deprecated. Use [ResetDisk](https://help.aliyun.com/document_detail/25520.html) to roll back cloud disks. * * @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({})); } /** * Rolls back one or more cloud disks by using an instance snapshot. * * @remarks * This operation is about to be deprecated. Use [ResetDisk](https://help.aliyun.com/document_detail/25520.html) to roll back cloud disks. * * @param request - ResetDisksRequest * @returns ResetDisksResponse */ async resetDisks(request: $_model.ResetDisksRequest): Promise<$_model.ResetDisksResponse> { let runtime = new $dara.RuntimeOptions({ }); return await this.resetDisksWithOptions(request, runtime); } /** * Expands the capacity of a disk, including system disks and data disks. * * @remarks * > Before expanding a disk, query the partition format of the disk. If the disk uses the MBR partition format, you cannot expand the disk to more than 2 TiB. Otherwise, data loss may occur. To expand an MBR-partitioned disk, create and attach a new data disk, use the GPT partition format, and then copy the existing data to the new data disk. For more information, see [Expand disk capacity](https://help.aliyun.com/document_detail/44986.html). * - Supported disk types include basic disks (`cloud`), ultra disks (`cloud_efficiency`), standard SSDs (`cloud_ssd`), enterprise SSDs (`cloud_essd`), ESSD Entry disks (cloud_essd_entry), ESSD AutoPL disks (cloud_auto), elastic ephemeral disks - Standard (elastic_ephemeral_disk_standard), elastic ephemeral disks - Premium (elastic_ephemeral_disk_premium), and regional ESSDs (cloud_regional_disk_auto). * - Disks for which snapshots are being created cannot be expanded. Wait until the snapshot creation is complete before expanding the disk. * - This operation does not expand partitions or file systems. After expanding the disk capacity, you must manually allocate partitions and file systems. For more information, see [Expand partitions and file systems (Linux)](~~2949817#bb3b1f02e51pj~~) and [Expand partitions and file systems (Windows)](~~2932233#a9f9b78f3fujb~~). * - Disks with the multi-attach feature enabled support both online and offline expansion. Make sure that the instances to which the disk is attached meet the following conditions: * - For online scale-out, the instance status must be **Running** (`Running`). * - For offline scale-out, the instance status must be **Running** (`Running`) or **Stopped** (`Stopped`). * - Make sure that the disk meets the following conditions: * - The disk is in the In Use (`In Use`) or Available (`Available`) state. * - (Strongly recommended) A snapshot has been created for the disk to back up data. For more information, see [Create a snapshot](https://help.aliyun.com/document_detail/25455.html). * - If the data disk is newly purchased, initialize the disk before expanding it. For more information, see [Initialization overview](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({})); } /** * Expands the capacity of a disk, including system disks and data disks. * * @remarks * > Before expanding a disk, query the partition format of the disk. If the disk uses the MBR partition format, you cannot expand the disk to more than 2 TiB. Otherwise, data loss may occur. To expand an MBR-partitioned disk, create and attach a new data disk, use the GPT partition format, and then copy the existing data to the new data disk. For more information, see [Expand disk capacity](https://help.aliyun.com/document_detail/44986.html). * - Supported disk types include basic disks (`cloud`), ultra disks (`cloud_efficiency`), standard SSDs (`cloud_ssd`), enterprise SSDs (`cloud_essd`), ESSD Entry disks (cloud_essd_entry), ESSD AutoPL disks (cloud_auto), elastic ephemeral disks - Standard (elastic_ephemeral_disk_standard), elastic ephemeral disks - Premium (elastic_ephemeral_disk_premium), and regional ESSDs (cloud_regional_disk_auto). * - Disks for which snapshots are being created cannot be expanded. Wait until the snapshot creation is complete before expanding the disk. * - This operation does not expand partitions or file systems. After expanding the disk capacity, you must manually allocate partitions and file systems. For more information, see [Expand partitions and file systems (Linux)](~~2949817#bb3b1f02e51pj~~) and [Expand partitions and file systems (Windows)](~~2932233#a9f9b78f3fujb~~). * - Disks with the multi-attach feature enabled support both online and offline expansion. Make sure that the instances to which the disk is attached meet the following conditions: * - For online scale-out, the instance status must be **Running** (`Running`). * - For offline scale-out, the instance status must be **Running** (`Running`) or **Stopped** (`Stopped`). * - Make sure that the disk meets the following conditions: * - The disk is in the In Use (`In Use`) or Available (`Available`) state. * - (Strongly recommended) A snapshot has been created for the disk to back up data. For more information, see [Create a snapshot](https://help.aliyun.com/document_detail/25455.html). * - If the data disk is newly purchased, initialize the disk before expanding it. For more information, see [Initialization overview](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: On 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 with this change promptly to avoid impacts on your online services. * This operation supports two methods to pass parameters for deleting rules: * - Delete rules by specifying security group rule IDs (recommended). * - If a specified security group rule ID does not exist, the invocation is failed. * - Delete rules by specifying Permissions. * - 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: specify 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: On 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 with this change promptly to avoid impacts on your online services. * This operation supports two methods to pass parameters for deleting rules: * - Delete rules by specifying security group rule IDs (recommended). * - If a specified security group rule ID does not exist, the invocation is failed. * - Delete rules by specifying Permissions. * - 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: specify 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: On 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 "InvalidSecurityGroupRule.RuleNotExist" instead of a success response. Make sure that your application is compatible with this fault code to avoid impacts on your 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, an error 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: Set 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 access 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: On 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 "InvalidSecurityGroupRule.RuleNotExist" instead of a success response. Make sure that your application is compatible with this fault code to avoid impacts on your 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, an error 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: Set 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 access 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 on one or more ECS instances. Supports Shell, PowerShell, or Bat script types, and provides features such as scheduled execution, custom parameters, and execution within containers on instances. * * @remarks * This is an asynchronous operation. After the request is sent, 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. * ### Before you begin * - The target instance must be in the running state (`Running`). You can call [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) to query the instance status. * - The target instance must have [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html) pre-installed. You can install it by calling [InstallCloudAssistant](https://help.aliyun.com/document_detail/2679925.html) and query the installation status by calling [DescribeCloudAssistantStatus](https://help.aliyun.com/document_detail/2679924.html). * > ECS instances created from public images after December 1, 2017 have Cloud Assistant Agent pre-installed by default. * - To run PowerShell commands, ensure that the Windows operating system on the target ECS instance has the PowerShell module configured. * ### Before you begin * - In a single region, you can retain 500 to 50,000 Cloud Assistant commands. You can also request a quota increase. For more information, see [Quota management](https://help.aliyun.com/document_detail/184116.html). * - The Cloud Assistant Agent version must be no earlier than the following versions to support new features of scheduled tasks (execution at fixed intervals, one-time execution at a specified time, and specifying a year or time zone for Cron-based scheduled execution). If the `ClientNeedUpgrade` error code is returned, see [Upgrade or disable upgrades of 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 * - If you use a Cron expression for scheduled execution 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 is determined by the system time of the instance. Ensure that the time or time zone of the ECS instance is consistent with your expectations. For more information about time zones, see [Configure the time zone and NTP service for a Linux instance](https://help.aliyun.com/document_detail/92803.html) or [Configure the NTP service for a Windows instance](https://help.aliyun.com/document_detail/51890.html). * ### Usage notes * - **Timeout settings**: You can specify the `Timeout` parameter to set the maximum timeout period for command execution on an ECS instance. If the command times out, Cloud Assistant Agent forcefully stops the process. * - For a one-time execution that times out, the execution status ([InvokeRecordStatus](https://help.aliyun.com/document_detail/64845.html)) changes to execution fault (Failed). * - For a scheduled execution, the timeout period applies to each execution record. A timeout in the previous execution does not affect the next execution. If an execution times out, the execution status ([InvokeRecordStatus](https://help.aliyun.com/document_detail/64845.html)) changes to execution fault (Failed). * - **Execution failures**: A command may fail to execute due to abnormal target instance status, network exceptions, or Cloud Assistant Agent exceptions. In such cases, no execution information is generated. For more information, see [Common errors and solutions for execution failures](https://help.aliyun.com/document_detail/87029.html). * - **Custom parameters**: When `EnableParameter=true`, the custom parameter feature is enabled. You can define custom parameters in the format of `{{parameter}}` in `CommandContent`, and pass in custom parameter key-value pairs when running 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 on one or more ECS instances. Supports Shell, PowerShell, or Bat script types, and provides features such as scheduled execution, custom parameters, and execution within containers on instances. * * @remarks * This is an asynchronous operation. After the request is sent, 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. * ### Before you begin * - The target instance must be in the running state (`Running`). You can call [DescribeInstances](https://help.aliyun.com/document_detail/25506.html) to query the instance status. * - The target instance must have [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html) pre-installed. You can install it by calling [InstallCloudAssistant](https://help.aliyun.com/document_detail/2679925.html) and query the installation status by calling [DescribeCloudAssistantStatus](https://help.aliyun.com/document_detail/2679924.html). * > ECS instances created from public images after December 1, 2017 have Cloud Assistant Agent pre-installed by default. * - To run PowerShell commands, ensure that the Windows operating system on the target ECS instance has the PowerShell module configured. * ### Before you begin * - In a single region, you can retain 500 to 50,000 Cloud Assistant commands. You can also request a quota increase. For more information, see [Quota management](https://help.aliyun.com/document_detail/184116.html). * - The Cloud Assistant Agent version must be no earlier than the following versions to support new features of scheduled tasks (execution at fixed intervals, one-time execution at a specified time, and specifying a year or time zone for Cron-based scheduled execution). If the `ClientNeedUpgrade` error code is returned, see [Upgrade or disable upgrades of 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 * - If you use a Cron expression for scheduled execution 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 is determined by the system time of the instance. Ensure that the time or time zone of the ECS instance is consistent with your expectations. For more information about time zones, see [Configure the time zone and NTP service for a Linux instance](https://help.aliyun.com/document_detail/92803.html) or [Configure the NTP service for a Windows instance](https://help.aliyun.com/document_detail/51890.html). * ### Usage notes * - **Timeout settings**: You can specify the `Timeout` parameter to set the maximum timeout period for command execution on an ECS instance. If the command times out, Cloud Assistant Agent forcefully stops the process. * - For a one-time execution that times out, the execution status ([InvokeRecordStatus](https://help.aliyun.com/document_detail/64845.html)) changes to execution fault (Failed). * - For a scheduled execution, the timeout period applies to each execution record. A timeout in the previous execution does not affect the next execution. If an execution times out, the execution status ([InvokeRecordStatus](https://help.aliyun.com/document_detail/64845.html)) changes to execution fault (Failed). * - **Execution failures**: A command may fail to execute due to abnormal target instance status, network exceptions, or Cloud Assistant Agent exceptions. In such cases, no execution information is generated. For more information, see [Common errors and solutions for execution failures](https://help.aliyun.com/document_detail/87029.html). * - **Custom parameters**: When `EnableParameter=true`, the custom parameter feature is enabled. You can define custom parameters in the format of `{{parameter}}` in `CommandContent`, and pass in custom parameter key-value pairs when running 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); } /** * Batch creates ECS instances with support for automatic startup, public IP address allocation, and automatic release time settings. * * @remarks * * Creating an instance incurs fees. 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 [public bandwidth](https://help.aliyun.com/document_detail/25411.html). 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 successfully sent, the instance ID is returned. The instance is not immediately created and started. You can call [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query instance information. When the returned status is `Running`, the instance is created and started. * ### Before you begin * * - Make sure that your account has completed real-name registration. For more information, see [Real-name registration](https://help.aliyun.com/document_detail/48263.html). * - When resource inventory is insufficient to complete the current instance creation, Alibaba Cloud immediately sends an instance creation failure event (SystemFailure.Delete). You can call [DescribeInstanceHistoryEvents](https://help.aliyun.com/document_detail/2679897.html) to check whether an instance creation failure event exists. For more information, see [Instance creation failure event](https://help.aliyun.com/document_detail/2545990.html). * - Make sure that the total number of instances you create or the total vCPUs across all instance types does not exceed the system quota. For more information, see [Quota Center](https://quotas.console.aliyun.com/products/ecs/quotas). * - Before you create a VPC-type instance, [create a VPC](https://help.aliyun.com/document_detail/65430.html) in the corresponding region. * ### Before you begin. * ### Recommendations. * ## Request examples * Assume that you want to create ECS instances in the China (Hangzhou) region. You want to use a specific image, instance type, security group, and vSwitch, configure system and data disks with specific capacities, assign a public IP address, and set the instance name and password. The relevant request parameters are as follows: * ``` * RegionId:"ap-southeast-1", //Set the China (Hangzhou) region * 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 vSwitch ID * SystemDisk:{ * Category:"cloud_essd", //Set the system disk category to enterprise SSD * Size:40, //Set the system disk size to 40 GiB * }, * DataDisk:[ * { * Category:"cloud_essd", //Set the data disk category to enterprise SSD * Size:100, //Set the data disk size to 100 GiB * } * ], * HostName:"ECS-test", //Set the instance hostname * Password:"ECS@test1234", //Set the instance logon password * InternetMaxBandwidthOut:10 //Set the outbound public bandwidth to 10 Mbit/s * ``` * Based on the preceding configurations, create instances of different types: *
* Example: Create five subscription instances with auto-renewal enabled * ``` * Amount:5, //Set the quantity to 5 * InstanceChargeType:"PrePaid", //Specify subscription billing * PeriodUnit:"Month", //Set the period unit to month * Period:1, //Set the period 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, //Set the quantity to 10 * InstanceChargeType:"PostPaid", //Specify pay-as-you-go billing * SpotStrategy:"NoSpot" //Default value, indicating regular pay-as-you-go * ``` *
*
* Example: Create 20 spot instances with a bidding strategy and protection period * ``` * Amount:20, //Set the quantity to 20 * InstanceChargeType:"PostPaid", * SpotStrategy:"SpotAsPriceGo", //Set the bidding strategy to automatically bid based on market price * SpotDuration:1 //Set the spot instance protection period to 1 hour * ``` *
* Assume that you have created a launch template by calling [CreateLaunchTemplate](https://help.aliyun.com/document_detail/2679729.html). You now want to use this template to create ECS instances in the China (Hangzhou) region. Example: *
* Example: Create 10 ECS instances based on a launch template * ``` * RegionId:"ap-southeast-1", //Set the China (Hangzhou) region * Amount:10, //Set the quantity to 10 * LaunchTemplateId:"lt-bp14xczpoxvb6rre****" //Set the launch template ID * ``` *
* >Notice: If you specify both instance parameters and template parameters, the instance parameters take precedence. For example, if the billing method in the template is subscription but `InstanceChargeType` is set to `PostPaid`, pay-as-you-go instances are created. *
* Example: Create one instance by using a full image (a whole-machine image that contains a system disk and data disks) * ``` * RegionId:"ap-southeast-1", //Set the China (Hangzhou) region * ImageId = m-bp13ohd32cvzpq9e****,//Custom image ID * InstanceType = ecs.u1-c1m1.large,//Instance type * SecurityGroupId = sg-bp10jztp6b0sdsyl****,//Security group ID * VSwitchId = vsw-bp19wo63nleroq22g****,//vSwitch ID * SystemDisk.Size = 50,//Set the size of the system disk included in the full image * SystemDisk.Category = cloud_auto,//Set the category of the system disk included in the full image * DataDisk.1.Device = /dev/xvdb,//Set the mount point of the data disk included in the full image * DataDisk.1.Size = 50,//Set the size of the data disk included in the full image * DataDisk.1.Category = cloud_essd,//Set the category of the data disk included in the full image * DataDisk.2.Device = /dev/xvdc,//Mount point of the additional data disk. To replace the data disk included in the full image with an additional data disk, set DataDisk.1.Device = /dev/xvdb (the default mount point of the data disk in the full image). * DataDisk.2.Size = 70,//Size of the additional data disk * DataDisk.2.Category = cloud_auto,//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({})); } /** * Batch creates ECS instances with support for automatic startup, public IP address allocation, and automatic release time settings. * * @remarks * * Creating an instance incurs fees. 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 [public bandwidth](https://help.aliyun.com/document_detail/25411.html). 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 successfully sent, the instance ID is returned. The instance is not immediately created and started. You can call [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query instance information. When the returned status is `Running`, the instance is created and started. * ### Before you begin * * - Make sure that your account has completed real-name registration. For more information, see [Real-name registration](https://help.aliyun.com/document_detail/48263.html). * - When resource inventory is insufficient to complete the current instance creation, Alibaba Cloud immediately sends an instance creation failure event (SystemFailure.Delete). You can call [DescribeInstanceHistoryEvents](https://help.aliyun.com/document_detail/2679897.html) to check whether an instance creation failure event exists. For more information, see [Instance creation failure event](https://help.aliyun.com/document_detail/2545990.html). * - Make sure that the total number of instances you create or the total vCPUs across all instance types does not exceed the system quota. For more information, see [Quota Center](https://quotas.console.aliyun.com/products/ecs/quotas). * - Before you create a VPC-type instance, [create a VPC](https://help.aliyun.com/document_detail/65430.html) in the corresponding region. * ### Before you begin. * ### Recommendations. * ## Request examples * Assume that you want to create ECS instances in the China (Hangzhou) region. You want to use a specific image, instance type, security group, and vSwitch, configure system and data disks with specific capacities, assign a public IP address, and set the instance name and password. The relevant request parameters are as follows: * ``` * RegionId:"ap-southeast-1", //Set the China (Hangzhou) region * 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 vSwitch ID * SystemDisk:{ * Category:"cloud_essd", //Set the system disk category to enterprise SSD * Size:40, //Set the system disk size to 40 GiB * }, * DataDisk:[ * { * Category:"cloud_essd", //Set the data disk category to enterprise SSD * Size:100, //Set the data disk size to 100 GiB * } * ], * HostName:"ECS-test", //Set the instance hostname * Password:"ECS@test1234", //Set the instance logon password * InternetMaxBandwidthOut:10 //Set the outbound public bandwidth to 10 Mbit/s * ``` * Based on the preceding configurations, create instances of different types: *
* Example: Create five subscription instances with auto-renewal enabled * ``` * Amount:5, //Set the quantity to 5 * InstanceChargeType:"PrePaid", //Specify subscription billing * PeriodUnit:"Month", //Set the period unit to month * Period:1, //Set the period 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, //Set the quantity to 10 * InstanceChargeType:"PostPaid", //Specify pay-as-you-go billing * SpotStrategy:"NoSpot" //Default value, indicating regular pay-as-you-go * ``` *
*
* Example: Create 20 spot instances with a bidding strategy and protection period * ``` * Amount:20, //Set the quantity to 20 * InstanceChargeType:"PostPaid", * SpotStrategy:"SpotAsPriceGo", //Set the bidding strategy to automatically bid based on market price * SpotDuration:1 //Set the spot instance protection period to 1 hour * ``` *
* Assume that you have created a launch template by calling [CreateLaunchTemplate](https://help.aliyun.com/document_detail/2679729.html). You now want to use this template to create ECS instances in the China (Hangzhou) region. Example: *
* Example: Create 10 ECS instances based on a launch template * ``` * RegionId:"ap-southeast-1", //Set the China (Hangzhou) region * Amount:10, //Set the quantity to 10 * LaunchTemplateId:"lt-bp14xczpoxvb6rre****" //Set the launch template ID * ``` *
* >Notice: If you specify both instance parameters and template parameters, the instance parameters take precedence. For example, if the billing method in the template is subscription but `InstanceChargeType` is set to `PostPaid`, pay-as-you-go instances are created. *
* Example: Create one instance by using a full image (a whole-machine image that contains a system disk and data disks) * ``` * RegionId:"ap-southeast-1", //Set the China (Hangzhou) region * ImageId = m-bp13ohd32cvzpq9e****,//Custom image ID * InstanceType = ecs.u1-c1m1.large,//Instance type * SecurityGroupId = sg-bp10jztp6b0sdsyl****,//Security group ID * VSwitchId = vsw-bp19wo63nleroq22g****,//vSwitch ID * SystemDisk.Size = 50,//Set the size of the system disk included in the full image * SystemDisk.Category = cloud_auto,//Set the category of the system disk included in the full image * DataDisk.1.Device = /dev/xvdb,//Set the mount point of the data disk included in the full image * DataDisk.1.Size = 50,//Set the size of the data disk included in the full image * DataDisk.1.Category = cloud_essd,//Set the category of the data disk included in the full image * DataDisk.2.Device = /dev/xvdc,//Mount point of the additional data disk. To replace the data disk included in the full image with an additional data disk, set DataDisk.1.Device = /dev/xvdb (the default mount point of the data disk in the full image). * DataDisk.2.Size = 70,//Size of the additional data disk * DataDisk.2.Category = cloud_auto,//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 remote file to one or more ECS instances. * * @remarks * ## Operation description * - The target ECS instances must be in the running state. * - Cloud Assistant Agent must be installed on the target ECS instances. For more information, see [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html). * - The Cloud Assistant Agent version must be later than the following versions to support file sending. If the `ClientNeedUpgrade` error code is returned, update the agent to the latest version. * - Linux: 1.0.2.569 * - Windows: 1.0.0.149 * - The file content cannot exceed 32 KB after Base64 encoding. * - File sending may fail due to exceptions in the target ECS instance status, network issues, or Cloud Assistant Agent exceptions. Call [DescribeSendFileResults](https://help.aliyun.com/document_detail/184117.html) or refer to [Common errors and solutions for execution failures](https://help.aliyun.com/document_detail/87029.html) to troubleshoot issues. * * @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 remote file to one or more ECS instances. * * @remarks * ## Operation description * - The target ECS instances must be in the running state. * - Cloud Assistant Agent must be installed on the target ECS instances. For more information, see [Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html). * - The Cloud Assistant Agent version must be later than the following versions to support file sending. If the `ClientNeedUpgrade` error code is returned, update the agent to the latest version. * - Linux: 1.0.2.569 * - Windows: 1.0.0.149 * - The file content cannot exceed 32 KB after Base64 encoding. * - File sending may fail due to exceptions in the target ECS instance status, network issues, or Cloud Assistant Agent exceptions. Call [DescribeSendFileResults](https://help.aliyun.com/document_detail/184117.html) or refer to [Common errors and solutions for execution failures](https://help.aliyun.com/document_detail/87029.html) to troubleshoot issues. * * @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 building task by using an image template. * * @remarks * - After an image template is created, call this operation to execute an image building task. The system builds, distributes, and creates shared images based on the parameters specified in the image template. * - For the same image template, only one image building task can be executed at a time. You can call CancelImagePipelineExecution multiple times simultaneously, and canceling an image building task does not interfere with other image building tasks. * - When you execute an image template, multiple intermediate instances are created to help build images. The intermediate instances are ECS instances that use the pay-as-you-go billing method, and billing fees are incurred. For more information, see [Pay-as-you-go](https://help.aliyun.com/document_detail/40653.html). * * @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 building task by using an image template. * * @remarks * - After an image template is created, call this operation to execute an image building task. The system builds, distributes, and creates shared images based on the parameters specified in the image template. * - For the same image template, only one image building task can be executed at a time. You can call CancelImagePipelineExecution multiple times simultaneously, and canceling an image building task does not interfere with other image building tasks. * - When you execute an image template, multiple intermediate instances are created to help build images. The intermediate instances are ECS instances that use the pay-as-you-go billing method, and billing fees are incurred. For more information, see [Pay-as-you-go](https://help.aliyun.com/document_detail/40653.html). * * @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 ECS instance. You can start an instance by specifying the instance ID and optionally setting parameters such as InitLocalDisk. * * @remarks * This is an asynchronous operation. The instance does not start immediately after a successful call. The instance first enters the Starting state. Call [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query the instance status. When the returned status is `Running`, the instance is started. * ### Before you begin * - 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). * - The ECS instance must be in the **Stopped** (`Stopped`) state. * - Instances in economical mode may fail to start due to insufficient inventory. * * @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 ECS instance. You can start an instance by specifying the instance ID and optionally setting parameters such as InitLocalDisk. * * @remarks * This is an asynchronous operation. The instance does not start immediately after a successful call. The instance first enters the Starting state. Call [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query the instance status. When the returned status is `Running`, the instance is started. * ### Before you begin * - 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). * - The ECS instance must be in the **Stopped** (`Stopped`) state. * - Instances in economical mode may fail to start due to insufficient inventory. * * @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 multiple ECS instances in a batch. You can specify parameters to select different batch operation modes for flexible startup. * * @remarks * This is an asynchronous operation. Instance startup is not immediate. After you invoke the operation, the instances enter the Starting state. You can invoke [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query the instance status. When the returned status is `Running`, the instances are started. * ### Before you begin * - Instances that are locked for security reasons cannot be started by invoking this operation. For more information, see [Impacts of security lock on API operations](https://help.aliyun.com/document_detail/25695.html). * - The ECS instances must be in the **Stopped** (`Stopped`) state. * - Starting instances in economical mode may fail because of 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 multiple ECS instances in a batch. You can specify parameters to select different batch operation modes for flexible startup. * * @remarks * This is an asynchronous operation. Instance startup is not immediate. After you invoke the operation, the instances enter the Starting state. You can invoke [DescribeInstanceStatus](https://help.aliyun.com/document_detail/2679688.html) to query the instance status. When the returned status is `Running`, the instances are started. * ### Before you begin * - Instances that are locked for security reasons cannot be started by invoking this operation. For more information, see [Impacts of security lock on API operations](https://help.aliyun.com/document_detail/25695.html). * - The ECS instances must be in the **Stopped** (`Stopped`) state. * - Starting instances in economical mode may fail because of 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 the 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 remotely connecting to an ECS instance. Take note of the following items: * - The specified ECS instance must be in the running state. * - The 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 the Cloud Assistant Agent is installed on the ECS instance and query the version number of the Cloud Assistant Agent. * - If the Cloud Assistant Agent is not installed on the ECS instance, invoke [InstallCloudAssistant](https://help.aliyun.com/document_detail/85916.html) to install it. * - The Cloud Assistant Agent version must be later than the following versions to support the session management feature. To upgrade the Cloud Assistant Agent, see [Upgrade or disable upgrades for the 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 you successfully invoke this operation, the WebSocketUrl is valid for 10 minutes. * - After a session is established, if no data is transmitted for 3 minutes, Cloud Assistant closes the connection. * - 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 connection 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 the 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 remotely connecting to an ECS instance. Take note of the following items: * - The specified ECS instance must be in the running state. * - The 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 the Cloud Assistant Agent is installed on the ECS instance and query the version number of the Cloud Assistant Agent. * - If the Cloud Assistant Agent is not installed on the ECS instance, invoke [InstallCloudAssistant](https://help.aliyun.com/document_detail/85916.html) to install it. * - The Cloud Assistant Agent version must be later than the following versions to support the session management feature. To upgrade the Cloud Assistant Agent, see [Upgrade or disable upgrades for the 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 you successfully invoke this operation, the WebSocketUrl is valid for 10 minutes. * - After a session is established, if no data is transmitted for 3 minutes, Cloud Assistant closes the connection. * - 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 connection 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 the stop method, stop mode, and batch operation mode. * * @remarks * This is an asynchronous operation. The ECS instance is not stopped immediately after a successful call. After the call succeeds, the instance enters the Stopping state. You can 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 * - Instances that are locked for security reasons cannot be stopped by calling 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 instances in a VPC, 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 public 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 the stop method, stop mode, and batch operation mode. * * @remarks * This is an asynchronous operation. The ECS instance is not stopped immediately after a successful call. After the call succeeds, the instance enters the Stopping state. You can 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 * - Instances that are locked for security reasons cannot be stopped by calling 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 instances in a VPC, 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 public 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 different stop methods, stop modes, and batch operation modes. * * @remarks * This is an asynchronous operation. Instances are not stopped immediately after a successful call. 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 different stop methods, stop modes, and batch operation modes. * * @remarks * This is an asynchronous operation. Instances are not stopped immediately after a successful call. 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); } /** * Stops a running Cloud Assistant command process on one or more ECS instances. * * @remarks * ## Operation description * - After you stop a one-time command process, instances that have started the execution continue to run, and instances that have not started the execution will not run. * - After you stop a periodic command process, commands that have started the execution continue to run, but subsequent executions will not be triggered. * * @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({})); } /** * Stops a running Cloud Assistant command process on one or more ECS instances. * * @remarks * ## Operation description * - After you stop a one-time command process, instances that have started the execution continue to run, and instances that have not started the execution will not run. * - After you stop a periodic command process, commands that have started the execution continue to run, but subsequent executions will not be triggered. * * @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 binds tags to specified ECS resources in a single operation. * * @remarks * ## Operation description * Before you attach tags, Alibaba Cloud checks the number of existing tags on the resource. If the maximum number of tags is exceeded, an error message is returned. For more information, see [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 binds tags to specified ECS resources in a single operation. * * @remarks * ## Operation description * Before you attach tags, Alibaba Cloud checks the number of existing tags on the resource. If the maximum number of tags is exceeded, an error message is returned. For more information, see [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** (Available) 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** (Available) 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); } /** * Removes one or more secondary private IP addresses from an Elastic Network Interface (ENI). * * @remarks * ## Operation description * - Only Elastic Network Interfaces (ENIs) in the **Active** (Available) or **InUse** (InUse) state are supported. * - When you operate on a primary ENI, the instance to which the network interface controller (NIC) 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({})); } /** * Removes one or more secondary private IP addresses from an Elastic Network Interface (ENI). * * @remarks * ## Operation description * - Only Elastic Network Interfaces (ENIs) in the **Active** (Available) or **InUse** (InUse) state are supported. * - When you operate on a primary ENI, the instance to which the network interface controller (NIC) 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 an 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 an 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); } /** * Unlocks a snapshot that is locked in compliance mode but is still within the cooling-off period. If the snapshot is locked in compliance mode and the cooling-off period has ended, the snapshot 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({})); } /** * Unlocks a snapshot that is locked in compliance mode but is still within the cooling-off period. If the snapshot is locked in compliance mode and the cooling-off period has ended, the snapshot 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); } /** * Unbinds tags from specified ECS resources. After a tag is unbound, the tag is automatically deleted if it is not bound to any 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({})); } /** * Unbinds tags from specified ECS resources. After a tag is unbound, the tag is automatically deleted if it is not bound to any 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); } }