CertificateClient
- class CertificatesClient(client: Client)[source]
- actions: ResourceActionsClient
Certificates scoped actions client
- Type:
- create(name: str, certificate: str, private_key: str, labels: dict[str, str] | None = None) BoundCertificate [source]
- Creates a new Certificate with the given name, certificate and private_key. This methods allows only creating
custom uploaded certificates. If you want to create a managed certificate use
create_managed()
- Parameters:
name – str
certificate – str Certificate and chain in PEM format, in order so that each record directly certifies the one preceding
private_key – str Certificate key in PEM format
labels – Dict[str, str] (optional) User-defined labels (key-value pairs)
- Returns:
- create_managed(name: str, domain_names: list[str], labels: dict[str, str] | None = None) CreateManagedCertificateResponse [source]
- Creates a new managed Certificate with the given name and domain names. This methods allows only creating
managed certificates for domains that are using the Hetzner DNS service. If you want to create a custom uploaded certificate use
create()
- Parameters:
name – str
domain_names – List[str] Domains and subdomains that should be contained in the Certificate
labels – Dict[str, str] (optional) User-defined labels (key-value pairs)
- Returns:
- delete(certificate: Certificate | BoundCertificate) bool [source]
Deletes a certificate.
- Parameters:
certificate –
BoundCertificate
orCertificate
- Returns:
True
- get_actions(certificate: Certificate | BoundCertificate, status: list[str] | None = None, sort: list[str] | None = None) list[BoundAction] [source]
Returns all action objects for a Certificate.
- Parameters:
certificate –
BoundCertificate
orCertificate
status – List[str] (optional) Response will have only actions with specified statuses. Choices: running success error
sort – List[str] (optional) Specify how the results are sorted. Choices: id id:asc id:desc command command:asc command:desc status status:asc status:desc progress progress:asc progress:desc started started:asc started:desc finished finished:asc finished:desc
- Returns:
List[
BoundAction
]
- get_actions_list(certificate: Certificate | BoundCertificate, status: list[str] | None = None, sort: list[str] | None = None, page: int | None = None, per_page: int | None = None) ActionsPageResult [source]
Returns all action objects for a Certificate.
- Parameters:
certificate –
BoundCertificate
orCertificate
status – List[str] (optional) Response will have only actions with specified statuses. Choices: running success error
sort – List[str] (optional) Specify how the results are sorted. Choices: id id:asc id:desc command command:asc command:desc status status:asc status:desc progress progress:asc progress:desc started started:asc started:desc finished finished:asc finished:desc
page – int (optional) Specifies the page to fetch
per_page – int (optional) Specifies how many results are returned by page
- Returns:
(List[
BoundAction
],Meta
)
- get_all(name: str | None = None, label_selector: str | None = None) list[BoundCertificate] [source]
Get all certificates
- Parameters:
name – str (optional) Can be used to filter certificates by their name.
label_selector – str (optional) Can be used to filter certificates by labels. The response will only contain certificates matching the label selector.
- Returns:
List[
BoundCertificate
]
- get_by_id(id: int) BoundCertificate [source]
Get a specific certificate by its ID.
- Parameters:
id – int
- Returns:
- get_by_name(name: str) BoundCertificate | None [source]
Get certificate by name
- Parameters:
name – str Used to get certificate by name.
- Returns:
- get_list(name: str | None = None, label_selector: str | None = None, page: int | None = None, per_page: int | None = None) CertificatesPageResult [source]
Get a list of certificates
- Parameters:
name – str (optional) Can be used to filter certificates by their name.
label_selector – str (optional) Can be used to filter certificates by labels. The response will only contain certificates matching the label selector.
page – int (optional) Specifies the page to fetch
per_page – int (optional) Specifies how many results are returned by page
- Returns:
(List[
BoundCertificate
],Meta
)
- retry_issuance(certificate: Certificate | BoundCertificate) BoundAction [source]
Returns all action objects for a Certificate.
- Parameters:
certificate –
BoundCertificate
orCertificate
- Returns:
- update(certificate: Certificate | BoundCertificate, name: str | None = None, labels: dict[str, str] | None = None) BoundCertificate [source]
Updates a Certificate. You can update a certificate name and labels.
- Parameters:
certificate –
BoundCertificate
orCertificate
name – str (optional) New name to set
labels – Dict[str, str] (optional) User-defined labels (key-value pairs)
- Returns:
- class BoundCertificate(client: CertificatesClient, data: dict, complete: bool = True)[source]
-
- get_actions(status: list[str] | None = None, sort: list[str] | None = None) list[BoundAction] [source]
Returns all action objects for a Certificate.
- Parameters:
status – List[str] (optional) Response will have only actions with specified statuses. Choices: running success error
sort – List[str] (optional) Specify how the results are sorted. Choices: id id:asc id:desc command command:asc command:desc status status:asc status:desc progress progress:asc progress:desc started started:asc started:desc finished finished:asc finished:desc
- Returns:
List[
BoundAction
]
- get_actions_list(status: list[str] | None = None, sort: list[str] | None = None, page: int | None = None, per_page: int | None = None) ActionsPageResult [source]
Returns all action objects for a Certificate.
- Parameters:
status – List[str] (optional) Response will have only actions with specified statuses. Choices: running success error
sort – List[str] (optional) Specify how the results are sorted. Choices: id id:asc id:desc command command:asc command:desc status status:asc status:desc progress progress:asc progress:desc started started:asc started:desc finished finished:asc finished:desc
page – int (optional) Specifies the page to fetch
per_page – int (optional) Specifies how many results are returned by page
- Returns:
(List[
BoundAction
],Meta
)
- model
alias of
Certificate
- retry_issuance() BoundAction [source]
Retry a failed Certificate issuance or renewal. :return: BoundAction
- update(name: str | None = None, labels: dict[str, str] | None = None) BoundCertificate [source]
Updates an certificate. You can update an certificate name and the certificate labels.
- Parameters:
name – str (optional) New name to set
labels – Dict[str, str] (optional) User-defined labels (key-value pairs)
- Returns:
- class Certificate(id: int | None = None, name: str | None = None, certificate: str | None = None, not_valid_before: str | None = None, not_valid_after: str | None = None, domain_names: list[str] | None = None, fingerprint: str | None = None, created: str | None = None, labels: dict[str, str] | None = None, type: str | None = None, status: ManagedCertificateStatus | None = None)[source]
Certificate Domain
- Parameters:
id – int ID of Certificate
name – str Name of Certificate
certificate – str Certificate and chain in PEM format, in order so that each record directly certifies the one preceding
not_valid_before – datetime Point in time when the Certificate becomes valid
not_valid_after – datetime Point in time when the Certificate becomes invalid
domain_names – List[str] List of domains and subdomains covered by this certificate
fingerprint – str Fingerprint of the Certificate
labels – dict User-defined labels (key-value pairs)
created – datetime Point in time when the certificate was created
type – str Type of Certificate
status – ManagedCertificateStatus Current status of a type managed Certificate, always none for type uploaded Certificates