Roles

Add role

Show auth code
<?php

require 'vendor/autoload.php';

$openstack = new OpenStack\OpenStack([
    'authUrl' => '{authUrl}',
    'region'  => '{region}',
    'user'    => [
        'id'       => '{userId}',
        'password' => '{password}'
    ],
    'scope' => [
        'project' => [
            'id' => '{projectId}'
        ]
    ]
]);
$identity = $openstack->identityV3();

$role = $identity->createRole([
    'name' => '{name}',
]);

To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.

List roles

Show auth code
<?php

require 'vendor/autoload.php';

$openstack = new OpenStack\OpenStack([
    'authUrl' => '{authUrl}',
    'region'  => '{region}',
    'user'    => [
        'id'       => '{userId}',
        'password' => '{password}'
    ],
    'scope' => [
        'project' => [
            'id' => '{projectId}'
        ]
    ]
]);
$identity = $openstack->identityV3();

foreach ($identity->listRoles() as $role) {
}

To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.

List role assignments

Show auth code
<?php

require 'vendor/autoload.php';

$openstack = new OpenStack\OpenStack([
    'authUrl' => '{authUrl}',
    'region'  => '{region}',
    'user'    => [
        'id'       => '{userId}',
        'password' => '{password}'
    ],
    'scope' => [
        'project' => [
            'id' => '{projectId}'
        ]
    ]
]);
$identity = $openstack->identityV3();

foreach ($identity->listRoleAssignments() as $assignment) {
}

To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.