const apiInstance = new Fastly.IamRolesApi();
Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
addRolePermissions | POST /roles/{role_id}/permissions | Add permissions to a role |
createARole | POST /roles | Create a role |
deleteARole | DELETE /roles/{role_id} | Delete a role |
getARole | GET /roles/{role_id} | Get a role |
listRolePermissions | GET /roles/{role_id}/permissions | List permissions in a role |
listRoles | GET /roles | List roles |
removeRolePermissions | DELETE /roles/{role_id}/permissions | Remove permissions from a role |
updateARole | PATCH /roles/{role_id} | Update a role |
addRolePermissions({ role_id, [request_body] })
Add permissions to a role.
const options = {
role_id: "role_id_example", // required
request_body: {"permissions":[{"id":"2bxSauWWdQ5Hmg2d7WQiPU"},{"id":"5QoWSdPgkxvL9eoDMXRDr4"}]},
};
apiInstance.addRolePermissions(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
role_id | String | Alphanumeric string identifying the role. | |
request_body | {String: Object} | [optional] |
Object
createARole({ , [request_body] })
Create a role.
const options = {
request_body: {"name":"Security Engineer"},
};
apiInstance.createARole(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
request_body | {String: Object} | [optional] |
Object
deleteARole({ role_id })
Delete a role.
const options = {
role_id: "role_id_example", // required
};
apiInstance.deleteARole(options)
.then(() => {
console.log('API called successfully.');
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
role_id | String | Alphanumeric string identifying the role. |
null (empty response body)
getARole({ role_id })
Get a role.
const options = {
role_id: "role_id_example", // required
};
apiInstance.getARole(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
role_id | String | Alphanumeric string identifying the role. |
Object
listRolePermissions({ role_id })
List all permissions in a role.
const options = {
role_id: "role_id_example", // required
};
apiInstance.listRolePermissions(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
role_id | String | Alphanumeric string identifying the role. |
Object
listRoles({ , [per_page, ][page] })
List all roles.
const options = {
per_page: 20,
page: 1,
};
apiInstance.listRoles(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
per_page | Number | Number of records per page. | [optional] [defaults to 20] |
page | Number | Current page. | [optional] |
Object
removeRolePermissions({ role_id, [request_body] })
Remove permissions from a role.
const options = {
role_id: "role_id_example", // required
request_body: {"permissions":[{"id":"2bxSauWWdQ5Hmg2d7WQiPU"},{"id":"5QoWSdPgkxvL9eoDMXRDr4"}]},
};
apiInstance.removeRolePermissions(options)
.then(() => {
console.log('API called successfully.');
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
role_id | String | Alphanumeric string identifying the role. | |
request_body | {String: Object} | [optional] |
null (empty response body)
updateARole({ role_id, [request_body] })
Update a role.
const options = {
role_id: "role_id_example", // required
request_body: {"name":"Account Manager","description":"Manage users."},
};
apiInstance.updateARole(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
role_id | String | Alphanumeric string identifying the role. | |
request_body | {String: Object} | [optional] |
Object