• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Keystone
  5. User Management
  6. Querying the User Group to Which a User Belongs

Querying the User Group to Which a User Belongs

Function Description

This interface is used to query the information about the user group to which a specified user belongs.

URI

  • URI format

    GET /v3/users/{user_id}/groups

  • URI parameter description

    Parameter

    Mandatory

    Type

    Description

    user_id

    Yes

    String

    User ID.

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

    Authenticated token with the Security Administrator permission or authenticated token of the user.

  • 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/users/43cbe5e77aaf4665bbb962062dc1fc9d/groups

Response

  • Response body parameter description

    Parameter

    Mandatory

    Type

    Description

    groups

    Yes

    JSONArray

    List of a user group.

    links

    Yes

    JSONObject

    Resource links of a user group.

  • Description for the group format

    Parameter

    Mandatory

    Type

    Description

    description

    Yes

    String

    Description for a user group.

    id

    Yes

    String

    User group ID.

    domain_id

    Yes

    String

    ID of the domain where a user group is located.

    name

    Yes

    String

    User group name.

    links

    Yes

    JSONObject

    Resource links of a user group.

    create_time

    Yes

    Long

    Time when a user group is created.

  • Sample response
    {
        "links": {
            "self": "https://sample.domain.com/v3/users/f7cb4876e5174c0885433e280e831c43/groups",
            "previous": null,
            "next": null
        },
        "groups": [{
            "description": "User group that has the permission for all system operations",
            "links": {
                "self": "https://sample.domain.com/v3/groups/e21c7a1e415c4604927948dc24750716"
            },
            "id": "e21c7a1e415c4604927948dc24750716",
            "create_time": 1472888495993,
            "domain_id": "88b16b6440684467b8825d7d96e154d8",
            "name": "admin"
        }]
    }

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.