provisioning_url¶
The following methods allow for interaction with the ZTW Provisioning URL API endpoints.
Methods are accessible via ztw.provisioning_url
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 ProvisioningURLAPI¶
Bases:
APIClientA Client object for the ProvisioningURLAPI resource.
- add_provisioning_url(**kwargs)¶
Adds a new Provisioning URL.
- Parameters:
name (str) – The name of the provisioning URL.
desc (str) – Additional information for the provisioning URL.
prov_url_type (str) – The type of provisioning URL. Supported values:
CLOUD,BRANCH.prov_url_data (dict) – The provisioning URL data containing: - location_template (dict): Location template with
id. - cloud_provider_type (str): Cloud provider type (e.g.,AWS,AZURE,GCP). - form_factor (str): Form factor (e.g.,SMALL,MEDIUM,LARGE). - release_channel (str): Release channel (e.g.,LATEST,STABLE).
- Returns:
The new provisioning URL resource record.
- Return type:
Examples
Add a new provisioning URL:
>>> added_prov_url, _, error = client.ztw.provisioning_url.add_provisioning_url( ... name="AWS_CAN02", ... desc="AWS_CAN02_Description", ... prov_url_type="CLOUD", ... prov_url_data={ ... "location_template": { ... "id": 82521 ... }, ... "cloud_provider_type": "AWS", ... "form_factor": "SMALL", ... "release_channel": "LATEST" ... } ... ) >>> if error: ... print(f"Error adding provisioning URL: {error}") ... return ... print(f"Provisioning URL added successfully: {added_prov_url.as_dict()}")
- delete_provisioning_url(provision_id)¶
Deletes a provisioning URL.
- Parameters:
provision_id (str) – The unique ID of the provisioning URL to be deleted.
- Returns:
The status code for the operation.
- Return type:
Examples
>>> _, response, error = client.ztw.provisioning.delete_provisioning_url('545845') ... if error: ... print(f"Error deleting provisioning URL: {error}") ... return
- get_provisioning_url(provision_id)¶
Get details for a provisioning template by ID.
- Parameters:
provision_id (str) – ID of Cloud & Branch Connector provisioning template.
- Returns:
The provisiong template url details.
- Return type:
Tuple
Examples
Print the details of a provisioning template url:
print(ztw.provisioning.get_provisioning_url(“123456789”)
- list_provisioning_url(query_params=None)¶
List all provisioning URLs.
- Keyword Arguments:
{dict} (query_params) –
Optional query parameters.
[query_params.page]{int}: Specifies the page offset.[query_params.page_size]{int}: Specifies the page size. The default size is 250.- Returns:
The list of provisioning URLs.
- Return type:
Tuple
Examples
Print all provisioning URLs:
roles = ztw.provisioning.list_provisioning_url() for role in roles: print(role)
Client-side filtering with JMESPath:
The response object supports client-side filtering and projection via
resp.search(expression). See the JMESPath documentation for expression syntax.
- update_provisioning_url(provision_id, **kwargs)¶
Updates information for the specified Provisioning URL.
- Parameters:
provision_id (int) – The unique ID for the Provisioning URL.
name (str) – The name of the provisioning URL.
desc (str) – Additional information for the provisioning URL.
prov_url_type (str) – The type of provisioning URL. Supported values:
CLOUD,BRANCH.prov_url_data (dict) – The provisioning URL data containing: - location_template (dict): Location template with
id. - cloud_provider_type (str): Cloud provider type (e.g.,AWS,AZURE,GCP). - form_factor (str): Form factor (e.g.,SMALL,MEDIUM,LARGE). - release_channel (str): Release channel (e.g.,LATEST,STABLE).
- Returns:
A tuple containing the updated Provisioning URL, response, and error.
- Return type:
Examples
Update an existing Provisioning URL:
>>> updated_prov_url, _, error = client.ztw.provisioning_url.update_provisioning_url( ... provision_id=added_prov_url.id, ... name="AWS_CAN02", ... desc="AWS_CAN02_Updated_Description", ... prov_url_type="CLOUD", ... prov_url_data={ ... "location_template": { ... "id": 82521 ... }, ... "cloud_provider_type": "AWS", ... "form_factor": "SMALL", ... "release_channel": "LATEST" ... } ... ) >>> if error: ... print(f"Error updating provisioning URL: {error}") ... return ... print(f"Provisioning URL updated successfully: {updated_prov_url.as_dict()}")