Struct dnsimple::dnsimple::certificates::Certificates [−][src]
pub struct Certificates<'a> {
pub client: &'a Client,
}
Expand description
The Certificates Service handles the certificates endpoint of the DNSimple API.
Fields
client: &'a Client
Implementations
pub fn list_certificates(
&self,
account_id: u64,
domain: &str,
options: Option<RequestOptions>
) -> Result<DNSimpleResponse<Vec<Certificate>>, String>
pub fn list_certificates(
&self,
account_id: u64,
domain: &str,
options: Option<RequestOptions>
) -> Result<DNSimpleResponse<Vec<Certificate>>, String>
List the certificates for a domain in the account.
Examples
use dnsimple::dnsimple::{Client, new_client};
let client = new_client(true, String::from("AUTH_TOKEN"));
let certificates = client.certificates().list_certificates(1010, "example.com", None).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
options
: The RequestOptions
.
- Sorting: id
, common_name
, expiration
pub fn get_certificate(
&self,
account_id: u64,
domain: &str,
certificate_id: u64
) -> Result<DNSimpleResponse<Certificate>, String>
pub fn get_certificate(
&self,
account_id: u64,
domain: &str,
certificate_id: u64
) -> Result<DNSimpleResponse<Certificate>, String>
Get the details of a certificate
Examples
use dnsimple::dnsimple::{Client, new_client};
let client = new_client(true, String::from("AUTH_TOKEN"));
let certificate = client.certificates().get_certificate(1010, "example.com", 42).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
certificate_id
: The certificate id
pub fn download_certificate(
&self,
account_id: u64,
domain: &str,
certificate_id: u64
) -> Result<DNSimpleResponse<CertificateBundle>, String>
pub fn download_certificate(
&self,
account_id: u64,
domain: &str,
certificate_id: u64
) -> Result<DNSimpleResponse<CertificateBundle>, String>
Download a certificate
Examples
use dnsimple::dnsimple::{Client, new_client};
let client = new_client(true, String::from("AUTH_TOKEN"));
let certificate = client.certificates().download_certificate(1010, "example.com", 42).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
certificate_id
: The certificate id
pub fn get_certificate_private_key(
&self,
account_id: u64,
domain: &str,
certificate_id: u64
) -> Result<DNSimpleResponse<CertificatePrivateKey>, String>
pub fn get_certificate_private_key(
&self,
account_id: u64,
domain: &str,
certificate_id: u64
) -> Result<DNSimpleResponse<CertificatePrivateKey>, String>
Get the PEM-encoded certificate private key
Examples
use dnsimple::dnsimple::{Client, new_client};
let client = new_client(true, String::from("AUTH_TOKEN"));
let private_key = client.certificates().get_certificate_private_key(1010, "example.com", 42).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
certificate_id
: The certificate id
pub fn purchase_letsencrypt_certificate(
&self,
account_id: u64,
domain: &str,
payload: LetsEncryptPurchasePayload
) -> Result<DNSimpleResponse<LetsEncryptPurchase>, String>
pub fn purchase_letsencrypt_certificate(
&self,
account_id: u64,
domain: &str,
payload: LetsEncryptPurchasePayload
) -> Result<DNSimpleResponse<LetsEncryptPurchase>, String>
Purchase a Let’s Encrypt certificate with DNSimple.
Examples
use dnsimple::dnsimple::{Client, new_client};
use dnsimple::dnsimple::certificates::LetsEncryptPurchasePayload;
let client = new_client(true, String::from("AUTH_TOKEN"));
let payload = LetsEncryptPurchasePayload {
contact_id: 42,
auto_renew: true,
name: String::from("secret"),
alternate_names: vec![],
};
let purchase = client.certificates().purchase_letsencrypt_certificate(1010, "example.com", payload).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
payload
: The LetsEncryptPurchasePayload
containing the information to purchase the certificate
pub fn issue_letsencrypt_certificate(
&self,
account_id: u64,
domain: &str,
certificate_id: u64
) -> Result<DNSimpleResponse<Certificate>, String>
pub fn issue_letsencrypt_certificate(
&self,
account_id: u64,
domain: &str,
certificate_id: u64
) -> Result<DNSimpleResponse<Certificate>, String>
Issue a Let’s Encrypt certificate for a domain in the account
Examples
use dnsimple::dnsimple::{Client, new_client};
let client = new_client(true, String::from("AUTH_TOKEN"));
let issued = client.certificates().issue_letsencrypt_certificate(1010, "example.com", 42).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
certificate_id
: The id of the certificate to be issued
pub fn purchase_letsencrypt_certificate_renewal(
&self,
account_id: u64,
domain: &str,
certificate_id: u64,
payload: LetsEncryptPurchaseRenewalPayload
) -> Result<DNSimpleResponse<LetsEncryptPurchaseRenewal>, String>
pub fn purchase_letsencrypt_certificate_renewal(
&self,
account_id: u64,
domain: &str,
certificate_id: u64,
payload: LetsEncryptPurchaseRenewalPayload
) -> Result<DNSimpleResponse<LetsEncryptPurchaseRenewal>, String>
Purchase a Let’s Encrypt certificate renewal
Examples
use dnsimple::dnsimple::{Client, new_client};
use dnsimple::dnsimple::certificates::LetsEncryptPurchaseRenewalPayload;
let client = new_client(true, String::from("AUTH_TOKEN"));
let payload = LetsEncryptPurchaseRenewalPayload {
auto_renew: false,
};
let issued = client.certificates().purchase_letsencrypt_certificate_renewal(1010, "example.com", 42, payload).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
payload
: The LetsEncryptPurchaseRenewalPayload
containing the information to purchase the certificate
pub fn issue_letsencrypt_certificate_renewal(
&self,
account_id: u64,
domain: &str,
certificate_id: u64,
certificate_renewal_id: u64
) -> Result<DNSimpleResponse<Certificate>, String>
pub fn issue_letsencrypt_certificate_renewal(
&self,
account_id: u64,
domain: &str,
certificate_id: u64,
certificate_renewal_id: u64
) -> Result<DNSimpleResponse<Certificate>, String>
Issue a Let’s Encrypt certificate for a domain in the account
Examples
use dnsimple::dnsimple::{Client, new_client};
let client = new_client(true, String::from("AUTH_TOKEN"));
let issued = client.certificates().issue_letsencrypt_certificate_renewal(1010, "example.com", 41, 42).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
certificate_id
: The id of the certificate to be issued
certificate_renewal_id
: The certificate renewal id