Class: NgrokAPI::Services::EdgesHTTPSRoutesClient

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

Overview

Constant Summary collapse

PATH =

The API path for the requests

'/edges/https/%{edge_id}/routes'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ EdgesHTTPSRoutesClient

Returns a new instance of EdgesHTTPSRoutesClient.



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

def initialize(client:)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



13
14
15
# File 'lib/ngrokapi/services/edges_https_routes_client.rb', line 13

def client
  @client
end

Instance Method Details

#create(edge_id: "", match_type:, match:, description: "", metadata: "", backend: nil, ip_restriction: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, webhook_verification: nil, oauth: nil, saml: nil, oidc: nil, websocket_tcp_converter: nil) ⇒ NgrokAPI::Models::HTTPSEdgeRoute

Parameters:

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

    unique identifier of this edge

  • match_type (string)

    Type of match to use for this route. Valid values are "exact_path" and "path_prefix".

  • match (string)

    Route selector: "/blog" or "example.com" or "example.com/blog"

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

    human-readable description of what this edge will be used for; optional, max 255 bytes.

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

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

  • backend (EndpointBackendMutate) (defaults to: nil)

    backend module configuration or null

  • ip_restriction (EndpointIPPolicyMutate) (defaults to: nil)

    ip restriction module configuration or null

  • 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

  • webhook_verification (EndpointWebhookValidation) (defaults to: nil)

    webhook verification module configuration or null

  • oauth (EndpointOAuth) (defaults to: nil)

    oauth module configuration or null

  • saml (EndpointSAMLMutate) (defaults to: nil)

    saml module configuration or null

  • oidc (EndpointOIDC) (defaults to: nil)

    oidc module configuration or null

  • websocket_tcp_converter (EndpointWebsocketTCPConverter) (defaults to: nil)

    websocket to tcp adapter configuration or null

Returns:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/ngrokapi/services/edges_https_routes_client.rb', line 41

def create(edge_id: "", match_type:, match:, description: "", metadata: "", backend: nil, ip_restriction: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, webhook_verification: nil, oauth: nil, saml: nil, oidc: nil, websocket_tcp_converter: nil)
  path = '/edges/https/%{edge_id}/routes'
  replacements = {
    edge_id: edge_id,
  }
  data = {}
  data[:match_type] = match_type if match_type
  data[:match] = match if match
  data[:description] = description if description
  data[:metadata] =  if 
  data[:backend] = backend if backend
  data[:ip_restriction] = ip_restriction if ip_restriction
  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[:webhook_verification] = webhook_verification if webhook_verification
  data[:oauth] = oauth if oauth
  data[:saml] = saml if saml
  data[:oidc] = oidc if oidc
  data[:websocket_tcp_converter] = websocket_tcp_converter if websocket_tcp_converter
  result = @client.post(path % replacements, data: data)
  NgrokAPI::Models::HTTPSEdgeRoute.new(client: self, attrs: result)
end

#create!(edge_id: "", match_type:, match:, description: "", metadata: "", backend: nil, ip_restriction: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, webhook_verification: nil, oauth: nil, saml: nil, oidc: nil, websocket_tcp_converter: nil) ⇒ NgrokAPI::Models::HTTPSEdgeRoute

Create an HTTPS Edge Route Throws an exception if API error.

https://ngrok.com/docs/api#api-edges-https-routes-create

Parameters:

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

    unique identifier of this edge

  • match_type (string)

    Type of match to use for this route. Valid values are "exact_path" and "path_prefix".

  • match (string)

    Route selector: "/blog" or "example.com" or "example.com/blog"

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

    human-readable description of what this edge will be used for; optional, max 255 bytes.

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

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

  • backend (EndpointBackendMutate) (defaults to: nil)

    backend module configuration or null

  • ip_restriction (EndpointIPPolicyMutate) (defaults to: nil)

    ip restriction module configuration or null

  • 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

  • webhook_verification (EndpointWebhookValidation) (defaults to: nil)

    webhook verification module configuration or null

  • oauth (EndpointOAuth) (defaults to: nil)

    oauth module configuration or null

  • saml (EndpointSAMLMutate) (defaults to: nil)

    saml module configuration or null

  • oidc (EndpointOIDC) (defaults to: nil)

    oidc module configuration or null

  • websocket_tcp_converter (EndpointWebsocketTCPConverter) (defaults to: nil)

    websocket to tcp adapter configuration or null

Returns:



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/ngrokapi/services/edges_https_routes_client.rb', line 89

