$apiInstance = new Fastly\Api\IamRolesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
Method | Fastly API endpoint | 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($options): object // Add permissions to a role
Add permissions to a role.
$options['role_id'] = 'role_id_example'; // string | Alphanumeric string identifying the role.
$options['request_body'] = {"permissions":[{"id":"2bxSauWWdQ5Hmg2d7WQiPU"},{"id":"5QoWSdPgkxvL9eoDMXRDr4"}]}; // array<string,object>
try {
$result = $apiInstance->addRolePermissions($options);
} catch (Exception $e) {
echo 'Exception when calling IamRolesApi->addRolePermissions: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
role_id | string | Alphanumeric string identifying the role. | |
request_body | array<string,object> | [optional] |
object
[Back to top] [Back to API list] [Back to README]
createARole($options): object // Create a role
Create a role.
$options['request_body'] = {"name":"Security Engineer"}; // array<string,object>
try {
$result = $apiInstance->createARole($options);
} catch (Exception $e) {
echo 'Exception when calling IamRolesApi->createARole: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
request_body | array<string,object> | [optional] |
object
[Back to top] [Back to API list] [Back to README]
deleteARole($options) // Delete a role
Delete a role.
$options['role_id'] = 'role_id_example'; // string | Alphanumeric string identifying the role.
try {
$apiInstance->deleteARole($options);
} catch (Exception $e) {
echo 'Exception when calling IamRolesApi->deleteARole: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
role_id | string | Alphanumeric string identifying the role. |
void (empty response body)
[Back to top] [Back to API list] [Back to README]
getARole($options): object // Get a role
Get a role.
$options['role_id'] = 'role_id_example'; // string | Alphanumeric string identifying the role.
try {
$result = $apiInstance->getARole($options);
} catch (Exception $e) {
echo 'Exception when calling IamRolesApi->getARole: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
role_id | string | Alphanumeric string identifying the role. |
object
[Back to top] [Back to API list] [Back to README]
listRolePermissions($options): object // List permissions in a role
List all permissions in a role.
$options['role_id'] = 'role_id_example'; // string | Alphanumeric string identifying the role.
try {
$result = $apiInstance->listRolePermissions($options);
} catch (Exception $e) {
echo 'Exception when calling IamRolesApi->listRolePermissions: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
role_id | string | Alphanumeric string identifying the role. |
object
[Back to top] [Back to API list] [Back to README]
listRoles($options): object // List roles
List all roles.
$options['per_page'] = 20; // int | Number of records per page.
$options['page'] = 1; // int | Current page.
try {
$result = $apiInstance->listRoles($options);
} catch (Exception $e) {
echo 'Exception when calling IamRolesApi->listRoles: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
per_page | int | Number of records per page. | [optional] [defaults to 20] |
page | int | Current page. | [optional] |
object
[Back to top] [Back to API list] [Back to README]
removeRolePermissions($options) // Remove permissions from a role
Remove permissions from a role.
$options['role_id'] = 'role_id_example'; // string | Alphanumeric string identifying the role.
$options['request_body'] = {"permissions":[{"id":"2bxSauWWdQ5Hmg2d7WQiPU"},{"id":"5QoWSdPgkxvL9eoDMXRDr4"}]}; // array<string,object>
try {
$apiInstance->removeRolePermissions($options);
} catch (Exception $e) {
echo 'Exception when calling IamRolesApi->removeRolePermissions: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
role_id | string | Alphanumeric string identifying the role. | |
request_body | array<string,object> | [optional] |
void (empty response body)
[Back to top] [Back to API list] [Back to README]
updateARole($options): object // Update a role
Update a role.
$options['role_id'] = 'role_id_example'; // string | Alphanumeric string identifying the role.
$options['request_body'] = {"name":"Account Manager","description":"Manage users."}; // array<string,object>
try {
$result = $apiInstance->updateARole($options);
} catch (Exception $e) {
echo 'Exception when calling IamRolesApi->updateARole: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
role_id | string | Alphanumeric string identifying the role. | |
request_body | array<string,object> | [optional] |
object