Class: NgrokAPI::Services::EndpointConfigurationsClient
- Inherits:
-
Object
- Object
- NgrokAPI::Services::EndpointConfigurationsClient
- Defined in:
- lib/ngrokapi/services/endpoint_configurations_client.rb
Overview
Endpoint Configurations are a reusable group of modules that encapsulate how traffic to a domain or address is handled. Endpoint configurations are only applied to Domains and TCP Addresses they have been attached to.
Constant Summary collapse
- PATH =
The API path for the requests
'/endpoint_configurations'
- LIST_PROPERTY =
The List Property from the resulting API for list calls
'endpoint_configurations'
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#create(type: "", description: "", metadata: "", basic_auth: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, ip_policy: nil, mutual_tls: nil, tls_termination: nil, webhook_validation: nil, oauth: nil, logging: nil, saml: nil, oidc: nil, backend: nil) ⇒ NgrokAPI::Models::EndpointConfiguration
Create a new endpoint configuration.
-
#delete(id: "") ⇒ NgrokAPI::Models::Empty
Delete an endpoint configuration.
-
#delete!(id: "") ⇒ NgrokAPI::Models::Empty
Delete an endpoint configuration.
-
#get(id: "") ⇒ NgrokAPI::Models::EndpointConfiguration
Returns detailed information about an endpoint configuration.
-
#get!(id: "") ⇒ NgrokAPI::Models::EndpointConfiguration
Returns detailed information about an endpoint configuration Throws an exception if API error.
-
#initialize(client:) ⇒ EndpointConfigurationsClient
constructor
A new instance of EndpointConfigurationsClient.
-
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
Returns a list of all endpoint configurations on this account.
-
#list!(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
Returns a list of all endpoint configurations on this account Throws an exception if API error.
-
#update(id: "", description: nil, metadata: nil, basic_auth: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, ip_policy: nil, mutual_tls: nil, tls_termination: nil, webhook_validation: nil, oauth: nil, logging: nil, saml: nil, oidc: nil, backend: nil) ⇒ NgrokAPI::Models::EndpointConfiguration
Updates an endpoint configuration.
-
#update!(id: "", description: nil, metadata: nil, basic_auth: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, ip_policy: nil, mutual_tls: nil, tls_termination: nil, webhook_validation: nil, oauth: nil, logging: nil, saml: nil, oidc: nil, backend: nil) ⇒ NgrokAPI::Models::EndpointConfiguration
Updates an endpoint configuration.
Constructor Details
#initialize(client:) ⇒ EndpointConfigurationsClient
Returns a new instance of EndpointConfigurationsClient.
19 20 21 |
# File 'lib/ngrokapi/services/endpoint_configurations_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/endpoint_configurations_client.rb', line 17 def client @client end |
Instance Method Details
#create(type: "", description: "", metadata: "", basic_auth: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, ip_policy: nil, mutual_tls: nil, tls_termination: nil, webhook_validation: nil, oauth: nil, logging: nil, saml: nil, oidc: nil, backend: nil) ⇒ NgrokAPI::Models::EndpointConfiguration
Create a new endpoint configuration
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 44 def create( type: "", description: "", metadata: "", basic_auth: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, ip_policy: nil, mutual_tls: nil, tls_termination: nil, webhook_validation: nil, oauth: nil, logging: nil, saml: nil, oidc: nil, backend: nil ) path = '/endpoint_configurations' replacements = { } data = {} data[:type] = type if type data[:description] = description if description data[:metadata] = if data[:circuit_breaker] = circuit_breaker if circuit_breaker data[:compression] = compression if compression data[:request_headers] = request_headers if request_headers data[:response_headers] = response_headers if response_headers data[:ip_policy] = ip_policy if ip_policy data[:mutual_tls] = mutual_tls if mutual_tls data[:tls_termination] = tls_termination if tls_termination data[:webhook_validation] = webhook_validation if webhook_validation data[:oauth] = oauth if oauth data[:logging] = logging if logging data[:saml] = saml if saml data[:oidc] = oidc if oidc result = @client.post(path % replacements, data: data) NgrokAPI::Models::EndpointConfiguration.new(client: self, result: result) end |
#delete(id: "") ⇒ NgrokAPI::Models::Empty
Delete an endpoint configuration. This operation will fail if the endpoint configuration is still referenced by any reserved domain or reserved address.
94 95 96 97 98 99 100 101 102 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 94 def delete( id: "" ) path = '/endpoint_configurations/%{id}' replacements = { id: id, } @client.delete(path % replacements) end |
#delete!(id: "") ⇒ NgrokAPI::Models::Empty
Delete an endpoint configuration. This operation will fail if the endpoint configuration is still referenced by any reserved domain or reserved address. Throws an exception if API error.
113 114 115 116 117 118 119 120 121 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 113 def delete!( id: "" ) path = '/endpoint_configurations/%{id}' replacements = { id: id, } @client.delete(path % replacements, danger: true) end |
#get(id: "") ⇒ NgrokAPI::Models::EndpointConfiguration
Returns detailed information about an endpoint configuration
130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 130 def get( id: "" ) path = '/endpoint_configurations/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data) NgrokAPI::Models::EndpointConfiguration.new(client: self, result: result) end |
#get!(id: "") ⇒ NgrokAPI::Models::EndpointConfiguration
Returns detailed information about an endpoint configuration Throws an exception if API error.
150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 150 def get!( id: "" ) path = '/endpoint_configurations/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data, danger: true) NgrokAPI::Models::EndpointConfiguration.new(client: self, result: result) end |
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
Returns a list of all endpoint configurations on this account
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 171 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::EndpointConfiguration ) end |
#list!(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
Returns a list of all endpoint configurations on this account Throws an exception if API error.
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 201 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::EndpointConfiguration, danger: true ) end |
#update(id: "", description: nil, metadata: nil, basic_auth: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, ip_policy: nil, mutual_tls: nil, tls_termination: nil, webhook_validation: nil, oauth: nil, logging: nil, saml: nil, oidc: nil, backend: nil) ⇒ NgrokAPI::Models::EndpointConfiguration
Updates an endpoint configuration. 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.
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 247 def update( id: "", description: nil, metadata: nil, basic_auth: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, ip_policy: nil, mutual_tls: nil, tls_termination: nil, webhook_validation: nil, oauth: nil, logging: nil, saml: nil, oidc: nil, backend: nil ) path = '/endpoint_configurations/%{id}' replacements = { id: id, } data = {} data[:description] = description if description data[:metadata] = if data[:circuit_breaker] = circuit_breaker if circuit_breaker data[:compression] = compression if compression data[:request_headers] = request_headers if request_headers data[:response_headers] = response_headers if response_headers data[:ip_policy] = ip_policy if ip_policy data[:mutual_tls] = mutual_tls if mutual_tls data[:tls_termination] = tls_termination if tls_termination data[:webhook_validation] = webhook_validation if webhook_validation data[:oauth] = oauth if oauth data[:logging] = logging if logging data[:saml] = saml if saml data[:oidc] = oidc if oidc result = @client.patch(path % replacements, data: data) NgrokAPI::Models::EndpointConfiguration.new(client: self, result: result) end |
#update!(id: "", description: nil, metadata: nil, basic_auth: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, ip_policy: nil, mutual_tls: nil, tls_termination: nil, webhook_validation: nil, oauth: nil, logging: nil, saml: nil, oidc: nil, backend: nil) ⇒ NgrokAPI::Models::EndpointConfiguration
Updates an endpoint configuration. 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.
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 314 def update!( id: "", description: nil, metadata: nil, basic_auth: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, ip_policy: nil, mutual_tls: nil, tls_termination: nil, webhook_validation: nil, oauth: nil, logging: nil, saml: nil, oidc: nil, backend: nil ) path = '/endpoint_configurations/%{id}' replacements = { id: id, } data = {} data[:description] = description if description data[:metadata] = if data[:circuit_breaker] = circuit_breaker if circuit_breaker data[:compression] = compression if compression data[:request_headers] = request_headers if request_headers data[:response_headers] = response_headers if response_headers data[:ip_policy] = ip_policy if ip_policy data[:mutual_tls] = mutual_tls if mutual_tls data[:tls_termination] = tls_termination if tls_termination data[:webhook_validation] = webhook_validation if webhook_validation data[:oauth] = oauth if oauth data[:logging] = logging if logging data[:saml] = saml if saml data[:oidc] = oidc if oidc result = @client.patch(path % replacements, data: data, danger: true) NgrokAPI::Models::EndpointConfiguration.new(client: self, result: result) end |