IAM
Common Guides
API Reference
- Users
- Roles
- Groups
- Policies
Get Role
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
username: "",
password: "",
},
});
async function run() {
const result = await stackOne.iam.getRole({
id: "<id>",
fields: "id,remote_id,name,type,policies,description,created_at,updated_at",
expand: "policies",
xAccountId: "<id>",
});
// Handle the result
console.log(result);
}
run();
{
"data": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "<string>",
"description": "<string>",
"type": {
"value": "admin",
"source_value": "<string>"
},
"policies": [
{
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Remote Contractor Policy",
"permissions": [
{
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "read:users",
"type": {
"value": "read_write",
"source_value": "<string>"
},
"resources": [
{
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Company History Records",
"location": "s3://bucket-name/folder-name",
"type": {
"value": "file",
"source_value": "<string>"
},
"description": "<string>",
"created_at": "2021-01-01T01:01:01.000Z",
"updated_at": "2021-01-01T01:01:01.000Z"
}
],
"description": "<string>",
"created_at": "2021-01-01T01:01:01.000Z",
"updated_at": "2021-01-01T01:01:01.000Z"
}
],
"description": "<string>",
"created_at": "2021-01-01T01:01:01.000Z",
"updated_at": "2021-01-01T01:01:01.000Z"
}
],
"created_at": "2021-01-01T01:01:01.000Z",
"updated_at": "2021-01-01T01:01:01.000Z"
},
"raw": [
{
"method": "<string>",
"url": "<string>",
"body": "<string>",
"response": {}
}
]
}
Authorizations
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Headers
The account identifier
Path Parameters
Query Parameters
Indicates that the raw request result is returned
Query parameters that can be used to pass through parameters to the underlying provider request by surrounding them with 'proxy' key
The comma separated list of fields that will be returned in the response (if empty, all fields are returned)
The comma separated list of fields that will be expanded in the response
Response
Unique identifier
"8187e5da-dc77-475e-9949-af0f1fa4e4e3"
Provider's unique identifier
"8187e5da-dc77-475e-9949-af0f1fa4e4e3"
The set of policies associated with the role.
Unique identifier
"8187e5da-dc77-475e-9949-af0f1fa4e4e3"
Provider's unique identifier
"8187e5da-dc77-475e-9949-af0f1fa4e4e3"
The name of the policy.
"Remote Contractor Policy"
The set of permissions associated with the policy.
Unique identifier
"8187e5da-dc77-475e-9949-af0f1fa4e4e3"
Provider's unique identifier
"8187e5da-dc77-475e-9949-af0f1fa4e4e3"
The name of the permission.
"read:users"
The resources that the permission applies to.
Unique identifier
"8187e5da-dc77-475e-9949-af0f1fa4e4e3"
Provider's unique identifier
"8187e5da-dc77-475e-9949-af0f1fa4e4e3"
The name of the resource.
"Company History Records"
The location of the resource.
"s3://bucket-name/folder-name"
"2021-01-01T01:01:01.000Z"
"2021-01-01T01:01:01.000Z"
"2021-01-01T01:01:01.000Z"
"2021-01-01T01:01:01.000Z"
"2021-01-01T01:01:01.000Z"
"2021-01-01T01:01:01.000Z"
"2021-01-01T01:01:01.000Z"
"2021-01-01T01:01:01.000Z"
Was this page helpful?
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
username: "",
password: "",
},
});
async function run() {
const result = await stackOne.iam.getRole({
id: "<id>",
fields: "id,remote_id,name,type,policies,description,created_at,updated_at",
expand: "policies",
xAccountId: "<id>",
});
// Handle the result
console.log(result);
}
run();
{
"data": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "<string>",
"description": "<string>",
"type": {
"value": "admin",
"source_value": "<string>"
},
"policies": [
{
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Remote Contractor Policy",
"permissions": [
{
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "read:users",
"type": {
"value": "read_write",
"source_value": "<string>"
},
"resources": [
{
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Company History Records",
"location": "s3://bucket-name/folder-name",
"type": {
"value": "file",
"source_value": "<string>"
},
"description": "<string>",
"created_at": "2021-01-01T01:01:01.000Z",
"updated_at": "2021-01-01T01:01:01.000Z"
}
],
"description": "<string>",
"created_at": "2021-01-01T01:01:01.000Z",
"updated_at": "2021-01-01T01:01:01.000Z"
}
],
"description": "<string>",
"created_at": "2021-01-01T01:01:01.000Z",
"updated_at": "2021-01-01T01:01:01.000Z"
}
],
"created_at": "2021-01-01T01:01:01.000Z",
"updated_at": "2021-01-01T01:01:01.000Z"
},
"raw": [
{
"method": "<string>",
"url": "<string>",
"body": "<string>",
"response": {}
}
]
}