Class: Emasser::Register
- Inherits:
-
SubCommandBase
- Object
- Thor
- SubCommandBase
- Emasser::Register
- Defined in:
- lib/emasser/post.rb
Overview
The Registration endpoint provides the ability to register a certificate & obtain an API-key.
Endpoint:
/api/api-key
Class Method Summary collapse
Instance Method Summary collapse
-
#cert ⇒ Object
rubocop:disable Style/RedundantBegin.
Methods inherited from SubCommandBase
Methods included from OutputConverters
#change_to_datetime, #to_output_hash
Methods included from InputConverters
Methods included from OptionsParser
#optional_options, #required_options
Class Method Details
.exit_on_failure? ⇒ Boolean
49 50 51 |
# File 'lib/emasser/post.rb', line 49 def self.exit_on_failure? true end |
Instance Method Details
#cert ⇒ Object
rubocop:disable Style/RedundantBegin
55 56 57 58 59 60 61 62 63 |
# File 'lib/emasser/post.rb', line 55 def cert begin result = EmassClient::RegistrationApi.new.register_user(Emasser::GET_REGISTER_RETURN_TYPE) puts to_output_hash(result).green rescue EmassClient::ApiError => e puts 'Exception when calling RegistrationApi->register_user'.red puts to_output_hash(e).split('\n').join('. ') end end |