Credentials¶
Add credential¶
Create a secret/access pair for use with ec2 style auth. This operation will generates a new set of credentials that map the user/tenant pair.
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}']);
$credential = $identity->createCredential([
'blob' => '{blob}',
'projectId' => '{projectId}',
'type' => '{type}',
'userId' => '{userId}'
]);
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
List credentials¶
List all credentials for a given 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}']);
foreach ($identity->listCredentials() as $credential) {
/** @var $credential \OpenStack\Identity\v3\Models\Credential */
}
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Show credential details¶
Retrieve a user’s access/secret pair by the access key.
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}']);
$credential = $identity->getCredential('credentialId');
$credential->retrieve();
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Update credential¶
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}']);
$credential = $identity->getCredential('credentialId');
$credential->type = 'foo';
$credential->blob = 'bar';
$credential->update();
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Delete credential¶
Delete a user’s access/secret pair.
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}']);
$credential = $identity->getCredential('credentialId');
$credential->delete();
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.