Creating a Custom Line
Function
This API is used to create a custom line.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
dns:customLine:create
Write
customLine *
-
-
dns:quota:list
URI
POST /v2.1/customlines
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition The user token. The token can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token. For details about how to obtain a user token, seeObtaining a User Token. Constraints N/A Range N/A Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Custom line name. The value contains 1 to 80 characters. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed. The name of each resolution line must be unique in an account. |
|
ip_segments |
Yes |
Array of strings |
IP address range. Use hyphens (-) to separate IP addresses. The smaller IP address is placed before the larger IP address. IP address ranges cannot overlap. If there is only one IP address, set this parameter to IP1-IP1. Only IPv4 addresses are supported. You can specify a maximum of 50 different IP address ranges. |
|
description |
No |
String |
Custom line description. The value can contain a maximum of 255 characters and is left blank by default. |
Response Parameters
Status code: 202
|
Parameter |
Type |
Description |
|---|---|---|
|
line_id |
String |
Resolution line ID. |
|
name |
String |
Custom line name. |
|
ip_segments |
Array of strings |
IP address range. |
|
created_at |
String |
The creation time. Format: yyyy-MM-dd'T'HH:mm:ss.SSS |
|
updated_at |
String |
The update time. Format: yyyy-MM-dd'T'HH:mm:ss.SSS |
|
status |
String |
Resource status. |
|
description |
String |
Custom line description. |
Example Requests
Creating a custom line and setting the IP address range to 1.1.1.1-1.1.1.1 and 1.1.1.2-1.1.1.3
POST https://{endpoint}/v2.1/customlines
{
"name" : "customline",
"ip_segments" : [ "1.1.1.1-1.1.1.1", "1.1.1.2-1.1.1.3" ],
"description" : "123"
}
Example Responses
Status code: 202
Request accepted
{
"line_id" : "custom_2ce45ef669fc87870169fcbada7a0007",
"name" : "customline",
"ip_segments" : [ "1.1.1.1-1.1.1.1", "1.1.1.2-1.1.1.3" ],
"status" : "PENDING_CREATE",
"created_at" : "2019-04-10T12:03:17.827",
"updated_at" : null,
"description" : "123"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
202 |
Request accepted |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.