class NgrokAPI::Services::EndpointsClient
Endpoints provides an API for querying the endpoint objects
which define what tunnel or edge is used to serve a hostport. Only active endpoints associated with a tunnel or backend are returned.
Constants
- LIST_PROPERTY
The List Property from the resulting API for list calls
- PATH
The API path for the requests
Attributes
Public Class Methods
# File lib/ngrokapi/services/endpoints_client.rb, line 19 def initialize(client:) @client = client end
Public Instance Methods
Get the status of an endpoint by ID
@param [string] id a resource identifier @return [NgrokAPI::Models::Endpoint] result from the API request
ngrok.com/docs/api#api-endpoints-get
# File lib/ngrokapi/services/endpoints_client.rb, line 83 def get(id: "") path = '/endpoints/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data) NgrokAPI::Models::Endpoint.new(client: self, attrs: result) end
Get the status of an endpoint by ID Throws an exception if API error.
@param [string] id a resource identifier @return [NgrokAPI::Models::Endpoint] result from the API request
ngrok.com/docs/api#api-endpoints-get
# File lib/ngrokapi/services/endpoints_client.rb, line 101 def get!(id: "") path = '/endpoints/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data, danger: true) NgrokAPI::Models::Endpoint.new(client: self, attrs: result) end
List all active endpoints on the account
@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
ngrok.com/docs/api#api-endpoints-list
# File lib/ngrokapi/services/endpoints_client.rb, line 32 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::Endpoint ) end
List all active endpoints 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
ngrok.com/docs/api#api-endpoints-list
# File lib/ngrokapi/services/endpoints_client.rb, line 58 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::Endpoint, danger: true ) end