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: "", domain: "", region: "", description: "", metadata: "", http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil, error_redirect_url: nil) ⇒ NgrokAPI::Models::ReservedDomain
Create a new reserved domain.
-
#create!(name: "", domain: "", region: "", description: "", metadata: "", http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil, error_redirect_url: 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.
-
#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, filter: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all reserved domains on this account.
-
#list!(before_id: nil, limit: nil, filter: 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, region: nil, error_redirect_url: 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, region: nil, error_redirect_url: nil) ⇒ NgrokAPI::Models::ReservedDomain
Update the attributes of a reserved domain.
Constructor Details
#initialize(client:) ⇒ ReservedDomainsClient
Returns a new instance of ReservedDomainsClient.
22 23 24 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 22 def initialize(client:) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
20 21 22 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 20 def client @client end |
Instance Method Details
#create(name: "", domain: "", region: "", description: "", metadata: "", http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil, error_redirect_url: nil) ⇒ NgrokAPI::Models::ReservedDomain
Create a new reserved domain.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 38 def create(name: "", domain: "", region: "", description: "", metadata: "", http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil, error_redirect_url: nil) path = '/reserved_domains' replacements = { } data = {} data[:domain] = domain if domain data[:region] = region if region data[:description] = description if description data[:metadata] = if 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, attrs: result) end |
#create!(name: "", domain: "", region: "", description: "", metadata: "", http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil, error_redirect_url: nil) ⇒ NgrokAPI::Models::ReservedDomain
Create a new reserved domain. Throws an exception if API error.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 66 def create!(name: "", domain: "", region: "", description: "", metadata: "", http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil, error_redirect_url: nil) path = '/reserved_domains' replacements = { } data = {} data[:domain] = domain if domain data[:region] = region if region data[:description] = description if description data[:metadata] = if 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, danger: true) NgrokAPI::Models::ReservedDomain.new(client: self, attrs: result) end |
#delete(id: "") ⇒ NgrokAPI::Models::Empty
Delete a reserved domain.
88 89 90 91 92 93 94 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 88 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.
104 105 106 107 108 109 110 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 104 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.
303 304 305 306 307 308 309 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 303 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.
319 320 321 322 323 324 325 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 319 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
272 273 274 275 276 277 278 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 272 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
288 289 290 291 292 293 294 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 288 def delete_certificate_management_policy!(id: "") path = '/reserved_domains/%{id}/certificate_management_policy' replacements = { id: id, } @client.delete(path % replacements, danger: true) end |
#get(id: "") ⇒ NgrokAPI::Models::ReservedDomain
Get the details of a reserved domain.
119 120 121 122 123 124 125 126 127 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 119 def get(id: "") path = '/reserved_domains/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data) NgrokAPI::Models::ReservedDomain.new(client: self, attrs: result) end |
#get!(id: "") ⇒ NgrokAPI::Models::ReservedDomain
Get the details of a reserved domain. Throws an exception if API error.
137 138 139 140 141 142 143 144 145 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 137 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, attrs: result) end |
#list(before_id: nil, limit: nil, filter: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all reserved domains on this account.
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 157 def list( before_id: nil, limit: nil, filter: nil, url: nil ) result = @client.list( before_id: before_id, limit: limit, filter: filter, url: url, path: PATH ) NgrokAPI::Models::Listable.new( client: self, attrs: result, list_property: LIST_PROPERTY, klass: NgrokAPI::Models::ReservedDomain ) end |
#list!(before_id: nil, limit: nil, filter: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all reserved domains on this account. Throws an exception if API error.
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/reserved_domains_client.rb', line 190 def list!( before_id: nil, limit: nil, filter: nil, url: nil ) result = @client.list( before_id: before_id, limit: limit, filter: filter, danger: true, url: url, path: PATH ) NgrokAPI::Models::Listable.new( client: self, attrs: 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, region: nil, error_redirect_url: nil) ⇒ NgrokAPI::Models::ReservedDomain
Update the attributes of a reserved domain.
225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 225 def update(id: "", description: nil, metadata: nil, http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil, region: nil, error_redirect_url: nil) path = '/reserved_domains/%{id}' replacements = { id: id, } data = {} data[:description] = description if description data[:metadata] = if 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, attrs: 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, region: nil, error_redirect_url: nil) ⇒ NgrokAPI::Models::ReservedDomain
Update the attributes of a reserved domain. Throws an exception if API error.
251 252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 251 def update!(id: "", description: nil, metadata: nil, http_endpoint_configuration_id: nil, https_endpoint_configuration_id: nil, certificate_id: nil, certificate_management_policy: nil, region: nil, error_redirect_url: nil) path = '/reserved_domains/%{id}' replacements = { id: id, } data = {} data[:description] = description if description data[:metadata] = if 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, attrs: result) end |