cloud_app_instances

The following methods allow for interaction with the ZIA Cloud Application Instances API endpoints.

Methods are accessible via zia.cloud_app_instances

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 CloudApplicationInstancesAPI

Bases: APIClient

add_cloud_app_instances(**kwargs)

Add a new cloud application instance.

Parameters:
  • instance_id (str) – Cloud application instance ID.

  • instance_type (str) – Cloud application instance type. Supported values: SHAREPOINTONLINE, ONEDRIVE, BOXNET, OKTA, APPSPACE, BITBUCKET, GITHUB, SLACK, QUICK_BASE, ZEPLIN, SOURCEFORGE, ZOOM, WORKDAY, GDRIVE, GOOGLE_WEBMAIL, WINDOWS_LIVE_HOTMAIL, MSTEAM.

  • instance_name (str) – Cloud application instance name.

  • instance_identifiers (list) – List of instance identifiers. Each identifier must include: * instance_identifier (str): URL, IP address, or keyword. * instance_identifier_name (str): Name of the identifier. * instance_type (str): Type of identifier (URL, REFURL, or KEYWORD).

Returns:

A tuple containing:
  • CloudApplicationInstances: The newly added instance.

  • Response: The raw API response object.

  • Error: An error message, if applicable.

Return type:

tuple

Examples

Add a new cloud application instance

>>> added_instance, _, error = client.zia.cloud_app_instances.add_cloud_app_instances(
...     instance_name=f"Instance01_{random.randint(1000, 10000)}",
...     instance_type='SHAREPOINTONLINE',
...     instance_identifiers=[
...         {
...             "instance_identifier_name": 'instance01',
...             "instance_identifier": 'instance01.sharepoint.com',
...             "identifier_type": 'URL',
...         }
...     ]
... )
>>> if error:
...     print(f"Error adding cloud application instance: {error}")
...     return
... print(f"cloud application instance added successfully: {added_instance.as_dict()}")
delete_cloud_app_instances(instance_id)

Deletes a cloud application instance based on the specified ID

Parameters:

instance_id (str) – The unique identifier of the cloud application instance.

Returns:

A tuple containing the response object and error (if any).

Return type:

tuple

Examples

Delete a specific Cloud application instances

>>> _, _, error = client.zia.cloud_app_instances.delete_cloud_app_instances(
    '1254654')
>>> if error:
...     print(f"Error deleting cloud application instance: {error}")
...     return
... print(f"cloud application instance with ID {'1254654'} deleted successfully.")
get_cloud_app_instances(instance_id)

Retrieves information about a cloud application instance based on the specified ID

Parameters:

instance_id (int) – The unique identifier for the cloud application instance.

Returns:

A tuple containing (cloud application instance, Response, error).

Return type:

tuple

Examples

Print a specific Cloud application instances

>>> fetched_instance, _, error = client.zia.cloud_app_instances.get_cloud_app_instances(
    '1254654')
>>> if error:
...     print(f"Error fetching cloud application instance by ID: {error}")
...     return
... print(f"Fetched cloud application instance by ID: {fetched_instance.as_dict()}")
list_cloud_app_instances(query_params=None)

Retrieves the list of cloud application instances configured in the ZIA Admin Portal

Parameters:

{dict} (query_params) –

Map of query parameters for the request.

[query_params.instance_name] {str}: The cloud application instance name

[query_params.instance_type] {bool}: The cloud application instance type
Supported values: SHAREPOINTONLINE, ONEDRIVE, BOXNET, OKTA, APPSPACE,

BITBUCKET, GITHUB, SLACK, QUICK_BASE, ZEPLIN, SOURCEFORGE, ZOOM, WORKDAY, GDRIVE, GOOGLE_WEBMAIL, WINDOWS_LIVE_HOTMAIL, MSTEAM

[query_params.page] (int): Specifies the page offset.

[query_params.page_size] (int): Specifies the page size.

Returns:

A tuple containing (list of Cloud application instances, Response, error)

Return type:

tuple

Examples

Print all Cloud application instances

>>> instance_list, _, error = client.zia.cloud_app_instances.list_cloud_app_instances()
>>> if error:
...     print(f"Error listing cloud application instances: {error}")
...     return
... print(f"Total cloud application instances found: {len(instance_list)}")
... for app in instance_list:
...     print(app.as_dict())
update_cloud_app_instances(instance_id, **kwargs)

Updates information about a cloud application instance based on the specified ID

Parameters:

instance_id (int) – The unique ID for the cloud application instance.

Returns:

A tuple containing the updated cloud application instance, response, and error.

Return type:

tuple

Examples

Update a cloud application instance

>>> updated_instance, _, error = client.zia.cloud_app_instances.add_cloud_app_instances(
...     instance_id='458554'
...     instance_name=f"Instance01_{random.randint(1000, 10000)}",
...     instance_type='SHAREPOINTONLINE',
...     instance_identifiers=[
...         {
...             "instance_identifier_name": 'instance01',
...             "instance_identifier": 'instance01.sharepoint.com',
...             "identifier_type": 'URL',
...         }
...     ]
... )
>>> if error:
...     print(f"Error updating cloud application instance: {error}")
...     return
... print(f"cloud application instance updated successfully: {updated_instance.as_dict()}")