MENU
      Get role list

        Get role list


        Article summary

        Available in Classic and VPC

        Get the list of roles.

        Request

        This section describes the request format. The method and URI are as follows:

        MethodURI
        GET/api/v1/roles

        Request headers

        For information about the headers common to all Sub Account APIs, see Sub Account request headers.

        Request query parameters

        You can use the following query parameters with your request:

        FieldTypeRequiredDescription
        pageIntegerOptionalPage number
        • 0-N (default: 0)
        sizeIntegerOptionalPage output count
        • 1-N (default: 10)
        searchColumnStringOptionalSearch column
        • roleName | roleType | nrn
          • roleName: role name
          • roleType: role type
          • nrn: NAVER Cloud Platform resource identification value for role
        searchWordStringOptionalSearch keyword

        Request example

        The request example is as follows:

        curl --location --request GET 'https://subaccount.apigw.ntruss.com/api/v1/roles?page=0&size=10' \
        --header 'x-ncp-apigw-timestamp: {Timestamp}' \
        --header 'x-ncp-iam-access-key: {Access Key}' \
        --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
        --header 'Accept: application/json'
        Shell

        Response

        This section describes the response format.

        Response body

        The response body includes the following data:

        FieldTypeRequiredDescription
        pageInteger-Page number
        totalPagesInteger-Total number of pages
        totalItemsInteger-Number of response results
        hasPreviousBoolean-Whether previous page exists
        • true | false
          • true: It exists
          • false: It doesn't exist
        hasNextBoolean-Whether next page exists
        • true | false
          • true: It exists
          • false: It doesn't exist
        itemsArray-Role list
        isFirstBoolean-Whether it is the first page
        • true | false
          • true: first page
          • false: not a first page
        isLastBoolean-Whether it is the last page
        • true | false
          • true: last page
          • false: not a last page

        items

        The following describes items.

        FieldTypeRequiredDescription
        nrnString-NAVER Cloud Platform resource identification value for role
        roleNoString-Role ID
        roleNameString-Role name
        roleTypeString-Role type
        • Server | Account | Service
          • Server: It is assigned to the server resource in the VPC environment. You can access services and resources without an access key
          • Account: Assign portal and console access permissions for the main account to the sub account. Role switching allows access to the target account's resources
          • Service: It is assigned to the service. You can access resources of other services
        sessionExpirationSecInteger-Session expiration time (second)
        • 600 | 1800 | 3600 | 10800
        descContString-Description of the role
        activeBoolean-Role status
        • true | false
          • true: enabled
          • false: disabled
        createTimeString-Role creation date and time
        • ISO 8601 format
        modifiedTimeString-Last modification date and time of the role
        • ISO 8601 format
        lastUseTimeString-Last usage date and time of the role
        • ISO 8601 format

        Response status codes

        For information about the HTTP status codes common to all Sub Account APIs, see Sub Account status codes.

        Response example

        The response example is as follows:

        {
          "page": 0,
          "totalPages": 1,
          "totalItems": 2,
          "hasPrevious": false,
          "hasNext": false,
          "items": [
            {
              "nrn": "nrn:PUB:IAM::5*****8:Role/76a744f0-****-****-****-246e966ebeb4",
              "roleNo": "76a744f0-****-****-****-246e966ebeb4",
              "roleName": "service1",
              "roleType": "Service",
              "descCont": "",
              "active": true,
              "createTime": "2024-12-23T02:41:51Z",
              "modifiedTime": "2024-12-24T02:25:16Z",
              "lastUseTime": "2025-01-02T01:26:02Z"
            },
            {
              "nrn": "nrn:PUB:IAM::5*****8:Role/6e1de560-****-****-****-246e966ebec4",
              "roleNo": "6e1de560-****-****-****-246e966ebec4",
              "roleName": "NcloudStorageManagementRole",
              "roleType": "NcloudStorage",
              "active": true,
              "createTime": "2024-11-07T05:23:32Z",
              "modifiedTime": "2024-11-07T05:23:32Z"
            }
          ],
          "isFirst": true,
          "isLast": true
        }
        JSON

        Was this article helpful?

        Changing your password will log you out immediately. Use the new password to log back in.
        First name must have atleast 2 characters. Numbers and special characters are not allowed.
        Last name must have atleast 1 characters. Numbers and special characters are not allowed.
        Enter a valid email
        Enter a valid password
        Your profile has been successfully updated.