Skip to content

Latest commit

 

History

History
305 lines (212 loc) · 8.18 KB

IamRolesApi.md

File metadata and controls

305 lines (212 loc) · 8.18 KB

Fastly\Api\IamRolesApi

$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
);

Methods

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()

addRolePermissions($options): object // Add permissions to a role

Add permissions to a role.

Example

    $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;
}

Options

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]

Return type

object

[Back to top] [Back to API list] [Back to README]

createARole()

createARole($options): object // Create a role

Create a role.

Example

    $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;
}

Options

Note: the input parameter is an associative array with the keys listed below.

Name Type Description Notes
request_body array<string,object> [optional]

Return type

object

[Back to top] [Back to API list] [Back to README]

deleteARole()

deleteARole($options) // Delete a role

Delete a role.

Example

    $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;
}

Options

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.

Return type

void (empty response body)

[Back to top] [Back to API list] [Back to README]

getARole()

getARole($options): object // Get a role

Get a role.

Example

    $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;
}

Options

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.

Return type

object

[Back to top] [Back to API list] [Back to README]

listRolePermissions()

listRolePermissions($options): object // List permissions in a role

List all permissions in a role.

Example

    $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;
}

Options

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.

Return type

object

[Back to top] [Back to API list] [Back to README]

listRoles()

listRoles($options): object // List roles

List all roles.

Example

    $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;
}

Options

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]

Return type

object

[Back to top] [Back to API list] [Back to README]

removeRolePermissions()

removeRolePermissions($options) // Remove permissions from a role

Remove permissions from a role.

Example

    $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;
}

Options

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]

Return type

void (empty response body)

[Back to top] [Back to API list] [Back to README]

updateARole()

updateARole($options): object // Update a role

Update a role.

Example

    $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;
}

Options

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]

Return type

object

[Back to top] [Back to API list] [Back to README]