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 |
# 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.
76 77 78 79 80 81 82 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 76 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.
93 94 95 96 97 98 99 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 93 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
108 109 110 111 112 113 114 115 116 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 108 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.
126 127 128 129 130 131 132 133 134 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 126 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
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 145 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.
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 172 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.
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 215 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.
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 264 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 |