Domains¶
Add domain¶
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(['region' => '{region}']);
$domain = $identity->createDomain([
'description' => '{description}',
'enabled' => true,
'name' => '{name}'
]);
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
List domains¶
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(['region' => '{region}']);
foreach ($identity->listDomains() as $domain) {
}
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Show domain details¶
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(['region' => '{region}']);
$domain = $identity->getDomain('{domainId}');
$domain->retrieve();
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Update domain¶
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(['region' => '{region}']);
$domain = $identity->getDomain('{domainId}');
$domain->enabled = false;
$domain->update();
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Delete domain¶
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(['region' => '{region}']);
$domain = $identity->getDomain('{domainId}');
$domain->delete();
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
List roles for domain user¶
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(['region' => '{region}']);
$domain = $identity->getDomain('{domainId}');
foreach ($domain->listUserRoles(['userId' => '{domainUserId}']) as $role) {
}
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Grant role to domain user¶
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(['region' => '{region}']);
$domain = $identity->getDomain('{domainId}');
$domain->grantUserRole([
'userId' => '{domainUserId}',
'roleId' => '{roleId}',
]);
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Check role for domain user¶
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(['region' => '{region}']);
$domain = $identity->getDomain('{domainId}');
$result = $domain->checkUserRole(['userId' => '{domainUserId}', 'roleId' => '{roleId}']);
if (true === $result) {
// It exists!
}
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Revoke role for domain user¶
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(['region' => '{region}']);
$domain = $identity->getDomain('{domainId}');
$domain->revokeUserRole([
'userId' => '{domainUserId}',
'roleId' => '{roleId}',
]);
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
List roles for domain group¶
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(['region' => '{region}']);
$domain = $identity->getDomain('{domainId}');
foreach ($domain->listGroupRoles(['groupId' => '{groupId}']) as $role) {
}
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Grant role to domain group¶
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(['region' => '{region}']);
$domain = $identity->getDomain('{domainId}');
$domain->grantGroupRole([
'groupId' => '{groupId}',
'roleId' => '{roleId}',
]);
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Check role for domain group¶
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(['region' => '{region}']);
$domain = $identity->getDomain('{domainId}');
$result = $domain->checkGroupRole(['groupId' => '{groupId}', 'roleId' => '{roleId}']);
if (true === $result) {
// It exists!
}
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Revoke role for domain group¶
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(['region' => '{region}']);
$domain = $identity->getDomain('{domainId}');
$domain->revokeGroupRole([
'groupId' => '{groupId}',
'roleId' => '{roleId}',
]);
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.