Class: NgrokAPI::Services::EdgesTLSClient
- Inherits:
-
Object
- Object
- NgrokAPI::Services::EdgesTLSClient
- Defined in:
- lib/ngrokapi/services/edges_tls_client.rb
Overview
Constant Summary collapse
- PATH =
The API path for the requests
'/edges/tls'
- LIST_PROPERTY =
The List Property from the resulting API for list calls
'tls_edges'
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#create(description: "", metadata: "", hostports: nil, backend: nil, ip_restriction: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::TLSEdge
Create a TLS Edge.
-
#delete(id: "") ⇒ NgrokAPI::Models::Empty
Delete a TLS Edge by ID.
-
#delete!(id: "") ⇒ NgrokAPI::Models::Empty
Delete a TLS Edge by ID Throws an exception if API error.
-
#get(id: "") ⇒ NgrokAPI::Models::TLSEdge
Get a TLS Edge by ID.
-
#get!(id: "") ⇒ NgrokAPI::Models::TLSEdge
Get a TLS Edge by ID Throws an exception if API error.
-
#initialize(client:) ⇒ EdgesTLSClient
constructor
A new instance of EdgesTLSClient.
-
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
Returns a list of all TLS Edges on this account.
-
#list!(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
Returns a list of all TLS Edges on this account Throws an exception if API error.
-
#update(id: "", description: nil, metadata: nil, hostports: nil, backend: nil, ip_restriction: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::TLSEdge
Updates a TLS Edge by ID.
-
#update!(id: "", description: nil, metadata: nil, hostports: nil, backend: nil, ip_restriction: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::TLSEdge
Updates a TLS Edge by ID.
Constructor Details
#initialize(client:) ⇒ EdgesTLSClient
Returns a new instance of EdgesTLSClient.
15 16 17 |
# File 'lib/ngrokapi/services/edges_tls_client.rb', line 15 def initialize(client:) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
13 14 15 |
# File 'lib/ngrokapi/services/edges_tls_client.rb', line 13 def client @client end |
Instance Method Details
#create(description: "", metadata: "", hostports: nil, backend: nil, ip_restriction: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::TLSEdge
Create a TLS Edge
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/ngrokapi/services/edges_tls_client.rb', line 32 def create(description: "", metadata: "", hostports: nil, backend: nil, ip_restriction: nil, mutual_tls: nil, tls_termination: nil) path = '/edges/tls' replacements = { } data = {} data[:description] = description if description data[:metadata] = if data[:hostports] = hostports if hostports data[:backend] = backend if backend data[:ip_restriction] = ip_restriction if ip_restriction data[:mutual_tls] = mutual_tls if mutual_tls data[:tls_termination] = tls_termination if tls_termination result = @client.post(path % replacements, data: data) NgrokAPI::Models::TLSEdge.new(client: self, result: result) end |
#delete(id: "") ⇒ NgrokAPI::Models::Empty
Delete a TLS Edge by ID
214 215 216 217 218 219 220 |
# File 'lib/ngrokapi/services/edges_tls_client.rb', line 214 def delete(id: "") path = '/edges/tls/%{id}' replacements = { id: id, } @client.delete(path % replacements) end |
#delete!(id: "") ⇒ NgrokAPI::Models::Empty
Delete a TLS Edge by ID Throws an exception if API error.
230 231 232 233 234 235 236 |
# File 'lib/ngrokapi/services/edges_tls_client.rb', line 230 def delete!(id: "") path = '/edges/tls/%{id}' replacements = { id: id, } @client.delete(path % replacements, danger: true) end |
#get(id: "") ⇒ NgrokAPI::Models::TLSEdge
Get a TLS Edge by ID
55 56 57 58 59 60 61 62 63 |
# File 'lib/ngrokapi/services/edges_tls_client.rb', line 55 def get(id: "") path = '/edges/tls/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data) NgrokAPI::Models::TLSEdge.new(client: self, result: result) end |
#get!(id: "") ⇒ NgrokAPI::Models::TLSEdge
Get a TLS Edge by ID Throws an exception if API error.
73 74 75 76 77 78 79 80 81 |
# File 'lib/ngrokapi/services/edges_tls_client.rb', line 73 def get!(id: "") path = '/edges/tls/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data, danger: true) NgrokAPI::Models::TLSEdge.new(client: self, result: result) end |
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
Returns a list of all TLS Edges on this account
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/ngrokapi/services/edges_tls_client.rb', line 92 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, result: result, list_property: LIST_PROPERTY, klass: NgrokAPI::Models::TLSEdge ) end |
#list!(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
Returns a list of all TLS Edges on this account Throws an exception if API error.
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/ngrokapi/services/edges_tls_client.rb', line 119 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, result: result, list_property: LIST_PROPERTY, klass: NgrokAPI::Models::TLSEdge, danger: true ) end |
#update(id: "", description: nil, metadata: nil, hostports: nil, backend: nil, ip_restriction: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::TLSEdge
Updates a TLS Edge by ID. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API.
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/ngrokapi/services/edges_tls_client.rb', line 155 def update(id: "", description: nil, metadata: nil, hostports: nil, backend: nil, ip_restriction: nil, mutual_tls: nil, tls_termination: nil) path = '/edges/tls/%{id}' replacements = { id: id, } data = {} data[:description] = description if description data[:metadata] = if data[:hostports] = hostports if hostports data[:backend] = backend if backend data[:ip_restriction] = ip_restriction if ip_restriction data[:mutual_tls] = mutual_tls if mutual_tls data[:tls_termination] = tls_termination if tls_termination result = @client.patch(path % replacements, data: data) NgrokAPI::Models::TLSEdge.new(client: self, result: result) end |
#update!(id: "", description: nil, metadata: nil, hostports: nil, backend: nil, ip_restriction: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::TLSEdge
Updates a TLS Edge by ID. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API. Throws an exception if API error.
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/ngrokapi/services/edges_tls_client.rb', line 190 def update!(id: "", description: nil, metadata: nil, hostports: nil, backend: nil, ip_restriction: nil, mutual_tls: nil, tls_termination: nil) path = '/edges/tls/%{id}' replacements = { id: id, } data = {} data[:description] = description if description data[:metadata] = if data[:hostports] = hostports if hostports data[:backend] = backend if backend data[:ip_restriction] = ip_restriction if ip_restriction data[:mutual_tls] = mutual_tls if mutual_tls data[:tls_termination] = tls_termination if tls_termination result = @client.patch(path % replacements, data: data, danger: true) NgrokAPI::Models::TLSEdge.new(client: self, result: result) end |