2.9. Updating projects

PATCH /v3/projects/{project_id}

Change the name and description of a project with the specified ID. You can also use this call to add and remove users in a project.

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

2.9.1. Request

2.9.1.1. Parameters

Name In Type Description
project_id path string The project ID.
project body object A project object
name (Optional) 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 new domain for the project. The ability to change the domain of a project is now deprecated, and will be removed in subequent release. It is already disabled by default in most Identity service implementations.
enabled (Optional) body boolean If set to true, project is enabled. If set to false, project is disabled.
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.9.1.2. Examples

Change project name and description:

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

Add a user with the specified ID to a project with the role project_user also specified by its ID:

# curl -ks -X PUT -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://<node_IP_addr>:5000/v3/projects/03013ec787054e78ae26806636ad18d9/\
users/2973892bee384ca6b8c9886f0c4a8815/roles/b05bd85e514a4abdbb46ee743f0d59a4

Remove a user with the specified ID and the role project_user from a project:

# curl -ks -X DELETE -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://<node_IP_addr>:5000/v3/projects/03013ec787054e78ae26806636ad18d9/\
users/2973892bee384ca6b8c9886f0c4a8815/roles/b05bd85e514a4abdbb46ee743f0d59a4

2.9.2. Response

2.9.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.
name body string The name of the project.
links body object The link to the resources in question.
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.9.2.2. Status codes

2.9.2.2.1. Success

Code Reason
200 - OK Request was successful.

2.9.2.2.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.
404 - Not Found The requested resource could not be found.
409 - Conflict This operation conflicted with another operation on this resource.

2.9.2.3. Example

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