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.
-
#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 |
# 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 |
#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.
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 214 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.
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 281 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 |