Call an API operation to create an Anti-DDoS Native 2.0 (Subscription) instance
Anti-DDoS Native does not provide its own API for creating instances. Use the CreateInstance operation from the BSS API (Alibaba Cloud Transactions and Bills Management API) instead. This topic covers the request parameters and sample requests for creating an Anti-DDoS Native 2.0 (Subscription) instance — either Anti-DDoS Native (SMB) for Small and Medium Enterprises or Anti-DDoS Native (Enterprise).
Prerequisites
Before you begin, make sure you have:
-
An Alibaba Cloud account with sufficient balance — fees are automatically deducted when
CreateInstanceis called -
(International site users only) A credit control identity for your account. If you have not applied for one, contact your account manager
Background
The BSS API is a set of operations for managing Alibaba Cloud resources, including querying service prices, managing instances, and retrieving bills. For the full list of BSS API operations, see List of operations by function.
To call CreateInstance, follow the request syntax described in Request syntax and signature method V2 for RPC APIs.
Usage notes
-
Only Anti-DDoS Native 2.0 (Subscription) instances can be created via API. Supported editions: Anti-DDoS Native (SMB) for Small and Medium Enterprises and Enterprise.
-
Fees are automatically deducted from your account balance after a successful
CreateInstancecall. For pricing details, see Anti-DDoS Native 2.0 (Subscription).
Common request parameters
All CreateInstance requests for Anti-DDoS Native share the following parameters. Edition-specific configuration items are passed as Parameter.N.Code and Parameter.N.Value pairs.
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
Action |
String | Yes | CreateInstance |
Set to CreateInstance. |
ProductCode |
String | Yes | ddos |
Service code for Anti-DDoS. Set to ddos. |
ProductType |
String | Yes | ddos_originpre_public_cn |
Service type. Valid values: ddos_originpre_public_cn (China site, aliyun.com) or ddos_ddosbgp_public_intl (international site, alibabacloud.com). |
SubscriptionType |
String | Yes | Subscription |
Billing method. Set to Subscription. |
Period |
Integer | Yes | 1 |
Subscription duration in months. Valid values: 1, 2, 3, 4, 5, 6, 12, 24, 36. |
RenewalStatus |
String | No | ManualRenewal |
Renewal method. Valid values: ManualRenewal (default) or AutoRenewal. |
RenewPeriod |
Integer | No | 1 |
Auto-renewal period in months. Required when RenewalStatus is AutoRenewal. |
ClientToken |
String | No | 123e4567-e89b-12d3-a456-42665544**** |
Client token for request idempotence. ASCII characters only, 64-character maximum. If omitted, the system uses the request ID as the token. For details, see How to ensure idempotence. |
Parameter.N.Code |
String | Yes | edition |
Code for configuration item N. Pair with Parameter.N.Value. For example, Parameter.1.Code and Parameter.1.Value define the first configuration item. |
Parameter.N.Value |
String | Yes | smb |
Value for configuration item N. |
Create an Anti-DDoS Native (SMB) for Small and Medium Enterprises instance
Configuration items
| Code | Type | Example | Description |
|---|---|---|---|
edition |
String | smb |
Set to smb for Anti-DDoS Native (SMB) for Small and Medium Enterprises. |
internet_protocol |
String | v4 |
IP version. Valid values: v4 (IPv4) or v6 (IPv6). |
ip_qty |
Integer | 3 |
Number of IP addresses to protect. Valid values: 1–29. |
mitigation_qty_monthly |
String | 2 |
Mitigation plan. Set to 2 for the Insurance mitigation plan (two mitigation sessions per month). |
coverage |
String | 1_region |
Set to 1_region. Anti-DDoS Native (SMB) instances protect assets in a single region only. |
clean_bandwidth |
Integer | 50 |
Clean bandwidth in Mbit/s. Valid values: 50–1000, in multiples of 50. |
mitigation_analysis |
String | off |
Set to off. Mitigation logs cannot be enabled for Anti-DDoS Native (SMB) instances. |
Sample request
The following example creates an Anti-DDoS Native (SMB) instance with 3 IPv4 addresses, the Insurance mitigation plan, single-region coverage, and 50 Mbit/s clean bandwidth.
{
"ProductCode": "ddos",
"ProductType": "ddos_originpre_public_cn",
"Parameter.1.Code": "edition",
"Parameter.1.Value": "smb",
"Parameter.2.Code": "internet_protocol",
"Parameter.2.Value": "v4",
"Parameter.3.Code": "ip_qty",
"Parameter.3.Value": "3",
"Parameter.4.Code": "mitigation_qty_monthly",
"Parameter.4.Value": "2",
"Parameter.5.Code": "coverage",
"Parameter.5.Value": "1_region",
"Parameter.6.Code": "clean_bandwidth",
"Parameter.6.Value": "50",
"Parameter.7.Code": "mitigation_analysis",
"Parameter.7.Value": "off",
"SubscriptionType": "Subscription",
"Period": "1",
"RenewalStatus": "AutoRenewal",
"RenewPeriod": "1"
}
Sample response
A successful response returns the instance ID and order ID:
{
"Message": "Successful!",
"RequestId": "A09C6A09-D399-5075-98D8-0A2D341EAC69",
"Data": {
"InstanceId": "ddos_originpre_public_cn-j4g3yvg****",
"OrderId": 24005131779****
},
"Code": "Success",
"Success": true
}
Create an Enterprise instance
Configuration items
| Code | Type | Example | Description |
|---|---|---|---|
edition |
String | enterprise |
Set to enterprise for Anti-DDoS Native (Enterprise). |
internet_protocol |
String | v4_6 |
Set to v4_6. Enterprise instances support both IPv4 and IPv6. |
ip_qty |
Integer | 30 |
Number of IP addresses to protect. Valid values: 30–10,000,000. |
mitigation_qty_monthly |
String | unlimited |
Mitigation plan. Valid values: 2 (Insurance mitigation plan, two sessions per month) or unlimited (Unlimited mitigation plan). Note
China site (aliyun.com) users can only set this to |
coverage |
String | only_mainland_china |
Region of the assets to protect. Valid values: only_mainland_china (Chinese mainland), international_and_hmt (outside the Chinese mainland), or global (Chinese mainland and outside). Note
China site (aliyun.com) users can only set this to |
clean_bandwidth |
Integer | 100 |
Clean bandwidth in Mbit/s. Valid values: 100–900,000, in multiples of 100. |
mitigation_analysis |
String | on |
Whether to enable mitigation logs. Valid values: on or off. |
mitigation_analysis_capacity |
String | 3T |
Log storage capacity. Set to 3T (3 TB). Required when mitigation_analysis is on. |
Sample request
The following example creates an Enterprise instance with 30 IPv4 and IPv6 addresses, the Unlimited mitigation plan, Chinese mainland coverage, 100 Mbit/s clean bandwidth, and mitigation logs enabled with 3 TB storage.
{
"ProductCode": "ddos",
"ProductType": "ddos_originpre_public_cn",
"Parameter.1.Code": "edition",
"Parameter.1.Value": "enterprise",
"Parameter.2.Code": "internet_protocol",
"Parameter.2.Value": "v4_6",
"Parameter.3.Code": "ip_qty",
"Parameter.3.Value": "30",
"Parameter.4.Code": "mitigation_qty_monthly",
"Parameter.4.Value": "unlimited",
"Parameter.5.Code": "coverage",
"Parameter.5.Value": "only_mainland_china",
"Parameter.6.Code": "clean_bandwidth",
"Parameter.6.Value": "100",
"Parameter.7.Code": "mitigation_analysis",
"Parameter.7.Value": "on",
"Parameter.8.Code": "mitigation_analysis_capacity",
"Parameter.8.Value": "3T",
"SubscriptionType": "Subscription",
"Period": "1",
"RenewalStatus": "AutoRenewal",
"RenewPeriod": "1"
}
Sample response
A successful response returns the instance ID and order ID:
{
"Message": "Successful!",
"RequestId": "09B48D51-AD06-5D95-8C0A-4BCD2E406F0C",
"Data": {
"InstanceId": "ddos_originpre_public_cn-lf63yvl****",
"OrderId": 24005235006****
},
"Code": "Success",
"Success": true
}
What's next
-
View and manage your new instance in the Anti-DDoS Native console.
-
For the full BSS API reference, see CreateInstance.