Class: Api::Activation
Overview
This class executes an HTTP call to the API in billing, when the node is started for the first time. As a result of activation if receives an auth key, which is used for signing all subsequent API calls.
Constant Summary collapse
- PKI_PATH =
'/hooks/pki/keys'
Constants inherited from Billing
Instance Method Summary collapse
Methods inherited from Billing
#api_call_result, #auth_key, #host_with_port, #hostname, #response, #success_api_call?, #uri
Instance Method Details
#activate ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/api/activation.rb', line 11 def activate return if active_node? if activated_successfully? save_auth_key else raise "Can't activate server at billing" end end |