• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Keystone
  5. Services and Endpoints
  6. Querying Services

Querying Services

Function Description

This interface is used to query the service list.

URI

  • URI format

    GET /v3/services{?type}

  • URI parameter description

    Parameter

    Mandatory

    Type

    Description

    type

    No

    String

    Type of a service Value range: computeec2identityimagenetwork, or volume.

Request

  • Request header parameter description

    Parameter

    Mandatory

    Type

    Description

    Content-Type

    Yes

    String

    Fill application/json;charset=utf8 in this field.

    X-Auth-Token

    Yes

    String

    An authenticated token.

  • Sample request
    curl -i -k -H 'Accept:application/json' -H 'Content-Type:application/json;charset=utf8' -H "X-Auth-Token:$token" -X GET https://172.30.48.86:31943/v3/services?type=compute

Response

  • Response body parameter description

    Parameter

    Mandatory

    Type

    Description

    links

    Yes

    Dict

    Service links, including nextprevious, and self.

    services

    Yes

    List

    A list of services.

  • Description for the services format

    Parameter

    Mandatory

    Type

    Description

    description

    No

    String

    Service description.

    enabled

    Yes

    Boolean

    Whether a service is available.

    id

    Yes

    String

    Service ID.

    name

    No

    String

    Service name.

    type

    Yes

    String

    Service type.

    links

    Yes

    Dict

    Service links.

  • Sample response (successful response)
    {
        "services": [
            {
                "name": "compute5",
                "links": {
                    "self": "https://iamcore_links.com/v3/services/053d21d488d1463c818132d9d08fb617"
                },
                "enabled": true,
                "type": "compute",
                "id": "053d21d488d1463c818132d9d08fb617",
                "description": "Compute service 5"
            },
            {
                "name": "compute3",
                "links": {
                    "self": "https://iamcore_links.com/v3/services/c2474183dca7453bbd73123a0b78feae"
                },
                "enabled": true,
                "type": "compute",
                "id": "c2474183dca7453bbd73123a0b78feae",
                "description": "Compute service 3"
            },
            {
                "name": "compute2",
                "links": {
                    "self": "https://iamcore_links.com/v3/services/c7166694ebdd4616bd927737f7b12ca2"
                },
                "enabled": true,
                "type": "compute",
                "id": "c7166694ebdd4616bd927737f7b12ca2",
                "description": "Compute service 2"
            }
        ],
        "links": {
            "self": "https://iamcore_links.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

You must enter a username and password to access the requested page.

403

You are forbidden to access the requested page.

404

The server could not find the requested page.

405

You are not allowed to use the method specified in the request.

413

The request entity is too large.

500

Failed to complete the request because of an internal service error.

503

Failed to complete the request because the service is unavailable.