def create!(edge_id: "", match_type:, match:, description: "", metadata: "", backend: nil, ip_restriction: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, webhook_verification: nil, oauth: nil, saml: nil, oidc: nil, websocket_tcp_converter: nil)
  path = '/edges/https/%{edge_id}/routes'
  replacements = {
    edge_id: edge_id,
  }
  data = {}
  data[:match_type] = match_type if match_type
  data[:match] = match if match
  data[:description] = description if description
  data[:metadata] =  if 
  data[:backend] = backend if backend
  data[:ip_restriction] = ip_restriction if ip_restriction
  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[:webhook_verification] = webhook_verification if webhook_verification
  data[:oauth] = oauth if oauth
  data[:saml] = saml if saml
  data[:oidc] = oidc if oidc
  data[:websocket_tcp_converter] = websocket_tcp_converter if websocket_tcp_converter
  result = @client.post(path % replacements, data: data, danger: true)
  NgrokAPI::Models::HTTPSEdgeRoute.new(client: self, attrs: result)
end

#delete(edge_id: "", id: "") ⇒ NgrokAPI::Models::Empty

Parameters:

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

    unique identifier of this edge

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

    unique identifier of this edge route

Returns:

  • (NgrokAPI::Models::Empty)

    result from the API request



266
267
268
269
270
271
272
273
# File 'lib/ngrokapi/services/edges_https_routes_client.rb', line 266

def delete(edge_id: "", id: "")
  path = '/edges/https/%{edge_id}/routes/%{id}'
  replacements = {
    edge_id: edge_id,
    id: id,
  }
  @client.delete(path % replacements)
end

#delete!(edge_id: "", id: "") ⇒ NgrokAPI::Models::Empty

Delete an HTTPS Edge Route by ID Throws an exception if API error.

https://ngrok.com/docs/api#api-edges-https-routes-delete

Parameters:

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

    unique identifier of this edge

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

    unique identifier of this edge route

Returns:

  • (NgrokAPI::Models::Empty)

    result from the API request



284
285
286
287
288
289
290
291
# File 'lib/ngrokapi/services/edges_https_routes_client.rb', line 284

def delete!(edge_id: "", id: "")
  path = '/edges/https/%{edge_id}/routes/%{id}'
  replacements = {
    edge_id: edge_id,
    id: id,
  }
  @client.delete(path % replacements, danger: true)
end

#get(edge_id: "", id: "") ⇒ NgrokAPI::Models::HTTPSEdgeRoute

Parameters:

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

    unique identifier of this edge

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

    unique identifier of this edge route

Returns:



122
123
124
125
126
127
128
129
130
131
# File 'lib/ngrokapi/services/edges_https_routes_client.rb', line 122

def get(edge_id: "", id: "")
  path = '/edges/https/%{edge_id}/routes/%{id}'
  replacements = {
    edge_id: edge_id,
    id: id,
  }
  data = {}
  result = @client.get(path % replacements, data: data)
  NgrokAPI::Models::HTTPSEdgeRoute.new(client: self, attrs: result)
end

#get!(edge_id: "", id: "") ⇒ NgrokAPI::Models::HTTPSEdgeRoute

Get an HTTPS Edge Route by ID Throws an exception if API error.

https://ngrok.com/docs/api#api-edges-https-routes-get

Parameters:

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

    unique identifier of this edge

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

    unique identifier of this edge route

Returns:



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

def get!(edge_id: "", id: "")
  path = '/edges/https/%{edge_id}/routes/%{id}'
  replacements = {
    edge_id: edge_id,
    id: id,
  }
  data = {}
  result = @client.get(path % replacements, data: data, danger: true)
  NgrokAPI::Models::HTTPSEdgeRoute.new(client: self, attrs: result)
end

#update(edge_id: "", id: "", match_type: "", match: "", description: "", metadata: "", backend: nil, ip_restriction: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, webhook_verification: nil, oauth: nil, saml: nil, oidc: nil, websocket_tcp_converter: nil) ⇒ NgrokAPI::Models::HTTPSEdgeRoute

Updates an HTTPS Edge Route by ID. 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.

https://ngrok.com/docs/api#api-edges-https-routes-update

