Class: NgrokAPI::Services::EdgesHTTPSClient

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

Overview

Constant Summary collapse

PATH =

The API path for the requests

'/edges/https'
LIST_PROPERTY =

The List Property from the resulting API for list calls

'https_edges'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ EdgesHTTPSClient

Returns a new instance of EdgesHTTPSClient.



15
16
17
# File 'lib/ngrokapi/services/edges_https_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_client.rb', line 13

def client
  @client
end

Instance Method Details

#create(description: "", metadata: "", hostports: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::HTTPSEdge

Parameters:

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

  • hostports (List<string>) (defaults to: nil)

    hostports served by this edge

  • mutual_tls (EndpointMutualTLSMutate) (defaults to: nil)

    edge modules

  • tls_termination (EndpointTLSTerminationAtEdge) (defaults to: nil)

Returns:



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/ngrokapi/services/edges_https_client.rb', line 30

def create(description: "", metadata: "", hostports: nil, mutual_tls: nil, tls_termination: nil)
  path = '/edges/https'
  replacements = {
  }
  data = {}
  data[:description] = description if description
  data[:metadata] =  if 
  data[:hostports] = hostports if hostports
  data[:mutual_tls] = mutual_tls if mutual_tls
  data[:tls_termination] = tls_termination if tls_termination
  result = @client.post(path % replacements, data: data)
  NgrokAPI::Models::HTTPSEdge.new(client: self, attrs: result)
end

#create!(description: "", metadata: "", hostports: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::HTTPSEdge

Create an HTTPS Edge Throws an exception if API error.

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

Parameters:

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

  • hostports (List<string>) (defaults to: nil)

    hostports served by this edge

  • mutual_tls (EndpointMutualTLSMutate) (defaults to: nil)

    edge modules

  • tls_termination (EndpointTLSTerminationAtEdge) (defaults to: nil)

Returns:



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/ngrokapi/services/edges_https_client.rb', line 56

def create!(description: "", metadata: "", hostports: nil, mutual_tls: nil, tls_termination: nil)
  path = '/edges/https'
  replacements = {
  }
  data = {}
  data[:description] = description if description
  data[:metadata] =  if 
  data[:hostports] = hostports if hostports
  data[:mutual_tls] = mutual_tls if mutual_tls
  data[:tls_termination] = tls_termination if tls_termination
  result = @client.post(path % replacements, data: data, danger: true)
  NgrokAPI::Models::HTTPSEdge.new(client: self, attrs: result)
end

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

Delete an HTTPS Edge by ID

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

Parameters:

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

    a resource identifier

Returns:

  • (NgrokAPI::Models::Empty)

    result from the API request



226
227
228
229
230
231
232
# File 'lib/ngrokapi/services/edges_https_client.rb', line 226

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

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

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

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

Parameters:

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

    a resource identifier

Returns:

  • (NgrokAPI::Models::Empty)

    result from the API request



242
243
244
245
246
247
248
# File 'lib/ngrokapi/services/edges_https_client.rb', line 242

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

#get(id: "") ⇒ NgrokAPI::Models::HTTPSEdge

Get an HTTPS Edge by ID

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

Parameters:

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

    a resource identifier

Returns:



77
78
79
80
81
82
83
84
85
# File 'lib/ngrokapi/services/edges_https_client.rb', line 77

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

#get!(id: "") ⇒ NgrokAPI::Models::HTTPSEdge

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

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

Parameters:

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

    a resource identifier

Returns:



95
96
97
98
99
100
101
102
103
# File 'lib/ngrokapi/services/edges_https_client.rb', line 95

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

#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable

Returns a list of all HTTPS Edges on this account

ngrok.com/docs/api#api-edges-https-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:



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/ngrokapi/services/edges_https_client.rb', line 114

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,
    attrs: result,
    list_property: LIST_PROPERTY,
    klass: NgrokAPI::Models::HTTPSEdge
  )
end

#list!(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable

Returns a list of all HTTPS Edges on this account Throws an exception if API error.

ngrok.com/docs/api#api-edges-https-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:



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/ngrokapi/services/edges_https_client.rb', line 140

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,
    attrs: result,
    list_property: LIST_PROPERTY,
    klass: NgrokAPI::Models::HTTPSEdge,
    danger: true
  )
end

#update(id: "", description: nil, metadata: nil, hostports: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::HTTPSEdge

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

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

Parameters:

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

    unique identifier of this edge

  • description (string) (defaults to: nil)

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

  • metadata (string) (defaults to: nil)

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

  • hostports (List<string>) (defaults to: nil)

    hostports served by this edge

  • mutual_tls (EndpointMutualTLSMutate) (defaults to: nil)

    edge modules

  • tls_termination (EndpointTLSTerminationAtEdge) (defaults to: nil)

Returns:



173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/ngrokapi/services/edges_https_client.rb', line 173

def update(id: "", description: nil, metadata: nil, hostports: nil, mutual_tls: nil, tls_termination: nil)
  path = '/edges/https/%{id}'
  replacements = {
    id: id,
  }
  data = {}
  data[:description] = description if description
  data[:metadata] =  if 
  data[:hostports] = hostports if hostports
  data[:mutual_tls] = mutual_tls if mutual_tls
  data[:tls_termination] = tls_termination if tls_termination
  result = @client.patch(path % replacements, data: data)
  NgrokAPI::Models::HTTPSEdge.new(client: self, attrs: result)
end

#update!(id: "", description: nil, metadata: nil, hostports: nil, mutual_tls: nil, tls_termination: nil) ⇒ NgrokAPI::Models::HTTPSEdge

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

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

Parameters:

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

    unique identifier of this edge

  • description (string) (defaults to: nil)

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

  • metadata (string) (defaults to: nil)

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

  • hostports (List<string>) (defaults to: nil)

    hostports served by this edge

  • mutual_tls (EndpointMutualTLSMutate) (defaults to: nil)

    edge modules

  • tls_termination (EndpointTLSTerminationAtEdge) (defaults to: nil)

Returns:



204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/ngrokapi/services/edges_https_client.rb', line 204

def update!(id: "", description: nil, metadata: nil, hostports: nil, mutual_tls: nil, tls_termination: nil)
  path = '/edges/https/%{id}'
  replacements = {
    id: id,
  }
  data = {}
  data[:description] = description if description
  data[:metadata] =  if 
  data[:hostports] = hostports if hostports
  data[:mutual_tls] = mutual_tls if mutual_tls
  data[:tls_termination] = tls_termination if tls_termination
  result = @client.patch(path % replacements, data: data, danger: true)
  NgrokAPI::Models::HTTPSEdge.new(client: self, attrs: result)
end