Reviewed-by: Belejkanic, Lukas <lukas.belejkanic@t-systems.com> Co-authored-by: weihongmin1 <weihongmin1@huawei.com> Co-committed-by: weihongmin1 <weihongmin1@huawei.com>
23 KiB
Creating a Project
Function
This API is used to create a project.
URI
POST /v3/projects
Request Parameters
- Parameters in the request header
Parameter
Mandatory
Type
Description
Content-Type
Yes
String
Fill application/json;charset=utf8 in this field.
X-Auth-Token
Yes
String
Authenticated token with the Security Administrator permission.
- Parameters in the request body
Parameter
Mandatory
Type
Description
Yes
Object
Project information.
- project
Parameter
Mandatory
Type
Description
name
Yes
String
Project name, which must start with "ID of an existing region_" and be less than or equal to 64 characters.
Example: {region_id}_test1
parent_id
Yes
String
Parent project ID which a project belongs to.
domain_id
No
String
ID of the domain that a project belongs to.
description
No
String
Project description, which can contain a maximum of 255 characters.
- Example request
curl -i -k -H "X-Auth-Token:$token" -H 'Content-Type:application/json;charset=utf8' -X POST -d '{"project":{"domain_id":"acf2ffabba974fae8f30378ffde2c...","name":"region_test1"}}' https://sample.domain.com/v3/projects
Response Parameters
- Parameters in the response body
Parameter
Type
Description
Object
Project information.
- project
Parameter
Type
Description
is_domain
Boolean
false.
description
String
Description of the project.
Object
Project resource link.
enabled
Boolean
Whether a project is available.
id
String
Project ID.
parent_id
String
Project ID corresponding to the region.
domain_id
String
Account ID of the project.
name
String
Project name.
- project.links
Parameter
Type
Description
self
String
Resource link.
Example response
{
"project": {
"is_domain": false,
"description": "",
"links": {
"self": "https://sample.domain.com/v3/projects/3de1461665f045ef91ba1efe8121b979"
},
"enabled": true,
"id": "3de1461665f045ef91ba1efe8121b979",
"parent_id": "d1294857fdf64251994892b344f53e88",
"domain_id": "d1294857fdf64251994892b344f53e88",
"name": "region_test1"
}
}
Status Codes
Status Code |
Description |
|---|---|
201 |
The request is successful. |
400 |
The server failed to process the request. |
401 |
Authentication failed. |
403 |
Access denied. |
409 |
Duplicate project name. |