class NgrokAPI::Services::CertificateAuthoritiesClient
Certificate Authorities are x509 certificates that are used to sign other
x509 certificates. Attach a Certificate Authority to the Mutual TLS module to verify that the TLS certificate presented by a client has been signed by this CA. Certificate Authorities are used only for mTLS validation only and thus a private key is not included in the resource.
Constants
- LIST_PROPERTY
The List Property from the resulting API for list calls
- PATH
The API path for the requests
Attributes
Public Class Methods
# File lib/ngrokapi/services/certificate_authorities_client.rb, line 21 def initialize(client:) @client = client end
Public Instance Methods
Upload a new Certificate Authority
@param [string] description human-readable description of this Certificate Authority. optional, max 255 bytes. @param [string] metadata arbitrary user-defined machine-readable data of this Certificate Authority. optional, max 4096 bytes. @param [string] ca_pem raw PEM of the Certificate Authority @return [NgrokAPI::Models::CertificateAuthority] result from the API request
ngrok.com/docs/api#api-certificate-authorities-create
# File lib/ngrokapi/services/certificate_authorities_client.rb, line 34 def create(description: "", metadata: "", ca_pem:) path = '/certificate_authorities' replacements = { } data = {} data[:description] = description if description data[:metadata] = metadata if metadata data[:ca_pem] = ca_pem if ca_pem result = @client.post(path % replacements, data: data) NgrokAPI::Models::CertificateAuthority.new(client: self, attrs: result) end
Upload a new Certificate Authority Throws an exception if API error.
@param [string] description human-readable description of this Certificate Authority. optional, max 255 bytes. @param [string] metadata arbitrary user-defined machine-readable data of this Certificate Authority. optional, max 4096 bytes. @param [string] ca_pem raw PEM of the Certificate Authority @return [NgrokAPI::Models::CertificateAuthority] result from the API request
ngrok.com/docs/api#api-certificate-authorities-create
# File lib/ngrokapi/services/certificate_authorities_client.rb, line 56 def create!(description: "", metadata: "", ca_pem:) path = '/certificate_authorities' replacements = { } data = {} data[:description] = description if description data[:metadata] = metadata if metadata data[:ca_pem] = ca_pem if ca_pem result = @client.post(path % replacements, data: data, danger: true) NgrokAPI::Models::CertificateAuthority.new(client: self, attrs: result) end
Delete a Certificate Authority
@param [string] id a resource identifier @return [NgrokAPI::Models::Empty] result from the API request
ngrok.com/docs/api#api-certificate-authorities-delete
# File lib/ngrokapi/services/certificate_authorities_client.rb, line 75 def delete(id: "") path = '/certificate_authorities/%{id}' replacements = { id: id, } @client.delete(path % replacements) end
Delete a Certificate Authority Throws an exception if API error.
@param [string] id a resource identifier @return [NgrokAPI::Models::Empty] result from the API request
ngrok.com/docs/api#api-certificate-authorities-delete
# File lib/ngrokapi/services/certificate_authorities_client.rb, line 91 def delete!(id: "") path = '/certificate_authorities/%{id}' replacements = { id: id, } @client.delete(path % replacements, danger: true) end
Get detailed information about a certficate authority
@param [string] id a resource identifier @return [NgrokAPI::Models::CertificateAuthority] result from the API request
ngrok.com/docs/api#api-certificate-authorities-get
# File lib/ngrokapi/services/certificate_authorities_client.rb, line 106 def get(id: "") path = '/certificate_authorities/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data) NgrokAPI::Models::CertificateAuthority.new(client: self, attrs: result) end
Get detailed information about a certficate authority Throws an exception if API error.
@param [string] id a resource identifier @return [NgrokAPI::Models::CertificateAuthority] result from the API request
ngrok.com/docs/api#api-certificate-authorities-get
# File lib/ngrokapi/services/certificate_authorities_client.rb, line 124 def get!(id: "") path = '/certificate_authorities/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data, danger: true) NgrokAPI::Models::CertificateAuthority.new(client: self, attrs: result) end
List all Certificate Authority on this account
@param [string] before_id @param [string] limit @param [string] url optional and mutually exclusive from before_id and limit @return [NgrokAPI::Models::Listable] result from the API request
ngrok.com/docs/api#api-certificate-authorities-list
# File lib/ngrokapi/services/certificate_authorities_client.rb, line 143 def list(before_id: nil, limit: nil, url: nil) result = @client.list( before_id: before_id, limit: limit, url: url, path: PATH ) NgrokAPI::Models::Listable.new( client: self, attrs: result, list_property: LIST_PROPERTY, klass: NgrokAPI::Models::CertificateAuthority ) end
List all Certificate Authority on this account Throws an exception if API error.
@param [string] before_id @param [string] limit @param [string] url optional and mutually exclusive from before_id and limit @return [NgrokAPI::Models::Listable] result from the API request
ngrok.com/docs/api#api-certificate-authorities-list
# File lib/ngrokapi/services/certificate_authorities_client.rb, line 169 def list!(before_id: nil, limit: nil, url: nil) result = @client.list( before_id: before_id, limit: limit, danger: true, url: url, path: PATH ) NgrokAPI::Models::Listable.new( client: self, attrs: result, list_property: LIST_PROPERTY, klass: NgrokAPI::Models::CertificateAuthority, danger: true ) end
Update attributes of a Certificate Authority by ID
@param [string] id @param [string] description human-readable description of this Certificate Authority. optional, max 255 bytes. @param [string] metadata arbitrary user-defined machine-readable data of this Certificate Authority. optional, max 4096 bytes. @return [NgrokAPI::Models::CertificateAuthority] result from the API request
ngrok.com/docs/api#api-certificate-authorities-update
# File lib/ngrokapi/services/certificate_authorities_client.rb, line 196 def update(id: "", description: nil, metadata: nil) path = '/certificate_authorities/%{id}' replacements = { id: id, } data = {} data[:description] = description if description data[:metadata] = metadata if metadata result = @client.patch(path % replacements, data: data) NgrokAPI::Models::CertificateAuthority.new(client: self, attrs: result) end
Update attributes of a Certificate Authority by ID Throws an exception if API error.
@param [string] id @param [string] description human-readable description of this Certificate Authority. optional, max 255 bytes. @param [string] metadata arbitrary user-defined machine-readable data of this Certificate Authority. optional, max 4096 bytes. @return [NgrokAPI::Models::CertificateAuthority] result from the API request
ngrok.com/docs/api#api-certificate-authorities-update
# File lib/ngrokapi/services/certificate_authorities_client.rb, line 218 def update!(id: "", description: nil, metadata: nil) path = '/certificate_authorities/%{id}' replacements = { id: id, } data = {} data[:description] = description if description data[:metadata] = metadata if metadata result = @client.patch(path % replacements, data: data, danger: true) NgrokAPI::Models::CertificateAuthority.new(client: self, attrs: result) end