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 Services
Function
This API is used to query the service list.
URI
- URI parameters
Parameter
Mandatory
Type
Description
type
No
String
Service type.
The value can be compute, ec2, identity, image, network, or volume.
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.
- 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/services?type=compute
Response Parameters
- Parameters in the response body
- services
Parameter
Type
Description
description
String
Service description.
enabled
Boolean
Whether a service is available.
id
String
Service ID.
name
String
Service name.
type
String
Service type.
Object
Service resource link.
-
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.
-
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 (successful response)
{ "services": [ { "name": "compute5", "links": { "self": "https://sample.domain.com/v3/services/053d21d488d1463c818132d9d08fb617" }, "enabled": true, "type": "compute", "id": "053d21d488d1463c818132d9d08fb617", "description": "Compute service 5" }, { "name": "compute3", "links": { "self": "https://sample.domain.com/v3/services/c2474183dca7453bbd73123a0b78feae" }, "enabled": true, "type": "compute", "id": "c2474183dca7453bbd73123a0b78feae", "description": "Compute service 3" }, { "name": "compute2", "links": { "self": "https://sample.domain.com/v3/services/c7166694ebdd4616bd927737f7b12ca2" }, "enabled": true, "type": "compute", "id": "c7166694ebdd4616bd927737f7b12ca2", "description": "Compute service 2" } ], "links": { "self": "https://sample.domain.com/v3/services?type=compute", "previous": null, "next": null } }
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. |