Class: NgrokAPI::Services::SSHUserCertificatesClient
- Inherits:
-
Object
- Object
- NgrokAPI::Services::SSHUserCertificatesClient
- Defined in:
- lib/ngrokapi/services/ssh_user_certificates_client.rb
Overview
SSH User Certificates are presented by SSH clients when connecting to an SSH server to authenticate their connection. The SSH server must trust the SSH Certificate Authority used to sign the certificate.
Constant Summary collapse
- PATH =
The API path for the requests
'/ssh_user_certificates'
- LIST_PROPERTY =
The List Property from the resulting API for list calls
'ssh_user_certificates'
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#create(ssh_certificate_authority_id:, public_key:, principals: [], critical_options: {}, extensions: {}, valid_after: "", valid_until: "", description: "", metadata: "") ⇒ NgrokAPI::Models::SSHUserCertificate
Create a new SSH User Certificate.
-
#create!(ssh_certificate_authority_id:, public_key:, principals: [], critical_options: {}, extensions: {}, valid_after: "", valid_until: "", description: "", metadata: "") ⇒ NgrokAPI::Models::SSHUserCertificate
Create a new SSH User Certificate Throws an exception if API error.
-
#delete(id: "") ⇒ NgrokAPI::Models::Empty
Delete an SSH User Certificate.
-
#delete!(id: "") ⇒ NgrokAPI::Models::Empty
Delete an SSH User Certificate Throws an exception if API error.
-
#get(id: "") ⇒ NgrokAPI::Models::SSHUserCertificate
Get detailed information about an SSH User Certficate.
-
#get!(id: "") ⇒ NgrokAPI::Models::SSHUserCertificate
Get detailed information about an SSH User Certficate Throws an exception if API error.
-
#initialize(client:) ⇒ SSHUserCertificatesClient
constructor
A new instance of SSHUserCertificatesClient.
-
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all SSH User Certificates issued on this account.
-
#list!(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all SSH User Certificates issued on this account Throws an exception if API error.
-
#update(id: "", description: nil, metadata: nil) ⇒ NgrokAPI::Models::SSHUserCertificate
Update an SSH User Certificate.
-
#update!(id: "", description: nil, metadata: nil) ⇒ NgrokAPI::Models::SSHUserCertificate
Update an SSH User Certificate Throws an exception if API error.
Constructor Details
#initialize(client:) ⇒ SSHUserCertificatesClient
Returns a new instance of SSHUserCertificatesClient.
19 20 21 |
# File 'lib/ngrokapi/services/ssh_user_certificates_client.rb', line 19 def initialize(client:) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
17 18 19 |
# File 'lib/ngrokapi/services/ssh_user_certificates_client.rb', line 17 def client @client end |
Instance Method Details
#create(ssh_certificate_authority_id:, public_key:, principals: [], critical_options: {}, extensions: {}, valid_after: "", valid_until: "", description: "", metadata: "") ⇒ NgrokAPI::Models::SSHUserCertificate
Create a new SSH User Certificate
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/ngrokapi/services/ssh_user_certificates_client.rb', line 38 def create(ssh_certificate_authority_id:, public_key:, principals: [], critical_options: {}, extensions: {}, valid_after: "", valid_until: "", description: "", metadata: "") path = '/ssh_user_certificates' replacements = { } data = {} data[:ssh_certificate_authority_id] = if data[:public_key] = public_key if public_key data[:principals] = principals if principals data[:critical_options] = if data[:extensions] = extensions if extensions data[:valid_after] = valid_after if valid_after data[:valid_until] = valid_until if valid_until data[:description] = description if description data[:metadata] = if result = @client.post(path % replacements, data: data) NgrokAPI::Models::SSHUserCertificate.new(client: self, attrs: result) end |
#create!(ssh_certificate_authority_id:, public_key:, principals: [], critical_options: {}, extensions: {}, valid_after: "", valid_until: "", description: "", metadata: "") ⇒ NgrokAPI::Models::SSHUserCertificate
Create a new SSH User Certificate Throws an exception if API error.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/ngrokapi/services/ssh_user_certificates_client.rb', line 72 def create!(ssh_certificate_authority_id:, public_key:, principals: [], critical_options: {}, extensions: {}, valid_after: "", valid_until: "", description: "", metadata: "") path = '/ssh_user_certificates' replacements = { } data = {} data[:ssh_certificate_authority_id] = if data[:public_key] = public_key if public_key data[:principals] = principals if principals data[:critical_options] = if data[:extensions] = extensions if extensions data[:valid_after] = valid_after if valid_after data[:valid_until] = valid_until if valid_until data[:description] = description if description data[:metadata] = if result = @client.post(path % replacements, data: data, danger: true) NgrokAPI::Models::SSHUserCertificate.new(client: self, attrs: result) end |
#delete(id: "") ⇒ NgrokAPI::Models::Empty
Delete an SSH User Certificate
97 98 99 100 101 102 103 |
# File 'lib/ngrokapi/services/ssh_user_certificates_client.rb', line 97 def delete(id: "") path = '/ssh_user_certificates/%{id}' replacements = { id: id, } @client.delete(path % replacements) end |
#delete!(id: "") ⇒ NgrokAPI::Models::Empty
Delete an SSH User Certificate Throws an exception if API error.
113 114 115 116 117 118 119 |
# File 'lib/ngrokapi/services/ssh_user_certificates_client.rb', line 113 def delete!(id: "") path = '/ssh_user_certificates/%{id}' replacements = { id: id, } @client.delete(path % replacements, danger: true) end |
#get(id: "") ⇒ NgrokAPI::Models::SSHUserCertificate
Get detailed information about an SSH User Certficate
128 129 130 131 132 133 134 135 136 |
# File 'lib/ngrokapi/services/ssh_user_certificates_client.rb', line 128 def get(id: "") path = '/ssh_user_certificates/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data) NgrokAPI::Models::SSHUserCertificate.new(client: self, attrs: result) end |
#get!(id: "") ⇒ NgrokAPI::Models::SSHUserCertificate
Get detailed information about an SSH User Certficate Throws an exception if API error.
146 147 148 149 150 151 152 153 154 |
# File 'lib/ngrokapi/services/ssh_user_certificates_client.rb', line 146 def get!(id: "") path = '/ssh_user_certificates/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data, danger: true) NgrokAPI::Models::SSHUserCertificate.new(client: self, attrs: result) end |
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all SSH User Certificates issued on this account
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/ngrokapi/services/ssh_user_certificates_client.rb', line 165 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::SSHUserCertificate ) end |
#list!(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all SSH User Certificates issued on this account Throws an exception if API error.
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/ngrokapi/services/ssh_user_certificates_client.rb', line 191 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::SSHUserCertificate, danger: true ) end |
#update(id: "", description: nil, metadata: nil) ⇒ NgrokAPI::Models::SSHUserCertificate
Update an SSH User Certificate
218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/ngrokapi/services/ssh_user_certificates_client.rb', line 218 def update(id: "", description: nil, metadata: nil) path = '/ssh_user_certificates/%{id}' replacements = { id: id, } data = {} data[:description] = description if description data[:metadata] = if result = @client.patch(path % replacements, data: data) NgrokAPI::Models::SSHUserCertificate.new(client: self, attrs: result) end |
#update!(id: "", description: nil, metadata: nil) ⇒ NgrokAPI::Models::SSHUserCertificate
Update an SSH User Certificate Throws an exception if API error.
240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/ngrokapi/services/ssh_user_certificates_client.rb', line 240 def update!(id: "", description: nil, metadata: nil) path = '/ssh_user_certificates/%{id}' replacements = { id: id, } data = {} data[:description] = description if description data[:metadata] = if result = @client.patch(path % replacements, data: data, danger: true) NgrokAPI::Models::SSHUserCertificate.new(client: self, attrs: result) end |