Creates an API Gateway instance.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| apigateway:CreateInstance | create | *Instance acs:apigateway:{#regionId}:{#accountId}:instance/* |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| ChargeType | string | Yes | The billing method of the instance. Valid values: PostPaid (pay-as-you-go) and PrePaid (subscription). | PostPaid PrePaid |
| InstanceName | string | Yes | Instance Name | ApigatewayInstance |
| InstanceSpec | string | Yes | Instance specifications | api.s1.small |
| ZoneId | string | No | The zone in which you want to create the instance. This parameter is required for a conventional dedicated instance and optional for a virtual private cloud (VPC) integration instance. | cn-beijing-MAZ3(c,e) |
| HttpsPolicy | string | Yes | The HTTPS policy. | HTTPS2_TLS1_2 |
| Duration | integer | No | The subscription duration of the instance.
Note
This parameter is valid and required only if the ChargeType parameter is set to PrePaid.
| 1 |
| PricingCycle | string | No | The unit of the subscription duration of the subscription instance. Valid values:
Note
This parameter is required if the ChargeType parameter is set to Prepaid.
| Month |
| AutoPay | boolean | No | Whether to automatically pay when renewing. Value:
Default value: False. | false |
| Token | string | Yes | Passwords are used to prevent duplicate requests from being submitted, please do not reuse them. | c20d86c4-1eb3-4d0b-afe9-c586df1e2136 |
| Tag | array<object> | No | The tags that you want to add to the instance. | |
| object | No | |||
| Key | string | No | The tag key. | test1 |
| Value | string | No | The tag value. | v1 |
| InstanceType | string | No | The type of the dedicated instance. Valid values:
Note
This parameter is in invitational preview and not available for public use.
| vpc_connect |
| InstanceCidr | string | No | The CIDR block of the VPC integration instance.
** Warning The VPC integration instance is connected to the specified CIDR block. Plan your CIDR block carefully to prevent overlaps with the private IP addresses of cloud services. Note
This parameter is in invitational preview and not available for public use.
| 172.16.0.0/12 |
| UserVpcId | string | No | The ID of the user's VPC to be connected by the VPC integration instance. Note
This parameter is in invitational preview and not available for public use.
| vpc-m5eo7khlb4h4f8y9egsdg |
| ZoneVSwitchSecurityGroup | array<object> | No | The network information when the instance is a VPC integration instance, such as the zone, vSwitch, and security group. Note
This parameter is in invitational preview and not available for public use.
| |
| object | No | |||
| ZoneId | string | No | The zone ID. | cn-beijing-c |
| VSwitchId | string | No | The vSwitch ID. | vsw-0xi349n11cxogmvm866tb |
| CidrBlock | string | No | The IPv4 CIDR block for the vSwitch. | 192.168.9.0/24 |
| SecurityGroupId | string | No | The ID of the security group. Services in the same security group can access each other. | sg-2ze2ql9nozv8q7kmlt6e |
Response parameters
Examples
Sample success responses
JSONformat
{
"TagStatus": true,
"InstanceId": "apigateway-hz-b3c5dadd5***",
"RequestId": "CEB6EC62-B6C7-5082-A45A-45A204724AC2"
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2024-01-19 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
| 2023-03-07 | The request parameters of the API has changed | View Change Details |
