cbi_banner¶
The following methods allow for interaction with the ZPA Cloud Browser Isolation Banner API endpoints.
Methods are accessible via zpa.cbi_banner
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 CBIBannerAPI¶
Bases:
APIClientA Client object for the Cloud Browser Isolation Banners resource.
- add_cbi_banner(**kwargs)¶
Adds a new cloud browser isolation banner.
- Parameters:
- Returns:
A tuple containing the CBIBanner instance, response object, and error if any.
- Return type:
Examples
>>> added_banner, _, err = client.zpa.cbi_banner.add_cbi_banner( ... name=f"Create_CBI_Banner_{random.randint(1000, 10000)}", ... logo= "data:image/png;base64,iVBORw0KGgoAAAANS", ... primary_color= "#0076BE", ... text_color= "#FFFFFF", ... banner=True, ... notification_title= "Heads up, you've been redirected to Browser Isolation!", ... notification_text= "The website you were trying to access", ... ) ... if err: ... print(f"Error adding cbi banner: {err}") ... return ... print(f"CBI Banner added successfully: {added_banner.as_dict()}")
- delete_cbi_banner(banner_id)¶
Deletes the specified cloud browser isolation banner.
- Parameters:
banner_id (str) – The unique identifier for the cloud browser isolation banner to be deleted.
- Returns:
A tuple containing the response object and error if any.
- Return type:
Examples
>>> _, _, err = client.zpa.cbi_banner.delete_cbi_banner( ... banner_id='ab73fa29-667a-4057-83c5-6a8dccf84930' ... ) ... if err: ... print(f"Error deleting cbi banner: {err}") ... return ... print(f"CBI Banner with ID {ab73fa29-667a-4057-83c5-6a8dccf84930} deleted successfully.")
- get_cbi_banner(banner_id)¶
Returns information on the specified cloud browser isolation banner.
- Parameters:
banner_id (str) – The unique identifier for the cloud browser isolation banner.
- Returns:
A tuple containing the CBIBanner instance, response object, and error if any.
- Return type:
Examples
>>> fetched_banner, _, err = client.zpa.cbi_banner.get_cbi_banner( ... banner_id='ab73fa29-667a-4057-83c5-6a8dccf84930') ... if err: ... print(f"Error fetching banner by ID: {err}") ... return ... print(f"Fetched banner by ID: {fetched_banner.as_dict()}")
- list_cbi_banners()¶
Returns a list of all cloud browser isolation banners.
- Returns:
A tuple containing a list of CBIBanner instances, response object, and error if any.
- Return type:
Tuple
Examples
>>> banner_list, _, err = client.zpa.cbi_banner.list_cbi_banners() ... if err: ... print(f"Error listing banners: {err}") ... return ... print(f"Total banners found: {len(banner_list)}") ... for banner in banner_list: ... print(banner.as_dict())
- update_cbi_banner(banner_id, **kwargs)¶
Updates an existing cloud browser isolation banner.
- Parameters:
banner_id (str) – The unique identifier of the cloud browser isolation banner.
- Returns:
A tuple containing the CBIBanner instance, response object, and error if any.
- Return type:
Examples
>>> updated_banner, _, err = client.zpa.cbi_banner.update_cbi_banner( ... banner_id='ab73fa29-667a-4057-83c5-6a8dccf84930' ... name=f"Update_CBI_Banner_{random.randint(1000, 10000)}", ... logo= "data:image/png;base64,iVBORw0KGgoAAAANS", ... primary_color= "#0076BE", ... text_color= "#FFFFFF", ... banner=True, ... notification_title= "Heads up, you've been redirected to Browser Isolation!", ... notification_text= "The website you were trying to access", ... ) ... if err: ... print(f"Error updating cbi banner: {err}") ... return ... print(f"CBI Banner updated successfully: {updated_banner.as_dict()}")