Updated on 2023-11-23 GMT+08:00

Creating an Endpoint

Function

This API is used to create an endpoint.

URI

POST /v2/{project_id}/routemgr/endpoints

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Request

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format).

The default value application/json is recommended.

X-Auth-Token

Yes

String

User token. The token 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 the user token.

Table 3 Parameters in the request body

Parameter

Mandatory

Type

Description

endpoint

No

Endpoint object

Endpoint details.

Table 4 Endpoint

Parameter

Mandatory

Type

Description

description

No

String

Endpoint description. The value contains a maximum of 255 characters. The following characters are not allowed: ^~#$%&*<>()[]{}'"\

ief_instance_id

No

String

Platinum edition instance ID. This parameter is left blank for a professional edition instance.

name

Yes

String

Endpoint name. The value contains a maximum of 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

The endpoint name must be unique in the account.

properties

Yes

Map<String,Object>

Endpoint properties to be displayed. Example:

  • dis:
    {"domain_id":"user's domain id"}
  • servicebus:
    {"service_port":8080}
  • apigw:
    {"domain_id":"user's domain id"}

type

Yes

String

Endpoint type.

The options are as follows:

  • dis
  • servicebus
  • apigw

Response

When the status code is 201, the response parameters are as follows.

Table 5 Parameters in the response body

Parameter

Type

Description

endpoint

EndpointResponse object

Endpoint details.

Table 6 EndpointResponse

Parameter

Type

Description

created_at

String

Creation time.

description

String

Endpoint description. The value contains a maximum of 255 characters. The following characters are not allowed: ^~#$%&*<>()[]{}'"\

id

String

Endpoint ID.

ief_instance_id

String

Platinum edition instance ID. This parameter is left blank for a professional edition instance.

is_shared

Boolean

Whether the endpoint is shared.

name

String

Endpoint name. The value contains a maximum of 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

The endpoint name must be unique in the account.

project_id

String

Project ID.

properties

Map<String,Object>

Endpoint properties to be displayed. Example:

  • dis:
    {"domain_id":"user's domain id"}
  • servicebus:
    {"service_port":8080}
  • apigw:
    {"domain_id":"user's domain id"}

type

String

Endpoint type.

The options are as follows:

  • dis
  • servicebus
  • apigw

updated_at

String

Update time.

When the status code is 400, the response parameters are as follows:

Table 7 Parameters in the response body

Parameter

Type

Description

error_code

String

Error code.

error_message

String

Error message.

When the status code is 401, the response parameters are as follows.

Table 8 Parameters in the response body

Parameter

Type

Description

error_code

String

Error code.

error_message

String

Error message.

When the status code is 500, the response parameters are as follows:

Table 9 Parameters in the response body

Parameter

Type

Description

error_code

String

Error code.

error_message

String

Error message.

Example Request

{
  "endpoint" : {
    "name" : "dis_example",
    "type" : "dis",
    "properties" : {
      "domain_id" : "8fd3691d01f44badab03e28d81abd4ff"
    }
  }
}

Example Response

None

Status Codes

Status Code

Description

201

Creation succeeded.

400

Error response.

401

Error response.

500

Error response.

Error Codes

For details, see Error Codes.