2.7. Creating projects

POST /v3/projects

Create a project with the specified name.

Source: https://docs.openstack.org/api-ref/identity/v3/index.html?expanded=#create-project

2.7.1. Request

2.7.1.1. Parameters

Name In Type Description
project body object A project object
name body string The name of the project, which must be unique within the owning domain. A project can have the same name as its domain.
is_domain (Optional) body boolean

Indicates whether the project also acts as a domain. If set to true, this project acts as both a project and domain. As a domain, the project provides a name space in which you can create users, groups, and other projects. If set to false, this project behaves as a regular project that contains only resources. Default is false. You cannot update this parameter after you create the project.

New in version 3.6

description (Optional) body string The description of the project.
domain_id (Optional) body string

The ID of the domain for the project.

For projects acting as a domain, the domain_id must not be specified, it will be generated by the Identity service implementation.

For regular projects (i.e. those not acing as a domain), if domain_id is not specified, but parent_id is specified, then the domain ID of the parent will be used. If neither domain_id or parent_id is specified, the Identity service implementation will default to the domain to which the client’s token is scoped. If both domain_id and parent_id are specified, and they do not indicate the same domain, an Bad Request (400) will be returned.

enabled (Optional) body boolean If set to true, project is enabled. If set to false, project is disabled. The default is true.
parent_id (Optional) body string

The ID of the parent of the project.

If specified on project creation, this places the project within a hierarchy and implicitly defines the owning domain, which will be the same domain as the parent specified. If parent_id is not specified and is_domain is false, then the project will use its owning domain as its parent. If is_domain is true (i.e. the project is acting as a domain), then parent_id must not specified (or if it is, it must be null) since domains have no parents.

parent_id is immutable, and can’t be updated after the project is created - hence a project cannot be moved within the hierarchy.

New in version 3.4

tags (Optional) body array A list of simple strings assigned to a project. Tags can be used to classify projects into groups.
options (Optional) body object The resource options for the project. Available resource options are immutable.

2.7.1.2. Example

# curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' -d '
{
    "project": {
        "description": "Project description",
        "domain_id": "f2eeaaf15c254d4fa10255796122c8ec",
        "name": "project1"
    }
}' https://<node_IP_addr>:5000/v3/projects

2.7.2. Response

2.7.2.1. Parameters

Name In Type Description
project body object A project object
is_domain body boolean

Indicates whether the project also acts as a domain. If set to true, this project acts as both a project and domain. As a domain, the project provides a name space in which you can create users, groups, and other projects. If set to false, this project behaves as a regular project that contains only resources.

New in version 3.6

description body string The description of the project.
domain_id body string The ID of the domain for the project.
enabled body boolean If set to true, project is enabled. If set to false, project is disabled.
id body string The ID for the project.
links body object The link to the resources in question.
name body string The name of the project.
parent_id body string

The ID of the parent for the project.

New in version 3.4

options body object The resource options for the project. Available resource options are immutable.

2.7.3. Status codes

2.7.3.1. Success

Code Reason
201 - Created Resource was created and is ready to use.

2.7.3.2. Error

Code Reason
400 - Bad Request Some content in the request was invalid.
401 - Unauthorized User must authenticate before making a request.
403 - Forbidden Policy does not allow current user to do this operation.
409 - Conflict This operation conflicted with another operation on this resource.

2.7.3.3. Example

{
  "project": {
    "is_domain": false,
    "description": "Project description",
    "links": {
      "self": "https://<node_IP_addr>:5000/v3/projects/ec35eb7ceb594ad696839fc867817e4c"
    },
    "tags": [],
    "enabled": true,
    "id": "ec35eb7ceb594ad696839fc867817e4c",
    "parent_id": "f2eeaaf15c254d4fa10255796122c8ec",
    "domain_id": "f2eeaaf15c254d4fa10255796122c8ec",
    "name": "project1"
  }
}