• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Keystone
  5. Permission Management
  6. Querying User Groups Associated with an Enterprise Project

Querying User Groups Associated with an Enterprise Project

Function Description

This interface is used to query the user groups associated with the enterprise project of a specified ID.

URI

  • URI format

    GET /v3.0/OS-PAP/enterprise-projects/{enterprise_project_id}/groups

  • URI parameter description

    Parameter

    Mandatory

    Type

    Description

    enterprise_project_id

    Yes

    String

    ID of the enterprise project for querying associated user groups.

Request

  • Request header parameter description

    Parameter

    Mandatory

    Type

    Description

    X-Auth-Token

    Yes

    String

    Authenticated token with the Security Administrator permission.

  • Sample request
    curl -i -k -H "X-Auth-Token:$token" -H 'Content-Type:application/json;charset=utf8' -X GET https://10.22.44.158:31943/v3.0/OS-PAP/enterprise-projects/535fb147-6148-4c71-a679-b79a2cb0ee5d/groups

Response

  • Response body parameter description

    Parameter

    Mandatory

    Type

    Description

    groups

    Yes

    Array

    Details about the user groups associated with the specified enterprise project.

  • groups parameter description

    Parameter

    Mandatory

    Type

    Description

    group_id

    Yes

    String

    ID of a user group.

    group_name

    Yes

    String

    Name of the user group.

    group_desc

    Yes

    String

    Description of the user group.

    user_num

    Yes

    Int

    Number of users contained in the user group.

    policy_num

    Yes

    Int

    Number of policies that have been configured for the user group.

    created_at

    Yes

    Int

    Time when the user group is created. The value is a Unix timestamp in millisecond.

  • Example response: Querying an enterprise project with associated user groups
    {
        "groups": [
            {
                "group_id": "758b99fa1fa24ec4a297d44e092bd123",
                "group_name": "Test",
                "group_desc": "Test",
                "user_num": 4,
                "policy_num": 1,
                "created_at": 1549088526000
            }
        ]
    }
  • If an enterprise project without any associated user groups is queried, the response body is empty.

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.