const apiInstance = new Fastly.IamRolesApi();
Method | Fastly API endpoint | Description |
---|---|---|
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 |
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