mirror of
https://github.com/ngrok/ngrok-api-ruby.git
synced 2026-05-17 16:50:40 +00:00
cut new release for ngrok-api-ruby
This commit is contained in:
committed by
Kyle Wenholz
parent
e02116bc09
commit
89fa79d222
+27
-8
@@ -1,5 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'ostruct'
|
||||
|
||||
module NgrokAPI
|
||||
##
|
||||
# Low-level api client for communicating with Ngrok's HTTP API.
|
||||
@@ -22,11 +24,10 @@ module NgrokAPI
|
||||
end
|
||||
|
||||
##
|
||||
# API Keys are used to authenticate to the
|
||||
# (https://ngrok.com/docs/api#authentication)ngrok
|
||||
# API. You may use the API itself
|
||||
# API Keys are used to authenticate to the [ngrok
|
||||
# API](https://ngrok.com/docs/api#authentication). You may use the API itself
|
||||
# to provision and manage API Keys but you'll need to provision your first API
|
||||
# key from the (https://dashboard.ngrok.com/api/keys)API Keys page on your
|
||||
# key from the [API Keys page](https://dashboard.ngrok.com/api/keys) on your
|
||||
# ngrok.com dashboard.
|
||||
#
|
||||
# @return [NgrokAPI::Services::APIKeysClient]
|
||||
@@ -49,8 +50,8 @@ module NgrokAPI
|
||||
##
|
||||
# Tunnel Credentials are ngrok agent authtokens. They authorize the ngrok
|
||||
# agent to connect the ngrok service as your account. They are installed with
|
||||
# the ngrok authtoken command or by specifying it in the ngrok.yml
|
||||
# configuration file with the authtoken property.
|
||||
# the `ngrok authtoken` command or by specifying it in the `ngrok.yml`
|
||||
# configuration file with the `authtoken` property.
|
||||
#
|
||||
# @return [NgrokAPI::Services::CredentialsClient]
|
||||
def credentials
|
||||
@@ -84,7 +85,7 @@ module NgrokAPI
|
||||
end
|
||||
|
||||
##
|
||||
# IP Policies are reusable groups of CIDR ranges with an allow or deny
|
||||
# IP Policies are reusable groups of CIDR ranges with an `allow` or `deny`
|
||||
# action. They can be attached to endpoints via the Endpoint Configuration IP
|
||||
# Policy module. They can also be used with IP Restrictions to control source
|
||||
# IP ranges that can start tunnel sessions and connect to the API and dashboard.
|
||||
@@ -118,7 +119,7 @@ module NgrokAPI
|
||||
|
||||
##
|
||||
# The IP Whitelist is deprecated and will be removed. Use an IP Restriction
|
||||
# with an endpoints type instead.
|
||||
# with an `endpoints` type instead.
|
||||
#
|
||||
# @return [NgrokAPI::Services::IPWhitelistClient]
|
||||
def ip_whitelist
|
||||
@@ -214,5 +215,23 @@ module NgrokAPI
|
||||
def tunnels
|
||||
@_tunnels ||= NgrokAPI::Services::TunnelsClient.new(client: @client)
|
||||
end
|
||||
|
||||
def pointcfg_module
|
||||
ns = OpenStruct.new
|
||||
ns.logging = NgrokAPI::Services::EndpointLoggingModuleClient.new(client: @client)
|
||||
ns.circuit_breaker = NgrokAPI::Services::EndpointCircuitBreakerModuleClient.new(client: @client)
|
||||
ns.compression = NgrokAPI::Services::EndpointCompressionModuleClient.new(client: @client)
|
||||
ns.tls_termination = NgrokAPI::Services::EndpointTLSTerminationModuleClient.new(client: @client)
|
||||
ns.ip_policy = NgrokAPI::Services::EndpointIPPolicyModuleClient.new(client: @client)
|
||||
ns.mutual_tls = NgrokAPI::Services::EndpointMutualTLSModuleClient.new(client: @client)
|
||||
ns.request_headers = NgrokAPI::Services::EndpointRequestHeadersModuleClient.new(client: @client)
|
||||
ns.response_headers = NgrokAPI::Services::EndpointResponseHeadersModuleClient.new(client: @client)
|
||||
ns.oauth = NgrokAPI::Services::EndpointOAuthModuleClient.new(client: @client)
|
||||
ns.webhook_validation = NgrokAPI::Services::EndpointWebhookValidationModuleClient.new(client: @client)
|
||||
ns.saml = NgrokAPI::Services::EndpointSAMLModuleClient.new(client: @client)
|
||||
ns.oidc = NgrokAPI::Services::EndpointOIDCModuleClient.new(client: @client)
|
||||
|
||||
ns
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -42,21 +42,23 @@ module NgrokAPI
|
||||
end
|
||||
|
||||
##
|
||||
# Make a GET request
|
||||
# Make a GET request to list resources
|
||||
#
|
||||
# @param [boolean] danger determine if we should throw an exception on 404 or not
|
||||
# @param [string] before_id URL resource path
|
||||
# @param [integer] limit URL resource path
|
||||
# @param [string] path resource path, mutually exclusive with url
|
||||
# @param [string] url Full URL of the resource, mutually exclusive with path
|
||||
# @param [string] url Full URL of the resource, mutually exclusive with path
|
||||
# @return [json] response body
|
||||
def list(before_id: nil, limit: nil, path: nil, url: nil)
|
||||
def list(danger: false, before_id: nil, limit: nil, path: nil, url: nil)
|
||||
if url
|
||||
get(url)
|
||||
else
|
||||
data = {}
|
||||
data[:before_id] = before_id if before_id
|
||||
data[:limit] = limit if limit
|
||||
get(path, data: data)
|
||||
get(path, danger: danger, data: data)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+5
-5
@@ -2,17 +2,17 @@
|
||||
|
||||
module NgrokAPI
|
||||
module Models
|
||||
class ReservedDomainCertNSTarget
|
||||
class EventSourceList
|
||||
attr_reader :client,
|
||||
:result,
|
||||
:zone,
|
||||
:nameservers
|
||||
:sources,
|
||||
:uri
|
||||
|
||||
def initialize(client:, result:)
|
||||
@client = client
|
||||
@result = result
|
||||
@zone = @result['zone']
|
||||
@nameservers = @result['nameservers']
|
||||
@sources = @result['sources']
|
||||
@uri = @result['uri']
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
@@ -5,6 +5,8 @@ module NgrokAPI
|
||||
##
|
||||
# A resource representing multiple instances from a given "list" API call
|
||||
class Listable
|
||||
include Enumerable
|
||||
|
||||
attr_reader :client,
|
||||
:klass,
|
||||
:iter,
|
||||
@@ -14,7 +16,7 @@ module NgrokAPI
|
||||
:result,
|
||||
:uri
|
||||
|
||||
def initialize(client:, result:, list_property:, klass:)
|
||||
def initialize(danger: false, client:, result:, list_property:, klass:)
|
||||
@client = client
|
||||
@result = result
|
||||
@list_property = list_property
|
||||
@@ -26,10 +28,19 @@ module NgrokAPI
|
||||
@iter = NgrokAPI::PagedIterator.new(
|
||||
client: client,
|
||||
page: self,
|
||||
list_property: list_property
|
||||
list_property: list_property,
|
||||
danger: danger
|
||||
)
|
||||
end
|
||||
|
||||
def each
|
||||
item = @iter.get_next
|
||||
while item
|
||||
yield item
|
||||
item = @iter.get_next
|
||||
end
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
@result == other.result
|
||||
end
|
||||
|
||||
@@ -17,7 +17,8 @@ module NgrokAPI
|
||||
:https_endpoint_configuration,
|
||||
:certificate,
|
||||
:certificate_management_policy,
|
||||
:certificate_management_status
|
||||
:certificate_management_status,
|
||||
:acme_challenge_cname_target
|
||||
|
||||
def initialize(client:, result:)
|
||||
@client = client
|
||||
@@ -35,6 +36,7 @@ module NgrokAPI
|
||||
@certificate = @result['certificate']
|
||||
@certificate_management_policy = @result['certificate_management_policy']
|
||||
@certificate_management_status = @result['certificate_management_status']
|
||||
@acme_challenge_cname_target = @result['acme_challenge_cname_target']
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
|
||||
@@ -8,8 +8,7 @@ module NgrokAPI
|
||||
:error_code,
|
||||
:msg,
|
||||
:started_at,
|
||||
:retries_at,
|
||||
:ns_targets
|
||||
:retries_at
|
||||
|
||||
def initialize(client:, result:)
|
||||
@client = client
|
||||
@@ -18,7 +17,6 @@ module NgrokAPI
|
||||
@msg = @result['msg']
|
||||
@started_at = @result['started_at']
|
||||
@retries_at = @result['retries_at']
|
||||
@ns_targets = @result['ns_targets']
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
|
||||
@@ -10,12 +10,14 @@ module NgrokAPI
|
||||
def initialize(
|
||||
client:,
|
||||
page:,
|
||||
list_property:
|
||||
list_property:,
|
||||
danger: false
|
||||
)
|
||||
@n = 0
|
||||
@client = client
|
||||
@list_property = list_property
|
||||
@page = page
|
||||
@danger = danger
|
||||
end
|
||||
|
||||
##
|
||||
@@ -30,7 +32,7 @@ module NgrokAPI
|
||||
item
|
||||
rescue
|
||||
if @page.next_page_uri
|
||||
res = @client.list(url: @page.next_page_uri)
|
||||
res = @client.list(danger: @danger, url: @page.next_page_uri)
|
||||
self.n = 0
|
||||
self.page = res
|
||||
get_next
|
||||
|
||||
@@ -3,11 +3,10 @@
|
||||
module NgrokAPI
|
||||
module Services
|
||||
##
|
||||
# API Keys are used to authenticate to the
|
||||
# (https://ngrok.com/docs/api#authentication)ngrok
|
||||
# API. You may use the API itself
|
||||
# API Keys are used to authenticate to the [ngrok
|
||||
# API](https://ngrok.com/docs/api#authentication). You may use the API itself
|
||||
# to provision and manage API Keys but you'll need to provision your first API
|
||||
# key from the (https://dashboard.ngrok.com/api/keys)API Keys page on your
|
||||
# key from the [API Keys page](https://dashboard.ngrok.com/api/keys) on your
|
||||
# ngrok.com dashboard.
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-api-keys
|
||||
@@ -140,6 +139,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -148,6 +148,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all API keys owned by this account
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-api-keys-list
|
||||
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::APIKey,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update attributes of an API key by ID.
|
||||
#
|
||||
|
||||
@@ -141,6 +141,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -149,6 +150,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all Certificate Authority on this account
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-certificate-authorities-list
|
||||
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::CertificateAuthority,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update attributes of a Certificate Authority by ID
|
||||
#
|
||||
|
||||
@@ -5,8 +5,8 @@ module NgrokAPI
|
||||
##
|
||||
# Tunnel Credentials are ngrok agent authtokens. They authorize the ngrok
|
||||
# agent to connect the ngrok service as your account. They are installed with
|
||||
# the ngrok authtoken command or by specifying it in the ngrok.yml
|
||||
# configuration file with the authtoken property.
|
||||
# the `ngrok authtoken` command or by specifying it in the `ngrok.yml`
|
||||
# configuration file with the `authtoken` property.
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-credentials
|
||||
class CredentialsClient
|
||||
@@ -143,6 +143,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -151,6 +152,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all tunnel authtoken credentials on this account
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-credentials-list
|
||||
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::Credential,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update attributes of an tunnel authtoken credential by ID
|
||||
#
|
||||
|
||||
@@ -179,6 +179,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -187,6 +188,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Returns a list of all endpoint configurations on this account
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-endpoint-configurations-list
|
||||
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::EndpointConfiguration,
|
||||
danger: true
|
||||
)
|
||||
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
|
||||
|
||||
@@ -145,6 +145,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -153,6 +154,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all Event Destinations on this account.
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-event-destinations-list
|
||||
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::EventDestination,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update attributes of an Event Destination.
|
||||
#
|
||||
|
||||
@@ -124,6 +124,45 @@ module NgrokAPI
|
||||
NgrokAPI::Models::EventSource.new(client: self, result: result)
|
||||
end
|
||||
|
||||
##
|
||||
# List the types for which this event subscription will trigger
|
||||
#
|
||||
# @param [string] subscription_id The unique identifier for the Event Subscription that this Event Source is attached to.
|
||||
# @return [NgrokAPI::Models::EventSourceList] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-event-sources-list
|
||||
def list(
|
||||
subscription_id: ""
|
||||
)
|
||||
path = '/event_subscriptions/%{subscription_id}/sources'
|
||||
replacements = {
|
||||
subscription_id: subscription_id,
|
||||
}
|
||||
data = {}
|
||||
result = @client.get(path % replacements, data: data)
|
||||
NgrokAPI::Models::EventSourceList.new(client: self, result: result)
|
||||
end
|
||||
|
||||
##
|
||||
# List the types for which this event subscription will trigger
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] subscription_id The unique identifier for the Event Subscription that this Event Source is attached to.
|
||||
# @return [NgrokAPI::Models::EventSourceList] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-event-sources-list
|
||||
def list!(
|
||||
subscription_id: ""
|
||||
)
|
||||
path = '/event_subscriptions/%{subscription_id}/sources'
|
||||
replacements = {
|
||||
subscription_id: subscription_id,
|
||||
}
|
||||
data = {}
|
||||
result = @client.get(path % replacements, data: data, danger: true)
|
||||
NgrokAPI::Models::EventSourceList.new(client: self, result: result)
|
||||
end
|
||||
|
||||
##
|
||||
# Update the type for which this event subscription will trigger
|
||||
#
|
||||
|
||||
@@ -145,6 +145,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -153,6 +154,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all Event Streams available on this account.
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-event-streams-list
|
||||
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::EventStream,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update attributes of an Event Stream by ID.
|
||||
#
|
||||
|
||||
@@ -138,6 +138,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -146,6 +147,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List this Account's Event Subscriptions.
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-event-subscriptions-list
|
||||
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::EventSubscription,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update an Event Subscription.
|
||||
#
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
module NgrokAPI
|
||||
module Services
|
||||
##
|
||||
# IP Policies are reusable groups of CIDR ranges with an allow or deny
|
||||
# IP Policies are reusable groups of CIDR ranges with an `allow` or `deny`
|
||||
# action. They can be attached to endpoints via the Endpoint Configuration IP
|
||||
# Policy module. They can also be used with IP Restrictions to control source
|
||||
# IP ranges that can start tunnel sessions and connect to the API and dashboard.
|
||||
@@ -145,6 +145,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -153,6 +154,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all IP policies on this account
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-ip-policies-list
|
||||
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::IPPolicy,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update attributes of an IP policy by ID
|
||||
#
|
||||
|
||||
@@ -141,6 +141,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -149,6 +150,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all IP policy rules on this account
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-ip-policy-rules-list
|
||||
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::IPPolicyRule,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update attributes of an IP policy rule by ID
|
||||
#
|
||||
|
||||
@@ -148,6 +148,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -156,6 +157,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all IP restrictions on this account
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-ip-restrictions-list
|
||||
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::IPRestriction,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update attributes of an IP restriction by ID
|
||||
#
|
||||
|
||||
@@ -4,7 +4,7 @@ module NgrokAPI
|
||||
module Services
|
||||
##
|
||||
# The IP Whitelist is deprecated and will be removed. Use an IP Restriction
|
||||
# with an endpoints type instead.
|
||||
# with an `endpoints` type instead.
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-ip-whitelist
|
||||
class IPWhitelistClient
|
||||
@@ -139,6 +139,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -147,6 +148,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all IP whitelist entries on this account
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-ip-whitelist-list
|
||||
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::IPWhitelistEntry,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update attributes of an IP whitelist entry by ID
|
||||
#
|
||||
|
||||
@@ -142,6 +142,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -150,6 +151,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all reserved addresses on this account.
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-reserved-addrs-list
|
||||
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::ReservedAddr,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update the attributes of a reserved address.
|
||||
#
|
||||
|
||||
@@ -155,6 +155,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -163,6 +164,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all reserved domains on this account.
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-reserved-domains-list
|
||||
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 the attributes of a reserved domain.
|
||||
#
|
||||
|
||||
@@ -144,6 +144,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -152,6 +153,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all SSH Certificate Authorities on this account
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-ssh-certificate-authorities-list
|
||||
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::SSHCertificateAuthority,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update an SSH Certificate Authority
|
||||
#
|
||||
|
||||
@@ -142,6 +142,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -150,6 +151,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all ssh credentials on this account
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-ssh-credentials-list
|
||||
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::SSHCredential,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update attributes of an ssh_credential by ID
|
||||
#
|
||||
|
||||
@@ -151,6 +151,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -159,6 +160,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all SSH Host Certificates issued on this account
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-ssh-host-certificates-list
|
||||
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::SSHHostCertificate,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update an SSH Host Certificate
|
||||
#
|
||||
|
||||
@@ -157,6 +157,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -165,6 +166,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all SSH User Certificates issued on this account
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-ssh-user-certificates-list
|
||||
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::SSHUserCertificate,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update an SSH User Certificate
|
||||
#
|
||||
|
||||
@@ -144,6 +144,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -152,6 +153,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all TLS certificates on this account
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-tls-certificates-list
|
||||
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::TLSCertificate,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Update attributes of a TLS Certificate by ID
|
||||
#
|
||||
|
||||
@@ -40,6 +40,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -48,6 +49,38 @@ module NgrokAPI
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all online tunnel sessions running on this account.
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-tunnel-sessions-list
|
||||
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::TunnelSession,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Get the detailed status of a tunnel session by ID
|
||||
#
|
||||
|
||||
@@ -39,6 +39,7 @@ module NgrokAPI
|
||||
url: url,
|
||||
path: PATH
|
||||
)
|
||||
|
||||
NgrokAPI::Models::Listable.new(
|
||||
client: self,
|
||||
result: result,
|
||||
@@ -46,6 +47,38 @@ module NgrokAPI
|
||||
klass: NgrokAPI::Models::Tunnel
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# List all online tunnels currently running on the account.
|
||||
# Throws an exception if API error.
|
||||
#
|
||||
# @param [string] before_id
|
||||
# @param [string] limit
|
||||
# @param [string] url optional and mutually exclusive from before_id and limit
|
||||
# @return [NgrokAPI::Models::Listable] result from the API request
|
||||
#
|
||||
# https://ngrok.com/docs/api#api-tunnels-list
|
||||
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::Tunnel,
|
||||
danger: true
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,6 +2,6 @@ module NgrokAPI
|
||||
# rubocop:disable Layout/SpaceAroundOperators
|
||||
|
||||
# The current version of the gem
|
||||
VERSION="0.12.0".freeze
|
||||
VERSION="0.14.0".freeze
|
||||
# rubocop:enable Layout/SpaceAroundOperators
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user