Class: Files::AgentProxyIdentity
- Inherits:
-
Object
- Object
- Files::AgentProxyIdentity
- Defined in:
- lib/files.com/models/agent_proxy_identity.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
-
.lookup(params = {}, options = {}) ⇒ Object
Parameters: ips (required) - array(string) - One or more public IPv4 addresses to resolve.
-
.report(params = {}, options = {}) ⇒ Object
Parameters: private_ip (required) - string - Proxy private IPv4 address peer_id (required) - string - Libp2p peer ID currently served by the proxy.
Instance Method Summary collapse
-
#endpoints ⇒ Object
array(object) - Protocol-specific endpoints for this peer ID.
-
#initialize(attributes = {}, options = {}) ⇒ AgentProxyIdentity
constructor
A new instance of AgentProxyIdentity.
-
#peer_id ⇒ Object
string - Libp2p peer ID for this identity candidate.
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ AgentProxyIdentity
Returns a new instance of AgentProxyIdentity.
7 8 9 10 |
# File 'lib/files.com/models/agent_proxy_identity.rb', line 7 def initialize(attributes = {}, = {}) @attributes = attributes || {} @options = || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/files.com/models/agent_proxy_identity.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/agent_proxy_identity.rb', line 5 def @options end |
Class Method Details
.lookup(params = {}, options = {}) ⇒ Object
Parameters:
ips (required) - array(string) - One or more public IPv4 addresses to resolve
24 25 26 27 28 29 30 31 32 |
# File 'lib/files.com/models/agent_proxy_identity.rb', line 24 def self.lookup(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: ips must be an Array") if params[:ips] and !params[:ips].is_a?(Array) raise MissingParameterError.new("Parameter missing: ips") unless params[:ips] response, = Api.send_request("/agent_proxy_identities/lookup", :post, params, ) response.data.map do |entity_data| AgentProxyIdentityResult.new(entity_data, ) end end |
.report(params = {}, options = {}) ⇒ Object
Parameters:
private_ip (required) - string - Proxy private IPv4 address
peer_id (required) - string - Libp2p peer ID currently served by the proxy
37 38 39 40 41 42 43 44 45 |
# File 'lib/files.com/models/agent_proxy_identity.rb', line 37 def self.report(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: private_ip must be an String") if params[:private_ip] and !params[:private_ip].is_a?(String) raise InvalidParameterError.new("Bad parameter: peer_id must be an String") if params[:peer_id] and !params[:peer_id].is_a?(String) raise MissingParameterError.new("Parameter missing: private_ip") unless params[:private_ip] raise MissingParameterError.new("Parameter missing: peer_id") unless params[:peer_id] Api.send_request("/agent_proxy_identities/report", :post, params, ) nil end |
Instance Method Details
#endpoints ⇒ Object
array(object) - Protocol-specific endpoints for this peer ID.
18 19 20 |
# File 'lib/files.com/models/agent_proxy_identity.rb', line 18 def endpoints @attributes[:endpoints] end |
#peer_id ⇒ Object
string - Libp2p peer ID for this identity candidate.
13 14 15 |
# File 'lib/files.com/models/agent_proxy_identity.rb', line 13 def peer_id @attributes[:peer_id] end |