...
The definition of namespace names supported by this API is described under Names and Characters for Namespace Identifiers.
All methods or endpoints described in this API have a base URL (typically http://<host>:11015
or https://<host>:10443
) that precedes the resource identifier, as described in the Microservices Conventions. These methods return a status code, as listed in the Microservices Status Codes.
...
Code Block |
---|
PUT /v3/namespaces/<namespace-id> |
Parameter | Description |
---|---|
| Namespace ID |
The namespace-id
must be of the limited character set for namespaces, as described in the Introduction. Properties for the namespace are passed in the JSON request body:
Parameter | Description | Default Value (if not defined) |
---|---|---|
| Display description of the namespace | An empty string ( |
| Configuration preferences for the namespace | A JSON string of configuration key-value pairs |
If a namespace with the same name already exists, the method will still return 200 OK
, but with a message that the Namespace '<namespace-id>' already exists
.
HTTP Responses
Status Codes | Description |
---|---|
| The event successfully called the method, and the namespace was created |
List Existing Namespaces
To list all of the existing namespaces, issue an HTTP GET request:
...
Code Block |
---|
{"name":"default","description":"Default Namespace","config":{"scheduler.queue.name":""}} |
Parameter | Description |
---|---|
| Namespace ID |
HTTP Responses
Status Codes | Description |
---|---|
| The event successfully called the method, and the body contains the results |
Editing a Namespace
To edit an existing namespace, submit an HTTP PUT request to:
Code Block |
---|
PUT /v3/namespaces/<namespace-id>/properties |
Parameter | Description |
---|---|
| Namespace ID |
The namespace-id
must be the name of an existing namespace. Properties for the namespace are passed in the JSON request body, as described for when you Create a Namespace.
Property | Description |
---|---|
| Display description of the namespace |
| Configuration properties, with a JSON map of key-value pairs. |
HTTP Responses
Status Codes | Description |
---|---|
| Namespace properties were changed successfully |
| The request was not created correctly |
| The Namespace does not exist |
Example
HTTP Method |
| ||
---|---|---|---|
Description | Set the description property of the Namespace named dev, and set the scheduler.queue.name to A. |
Deleting a Namespace
To delete an existing namespace (including all pipelines, applications, datasets, metrics, and other components), submit an HTTP DELETE request to:
Code Block |
---|
DELETE /v3/unrecoverable/namespaces/<namespace-id> |
Parameter | Description |
---|---|
| Namespace ID |
To prevent accidental use of this method, it will only work if the cdap-site.xml
parameter enable.unrecoverable.reset
has been enabled. This method must be exercised with extreme caution, as there is no recovery from it.
...
When creating or editing a namespace, namespace configurations can be supplied as part of the request body. These are in the form of a JSON string of configuration key-value pairs. Note that the values for these keys cannot be modified once the namespace has been created, with the exception of the property scheduler.queue.name
.
Namespace Configurations
Configuration Name | Description |
---|---|
| The pre-existing HBase namespace to be used for the namespace (CDAP Distributed mode only) |
hive.database
The pre-existing Hive database to be used for the namespace
| The URI of the Kerberos keytab file for the namespace |
| The Kerberos principal for the namespace |
| The group name for the namespace. If present, the namespace's data directory is created with this group name, and read, write, and execute permissions are given to the group. The namespace principal must be a member of this group. |
| The pre-existing file-system directory to be used for the namespace |
| Scheduler queue for CDAP programs and CDAP explore queries run in the namespace. See Scheduler queue for details. |