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
Methods included from InputConverters
Methods included from OptionsParser
#optional_options, #required_options
Class Method Details
.exit_on_failure? ⇒ Boolean
166 167 168 |
# File 'lib/emasser/get.rb', line 166 def self.exit_on_failure? true end |
Instance Method Details
#all ⇒ Object
172 173 174 175 176 177 178 |
# File 'lib/emasser/get.rb', line 172 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
190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/emasser/get.rb', line 190 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 |