resources¶
The following methods allow for interaction with the ZMS Resources API endpoints.
Methods are accessible via zms.resources
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 ResourcesAPI¶
Bases:
APIClientA Client object for the ZMS Resources domain.
Provides access to resource operations including: - List resources with filtering, ordering, and pagination - Resource protection status - Event metadata
- get_metadata(customer_id)¶
Get event metadata for a customer.
- Parameters:
customer_id – The customer ID.
- Returns:
(metadata JSON, response, error)
- Return type:
Examples
Get metadata:
>>> result, _, err = client.zms.resources.get_metadata( ... customer_id="123456789" ... ) >>> if err: ... print(err)
- get_resource_protection_status(customer_id, page_num=1, page_size=20)¶
Get resource 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 resource protection status:
>>> result, _, err = client.zms.resources.get_resource_protection_status( ... customer_id="123456789" ... ) >>> if err: ... print(err)
- list_resources(customer_id, page_num=1, page_size=20, include_deleted=False, filter_by=None, order_by=None)¶
Get resources for a given list of filters.
- Parameters:
customer_id – The customer ID.
page_num – Page number (default 1).
page_size – Number of items per page (default 20).
include_deleted – Whether to include deleted resources.
filter_by – Filter options using ResourceQueryFilter.
order_by – Ordering options using ResourceQueryOrderBy.
- Returns:
(resources_connection dict, response, error)
- Return type:
Examples
List resources:
>>> result, _, err = client.zms.resources.list_resources( ... customer_id="123456789", ... page_num=1, ... page_size=20 ... ) >>> if err: ... print(err) >>> for resource in result.get("nodes", []): ... print(resource.get("name"))