Skip to content

Latest commit

 

History

History
55 lines (33 loc) · 1.29 KB

File metadata and controls

55 lines (33 loc) · 1.29 KB

Server Groups

Server groups let you express affinity or anti-affinity placement rules for Nova servers.

.. osdoc:: https://docs.openstack.org/api-ref/compute/#server-groups-os-server-groups

List

.. sample:: Compute/v2/server_groups/list.php

Each iteration will return a :php:class:`ServerGroup` instance <OpenStack/Compute/v2/Models/ServerGroup.html>.

Admin-only listing across all projects is also available:

$serverGroups = $service->listServerGroups([
    'allProjects' => true,
]);

Create

Use name and policies for the baseline Compute API:

.. sample:: Compute/v2/server_groups/create.php

Microversion 2.64+

If the Compute service is created with microversion 2.64 or later, you can use the singular policy field and optional rules object instead:

.. sample:: Compute/v2/server_groups/create_2_64.php

When Nova responds with the newer singular policy field, the SDK also exposes that value as the first item in policies for compatibility with the older response shape.

Read

.. sample:: Compute/v2/server_groups/read.php

Delete

.. sample:: Compute/v2/server_groups/delete.php