Class: Emasser::Roles
- Inherits:
-
SubCommandBase
- Object
- Thor
- SubCommandBase
- Emasser::Roles
- Defined in:
- lib/emasser/get.rb
Overview
The System Roles endpoints provides the ability to access user data assigned to systems. Notes:
The endpoint can access three different role categories: PAC, CAC, and Other.
If a system is dual-policy enabled, the returned system role information will default
to the RMF policy information unless otherwise specified.
Endpoint:
/api/system-roles - Get all available roles
/api/system-roles/{roleCategory} - Get system roles for provided role catgory
Class Method Summary collapse
Instance Method Summary collapse
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
176 177 178 |
# File 'lib/emasser/get.rb', line 176 def self.exit_on_failure? true end |
Instance Method Details
#all ⇒ Object
182 183 184 185 186 187 188 |
# File 'lib/emasser/get.rb', line 182 def all result = EmassClient::SystemRolesApi.new.get_system_roles puts to_output_hash(result).green rescue EmassClient::ApiError => e puts 'Exception when calling SystemRolesApi->get_system_roles'.red puts to_output_hash(e) end |
#byCategory ⇒ Object
199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/emasser/get.rb', line 199 def byCategory = (@_initializer).keys = to_input_hash(, ) begin result = EmassClient::SystemRolesApi.new.get_system_roles_by_category_id([:roleCategory], [:role], ) puts to_output_hash(result).green rescue EmassClient::ApiError => e puts 'Exception when calling SystemRolesApi->get_system_by_role_category_id'.red puts to_output_hash(e) end end |