Module: NgrokAPI::Errors + + + +
+-
+
- Defined in: +
- lib/ngrokapi/errors/not_found_error.rb +
Defined Under Namespace
++ + + + + Classes: NotFoundError + + +
+ + + + + + + + + +diff --git a/doc/NgrokAPI.html b/doc/NgrokAPI.html index b9988ba..0d587a1 100644 --- a/doc/NgrokAPI.html +++ b/doc/NgrokAPI.html @@ -79,7 +79,7 @@
- Modules: Models, Services + Modules: Errors, Models, Services @@ -147,7 +147,7 @@
diff --git a/doc/NgrokAPI/Client.html b/doc/NgrokAPI/Client.html index e479ab6..f9ef45e 100644 --- a/doc/NgrokAPI/Client.html +++ b/doc/NgrokAPI/Client.html @@ -532,7 +532,7 @@ diff --git a/doc/NgrokAPI/Errors.html b/doc/NgrokAPI/Errors.html new file mode 100644 index 0000000..a764b3c --- /dev/null +++ b/doc/NgrokAPI/Errors.html @@ -0,0 +1,115 @@ + + + + + ++ + + + + Classes: NotFoundError + + +
+ + + + + + + + + +Error representing a 404 not found
+ + +Returns the value of attribute response.
+A new instance of NotFoundError.
+Returns a new instance of NotFoundError.
+ + +
+ + + +10 +11 +12 +13+ |
+
+ # File 'lib/ngrokapi/errors/not_found_error.rb', line 10 + +def initialize(msg: "Resource not found", response: nil) + @response = response + super(msg) +end+ |
+
Returns the value of attribute response.
+ + +
+ + + +8 +9 +10+ |
+
+ # File 'lib/ngrokapi/errors/not_found_error.rb', line 8 + +def response + @response +end+ |
+
URL resource path
+URL resource path.
+determine if we should throw an exception on 404 or not
-24 25 26 27 -28+28 +29
# File 'lib/ngrokapi/http_client.rb', line 24 +# File 'lib/ngrokapi/http_client.rb', line 25 -def delete(path) +def delete(path, danger: false) uri = get_uri(path) req = Net::HTTP::Delete.new(uri, headers) - json_do(uri, req) + json_do(uri, req, danger: danger) end
determine if we should throw an exception on 404 or not
+-36 -37 38 39 -40+40 +41 +42
# File 'lib/ngrokapi/http_client.rb', line 36 +# File 'lib/ngrokapi/http_client.rb', line 38 -def get(path, data: {}) +def get(path, danger: false, data: {}) uri = get_uri(path, data: data) req = Net::HTTP::Get.new(uri, headers) - json_do(uri, req) + json_do(uri, req, danger: danger) end
-50 -51 52 53 54 @@ -795,10 +829,12 @@ 56 57 58 -59+59 +60 +61
# File 'lib/ngrokapi/http_client.rb', line 50 +# File 'lib/ngrokapi/http_client.rb', line 52 def list(before_id: nil, limit: nil, path: nil, url: nil) if url @@ -818,7 +854,7 @@- #patch(path, data: {}) ⇒ json + #patch(path, danger: false, data: {}) ⇒ json @@ -852,6 +888,24 @@ +
+ + danger + + + (boolean) + + + (defaults to: false) + + + — + +++ +determine if we should throw an exception on 404 or not
+data @@ -897,19 +951,19 @@ -67 -68 -69 70 -71+71 +72 +73 +74
# File 'lib/ngrokapi/http_client.rb', line 67 +# File 'lib/ngrokapi/http_client.rb', line 70 -def patch(path, data: {}) +def patch(path, danger: false, data: {}) uri = get_uri(path) req = Net::HTTP::Patch.new(uri, headers_with_json) - json_do(uri, req, data: data.to_json) + json_do(uri, req, danger: danger, data: data.to_json) end
determine if we should throw an exception on 404 or not
+-79 -80 -81 -82 -83+83 +84 +85 +86 +87
# File 'lib/ngrokapi/http_client.rb', line 79 +# File 'lib/ngrokapi/http_client.rb', line 83 -def post(path, data: {}) +def post(path, danger: false, data: {}) uri = get_uri(path) req = Net::HTTP::Post.new(uri, headers_with_json) - json_do(uri, req, data: data.to_json) + json_do(uri, req, danger: danger, data: data.to_json) end
Delete an API key by ID.
+Delete an API key by ID.
Get the details of an API key by ID.
+Get the details of an API key by ID.
Update attributes of an API key by ID.
+Update attributes of an API key by ID.
# File 'lib/ngrokapi/services/api_keys_client.rb', line 31 def create(description: nil, metadata: nil) - data = {} - data[:description] = description if description - data[:metadata] = if - result = @client.post(PATH, data: data) + result = @client.post(PATH, data: build_data(description: description, metadata: )) NgrokAPI::Models::ApiKey.new(client: self, result: result) end
-47 -48 -49+44 +45 +46
# File 'lib/ngrokapi/services/api_keys_client.rb', line 47 +# File 'lib/ngrokapi/services/api_keys_client.rb', line 44 def delete(id: nil) @client.delete("#{PATH}/#{id}") @@ -642,6 +708,89 @@
Delete an API key by ID. Throw an exception if 404.
+ + + + +
+ + + +55 +56 +57+ |
+
+ # File 'lib/ngrokapi/services/api_keys_client.rb', line 55 + +def delete!(id: nil) + @client.delete("#{PATH}/#{id}", danger: true) +end+ |
+
-58 -59 -60 -61+66 +67 +68 +69
# File 'lib/ngrokapi/services/api_keys_client.rb', line 58 +# File 'lib/ngrokapi/services/api_keys_client.rb', line 66 def get(id: nil) result = @client.get("#{PATH}/#{id}") @@ -727,6 +876,91 @@
Get the details of an API key by ID. Throw an exception if 404.
+ + + + +
+ + + +78 +79 +80 +81+ |
+
+ # File 'lib/ngrokapi/services/api_keys_client.rb', line 78 + +def get!(id: nil) + result = @client.get("#{PATH}/#{id}", danger: true) + NgrokAPI::Models::ApiKey.new(client: self, result: result) +end+ |
+
-72 -73 -74 -75 -76 -77 -78 -79 -80+92 +93 +94 +95 +96 +97 +98 +99 +100
# File 'lib/ngrokapi/services/api_keys_client.rb', line 72 +# File 'lib/ngrokapi/services/api_keys_client.rb', line 92 def list(before_id: nil, limit: nil, url: nil) result = @client.list(before_id: before_id, limit: limit, url: url, path: PATH) @@ -949,22 +1183,134 @@-93 -94 -95 -96 -97 -98 -99+113 +114 +115 +116
# File 'lib/ngrokapi/services/api_keys_client.rb', line 93 +# File 'lib/ngrokapi/services/api_keys_client.rb', line 113 def update(id: nil, description: nil, metadata: nil) - data = {} - data[:description] = description if description - data[:metadata] = if - result = @client.patch("#{PATH}/#{id}", data: data) + result = @client.patch("#{PATH}/#{id}", data: build_data(description: description, metadata: )) + NgrokAPI::Models::ApiKey.new(client: self, result: result) +end+
Update attributes of an API key by ID.
+ + + + +
+ + + +127 +128 +129 +130 +131+ |
+
+ # File 'lib/ngrokapi/services/api_keys_client.rb', line 127 + +def update!(id: nil, description: nil, metadata: nil) + data = build_data(description: description, metadata: ) + result = @client.patch("#{PATH}/#{id}", danger: true, data: data) NgrokAPI::Models::ApiKey.new(client: self, result: result) end |
@@ -977,7 +1323,7 @@
diff --git a/doc/NgrokAPI/Services/EndpointConfigurationsClient.html b/doc/NgrokAPI/Services/EndpointConfigurationsClient.html
index af21be2..e8a6cf6 100644
--- a/doc/NgrokAPI/Services/EndpointConfigurationsClient.html
+++ b/doc/NgrokAPI/Services/EndpointConfigurationsClient.html
@@ -245,6 +245,30 @@
+
Delete an endpoint configuration. Throw an exception if 404. This operation will fail if the endpoint configuration is still referenced by any reserved domain or reserved address.
+ + + + +
+ + + +105 +106 +107+ |
+
+ # File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 105 + +def delete!(id: nil) + @client.delete("#{PATH}/#{id}", danger: true) +end+ |
+
-103 -104 -105 -106+116 +117 +118 +119
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 103 +# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 116 def get(id: nil) result = @client.get("#{PATH}/#{id}") @@ -1021,6 +1176,91 @@
Returns detailed information about an endpoint configuration by ID. Throw an execption if 404.
+ + + + +
+ + + +128 +129 +130 +131+ |
+
+ # File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 128 + +def get!(id: nil) + result = @client.get("#{PATH}/#{id}", danger: true) + NgrokAPI::Models::EndpointConfiguration.new(client: self, result: result) +end+ |
+
-117 -118 -119 -120 -121 -122 -123 -124 -125+142 +143 +144 +145 +146 +147 +148 +149 +150
# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 117 +# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 142 def list(before_id: nil, limit: nil, url: nil) result = @client.list(before_id: before_id, limit: limit, url: url, path: PATH) @@ -1464,31 +1704,6 @@-152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 177 178 179 @@ -1498,10 +1713,36 @@ 183 184 185 -186+186 +187 +188 +189 +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/endpoint_configurations_client.rb', line 152 +# File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 177 def update( id: nil, @@ -1520,27 +1761,429 @@ saml: nil, oidc: nil ) - data = {} - data[:description] = description if description - data[:metadata] = if - 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[:ip_policy] = ip_policy if ip_policy - data[:mutual_tls] = mutual_tls if mutual_tls - data[:tls_termination] = tls_termination if tls_termination - data[:webhook_validation] = webhook_validation if webhook_validation - data[:oauth] = oauth if oauth - data[:logging] = logging if logging - data[:saml] = saml if saml - data[:oidc] = oidc if oidc + data = build_data( + description: description, + metadata: , + circuit_breaker: circuit_breaker, + compression: compression, + request_headers: request_headers, + response_headers: response_headers, + ip_policy: ip_policy, + mutual_tls: mutual_tls, + tls_termination: tls_termination, + webhook_validation: webhook_validation, + oauth: oauth, + logging: logging, + saml: saml, + oidc: oidc + ) result = @client.patch("#{PATH}/#{id}", data: data) NgrokAPI::Models::EndpointConfiguration.new(client: self, result: result) end
Updates an endpoint configuration. 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. Throw an exception if 404.
+ + + + +
+ + + +238 +239 +240 +241 +242 +243 +244 +245 +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 +273+ |
+
+ # File 'lib/ngrokapi/services/endpoint_configurations_client.rb', line 238 + +def update!( + id: nil, + description: nil, + metadata: nil, + circuit_breaker: nil, + compression: nil, + request_headers: nil, + response_headers: nil, + ip_policy: nil, + mutual_tls: nil, + tls_termination: nil, + webhook_validation: nil, + oauth: nil, + logging: nil, + saml: nil, + oidc: nil +) + data = build_data( + description: description, + metadata: , + circuit_breaker: circuit_breaker, + compression: compression, + request_headers: request_headers, + response_headers: response_headers, + ip_policy: ip_policy, + mutual_tls: mutual_tls, + tls_termination: tls_termination, + webhook_validation: webhook_validation, + oauth: oauth, + logging: logging, + saml: saml, + oidc: oidc + ) + result = @client.patch("#{PATH}/#{id}", danger: true, data: data) + NgrokAPI::Models::EndpointConfiguration.new(client: self, result: result) +end+ |
+
Delete a reserved domain.
+Delete a reserved domain.
Detach the certificate attached from a reserved domain.
+Detach the certificate attached from a reserved domain.
Detach the certificate management policy attached from a reserved domain.
+Detach the certificate management policy attached from a reserved domain.
Detach the http endpoint configuration attached from a reserved domain.
+Detach the http endpoint configuration attached from a reserved domain.
Detach the https endpoint configuration attached from a reserved domain.
+Detach the https endpoint configuration attached from a reserved domain.
Get the details of a reserved domain.
+Get the details of a reserved domain.
Update the attributes of a reserved domain.
+Update the attributes of a reserved domain.
Delete a reserved domain. Throw an exception if 404.
+ + + + +
+ + + +80 +81 +82+ |
+
+ # File 'lib/ngrokapi/services/reserved_domains_client.rb', line 80 + +def delete!(id: nil) + @client.delete("#{PATH}/#{id}", danger: true) +end+ |
+
-153 -154 -155+205 +206 +207
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 153 +# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 205 def delete_certificate(id: nil) @client.delete("#{PATH}/#{id}/certificate") @@ -961,6 +1212,89 @@
Detach the certificate attached from a reserved domain. Throw an exception if 404.
+ + + + +
+ + + +216 +217 +218+ |
+
+ # File 'lib/ngrokapi/services/reserved_domains_client.rb', line 216 + +def delete_certificate!(id: nil) + @client.delete("#{PATH}/#{id}/certificate", danger: true) +end+ |
+
-164 -165 -166+227 +228 +229
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 164 +# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 227 def delete_certificate_management_policy(id: nil) @client.delete("#{PATH}/#{id}/certificate_management_policy") @@ -1044,6 +1378,89 @@
Detach the certificate management policy attached from a reserved domain.
+ +ngrok.com/docs/api#api-reserved-domains-delete-certificate-management-policy
+ + +
+ + + +238 +239 +240+ |
+
+ # File 'lib/ngrokapi/services/reserved_domains_client.rb', line 238 + +def delete_certificate_management_policy!(id: nil) + @client.delete("#{PATH}/#{id}/certificate_management_policy", danger: true) +end+ |
+
-175 -176 -177+249 +250 +251
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 175 +# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 249 def delete_http_endpoint_config(id: nil) @client.delete("#{PATH}/#{id}/http_endpoint_configuration") @@ -1127,6 +1544,89 @@
Detach the http endpoint configuration attached from a reserved domain. Throw an exception if 404.
+ +ngrok.com/docs/api#api-reserved-domains-delete-http-endpoint-config
+ + +
+ + + +260 +261 +262+ |
+
+ # File 'lib/ngrokapi/services/reserved_domains_client.rb', line 260 + +def delete_http_endpoint_config!(id: nil) + @client.delete("#{PATH}/#{id}/http_endpoint_configuration", danger: true) +end+ |
+
-186 -187 -188+271 +272 +273
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 186 +# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 271 def delete_https_endpoint_config(id: nil) @client.delete("#{PATH}/#{id}/https_endpoint_configuration") @@ -1210,6 +1710,89 @@
Detach the https endpoint configuration attached from a reserved domain. Throw an exception if 404.
+ +ngrok.com/docs/api#api-reserved-domains-delete-https-endpoint-config
+ + +
+ + + +282 +283 +284+ |
+
+ # File 'lib/ngrokapi/services/reserved_domains_client.rb', line 282 + +def delete_https_endpoint_config!(id: nil) + @client.delete("#{PATH}/#{id}/https_endpoint_configuration", danger: true) +end+ |
+
-80 -81 -82 -83+91 +92 +93 +94
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 80 +# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 91 def get(id: nil) result = @client.get("#{PATH}/#{id}") @@ -1295,6 +1878,91 @@
Get the details of a reserved domain. Throw an exception if 404.
+ + + + +
+ + + +103 +104 +105 +106+ |
+
+ # File 'lib/ngrokapi/services/reserved_domains_client.rb', line 103 + +def get!(id: nil) + result = @client.get!("#{PATH}/#{id}") + NgrokAPI::Models::ReservedDomain.new(client: self, result: result) +end+ |
+
-94 -95 -96 -97 -98 -99 -100 -101 -102+117 +118 +119 +120 +121 +122 +123 +124 +125
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 94 +# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 117 def list(before_id: nil, limit: nil, url: nil) result = @client.list(before_id: before_id, limit: limit, url: url, path: PATH) @@ -1589,34 +2257,29 @@-119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 142 -143+143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161
# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 119 +# File 'lib/ngrokapi/services/reserved_domains_client.rb', line 142 def update( id: nil, @@ -1627,25 +2290,240 @@ https_endpoint_configuration_id: nil, metadata: nil ) - data = {} - data[:certificate_id] = certificate_id if certificate_id - if certificate_management_policy - data[:certificate_management_policy] = certificate_management_policy - end - data[:description] = description if description - if http_endpoint_configuration_id - data[:http_endpoint_configuration_id] = http_endpoint_configuration_id - end - if https_endpoint_configuration_id - data[:https_endpoint_configuration_id] = https_endpoint_configuration_id - end - data[:metadata] = if + data = build_data( + description: description, + metadata: , + http_endpoint_configuration_id: http_endpoint_configuration_id, + https_endpoint_configuration_id: https_endpoint_configuration_id, + certificate_id: certificate_id, + certificate_management_policy: certificate_management_policy + ) result = @client.patch("#{PATH}/#{id}", data: data) NgrokAPI::Models::ReservedDomain.new(client: self, result: result) end
Update the attributes of a reserved domain. Throw an exception if 404.
+ + + + +
+ + + +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195+ |
+
+ # File 'lib/ngrokapi/services/reserved_domains_client.rb', line 176 + +def update!( + id: nil, + certificate_id: nil, + certificate_management_policy: nil, + description: nil, + http_endpoint_configuration_id: nil, + https_endpoint_configuration_id: nil, + metadata: nil +) + data = build_data( + description: description, + metadata: , + http_endpoint_configuration_id: http_endpoint_configuration_id, + https_endpoint_configuration_id: https_endpoint_configuration_id, + certificate_id: certificate_id, + certificate_management_policy: certificate_management_policy + ) + result = @client.patch("#{PATH}/#{id}", danger: true, data: data) + NgrokAPI::Models::ReservedDomain.new(client: self, result: result) +end+ |
+
Delete a TLS certificate by ID.
+Delete a TLS certificate by ID.
Get detailed information about a TLS certificate by ID.
+Get detailed information about a TLS certificate by ID.
Update attributes of a TLS Certificate by ID.
+Update attributes of a TLS Certificate by ID.
Delete a TLS certificate by ID. Throw an exception if 404.
+ + + + +
+ + + +68 +69 +70+ |
+
+ # File 'lib/ngrokapi/services/tls_certificates_client.rb', line 68 + +def delete!(id: nil) + @client.delete("#{PATH}/#{id}", danger: true) +end+ |
+
-68 -69 -70 -71+79 +80 +81 +82
# File 'lib/ngrokapi/services/tls_certificates_client.rb', line 68 +# File 'lib/ngrokapi/services/tls_certificates_client.rb', line 79 def get(id: nil) result = @client.get("#{PATH}/#{id}") @@ -779,6 +934,91 @@
Get detailed information about a TLS certificate by ID. Throw an exception if 404.
+ + + + +
+ + + +91 +92 +93 +94+ |
+
+ # File 'lib/ngrokapi/services/tls_certificates_client.rb', line 91 + +def get!(id: nil) + result = @client.get("#{PATH}/#{id}", danger: true) + NgrokAPI::Models::TlsCertificate.new(client: self, result: result) +end+ |
+
-82 -83 -84 -85 -86 -87 -88 -89 -90+105 +106 +107 +108 +109 +110 +111 +112 +113
# File 'lib/ngrokapi/services/tls_certificates_client.rb', line 82 +# File 'lib/ngrokapi/services/tls_certificates_client.rb', line 105 def list(before_id: nil, limit: nil, url: nil) result = @client.list(before_id: before_id, limit: limit, url: url, path: PATH) @@ -1001,20 +1241,20 @@-103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113+126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136
# File 'lib/ngrokapi/services/tls_certificates_client.rb', line 103 +# File 'lib/ngrokapi/services/tls_certificates_client.rb', line 126 def update( id: nil, @@ -1030,6 +1270,136 @@
Update attributes of a TLS Certificate by ID. Throw an exception if 404.
+ + + + +
+ + + +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157+ |
+
+ # File 'lib/ngrokapi/services/tls_certificates_client.rb', line 147 + +def update!( + id: nil, + description: nil, + metadata: nil +) + data = {} + data[:description] = description if description + data[:metadata] = if + result = @client.patch("#{PATH}/#{id}", danger: true, data: data) + NgrokAPI::Models::TlsCertificate.new(client: self, result: result) +end+ |
+