Class: HammerCLIForeman::RemoveAssociatedCommand
- Inherits:
-
AssociatedCommand
- Object
- HammerCLI::Apipie::WriteCommand
- WriteCommand
- AssociatedCommand
- HammerCLIForeman::RemoveAssociatedCommand
- Defined in:
- lib/hammer_cli_foreman/commands.rb
Direct Known Subclasses
AssociatingCommands::Architecture::RemoveArchitectureCommand, AssociatingCommands::ComputeResource::RemoveComputeResourceCommand, AssociatingCommands::ConfigTemplate::RemoveConfigTemplateCommand, AssociatingCommands::Domain::RemoveDomainCommand, AssociatingCommands::Environment::RemoveEnvironmentCommand, AssociatingCommands::Hostgroup::RemoveHostgroupCommand, AssociatingCommands::Medium::RemoveMediumCommand, AssociatingCommands::OperatingSystem::RemoveOSCommand, AssociatingCommands::Organization::RemoveOrganizationCommand, AssociatingCommands::PartitionTable::RemovePartitionTableCommand, AssociatingCommands::SmartProxy::RemoveSmartProxyCommand, AssociatingCommands::Subnet::RemoveSubnetCommand, AssociatingCommands::User::RemoveUserCommand
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from AssociatedCommand
apipie_options, associated_identifiers, associated_resource, #associated_resource, declared_associated_identifiers, #get_current_ids, #get_required_id, #request_params, setup_associated_identifier_options, #validate_options
Methods inherited from WriteCommand
#request_headers, #send_request
Class Method Details
.command_name(name = nil) ⇒ Object
285 286 287 |
# File 'lib/hammer_cli_foreman/commands.rb', line 285 def self.command_name(name=nil) super(name) || (associated_resource ? "remove_"+associated_resource.name : nil) end |
.desc(desc = nil) ⇒ Object
289 290 291 |
# File 'lib/hammer_cli_foreman/commands.rb', line 289 def self.desc(desc=nil) "Disassociate a resource" end |
Instance Method Details
#get_new_ids ⇒ Object
293 294 295 296 297 298 299 |
# File 'lib/hammer_cli_foreman/commands.rb', line 293 def get_new_ids ids = get_current_ids required_id = get_required_id ids = ids.delete_if { |id| id == required_id } ids end |