--- title: "Role Data" slug: "compute-vmetadata-roledata" updated: 2026-09-17T10:05:57Z published: 2026-09-17T10:05:57Z canonical: "api.ncloud-docs.com/compute-vmetadata-roledata" --- > ## Documentation Index > Fetch the complete documentation index at: https://api.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # Role Data Available in VPC View information regarding the role assigned to a server instance. A role must be assigned to the server instance through Sub Account to use the query features related to roles. For more information about assigning roles, see [Manage role](https://guide.ncloud-docs.com/docs/en/subaccount-policy-role#%EC%97%AD%ED%95%A0%EA%B4%80%EB%A6%AC) in the Sub Account user guide. Role ID query and temporary access key issuance features are available in the ncloud-sdk and Object Storage CLI when no access key is set in both the environment variable and the configure file. Note For the list of ncloud-sdks by language and installation instructions, and for more information about using the Ncloud CLI and Object Storage CLI, see the following. - **ncloud-sdk** - [ncloud-sdk-js](https://github.com/NaverCloudPlatform/ncloud-sdk-js) - [ncloud-sdk-java](https://github.com/NaverCloudPlatform/ncloud-sdk-java) - [ncloud-sdk-go](https://github.com/NaverCloudPlatform/ncloud-sdk-go-v2) - [ncloud-sdk-python](https://github.com/NaverCloudPlatform/ncloud-sdk-python) - **Ncloud CLI** - [CLI User Guide](https://cli.ncloud-docs.com/docs/en/home) - **Object Storage CLI** - [Object Storage CLI User Guide](https://cli.ncloud-docs.com/docs/en/guide-objectstorage) ## Request The following describes the request format for the endpoint. The request format is as follows: | Call path | Description | | --- | --- | | /{version}/meta-data/iam/ | View the list of the role-related metadata items provided in the applicable version | | /{version}/meta-data/iam/info | View details of the role assigned to the server instance | | /{version}/meta-data/iam/security-credentials | View the ID of the role assigned to the server instance - No newline character (\n) at the end of the output result - It can be used internally by ncloud-sdk and Object Storage CLI to obtain role IDs | | /{version}/meta-data/iam/security-credentials/{roleId} | Issue a temporary access key (STS) for the role assigned to the server instance - The issued temporary access key gains permissions according to the policy set in the role - It is available in API, CLI, SDK, just like access keys for sub accounts - No newline character (\n) at the end of the output result - It can be used internally by ncloud-sdk and Object Storage CLI to obtain temporary access keys | ## Examples See below for an example. ### Metadata v1 The following is an example of Metadata v1. ``` # View item [root@test-server ~]# curl http://169.254.169.254/latest/meta-data/iam/ info security-credentials # View role details [root@test-server ~]# curl http://169.254.169.254/latest/meta-data/iam/info { "roleId" : "***-***-***-***-***ec4", "roleName" : "test-role", "roleType" : "Server", "createTime" : "2024-05-04T08:24:35Z" } # View role ID [root@test-server ~]# curl http://169.254.169.254/latest/meta-data/iam/security-credentials ***-***-***-***-***ec4[root@test-server ~]# # Issue temporary access key ID [root@test-server ~]# curl http://169.254.169.254/latest/meta-data/iam/security-credentials/***-***-***-***-***ec4 { "Type" : "NCP-HMAC", "AccessKeyId" : "s_***976", "SecretAccessKey" : "***6ab", "Expiration" : "2024-05-22T11:50:45Z", "Token" : "", "LastUpdated" : "2024-04-21T23:50:45Z", "Code" : "Success" }[root@test-server ~]# ``` ### Metadata v2 The following is an example of Metadata v2. The second and subsequent requests in the example use the token generated by the first request, assuming it hasn't expired. ``` # View item [root@test-server ~]# TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-NCP-METADATA-TOKEN-TTL-SECONDS: 21600"` \ && curl -H "X-NCP-METADATA-TOKEN: $TOKEN" http://169.254.169.254/latest/meta-data/iam/ info security-credentials # View role details [root@test-server ~]# curl -H "X-NCP-METADATA-TOKEN: $TOKEN" http://169.254.169.254/latest/meta-data/iam/info { "roleId" : "***-***-***-***-***ec4", "roleName" : "test-role", "roleType" : "Server", "createTime" : "2024-05-04T08:24:35Z" } # View role ID [root@test-server ~]# curl -H "X-NCP-METADATA-TOKEN: $TOKEN" http://169.254.169.254/latest/meta-data/iam/security-credentials ***-***-***-***-***ec4[root@test-server ~]# # Issue temporary access key ID [root@test-server ~]# curl -H "X-NCP-METADATA-TOKEN: $TOKEN" http://169.254.169.254/latest/meta-data/iam/security-credentials/***-***-***-***-***ec4 { "Type" : "NCP-HMAC", "AccessKeyId" : "s_***976", "SecretAccessKey" : "***6ab", "Expiration" : "2024-05-22T11:50:45Z", "Token" : "", "LastUpdated" : "2024-04-21T23:50:45Z", "Code" : "Success" }[root@test-server ~]# ```