SoftLayer.ssl¶
SSL Manager/helpers
license: | MIT, see LICENSE for more details. |
---|
-
class
SoftLayer.managers.ssl.
SSLManager
(client)[source]¶ Manages SSL certificates in SoftLayer.
See product information here: https://www.ibm.com/cloud/ssl-certificates
Example:
# Initialize the Manager. # env variables. These can also be specified in ~/.softlayer, # or passed directly to SoftLayer.Client() # SL_USERNAME = YOUR_USERNAME # SL_API_KEY = YOUR_API_KEY import SoftLayer client = SoftLayer.Client() mgr = SoftLayer.SSLManager(client)
Parameters: client (SoftLayer.API.BaseClient) – the client instance -
add_certificate
(certificate)[source]¶ Creates a new certificate.
Parameters: certificate (dict) – A dictionary representing the parts of the certificate. See sldn.softlayer.com for more info. Example:
cert = ?? result = mgr.add_certificate(certificate=cert)
-
edit_certificate
(certificate)[source]¶ Updates a certificate with the included options.
The provided dict must include an ‘id’ key and value corresponding to the certificate ID that should be updated.
Parameters: certificate (dict) – the certificate to update. Example:
# Updates the cert id 1234 cert['id'] = 1234 cert['certificate'] = ?? result = mgr.edit_certificate(certificate=cert)
-
get_certificate
(cert_id)[source]¶ Gets a certificate with the ID specified.
Parameters: cert_id (integer) – the certificate ID to retrieve Example:
cert = mgr.get_certificate(cert_id=1234) print(cert)
-
list_certs
(method='all')[source]¶ List all certificates.
Parameters: method (string) – The type of certificates to list. Options are ‘all’, ‘expired’, and ‘valid’. Returns: A list of dictionaries representing the requested SSL certs. Example:
# Get all valid SSL certs certs = mgr.list_certs(method='valid') print certs
-