ServerGroup

class cloudpassage.ServerGroup(session)

Initializing the ServerGroup class:

Parameters:session (cloudpassage.HaloSession) – This will define how you interact with the Halo API, including proxy settings and API keys used for authentication.
create(group_name, **kwargs)

Creates a ServerGroup.

Parameters:

group_name (str) – Name for the new group

Keyword Arguments:
 
  • firewall_policy_id (str) – ID of firewall policy to be assigned to the group (deprecated- use linux_firewall_policy_id)
  • linux_firewall_policy_id (str) – ID of linux firewall policy to associate with the new group
  • windows_firewall_policy_id (str) – ID of Windows firewall policy to associate with the new group
  • policy_ids (list) – List of Linux configuration policy IDs
  • windows_policy_ids (list) – List of Windows configuration policy IDs
  • fim_policy_ids (list) – List of Linux FIM policies
  • linux_fim_policy_ids (list) – List of Linux FIM policies
  • windows_fim_policy_ids (list) – List of Windows FIM policies
  • lids_policy_ids (list) – List of LIDS policy IDs
  • tag (str) – Server group tag-used for auto-assignment of group.
  • server_events_policy (str) – Special events policy IDs
  • alert_profiles (list) – List of alert profile IDs
Returns:

ID of newly-created group.

Return type:

str

delete(group_id, **kwargs)

Delete a server group.

Parameters:group_id (str) – ID of group to delete
Keyword Arguments:
 force (bool) – If set to True, the member servers from this group will be moved to the parent group.
Returns:None if successful, exceptions otherwise.
describe(group_id)

Describe a ServerGroup. In detail.

Parameters:group_id (str) – ID of group
Returns:Dictionary object describing group. In detail.
Return type:dict
list_all()

Returns a list of all groups for an account

This is represented as a list of dictionaries

This will only return a maximum of 20 pages, which amounts to 200 groups. If you have more than that, you should consider using the SDK within a multi-threaded application so you don’t spend the rest of your life waiting on a list of groups.

list_members(group_id)

Returns a list of all member servers of a group_id

Parameters:group_id (str) – ID of group_id
Returns:List of dictionary objects describing member servers
Return type:list
update(group_id, **kwargs)

Updates a ServerGroup.

Parameters:

group_id (str) – ID of group to be altered

Keyword Arguments:
 
  • name (str) – Override name for group
  • linux_firewall_policy_id (str) – Override Linux firewall policy ID.
  • windows_firewall_policy_id (str) – Override Windows firewall policy ID.
  • policy_ids (list) – Override Linux configuration policies
  • windows_policy_ids (list) – Override Windows firewall policies
  • linux_fim_policy_ids (list) – Override Linux firewall policies
  • windows_fim_policy_ids (list) – Override Windows FIM policies
  • lids_policy_ids (list) – Override LIDS policy IDs
  • tag (str) – Override server group tag
  • special_events_policy (str) – Override server events policy. Note the difference in naming from the cloudpassage.ServerGroup.create() method
  • alert_profiles (list) – List of alert profiles
Returns:

True if successful, throws exception otherwise.