Jump to: navigation, search

Difference between revisions of "HierarchicalMultitenancy API"

(Hierarchical Multitenancy API)
(5. Delete a project)
Line 76: Line 76:
 
'''DELETE - /v3/projects/{project_id}'''
 
'''DELETE - /v3/projects/{project_id}'''
  
* - These arguments were discussed in spec. https://review.openstack.org/#/c/101017/
+
 
 +
 
 +
* These arguments were discussed in spec. https://review.openstack.org/#/c/101017/

Revision as of 13:26, 25 July 2014

Hierarchical Multitenancy API

Guide how to use the API using hierarchical projects

1. Create a new project

Insert and update projects into the tree are not planned for the initial release.*

As of the first release we should have a configuration option allowing to restrict the depth of the tree with a reasonable default of 5.*

POST - /v3/projects

{
  "project": {
       "description": "test_project",
       "domain_id": "default",
       "parent_project_id": "$parent_project_id",
       "enabled": true,
       "name": "test_project"
   }
}

2. Give an user a role in the project

3. Get a token for "test_project" and check that the hierarchy is there like the following

POST v3/auth/tokens

{
   "token": {
       "methods": [
           "password"
       ],
       "roles": [
           {
               "id": "c60f0d7461354749ae8ac8bace3e35c5",
               "name": "admin"
           }
       ],
       "expires_at": "2014-02-18T15:52:03.499433Z",
       "project": {
           "hierarchical_ids": "openstack.8a4ebcf44ebc47e0b98d3d5780c1f71a.de2a7135b01344cd82a02117c005ce47",
           "hierarchy": "test1",
           "domain": {
               "id": "default",
               "name": "Default"
           },
           "id": "de2a7135b01344cd82a02117c005ce47",
           "name": "test1"
       },
       "extras": {},
       "user": {
           "domain": {
               "id": "default",
               "name": "Default"
           },
           "id": "895864161f1e4beaae42d9392ec105c8",
           "name": "admin"
       },
       "issued_at": "2014-02-18T14:52:03.499478Z"
   }
}

4. Update a project

PATCH - /v3/projects/{project_id}

{
   "project": {
       "description": "Project space for Build Group",
       "name": "Build Group"
   }
}

5. Delete a project

The first version will support a non-recursive delete function which will fail with "in use" or similar if the project to be deleted has children.*

DELETE - /v3/projects/{project_id}