Class: Pvectl::Commands::SetContainer
- Inherits:
-
Object
- Object
- Pvectl::Commands::SetContainer
- Includes:
- SetResourceCommand
- Defined in:
- lib/pvectl/commands/set_container.rb,
sig/pvectl/commands/set_container.rbs
Overview
Handler for the pvectl set container command.
Includes SetResourceCommand for shared workflow and overrides template methods with container-specific behavior.
Instance Method Summary collapse
-
#build_set_service(connection) ⇒ Services::SetContainer
Builds the container set service.
-
#execute_params(resource_id, key_values) ⇒ Hash
Builds execution parameters from a container ID.
-
#resource_id_label ⇒ String
Human label for container IDs.
-
#resource_label ⇒ String
Human label for container resources.
Methods included from SetResourceCommand
#display_diff, #execute, included, #initialize, #load_config, #parse_key_values, #service_options, #usage_error
Instance Method Details
#build_set_service(connection) ⇒ Services::SetContainer
Builds the container set service.
41 42 43 44 45 46 47 |
# File 'lib/pvectl/commands/set_container.rb', line 41 def build_set_service(connection) ct_repo = Pvectl::Repositories::Container.new(connection) Pvectl::Services::SetContainer.new( container_repository: ct_repo, options: ) end |
#execute_params(resource_id, key_values) ⇒ Hash
Builds execution parameters from a container ID.
33 34 35 |
# File 'lib/pvectl/commands/set_container.rb', line 33 def execute_params(resource_id, key_values) { ctid: resource_id.to_i, params: key_values } end |
#resource_id_label ⇒ String
Returns human label for container IDs.
24 25 26 |
# File 'lib/pvectl/commands/set_container.rb', line 24 def resource_id_label "CTID" end |
#resource_label ⇒ String
Returns human label for container resources.
19 20 21 |
# File 'lib/pvectl/commands/set_container.rb', line 19 def resource_label "container" end |