• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Keystone
  5. Project
  6. Querying Project Information Based on the Specified Criteria

Querying Project Information Based on the Specified Criteria

Function Description

This interface is used to query project information based on the specified criteria. This interface applies only to domain names in the Global zone.

URI

  • URI format

    GET /v3/projects{?domain_id,name,enabled,parent_id,is_domain,page,per_page}

  • URI parameter description

    Parameter

    Mandatory

    Type

    Description

    domain_id

    No

    String

    ID of an enterprise account to which a user belongs.

    name

    No

    String

    Project name.

    parent_id

    No

    String

    Parent ID of the project.

    enabled

    No

    Boolean

    Whether a project is available.

    is_domain

    No

    Boolean

    Is domain or not.

    page

    No

    Integer

    The page to be queried. The minimum value is 1.

    per_page

    No

    Integer

    Number of data records on each page.

    Value range: [1,5000]

    NOTE:
    • This interface requires at least one query criterion. You cannot query all projects.
    • When querying required information by page, ensure that the query parameters page and per_page both exist.

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

    Valid token of a user with the op_service permission, or token of the domain whose project information is to be queried.

  • Sample request
    curl -i -k -H 'Accept:application/json' -H 'Content-Type:application/json;charset=utf8' -X "X-Auth-Token:$token" -X GET https://10.145.93.56:31943/v3/projects?domain_id=5c9f5525d9d24c5bbf91e74d86772029&name=region_name

Response

  • Response body parameter description

    Parameter

    Mandatory

    Type

    Description

    projects

    Yes

    List

    List of projects.

  • Description for the projects format

    Parameter

    Mandatory

    Type

    Description

    description

    Yes

    String

    Project description.

    enabled

    Yes

    Boolean

    Whether a project is available.

    id

    Yes

    String

    Project ID.

    domain_id

    Yes

    String

    ID of the domain where a project is located.

    name

    Yes

    String

    Project name.

    is_domain

    Yes

    Boolean

    Is domain or not.

    enabled

    Yes

    Boolean

    Whether a project is available.

    parent_id

    Yes

    String

    Parent ID of the project.

  • Sample response
    {
      "links": {
        "self": "www.example.com/v3/projects?domain_id=c9f5525d9d24c5bbf91e74d86772029&name=region_name",
        "previous": null,
        "next": null
      },
      "projects": [
        {
          "is_domain": false,
          "description": "",
          "links": {
            "self": "www.example.com/v3/projects/e86737682ab64b2490c48f08bcc41914"
          },
          "enabled": true,
          "id": "e86737682ab64b2490c48f08bcc41914",
          "parent_id": "c9f5525d9d24c5bbf91e74d86772029",
          "domain_id": "c9f5525d9d24c5bbf91e74d86772029",
          "name": "region_name"
        }
      ]
    }

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.

500

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

503

Failed to complete the request because the service is unavailable.