certificates#
The following methods allow for interaction with the ZPA Certificate API endpoints.
Methods are accessible via zpa.certificates
- class CertificatesAPI#
Bases:
object
- add_certificate(name, cert_blob, **kwargs)#
Add a new Certificate.
- Parameters:
- Keyword Arguments:
description (str) – The description of the certificate.
- Returns:
The resource record for the newly created server.
- Return type:
Box
Examples
Create a certificate with minimum required parameters:
>>> zpa.servers.add_server( ... name='myserver.example', ... cert_blob=("-----BEGIN CERTIFICATE-----\n" ... "MIIFNzCCBIHNIHIO==\n" ... "-----END CERTIFICATE-----"), )
- delete_certificate(certificate_id)#
Returns information on a specified Browser Access certificate.
- Parameters:
certificate_id (str) – The unique identifier for the Browser Access certificate.
- Returns:
The Browser Access certificate resource record.
- Return type:
Box
Examples
>>> ba_certificate = zpa.certificates.get_certificate('99999')
- get_certificate(certificate_id)#
Returns information on a specified Browser Access certificate.
- Parameters:
certificate_id (str) – The unique identifier for the Browser Access certificate.
- Returns:
The Browser Access certificate resource record.
- Return type:
Box
Examples
>>> ba_certificate = zpa.certificates.get_browser_access('99999')
- get_certificate_by_name(name)#
- get_enrolment(certificate_id)#
Returns information on the specified enrollment certificate.
- Parameters:
certificate_id (str) – The unique id of the enrollment certificate.
- Returns:
The enrollment certificate resource record.
- Return type:
Box
Examples
enrolment_cert = zpa.certificates.get_enrolment(‘99999999’)
- get_enrolment_cert_by_name(name)#
- list_all_certificates(**kwargs)#
Returns a list of all Browser Access certificates.
- Parameters:
**kwargs – Optional keyword args.
- Keyword Arguments:
**max_items (int, optional) – The maximum number of items to request before stopping iteration.
**max_pages (int, optional) – The maximum number of pages to request before stopping iteration.
**pagesize (int, optional) – Specifies the page size. The default size is 20, but the maximum size is 500.
**search (str, optional) – The search string used to match against features and fields.
- Returns:
List of all Browser Access certificates.
- Return type:
BoxList
Examples
>>> for cert in zpa.certificates.list_all_certificates(): ... print(cert)
- list_enrolment(**kwargs)#
Returns a list of all configured enrollment certificates.
- Parameters:
**kwargs – Optional keyword args.
- Keyword Arguments:
**max_items (int, optional) – The maximum number of items to request before stopping iteration.
**max_pages (int, optional) – The maximum number of pages to request before stopping iteration.
**pagesize (int, optional) – Specifies the page size. The default size is 20, but the maximum size is 500.
**search (str, optional) – The search string used to match against features and fields.
- Returns:
List of all enrollment certificates.
- Return type:
BoxList
Examples
>>> for cert in zpa.certificates.list_enrolment(): ... print(cert)
- list_issued_certificates(**kwargs)#
Returns a list of all Browser Access certificates.
- Parameters:
**kwargs – Optional keyword args.
- Keyword Arguments:
max_items (int, optional) – The maximum number of items to request before stopping iteration.
max_pages (int, optional) – The maximum number of pages to request before stopping iteration.
pagesize (int, optional) – Specifies the page size. The default size is 20, but the maximum size is 500.
search (str, optional) – The search string used to match against features and fields.
- Returns:
List of all Browser Access certificates.
- Return type:
BoxList
Examples
>>> for cert in zpa.certificates.list_browser_access(): ... print(cert)