Class: NgrokAPI::Services::EndpointConfigurationsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/ngrokapi/services/endpoint_configurations_client.rb

Overview

A client for interacting with the endpoint_configuration API

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

Constant Summary collapse

LIST_PROPERTY =

The List Property from the resulting API for list calls

'endpoint_configurations'
PATH =

The API path for endpoint configurations

'/endpoint_configurations'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ EndpointConfigurationsClient

Returns a new instance of EndpointConfigurationsClient.



17
18
19
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 17

def initialize(client:)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



15
16
17
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 15

def client
  @client
end

Instance Method Details

#create(description: '', metadata: '', type: '', 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) ⇒ NgrokAPI::Models::EndpointConfiguration

Create a new endpoint configuration

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

Parameters:

  • 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.

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

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

  • circuit_breaker (string) (defaults to: nil)

    circuit breaker module configuration

  • compression (string) (defaults to: nil)

    compression module configuration

  • request_headers (string) (defaults to: nil)

    request headers module configuration

  • response_headers (string) (defaults to: nil)

    response headers module configuration

  • ip_policy (string) (defaults to: nil)

    ip policy module configuration

  • mutual_tls (string) (defaults to: nil)

    mutual TLS module configuration

  • tls_termination (string) (defaults to: nil)

    TLS termination module configuration

  • webhook_validation (string) (defaults to: nil)

    webhook validation module configuration

  • oauth (string) (defaults to: nil)

    oauth module configuration

  • logging (string) (defaults to: nil)

    logging module configuration

  • saml (string) (defaults to: nil)

    saml module configuration

  • oidc (string) (defaults to: nil)

    oidc module configuration

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
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 44

def create(
  description: '',
  metadata: '',
  type: '',
  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
)
  data = {
    type: type,
    description: description,
    metadata: ,
    circuit_breaker: circuit_breaker,
    compression: compression,
    request_headers: request_headers,
    response_headers: response_headers,
    ip_policy: ip_policy,
    mutual_tls: mutual_tls,
    tls_termination: tls_termination,
    webhook_validation: webhook_validation,
    oauth: oauth,
    logging: logging,
    saml: saml,
    oidc: oidc,
  }
  result = @client.post(PATH, data: data)
  NgrokAPI::Models::EndpointConfiguration.new(client: self, result: result)
end

#delete(id: nil) ⇒ nil

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: nil)

    a resource identifier

Returns:

  • (nil)

    result from delete request



92
93
94
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 92

def delete(id: nil)
  @client.delete("#{PATH}/#{id}")
end

#delete!(id: nil) ⇒ nil

Delete an endpoint configuration. Throw an exception if 404. 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: nil)

    a resource identifier

Returns:

  • (nil)

    result from delete request



105
106
107
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 105

def delete!(id: nil)
  @client.delete("#{PATH}/#{id}", danger: true)
end

#get(id: nil) ⇒ NgrokAPI::Models::EndpointConfiguration

Returns detailed information about an endpoint configuration by ID.

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

Parameters:

  • id (string) (defaults to: nil)

    a resource identifier

Returns:



116
117
118
119
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 116

def get(id: nil)
  result = @client.get("#{PATH}/#{id}")
  NgrokAPI::Models::EndpointConfiguration.new(client: self, result: result)
end

#get!(id: nil) ⇒ NgrokAPI::Models::EndpointConfiguration

Returns detailed information about an endpoint configuration by ID. Throw an execption if 404.

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

Parameters:

  • id (string) (defaults to: nil)

    a resource identifier

Returns:



128
129
130
131
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 128

def get!(id: nil)
  result = @client.get("#{PATH}/#{id}", 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 (integer) (defaults to: nil)
  • url (string) (defaults to: nil)

    optional and mutually exclusive from before_id and limit

Returns:



142
143
144
145
146
147
148
149
150
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 142

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: nil, description: nil, metadata: 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) ⇒ 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: nil)

    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 (string) (defaults to: nil)

    circuit breaker module configuration

  • compression (string) (defaults to: nil)

    compression module configuration

  • request_headers (string) (defaults to: nil)

    request headers module configuration

  • response_headers (string) (defaults to: nil)

    response headers module configuration

  • ip_policy (string) (defaults to: nil)

    ip policy module configuration

  • mutual_tls (string) (defaults to: nil)

    mutual TLS module configuration

  • tls_termination (string) (defaults to: nil)

    TLS termination module configuration

  • webhook_validation (string) (defaults to: nil)

    webhook validation module configuration

  • oauth (string) (defaults to: nil)

    oauth module configuration

  • logging (string) (defaults to: nil)

    logging module configuration

  • saml (string) (defaults to: nil)

    saml module configuration

  • oidc (string) (defaults to: nil)

    oidc module configuration

Returns:



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 177

def update(
  id: nil,
  description: nil,
  metadata: 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
)
  data = build_data(
    description: description,
    metadata: ,
    circuit_breaker: circuit_breaker,
    compression: compression,
    request_headers: request_headers,
    response_headers: response_headers,
    ip_policy: ip_policy,
    mutual_tls: mutual_tls,
    tls_termination: tls_termination,
    webhook_validation: webhook_validation,
    oauth: oauth,
    logging: logging,
    saml: saml,
    oidc: oidc
  )
  result = @client.patch("#{PATH}/#{id}", data: data)
  NgrokAPI::Models::EndpointConfiguration.new(client: self, result: result)
end

#update!(id: nil, description: nil, metadata: 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) ⇒ 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. Throw an exception if 404.

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

Parameters:

  • id (string) (defaults to: nil)

    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 (string) (defaults to: nil)

    circuit breaker module configuration

  • compression (string) (defaults to: nil)

    compression module configuration

  • request_headers (string) (defaults to: nil)

    request headers module configuration

  • response_headers (string) (defaults to: nil)

    response headers module configuration

  • ip_policy (string) (defaults to: nil)

    ip policy module configuration

  • mutual_tls (string) (defaults to: nil)

    mutual TLS module configuration

  • tls_termination (string) (defaults to: nil)

    TLS termination module configuration

  • webhook_validation (string) (defaults to: nil)

    webhook validation module configuration

  • oauth (string) (defaults to: nil)

    oauth module configuration

  • logging (string) (defaults to: nil)

    logging module configuration

  • saml (string) (defaults to: nil)

    saml module configuration

  • oidc (string) (defaults to: nil)

    oidc module configuration

Returns:



238
239
240
241
242
243
244
245
246
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
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 238

def update!(
  id: nil,
  description: nil,
  metadata: 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
)
  data = build_data(
    description: description,
    metadata: ,
    circuit_breaker: circuit_breaker,
    compression: compression,
    request_headers: request_headers,
    response_headers: response_headers,
    ip_policy: ip_policy,
    mutual_tls: mutual_tls,
    tls_termination: tls_termination,
    webhook_validation: webhook_validation,
    oauth: oauth,
    logging: logging,
    saml: saml,
    oidc: oidc
  )
  result = @client.patch("#{PATH}/#{id}", danger: true, data: data)
  NgrokAPI::Models::EndpointConfiguration.new(client: self, result: result)
end