Help Center/ Cloud Service Engine/ API Reference/ Nacos API/ Creating the nacos Namespace
Updated on 2023-12-18 GMT+08:00

Creating the nacos Namespace

Function

This API is used to create the nacos namespace.

URI

POST /v1/{project_id}/nacos/v1/console/namespaces

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Unique ID of a tenant's sub-project. The value contains 1 to 64 characters.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

custom_namespace_id

Yes

String

Namespace ID. The value can contain a maximum of 128 characters, including uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_).

namespace_name

Yes

String

Namespace name. The value can contain a maximum of 128 characters, excluding @, #, $, %, ^, &, and *.

namespace_desc

No

String

Namespace description. The value can contain a maximum of 256 characters.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

IAM-Token.

x-engine-id

Yes

String

Instance ID of an exclusive microservice engine.

X-Enterprise-Project-ID

Yes

String

Enterprise project ID.

Response Parameters

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

detail

String

Location details.

Example Requests

POST https://{endpoint}/v1/{project_id}/nacos/v1/console/namespaces

Example Responses

None

Status Codes

Status Code

Description

200

OK

400

Bad Request

Error Codes

See CSE Error Codes.