• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Keystone
  5. Project Management
  6. Creating a Project

Creating a Project

Function Description

This interface is used to create a project.

URI

URI format

POST /v3/projects

Request

  • Request header parameter description

    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.

  • Request body parameter description

    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

    No

    String

    Parent project ID to which a project belongs.

    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.

  • Sample request
    curl -i -k -H "X-Auth-Token:$token" -H 'Content-Type:application/json;charset=utf8' -X POST –d '{"project":{"domain_id":"acf2ffabba974fae8f30378ffde2cfa6","name":"region_test1"}}' https://10.144.24.54:31943/v3/projects

Response

Sample response

{
    "project": {
        "is_domain": false,
        "description": "",
        "links": {
            "self": "10.10.10.10/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

You must enter a username and password to access the requested page.

403

You are forbidden to access the requested page.

409

Duplicate project name.