novaclient.v2.server_groups module

novaclient.v2.server_groups module

Server group interface.

class novaclient.v2.server_groups.ServerGroup(manager, info, loaded=False, resp=None)

Bases: novaclient.base.Resource

A server group.

Populate and bind to a manager.

Parameters:
  • manager – BaseManager object
  • info – dictionary representing resource attributes
  • loaded – prevent lazy-loading if set to True
  • resp – Response or list of Response objects
delete()

Delete this server group.

Returns:An instance of novaclient.base.TupleWithMeta
class novaclient.v2.server_groups.ServerGroupsManager(api)

Bases: novaclient.base.ManagerWithFind

Manage ServerGroup resources.

create(name, policy, rules=None)

Create (allocate) a server group.

Parameters:
  • name – The name of the server group.
  • policy – Policy name to associate with the server group.
  • rules – The rules of policy which is a dict, can be applied to the policy, now only max_server_per_host for anti-affinity policy would be supported (optional).
Return type:

list of ServerGroup

delete(id)

Delete a specific server group.

Parameters:id – The ID of the ServerGroup to delete.
Returns:An instance of novaclient.base.TupleWithMeta
get(id)

Get a specific server group.

Parameters:id – The ID of the ServerGroup to get.
Return type:ServerGroup
list(all_projects=False, limit=None, offset=None)

Get a list of all server groups.

Parameters:
  • all_projects – Lists server groups for all projects. (optional)
  • limit – Maximum number of server groups to return. (optional)
  • offset – Use with limit to return a slice of server groups. offset is where to start in the groups list. (optional)
Returns:

list of ServerGroup.

resource_class

alias of ServerGroup

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.