CreateInstance

Updated at:

Creates an API Gateway instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

apigateway:CreateInstance

create

*Instance

acs:apigateway:{#regionId}:{#accountId}:instance/*

None None

Request parameters

Parameter

Type

Required

Description

Example

ChargeType

string

Yes

The billing method.

PostPaid

InstanceName

string

Yes

The instance name.

ApigatewayInstance

InstanceSpec

string

Yes

The instance specifications.

api.s1.small

ZoneId

string

No

The zone ID. This parameter is required for traditional dedicated instances and optional for VPC-integrated dedicated instances.

cn-beijing-MAZ3(c,e)

HttpsPolicy

string

No

The HTTPS policy.

HTTPS2_TLS1_2

Duration

integer

No

The subscription duration of the instance. Valid values:

  • If PricingCycle is set to Month, the value ranges from 1 to 9.

  • If PricingCycle is set to Year, the value ranges from 1 to 3.

Note

This parameter is available and required only when ChargeType is set to PrePaid.

1

PricingCycle

string

No

The billing cycle of the subscription instance. Valid values:

  • year: year

  • month: month

Note

This parameter is required when ChargeType is set to PrePaid.

Month

AutoPay

boolean

No

Specifies whether to enable automatic payment for renewals. Valid values:

  • True: Automatic payment is enabled. Make sure that your account has sufficient balance.

  • False: Manual payment is required. You can log on to the console, choose Billing > User Center in the upper-right corner, and pay for the order on the Orders page.

Default value: False.

false

Token

string

Yes

The client token that is used to ensure the idempotence of the request. Do not reuse the token. If the token string contains leading or trailing spaces, the spaces are automatically trimmed by the gateway.

c20d86c4-1eb3-4d0b-afe9-c586df1e2136

Tag

array<object>

No

The list of tags.

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:

  • vpc_connect: VPC-integrated dedicated instance.

  • normal: traditional dedicated instance.

Important This parameter is in invitational preview and is not available.

vpc_connect

InstanceCidr

string

No

The CIDR block of the instance. This parameter is required when the dedicated instance type is VPC-integrated. Valid values:

  • 192.168.0.0/16

  • 172.16.0.0/12

Warning A VPC-integrated dedicated instance connects to the specified CIDR block. To prevent IP address conflicts, make sure that the specified CIDR block does not overlap with the private IP addresses of your cloud services.
Important This parameter is in invitational preview and is not available.

172.16.0.0/12

UserVpcId

string

No

The ID of the user VPC to be connected. This parameter is required when the dedicated instance type is VPC-integrated.

Important This parameter is in invitational preview and is not available.

vpc-m5eo7khlb4h4f8y9egsdg

ZoneVSwitchSecurityGroup

array<object>

No

The zone, vSwitch, and security group information required for network connectivity. This parameter is required when the dedicated instance type is VPC-integrated.

Important This parameter is in invitational preview and is not available.

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 of the vSwitch.

192.168.9.0/24

SecurityGroupId

string

No

The security group ID. Services in the same security group can access each other.

sg-2ze2ql9nozv8q7kmlt6e

Response elements

Element

Type

Description

Example

object

TagStatus

boolean

Indicates whether the tag exists. Valid values:

  • true: The tag exists.

  • false: The tag does not exist.

True

InstanceId

string

The instance ID.

apigateway-hz-b3c5dadd5***

RequestId

string

The request ID.

CEB6EC62-B6C7-5082-A45A-45A204724AC2

Examples

Success response

JSON format

{
  "TagStatus": true,
  "InstanceId": "apigateway-hz-b3c5dadd5***",
  "RequestId": "CEB6EC62-B6C7-5082-A45A-45A204724AC2"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.