customer_region_handling

The following methods allow for interaction with the ZCell Customer Region Handling API endpoints. Includes listing regions, updating enabled regions, and retrieving region operational status.

Methods are accessible via zcell.customer_region_handling

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 CustomerRegionHandlingAPI

Bases: APIClient

list_regions(id=None, query_params=None)

Gets the available and configured regions for the logged-in customer.

Parameters:
  • id (str) – Optional. The ZCell customer ID. Defaults to the zcellCustomerId config value or the ZCELL_CUSTOMER_ID environment variable when omitted.

  • query_params (dict) – Map of query parameters for the request. [query_params.skip_sku_check] {bool}

Returns:

(result, Response, error)

Return type:

tuple

The returned response supports resp.search(<jmespath>) for client-side filtering/projection of the current page.

Examples

>>> results, response, error = client.zcell.customer_region_handling.list_regions(id='...')
>>> if error:
...     print(f"Error: {error}")
...     return
>>> for item in results:
...     print(item.as_dict())
list_regions_operational_status(id=None, query_params=None)

Gets the configured regions and their operational status for the logged-in customer.

Parameters:
  • id (str) – Optional. The ZCell customer ID. Defaults to the zcellCustomerId config value or the ZCELL_CUSTOMER_ID environment variable when omitted.

  • query_params (dict) – Map of query parameters for the request. [query_params.bc_size] {str}

Returns:

(result, Response, error)

Return type:

tuple

The returned response supports resp.search(<jmespath>) for client-side filtering/projection of the current page.

Examples

>>> results, response, error = client.zcell.customer_region_handling.list_regions_operational_status(
...     id='...',
... )
>>> if error:
...     print(f"Error: {error}")
...     return
>>> for item in results:
...     print(item.as_dict())
update_regions(id=None, regions=None)

Configure customer regions.

The API expects a raw JSON array of region codes (e.g. ["AMER"]) as the request body. Although the request is sent via PUT, the endpoint responds with 201 Created and a raw scalar value (e.g. 1) rather than a JSON object — so the raw response body is returned as the result.

Parameters:
  • id (str) – Optional. The ZCell customer ID. Defaults to the zcellCustomerId config value or the ZCELL_CUSTOMER_ID environment variable when omitted.

  • regions (list[str]) – List of region codes to configure (e.g. ["AMER", "EMEA", "APAC"]).

Returns:

(result, Response, error)

Return type:

tuple

Examples

Configure the regions for a customer:

>>> result, _, error = client.zcell.customer_region_handling.update_regions(
...     id='gi754cvqb07r0',
...     regions=['AMER'],
... )
>>> if error:
...     print(f"Error configuring regions: {error}")
...     return
>>> print(f"Regions configured successfully. Response: {result}")