Updated on 2024-03-25 GMT+08:00

Creating a PTR Record for an EIP

Function

This API is to create a PTR record for an EIP.

Calling Method

For details, see Calling APIs.

URI

PATCH /v2/reverse/floatingips/{region}:{floatingip_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

region

Yes

String

Region of the tenant

floatingip_id

Yes

String

EIP 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 an IAM API. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

ptrdname

Yes

String

Domain name of the PTR record

description

No

String

PTR record description

ttl

No

Integer

PTR record caching duration (in seconds) on a local DNS server. The longer the duration is, the slower the update takes effect. The value ranges from 1 to 2147483647.

enterprise_project_id

No

String

ID of the enterprise project associated with the PTR record. The value contains a maximum of 36 characters.

tags

No

Array of tag objects

Resource tag

Table 4 tag

Parameter

Mandatory

Type

Description

key

Yes

String

Tag key. A key can contain up to 36 Unicode characters. It cannot be left blank. A tag value cannot contain special characters (=*<>,|/) or start or end with spaces.

value

No

String

Tag value. A tag value contains a maximum of 43 Unicode characters and can be left blank. A tag value cannot contain special characters (=*<>,|/) or start or end with spaces.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

id

String

PTR record ID, which is in {region}:{floatingip_id} format

ptrdname

String

Domain name of the PTR record

description

String

PTR record description

ttl

Integer

PTR record caching duration (in seconds) on a local DNS server. The longer the duration is, the slower the update takes effect.

address

String

EIP

status

String

Resource status

action

String

Requested operation on the resource.Value options: CREATE, UPDATE, DELETE, NONE, CREATE, UPDATE, and DELETE****NONE: No operation will be performed.

links

pageLink object

Link of the current resource or other related resources. When a response is broken into pages, a next link is provided to retrieve all results.

enterprise_project_id

String

ID of the enterprise project associated with the PTR record. The value contains a maximum of 36 characters.

Example Requests

Creating a PTR record for an EIP and setting its TTL to 300 seconds

POST https://{endpoint}/v2/reverse/floatingips/{region}:{floatingip_id}

{
  "ptrdname" : "www.example.com",
  "description" : "Description for this PTR record",
  "ttl" : 300,
  "tags" : [ {
    "key" : "key1",
    "value" : "value1"
  } ]
}

Example Responses

Status code: 200

Response to the request for configuring the PTR record of an EIP

{
  "id" : "region_id:c5504932-bf23-4171-b655-b87a6bc59334",
  "ptrdname" : "www.example.com.",
  "description" : "Description for this PTR record",
  "address" : "10.154.52.138",
  "action" : "CREATE",
  "ttl" : 300,
  "status" : "PENDING_CREATE",
  "links" : {
    "self" : "https://Endpoint/v2/reverse/floatingips/region_id:c5504932-bf23-4171-b655-b87a6bc59334"
  },
  "enterprise_project_id" : 0
}

Status Codes

Status Code

Description

200

Response to the request for configuring the PTR record of an EIP

Error Codes

See Error Codes.