Image Members

Add member to image

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}']]
]);
$member = $openstack->imagesV2()
                    ->getImage('{imageId}')
                    ->addMember('{tenantId}');

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

List image members

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}']]
]);
$image = $openstack->imagesV2()
                   ->getImage('{imageId}');

foreach ($image->listMembers() as $member) {
}

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

By default, PHP generators are used to represent collections of resources in the SDK. The benefit of using generators is that it generally improves performance, since objects are not saved in memory as the iteration cycle goes on; instead, each resource is directly output to the user-defined foreach loop. For all intents and purposes, you interact with generators like any other Traversable object, but to retain collections in memory, you will need to implement your own logic.

Show member 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}']]
]);
$member = $openstack->imagesV2()
                    ->getImage('{imageId}')
                    ->getMember('{tenantId}');

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

Remove member from image

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}']]
]);
$openstack->imagesV2()
          ->getImage('{imageId}')
          ->getMember('{tenantId}')
          ->delete();

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

Update status of image member

Show auth code
<?php

require 'vendor/autoload.php';

use OpenStack\Images\v2\Models\Member;

$openstack = new OpenStack\OpenStack([
    'authUrl' => '{authUrl}',
    'region'  => '{region}',
    'user'    => ['id' => '{userId}', 'password' => '{password}'],
    'scope'   => ['project' => ['id' => '{projectId}']]
]);
$openstack->imagesV2()
    ->getImage('{imageId}')
    ->getMember('{tenantId}')
    ->updateStatus(Member::STATUS_ACCEPTED);

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