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, user_agent_filter: nil, policy: nil, traffic_policy: 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

  • user_agent_filter (EndpointUserAgentFilter) (defaults to: nil)
  • traffic_policy (EndpointTrafficPolicy) (defaults to: nil)

    the traffic policy associated with this edge or null

Returns:



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

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, user_agent_filter: nil, policy: nil, traffic_policy: 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
  data[:user_agent_filter] = user_agent_filter if user_agent_filter
  data[:traffic_policy] = traffic_policy if traffic_policy
  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, user_agent_filter: nil, policy: nil, traffic_policy: 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

  • user_agent_filter (EndpointUserAgentFilter) (defaults to: nil)
  • traffic_policy (EndpointTrafficPolicy) (defaults to: nil)

    the traffic policy associated with this edge or null

Returns:



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/ngrokapi/services/edges_https_routes_client.rb', line 95

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, user_agent_filter: nil, policy: nil, traffic_policy: 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
  data[:user_agent_filter] = user_agent_filter if user_agent_filter
  data[:traffic_policy] = traffic_policy if traffic_policy
  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



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

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



300
301
302
303
304
305
306
307
# File 'lib/ngrokapi/services/edges_https_routes_client.rb', line 300

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:



130
131
132
133
134
135
136
137
138
139
# File 'lib/ngrokapi/services/edges_https_routes_client.rb', line 130

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:



150
151
152
153
154
155
156
157
158
159
# File 'lib/ngrokapi/services/edges_https_routes_client.rb', line 150

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, user_agent_filter: nil, policy: nil, traffic_policy: 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

  • user_agent_filter (EndpointUserAgentFilter) (defaults to: nil)
  • traffic_policy (EndpointTrafficPolicy) (defaults to: nil)

    the traffic policy associated with this edge or null

Returns:



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/ngrokapi/services/edges_https_routes_client.rb', line 189

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, user_agent_filter: nil, policy: nil, traffic_policy: 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
  data[:user_agent_filter] = user_agent_filter if user_agent_filter
  data[:traffic_policy] = traffic_policy if traffic_policy
  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, user_agent_filter: nil, policy: nil, traffic_policy: 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

  • user_agent_filter (EndpointUserAgentFilter) (defaults to: nil)
  • traffic_policy (EndpointTrafficPolicy) (defaults to: nil)

    the traffic policy associated with this edge or null

Returns:



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

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, user_agent_filter: nil, policy: nil, traffic_policy: 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
  data[:user_agent_filter] = user_agent_filter if user_agent_filter
  data[:traffic_policy] = traffic_policy if traffic_policy
  result = @client.patch(path % replacements, data: data, danger: true)
  NgrokAPI::Models::HTTPSEdgeRoute.new(client: self, attrs: result)
end