This API is used to create firewall.
POST /v2/{project_id}/firewall
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token. |
X-Client-Token |
No |
String |
An identity that guarantees the idempotency of client requests. The identifier is in 32-bit UUID format, generated by the client, and must be unique between requests. |
X-Trace-Id |
No |
String |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Firewall Name |
enterprise_project_id |
No |
String |
Enterprise project id, the id generated by the enterprise project after the user supports the enterprise project. Default: 0 |
tags |
No |
Array of tags objects |
Resource Tag |
flavor |
Yes |
flavor object |
flavor |
charge_info |
Yes |
charge_info object |
Billing type information, prepaid and postpaid, the default is postpaid. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
version |
Yes |
String |
Firewall version: If charge_mode is set to postPaid, only the Professional Edition is supported, and when charge_mode is set to prePaid, the Standard and Professional Editions are supported. Enumeration values:
|
extend_eip_count |
No |
Integer |
Expand the number of EIPs and take effect only in the prepaid mode. Minimum: 0 Maximum: 2000 Default: 0 |
extend_bandwidth |
No |
Integer |
Expand band width and take effect only in the prepaid mode. Minimum: 0 Maximum: 5000 |
extend_vpc_count |
No |
Integer |
Expand the number of VPCs and take effect only in the prepaid mode. Minimum: 0 Maximum: 100 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
charge_mode |
Yes |
String |
The billing mode can be prepaid, i.e., yearly/monthly, and postPaid: postpaid, i.e., pay-per-use. |
period_type |
No |
String |
The value range of the subscription cycle,include monthly and yearly. Note: This parameter takes effect when charge_mode is set to prePaid, and the value is required. |
period_num |
No |
Integer |
the time of the subscription, take effect when charge_mode is prePaid and it is required, value range: 1~9 when period_type is set to month, and 1~3 when period_type is set to year. |
is_auto_renew |
Yes |
Boolean |
whether the firewall instance is auto renewed Default: false |
is_auto_pay |
Yes |
Boolean |
whether the firewall instance is auto paid Default: false |
Status code: 200
Parameter |
Type |
Description |
---|---|---|
job_id |
String |
The job id, created when the firewall instance is created, which is returned only when the billing mode is postpaid. |
order_id |
String |
Order id,which is returned when the firewall instance is created. |
data |
CreateFirewallReq object |
Create Firewall Request |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Firewall Name |
enterprise_project_id |
String |
Enterprise project id, the id generated by the enterprise project after the user supports the enterprise project. Default: 0 |
tags |
Array of tags objects |
Resource Tag |
flavor |
flavor object |
flavor |
charge_info |
charge_info object |
Billing type information, prepaid and postpaid, the default is postpaid. |
Parameter |
Type |
Description |
---|---|---|
version |
String |
Firewall version: If charge_mode is set to postPaid, only the Professional Edition is supported, and when charge_mode is set to prePaid, the Standard and Professional Editions are supported. Enumeration values:
|
extend_eip_count |
Integer |
Expand the number of EIPs and take effect only in the prepaid mode. Minimum: 0 Maximum: 2000 Default: 0 |
extend_bandwidth |
Integer |
Expand band width and take effect only in the prepaid mode. Minimum: 0 Maximum: 5000 |
extend_vpc_count |
Integer |
Expand the number of VPCs and take effect only in the prepaid mode. Minimum: 0 Maximum: 100 |
Parameter |
Type |
Description |
---|---|---|
charge_mode |
String |
The billing mode can be prepaid, i.e., yearly/monthly, and postPaid: postpaid, i.e., pay-per-use. |
period_type |
String |
The value range of the subscription cycle,include monthly and yearly. Note: This parameter takes effect when charge_mode is set to prePaid, and the value is required. |
period_num |
Integer |
the time of the subscription, take effect when charge_mode is prePaid and it is required, value range: 1~9 when period_type is set to month, and 1~3 when period_type is set to year. |
is_auto_renew |
Boolean |
whether the firewall instance is auto renewed Default: false |
is_auto_pay |
Boolean |
whether the firewall instance is auto paid Default: false |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code Minimum: 8 Maximum: 36 |
error_msg |
String |
Description Minimum: 2 Maximum: 512 |
Enable a standard firewall with 2000 extended EIP, 5,000 Mbps extended protection bandwidth, 100 extended protection VCPs under a monthly billing auto-renewal model.
https://{Endpoint}/v2/124147da-5b08-471a-93d2-bc82acc290c6/firewall { "name" : "CFW-TEST", "enterprise_project_id" : "0", "tags" : [ { "key" : "TagKey", "value" : "TagVal" } ], "flavor" : { "version" : "Standard", "extend_eip_count" : 2000, "extend_bandwidth" : 5000, "extend_vpc_count" : 100 }, "charge_info" : { "charge_mode" : "prePaid", "period_type" : "month", "period_num" : 1, "is_auto_renew" : true, "is_auto_pay" : true } }
Status code: 200
Create Firewall Response
{ "data" : { "charge_info" : { "charge_mode" : "prePaid", "is_auto_pay" : true, "is_auto_renew" : true, "period_num" : 1, "period_type" : "month" }, "enterprise_project_id" : "0", "flavor" : { "extend_bandwidth" : 5000, "extend_eip_count" : 2000, "extend_vpc_count" : 100, "version" : "Standard" }, "name" : "CFW-TEST", "tags" : [ { "key" : "TagKey", "value" : "TagVal" } ] }, "order_id" : "CS2403271050ZEM0L" }
Status code: 400
Bad Request
{ "error_code" : "CFW.00100001", "error_msg" : "The system is busy. Please try again later." }
Status Code |
Description |
---|---|
200 |
Create Firewall Response |
400 |
Bad Request |
See Error Codes.