Class: NgrokAPI::Services::EndpointConfigurationsClient

Inherits:
Object
  • Object
show all
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.

ngrok.com/docs/api#api-endpoint-configurations

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

Instance Method Summary collapse

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

#clientObject (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

ngrok.com/docs/api#api-endpoint-configurations-create

Parameters:

  • type (string) (defaults to: "")

    they type of traffic this endpoint configuration can be applied to. one of: http, https, tcp

  • description (string) (defaults to: "")

    human-readable description of what this endpoint configuration will be do when applied or what traffic it will be applied to. Optional, max 255 bytes

  • metadata (string) (defaults to: "")

    arbitrary user-defined machine-readable data of this endpoint configuration. Optional, max 4096 bytes.

  • circuit_breaker (EndpointCircuitBreaker) (defaults to: nil)

    circuit breaker module configuration or null

  • compression (EndpointCompression) (defaults to: nil)

    compression module configuration or null

  • request_headers (EndpointRequestHeaders) (defaults to: nil)

    request headers module configuration or null

  • response_headers (EndpointResponseHeaders) (defaults to: nil)

    response headers module configuration or null

  • ip_policy (EndpointIPPolicyMutate) (defaults to: nil)

    ip policy module configuration or null

  • mutual_tls (EndpointMutualTLSMutate) (defaults to: nil)

    mutual TLS module configuration or null

  • tls_termination (EndpointTLSTermination) (defaults to: nil)

    TLS termination module configuration or null

  • webhook_validation (EndpointWebhookValidation) (defaults to: nil)

    webhook validation module configuration or null

  • oauth (EndpointOAuth) (defaults to: nil)

    oauth module configuration or null

  • logging (EndpointLoggingMutate) (defaults to: nil)

    logging module configuration or null

  • saml (EndpointSAMLMutate) (defaults to: nil)

    saml module configuration or null

  • oidc (EndpointOIDC) (defaults to: nil)

    oidc module configuration or null

Returns:



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.

ngrok.com/docs/api#api-endpoint-configurations-delete

Parameters:

  • id (string) (defaults to: "")

    a resource identifier

Returns:

  • (NgrokAPI::Models::Empty)

    result from the API request



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.

ngrok.com/docs/api#api-endpoint-configurations-delete

Parameters:

  • id (string) (defaults to: "")

    a resource identifier

Returns:

  • (NgrokAPI::Models::Empty)

    result from the API request



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

ngrok.com/docs/api#api-endpoint-configurations-get

Parameters:

  • id (string) (defaults to: "")

    a resource identifier

Returns:



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.

ngrok.com/docs/api#api-endpoint-configurations-get

Parameters:

  • id (string) (defaults to: "")

    a resource identifier

Returns:



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

ngrok.com/docs/api#api-endpoint-configurations-list

Parameters:

  • before_id (string) (defaults to: nil)
  • limit (string) (defaults to: nil)
  • url (string) (defaults to: nil)

    optional and mutually exclusive from before_id and limit

Returns:



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.

ngrok.com/docs/api#api-endpoint-configurations-list

Parameters:

  • before_id (string) (defaults to: nil)
  • limit (string) (defaults to: nil)
  • url (string) (defaults to: nil)

    optional and mutually exclusive from before_id and limit

Returns:



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.

ngrok.com/docs/api#api-endpoint-configurations-update

Parameters:

  • id (string) (defaults to: "")

    unique identifier of this endpoint configuration

  • description (string) (defaults to: nil)

    human-readable description of what this endpoint configuration will be do when applied or what traffic it will be applied to. Optional, max 255 bytes

  • metadata (string) (defaults to: nil)

    arbitrary user-defined machine-readable data of this endpoint configuration. Optional, max 4096 bytes.

  • circuit_breaker (EndpointCircuitBreaker) (defaults to: nil)

    circuit breaker module configuration or null

  • compression (EndpointCompression) (defaults to: nil)

    compression module configuration or null

  • request_headers (EndpointRequestHeaders) (defaults to: nil)

    request headers module configuration or null

  • response_headers (EndpointResponseHeaders) (defaults to: nil)

    response headers module configuration or null

  • ip_policy (EndpointIPPolicyMutate) (defaults to: nil)

    ip policy module configuration or null

  • mutual_tls (EndpointMutualTLSMutate) (defaults to: nil)

    mutual TLS module configuration or null

  • tls_termination (EndpointTLSTermination) (defaults to: nil)

    TLS termination module configuration or null

  • webhook_validation (EndpointWebhookValidation) (defaults to: nil)

    webhook validation module configuration or null

  • oauth (EndpointOAuth) (defaults to: nil)

    oauth module configuration or null

  • logging (EndpointLoggingMutate) (defaults to: nil)

    logging module configuration or null

  • saml (EndpointSAMLMutate) (defaults to: nil)

    saml module configuration or null

  • oidc (EndpointOIDC) (defaults to: nil)

    oidc module configuration or null

Returns:



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.

ngrok.com/docs/api#api-endpoint-configurations-update

Parameters:

  • id (string) (defaults to: "")

    unique identifier of this endpoint configuration

  • description (string) (defaults to: nil)

    human-readable description of what this endpoint configuration will be do when applied or what traffic it will be applied to. Optional, max 255 bytes

  • metadata (string) (defaults to: nil)

    arbitrary user-defined machine-readable data of this endpoint configuration. Optional, max 4096 bytes.

  • circuit_breaker (EndpointCircuitBreaker) (defaults to: nil)

    circuit breaker module configuration or null

  • compression (EndpointCompression) (defaults to: nil)

    compression module configuration or null

  • request_headers (EndpointRequestHeaders) (defaults to: nil)

    request headers module configuration or null

  • response_headers (EndpointResponseHeaders) (defaults to: nil)

    response headers module configuration or null

  • ip_policy (EndpointIPPolicyMutate) (defaults to: nil)

    ip policy module configuration or null

  • mutual_tls (EndpointMutualTLSMutate) (defaults to: nil)

    mutual TLS module configuration or null

  • tls_termination (EndpointTLSTermination) (defaults to: nil)

    TLS termination module configuration or null

  • webhook_validation (EndpointWebhookValidation) (defaults to: nil)

    webhook validation module configuration or null

  • oauth (EndpointOAuth) (defaults to: nil)

    oauth module configuration or null

  • logging (EndpointLoggingMutate) (defaults to: nil)

    logging module configuration or null

  • saml (EndpointSAMLMutate) (defaults to: nil)

    saml module configuration or null

  • oidc (EndpointOIDC) (defaults to: nil)

    oidc module configuration or null

Returns:



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