Reviewed-by: Belejkanic, Lukas <lukas.belejkanic@t-systems.com> Co-authored-by: weihongmin1 <weihongmin1@huawei.com> Co-committed-by: weihongmin1 <weihongmin1@huawei.com>
27 KiB
Querying a User Project List
Function
This API is used to query the project list of a specified user.
URI
- URI parameters
Parameter
Mandatory
Type
Description
user_id
Yes
String
User ID.
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 or token of the user.
- Example request
curl -i -k -H 'Accept:application/json' -H 'Content-Type:application/json;charset=utf8' -H "X-Auth-Token:$token" -X GET https://sample.domain.com/v3/users/43cbe5e77aaf4665bbb962062dc1fc9d/projects
Response Parameters
- Parameters in the response body
- projects
Parameter
Type
Description
description
String
Project description.
id
String
Project ID.
domain_id
String
ID of the domain where a project is located.
name
String
Project name.
Object
Project resource link.
is_domain
Boolean
Indicates whether the user calling the API is a tenant.
enabled
Boolean
Whether a project is available.
parent_id
String
Parent ID of the project.
- links
Parameter
Type
Description
self
String
Resource link.
previous
String
Previous resource link. If the previous resource link is unavailable, this parameter is set to null.
next
String
Next resource link. If the next resource link is unavailable, this parameter is set to null.
- projects.links
Parameter
Type
Description
self
String
Resource link.
previous
String
Previous resource link. If the previous resource link is unavailable, this parameter is set to null.
next
String
Next resource link. If the next resource link is unavailable, this parameter is set to null.
- Example response
{ "links": { "self": "https://sample.domain.com/v3/auth/projects", "previous": null, "next": null }, "projects": [ { "is_domain": false, "description": "", "links": { "self": "https://sample.domain.com/v3/projects/9041929bcc6e4bfe85add4e7b96ffdd7" }, "enabled": true, "id": "9041929bcc6e4bfe85add4e7b96ffdd7", "parent_id": "398998b5392f4150ad48fe456d6de4f1", "domain_id": "398998b5392f4150ad48fe456d6de4f1", "name": "region_name" }, { "is_domain": false, "description": "", "links": { "self": "https://sample.domain.com/v3/projects/ee65ca70d3cf43aaa1ea6492ce15f289" }, "enabled": true, "id": "ee65ca70d3cf43aaa1ea6492ce15f289", "parent_id": "398998b5392f4150ad48fe456d6de4f1", "domain_id": "398998b5392f4150ad48fe456d6de4f1", "name": "MOS" //Default project name of OBS } ] }
Status Codes
Status Code |
Description |
|---|---|
200 |
The request is successful. |
400 |
The server failed to process the request. |
401 |
Authentication failed. |
403 |
Access denied. |
404 |
The requested resource cannot be found. |
405 |
The method specified in the request is not allowed for the requested resource. |
413 |
The request entity is too large. |
500 |
Internal server error. |
503 |
Service unavailable. |