Projects¶
Add project¶
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}']);
$project = $identity->createProject([
'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 projects¶
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->listProjects() as $project) {
}
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Show project 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}']);
$project = $identity->getProject('{id}');
$project->retrieve();
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Update project¶
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}']);
$project = $identity->getProject('{id}');
$project->enabled = false;
$project->update();
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Delete project¶
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}']);
$project = $identity->getProject('{id}');
$project->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 project 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}']);
$project = $identity->getProject('{id}');
foreach ($project->listUserRoles(['userId' => '{projectUserId}']) 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 project 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}']);
$project = $identity->getProject('{id}');
$project->grantUserRole([
'userId' => '{projectUserId}',
'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 project 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}']);
$project = $identity->getProject('{id}');
$result = $project->checkUserRole([
'userId' => '{projectUserId}',
'roleId' => '{roleId}',
]);
if (true === $result) {
}
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Revoke role for project 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}']);
$project = $identity->getProject('{id}');
$project->revokeUserRole([
'userId' => '{projectUserId}',
'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 project 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}']);
$project = $identity->getProject('{id}');
foreach ($project->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 project 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}']);
$project = $identity->getProject('{id}');
$project->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 project 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}']);
$project = $identity->getProject('{id}');
$result = $project->checkGroupRole([
'groupId' => '{groupId}',
'roleId' => '{roleId}',
]);
if (true === $result) {
}
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Revoke role for project 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}']);
$project = $identity->getProject('{id}');
$project->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.