resource_groups¶
The following methods allow for interaction with the ZMS Resource Groups API endpoints.
Methods are accessible via zms.resource_groups
Copyright (c) 2023, Zscaler Inc.
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- class ResourceGroupsAPI¶
Bases:
APIClientA Client object for the ZMS Resource Groups domain.
Provides access to resource group operations including: - List resource groups with filtering and pagination - Get resource group members - Get resource group protection status - Get recommended resource groups (ML-based)
- get_resource_group_members(customer_id, group_id, page_num=1, page_size=20)¶
Get resources of a specific resource group.
- Parameters:
customer_id – The customer ID.
group_id – The resource group ID.
page_num – Page number (default 1).
page_size – Number of items per page (default 20).
- Returns:
(resources_connection dict, response, error)
- Return type:
Examples
Get resource group members:
>>> result, _, err = client.zms.resource_groups.get_resource_group_members( ... customer_id="123456789", ... group_id="rg-abc-123" ... ) >>> if err: ... print(err) >>> for resource in result.get("nodes", []): ... print(resource.get("name"))
- get_resource_group_protection_status(customer_id, page_num=1, page_size=20)¶
Get resource group protection status.
- Parameters:
customer_id – The customer ID.
page_num – Page number (default 1).
page_size – Number of items per page (default 20).
- Returns:
(protection_status dict, response, error)
- Return type:
Examples
Get protection status:
>>> result, _, err = client.zms.resource_groups.get_resource_group_protection_status( ... customer_id="123456789" ... ) >>> if err: ... print(err)
- list_resource_groups(customer_id, page_num=1, page_size=20, filter_by=None)¶
Get resource groups for a given customer with optional filtering.
- Parameters:
customer_id – The customer ID.
page_num – Page number (default 1).
page_size – Number of items per page (default 20).
filter_by – Filter options using ResourceGroupsFilter.
- Returns:
(resource_groups_connection dict, response, error)
- Return type:
Examples
List resource groups:
>>> result, _, err = client.zms.resource_groups.list_resource_groups( ... customer_id="123456789" ... ) >>> if err: ... print(err) >>> for rg in result.get("nodes", []): ... print(rg.get("name"))