18 KiB

original_name

CreateFirewall.html

Create Firewall

Function

This API is used to create firewall.

URI

POST /v2/{project_id}/firewall

Table 1 Path Parameters
Parameter Mandatory Type Description
project_id Yes String Project ID

Request Parameters

Table 2 Request header parameters
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.
Table 3 Request body parameters
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, which can be obtained by calling the ListFirewallList.

Default: 0

tags No Array of tags <createfirewall__request_tags> objects Resource Tag
flavor Yes flavor <createfirewall__request_flavor> object flavor
charge_info Yes charge_info <createfirewall__request_charge_info> object Billing type information, postpaid.
Table 4 tags
Parameter Mandatory Type Description
key No String Tag Key
value No String Tag Value
Table 5 flavor
Parameter Mandatory Type Description
version Yes String

Firewall version: charge_mode is postPaid, only the Professional Edition is supported

Enumeration values:

  • Professional
Table 6 charge_info
Parameter Mandatory Type Description
charge_mode Yes String The billing mode can be postPaid: postpaid, i.e., pay-per-use.

Response Parameters

Status code: 200

Table 7 Response body parameters
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 <createfirewall__response_createfirewallreq> object Create Firewall Request
Table 8 CreateFirewallReq
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, which can be obtained by calling the ListFirewallList.

Default: 0

tags Array of tags <createfirewall__response_tags> objects Resource Tag
flavor flavor <createfirewall__response_flavor> object flavor
charge_info charge_info <createfirewall__response_charge_info> object Billing type information, postpaid.
Table 9 tags
Parameter Type Description
key String Tag Key
value String Tag Value
Table 10 flavor
Parameter Type Description
version String

Firewall version: charge_mode is postPaid, only the Professional Edition is supported

Enumeration values:

  • Professional
Table 11 charge_info
Parameter Type Description
charge_mode String The billing mode can be postPaid: postpaid, i.e., pay-per-use.

Status code: 400

Table 12 Response body parameters
Parameter Type Description
error_code String Error code
error_msg String Description

Example Requests

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" : "Professional"
  },
  "charge_info" : {
    "charge_mode" : "postPaid",
    "period_type" : "month",
    "period_num" : 1,
    "is_auto_renew" : true,
    "is_auto_pay" : true
  }
}

Example Responses

Status code: 200

Create Firewall Response

{
  "data" : {
    "charge_info" : {
      "charge_mode" : "postPaid"
    },
    "enterprise_project_id" : "0",
    "flavor" : {
      "version" : "Professional"
    },
    "name" : "CFW-TEST",
    "tags" : [ {
      "key" : "TagKey",
      "value" : "TagVal"
    } ]
  },
  "job_id" : "jobId"
}

Status code: 400

Bad Request

{
  "error_code" : "CFW.00100001",
  "error_msg" : "The system is busy. Please try again later."
}

Status Codes

Status Code Description
200 Create Firewall Response
400 Bad Request

Error Codes

See Error Codes <errorcode>.