Class: NgrokAPI::Services::ReservedDomainsClient
- Inherits:
-
Object
- Object
- NgrokAPI::Services::ReservedDomainsClient
- Defined in:
- lib/ngrokapi/services/reserved_domains_client.rb
Overview
Reserved Domains are hostnames that you can listen for traffic on. Domains can be used to listen for http, https or tls traffic. You may use a domain that you own by creating a CNAME record specified in the returned resource. This CNAME record points traffic for that domain to ngrok's edge servers.
Constant Summary collapse
- PATH =
The API path for the requests
'/reserved_domains'- LIST_PROPERTY =
The List Property from the resulting API for list calls
'reserved_domains'
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#create(name:, region: "", description: "", metadata: "", http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil) ⇒ NgrokAPI::Models::ReservedDomain
Create a new reserved domain.
-
#delete(id: "") ⇒ NgrokAPI::Models::Empty
Delete a reserved domain.
-
#delete!(id: "") ⇒ NgrokAPI::Models::Empty
Delete a reserved domain.
-
#delete_certificate(id: "") ⇒ NgrokAPI::Models::Empty
Detach the certificate attached to a reserved domain.
-
#delete_certificate!(id: "") ⇒ NgrokAPI::Models::Empty
Detach the certificate attached to a reserved domain.
-
#delete_certificate_management_policy(id: "") ⇒ NgrokAPI::Models::Empty
Detach the certificate management policy attached to a reserved domain.
-
#delete_certificate_management_policy!(id: "") ⇒ NgrokAPI::Models::Empty
Detach the certificate management policy attached to a reserved domain.
-
#delete_http_endpoint_config(id: "") ⇒ NgrokAPI::Models::Empty
Detach the http endpoint configuration attached to a reserved domain.
-
#delete_http_endpoint_config!(id: "") ⇒ NgrokAPI::Models::Empty
Detach the http endpoint configuration attached to a reserved domain.
-
#delete_https_endpoint_config(id: "") ⇒ NgrokAPI::Models::Empty
Detach the https endpoint configuration attached to a reserved domain.
-
#delete_https_endpoint_config!(id: "") ⇒ NgrokAPI::Models::Empty
Detach the https endpoint configuration attached to a reserved domain.
-
#get(id: "") ⇒ NgrokAPI::Models::ReservedDomain
Get the details of a reserved domain.
-
#get!(id: "") ⇒ NgrokAPI::Models::ReservedDomain
Get the details of a reserved domain.
-
#initialize(client:) ⇒ ReservedDomainsClient
constructor
A new instance of ReservedDomainsClient.
-
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all reserved domains on this account.
-
#list!(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all reserved domains on this account.
-
#update(id: "", description: nil, metadata: nil, http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil) ⇒ NgrokAPI::Models::ReservedDomain
Update the attributes of a reserved domain.
-
#update!(id: "", description: nil, metadata: nil, http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil) ⇒ NgrokAPI::Models::ReservedDomain
Update the attributes of a reserved domain.
Constructor Details
#initialize(client:) ⇒ ReservedDomainsClient
Returns a new instance of ReservedDomainsClient.
20 21 22 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 20 def initialize(client:) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
18 19 20 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 18 def client @client end |
Instance Method Details
#create(name:, region: "", description: "", metadata: "", http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil) ⇒ NgrokAPI::Models::ReservedDomain
Create a new reserved domain.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 38 def create( name:, region: "", description: "", metadata: "", http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil ) path = '/reserved_domains' replacements = { } data = {} data[:name] = name if name data[:region] = region if region data[:description] = description if description data[:metadata] = if data[:http_endpoint_configuration_id] = http_endpoint_configuration_id if http_endpoint_configuration_id data[:https_endpoint_configuration_id] = https_endpoint_configuration_id if https_endpoint_configuration_id data[:certificate_id] = certificate_id if certificate_id data[:certificate_management_policy] = certificate_management_policy if certificate_management_policy result = @client.post(path % replacements, data: data) NgrokAPI::Models::ReservedDomain.new(client: self, result: result) end |
#delete(id: "") ⇒ NgrokAPI::Models::Empty
Delete a reserved domain.
71 72 73 74 75 76 77 78 79 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 71 def delete( id: "" ) path = '/reserved_domains/%{id}' replacements = { id: id, } @client.delete(path % replacements) end |
#delete!(id: "") ⇒ NgrokAPI::Models::Empty
Delete a reserved domain. Throws an exception if API error.
89 90 91 92 93 94 95 96 97 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 89 def delete!( id: "" ) path = '/reserved_domains/%{id}' replacements = { id: id, } @client.delete(path % replacements, danger: true) end |
#delete_certificate(id: "") ⇒ NgrokAPI::Models::Empty
Detach the certificate attached to a reserved domain.
316 317 318 319 320 321 322 323 324 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 316 def delete_certificate( id: "" ) path = '/reserved_domains/%{id}/certificate' replacements = { id: id, } @client.delete(path % replacements) end |
#delete_certificate!(id: "") ⇒ NgrokAPI::Models::Empty
Detach the certificate attached to a reserved domain. Throws an exception if API error.
334 335 336 337 338 339 340 341 342 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 334 def delete_certificate!( id: "" ) path = '/reserved_domains/%{id}/certificate' replacements = { id: id, } @client.delete(path % replacements, danger: true) end |
#delete_certificate_management_policy(id: "") ⇒ NgrokAPI::Models::Empty
Detach the certificate management policy attached to a reserved domain.
ngrok.com/docs/api#api-reserved-domains-delete-certificate-management-policy
281 282 283 284 285 286 287 288 289 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 281 def delete_certificate_management_policy( id: "" ) path = '/reserved_domains/%{id}/certificate_management_policy' replacements = { id: id, } @client.delete(path % replacements) end |
#delete_certificate_management_policy!(id: "") ⇒ NgrokAPI::Models::Empty
Detach the certificate management policy attached to a reserved domain. Throws an exception if API error.
ngrok.com/docs/api#api-reserved-domains-delete-certificate-management-policy
299 300 301 302 303 304 305 306 307 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 299 def delete_certificate_management_policy!( id: "" ) path = '/reserved_domains/%{id}/certificate_management_policy' replacements = { id: id, } @client.delete(path % replacements, danger: true) end |
#delete_http_endpoint_config(id: "") ⇒ NgrokAPI::Models::Empty
Detach the http endpoint configuration attached to a reserved domain.
ngrok.com/docs/api#api-reserved-domains-delete-http-endpoint-config
351 352 353 354 355 356 357 358 359 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 351 def delete_http_endpoint_config( id: "" ) path = '/reserved_domains/%{id}/http_endpoint_configuration' replacements = { id: id, } @client.delete(path % replacements) end |
#delete_http_endpoint_config!(id: "") ⇒ NgrokAPI::Models::Empty
Detach the http endpoint configuration attached to a reserved domain. Throws an exception if API error.
ngrok.com/docs/api#api-reserved-domains-delete-http-endpoint-config
369 370 371 372 373 374 375 376 377 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 369 def delete_http_endpoint_config!( id: "" ) path = '/reserved_domains/%{id}/http_endpoint_configuration' replacements = { id: id, } @client.delete(path % replacements, danger: true) end |
#delete_https_endpoint_config(id: "") ⇒ NgrokAPI::Models::Empty
Detach the https endpoint configuration attached to a reserved domain.
ngrok.com/docs/api#api-reserved-domains-delete-https-endpoint-config
386 387 388 389 390 391 392 393 394 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 386 def delete_https_endpoint_config( id: "" ) path = '/reserved_domains/%{id}/https_endpoint_configuration' replacements = { id: id, } @client.delete(path % replacements) end |
#delete_https_endpoint_config!(id: "") ⇒ NgrokAPI::Models::Empty
Detach the https endpoint configuration attached to a reserved domain. Throws an exception if API error.
ngrok.com/docs/api#api-reserved-domains-delete-https-endpoint-config
404 405 406 407 408 409 410 411 412 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 404 def delete_https_endpoint_config!( id: "" ) path = '/reserved_domains/%{id}/https_endpoint_configuration' replacements = { id: id, } @client.delete(path % replacements, danger: true) end |
#get(id: "") ⇒ NgrokAPI::Models::ReservedDomain
Get the details of a reserved domain.
106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 106 def get( id: "" ) path = '/reserved_domains/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data) NgrokAPI::Models::ReservedDomain.new(client: self, result: result) end |
#get!(id: "") ⇒ NgrokAPI::Models::ReservedDomain
Get the details of a reserved domain. Throws an exception if API error.
126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 126 def get!( id: "" ) path = '/reserved_domains/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data, danger: true) NgrokAPI::Models::ReservedDomain.new(client: self, result: result) end |
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all reserved domains on this account.
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 147 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::ReservedDomain ) end |
#list!(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all reserved domains on this account. Throws an exception if API error.
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 177 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::ReservedDomain, danger: true ) end |
#update(id: "", description: nil, metadata: nil, http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil) ⇒ NgrokAPI::Models::ReservedDomain
Update the attributes of a reserved domain.
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 212 def update( id: "", description: nil, metadata: nil, http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil ) path = '/reserved_domains/%{id}' replacements = { id: id, } data = {} data[:description] = description if description data[:metadata] = if data[:http_endpoint_configuration_id] = http_endpoint_configuration_id if http_endpoint_configuration_id data[:https_endpoint_configuration_id] = https_endpoint_configuration_id if https_endpoint_configuration_id data[:certificate_id] = certificate_id if certificate_id data[:certificate_management_policy] = certificate_management_policy if certificate_management_policy result = @client.patch(path % replacements, data: data) NgrokAPI::Models::ReservedDomain.new(client: self, result: result) end |
#update!(id: "", description: nil, metadata: nil, http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil) ⇒ NgrokAPI::Models::ReservedDomain
Update the attributes of a reserved domain. Throws an exception if API error.
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/reserved_domains_client.rb', line 250 def update!( id: "", description: nil, metadata: nil, http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil ) path = '/reserved_domains/%{id}' replacements = { id: id, } data = {} data[:description] = description if description data[:metadata] = if data[:http_endpoint_configuration_id] = http_endpoint_configuration_id if http_endpoint_configuration_id data[:https_endpoint_configuration_id] = https_endpoint_configuration_id if https_endpoint_configuration_id data[:certificate_id] = certificate_id if certificate_id data[:certificate_management_policy] = certificate_management_policy if certificate_management_policy result = @client.patch(path % replacements, data: data, danger: true) NgrokAPI::Models::ReservedDomain.new(client: self, result: result) end |