Parameters:

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

    unique identifier of this edge

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

    unique identifier of this edge route

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

    Type of match to use for this route. Valid values are "exact_path" and "path_prefix".

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

    Route selector: "/blog" or "example.com" or "example.com/blog"

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

    human-readable description of what this edge will be used for; optional, max 255 bytes.

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

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

  • backend (EndpointBackendMutate) (defaults to: nil)

    backend module configuration or null

  • ip_restriction (EndpointIPPolicyMutate) (defaults to: nil)

    ip restriction module configuration or null

  • 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

  • webhook_verification (EndpointWebhookValidation) (defaults to: nil)

    webhook verification module configuration or null

  • oauth (EndpointOAuth) (defaults to: nil)

    oauth module configuration or null

  • saml (EndpointSAMLMutate) (defaults to: nil)

    saml module configuration or null

  • oidc (EndpointOIDC) (defaults to: nil)

    oidc module configuration or null

  • websocket_tcp_converter (EndpointWebsocketTCPConverter) (defaults to: nil)

    websocket to tcp adapter configuration or null

Returns:



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

def update(edge_id: "", id: "", match_type: "", match: "", description: "", metadata: "", backend: nil, ip_restriction: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, webhook_verification: nil, oauth: nil, saml: nil, oidc: nil, websocket_tcp_converter: nil)
  path = '/edges/https/%{edge_id}/routes/%{id}'
  replacements = {
    edge_id: edge_id,
    id: id,
  }
  data = {}
  data[:match_type] = match_type if match_type
  data[:match] = match if match
  data[:description] = description if description
  data[:metadata] =  if 
  data[:backend] = backend if backend
  data[:ip_restriction] = ip_restriction if ip_restriction
  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[:webhook_verification] = webhook_verification if webhook_verification
  data[:oauth] = oauth if oauth
  data[:saml] = saml if saml
  data[:oidc] = oidc if oidc
  data[:websocket_tcp_converter] = websocket_tcp_converter if websocket_tcp_converter
  result = @client.patch(path % replacements, data: data)
  NgrokAPI::Models::HTTPSEdgeRoute.new(client: self, attrs: result)
end

#update!(edge_id: "", id: "", match_type: "", match: "", description: "", metadata: "", backend: nil, ip_restriction: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, webhook_verification: nil, oauth: nil, saml: nil, oidc: nil, websocket_tcp_converter: nil) ⇒ NgrokAPI::Models::HTTPSEdgeRoute

Updates an HTTPS Edge Route by ID. 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.

https://ngrok.com/docs/api#api-edges-https-routes-update

Parameters:

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

    unique identifier of this edge

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

    unique identifier of this edge route

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

    Type of match to use for this route. Valid values are "exact_path" and "path_prefix".

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

    Route selector: "/blog" or "example.com" or "example.com/blog"

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

    human-readable description of what this edge will be used for; optional, max 255 bytes.

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

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

  • backend (EndpointBackendMutate) (defaults to: nil)

    backend module configuration or null

  • ip_restriction (EndpointIPPolicyMutate) (defaults to: nil)

    ip restriction module configuration or null

  • 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

  • webhook_verification (EndpointWebhookValidation) (defaults to: nil)

    webhook verification module configuration or null

  • oauth (EndpointOAuth) (defaults to: nil)

    oauth module configuration or null

  • saml (EndpointSAMLMutate) (defaults to: nil)

    saml module configuration or null

  • oidc (EndpointOIDC) (defaults to: nil)

    oidc module configuration or null

  • websocket_tcp_converter (EndpointWebsocketTCPConverter) (defaults to: nil)

    websocket to tcp adapter configuration or null

Returns:



232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/ngrokapi/services/edges_https_routes_client.rb', line 232

def update!(edge_id: "", id: "", match_type: "", match: "", description: "", metadata: "", backend: nil, ip_restriction: nil, circuit_breaker: nil, compression: nil, request_headers: nil, response_headers: nil, webhook_verification: nil, oauth: nil, saml: nil, oidc: nil, websocket_tcp_converter: nil)
  path = '/edges/https/%{edge_id}/routes/%{id}'
  replacements = {
    edge_id: edge_id,
    id: id,
  }
  data = {}
  data[:match_type] = match_type if match_type
  data[:match] = match if match
  data[:description] = description if description
  data[:metadata] =  if 
  data[:backend] = backend if backend
  data[:ip_restriction] = ip_restriction if ip_restriction
  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[:webhook_verification] = webhook_verification if webhook_verification
  data[:oauth] = oauth if oauth
  data[:saml] = saml if saml
  data[:oidc] = oidc if oidc
  data[:websocket_tcp_converter] = websocket_tcp_converter if websocket_tcp_converter
  result = @client.patch(path % replacements, data: data, danger: true)
  NgrokAPI::Models::HTTPSEdgeRoute.new(client: self, attrs: result)
end