Class: DTK::Client::Service

Inherits:
CommandBaseThor show all
Defined in:
lib/commands/thor/service.rb

Constant Summary

Constants inherited from CommandBaseThor

CommandBaseThor::ALT_IDENTIFIER_SEPARATOR, CommandBaseThor::EXTENDED_TIMEOUT, CommandBaseThor::HIDE_FROM_BASE_CONTEXT, CommandBaseThor::TIME_DIFF

Constants included from CommandHelperMixin

CommandHelperMixin::Loaded

Constants included from ReparseMixin

ReparseMixin::YamlDTKMetaFiles

Constants included from Poller

Poller::PERIOD_WAIT_TIME

Constants inherited from Thor

Thor::HIDE_FROM_BASE_CONTEXT_HELP

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CommandBaseThor

action_on_revalidation_response, basename, create_context_arguments, execute_from_cli, generate_cached_id, get_cached_response, get_identifiers, get_usage_info, #help, #initialize, invalidate_entities, invisible_context_list, list_method_supported?, task_names, tiered_task_names, valid_id?

Methods included from CommandBase

#get, #get_connection, handle_argument_error, #post, #post_file, #rest_url, #rotate_args

Methods included from TaskStatusMixin

#list_task_info_aux, #task_status_aux, #task_status_stream

Methods included from Console

confirmation_prompt, confirmation_prompt_additional_options, confirmation_prompt_multiple_choice, confirmation_prompt_simple, unix_shell, wait_animation

Methods included from CommandHelperMixin

#Helper

Methods included from ReparseMixin

#reparse_aux

Methods included from PushCloneChangesMixin

#push_clone_changes_aux

Methods included from CommandBaseThor::CommonOptionDefs::ClassMixin

#version_method_option

Methods included from Poller

#poller_response, #print_response, #resolve_type

Methods inherited from Thor

get_alternative_identifiers, help, match_help_item_changes, overriden_help, printable_tasks, replace_if_matched!, set_context

Constructor Details

This class inherits a constructor from DTK::Client::CommandBaseThor

Class Method Details

.all_childrenObject

this includes children of children



142
143
144
145
# File 'lib/commands/thor/service.rb', line 142

def self.all_children()
  # [:node, :component, :attribute]
  [:node]
end

.extended_contextObject

using extended_context when we want to use autocomplete from other context e.g. we are in assembly/apache context and want to create-component we will use extended context to add component-templates to autocomplete



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/commands/thor/service.rb', line 84

def self.extended_context()
  {
    :context => {
      :create_node => "node_template",
      :create_node_group => "node_template",
      :add_component_dependency => "component_template"
    },
    :command => {
      :add_component => {
        :endpoint => "component_template",
        :url => "component/list",
        :opts => {:subtype=>"template", :ignore => "test_module", :hide_assembly_cmps => "true"}
      },
      :edit_component_module => {
        :endpoint => "assembly",
        :url => "assembly/info_about",
        :opts => {:subtype=>"instance", :about=>"modules"}
      },
      :push_component_module_updates => {
        :endpoint => "assembly",
        :url => "assembly/info_about",
        :opts => {:subtype=>"instance", :about=>"modules"}
      },
      :delete_node => {
        :endpoint => "assembly",
        :url => "assembly/get_nodes_without_node_groups"
      },
      :delete_node_group => {
        :endpoint => "assembly",
        :url => "assembly/get_node_groups"
      },
      :pull_base_component_module => {
        :endpoint => "assembly",
        :url => "assembly/info_about",
        :opts => {:subtype=>"instance", :about=>"modules"}
      },
      :action_info => {
        :endpoint => "assembly",
        :url => "assembly/task_action_list"
      },
      :exec => {
        :endpoint => "assembly",
        :url => "assembly/list_actions"
      },
      :exec_sync => {
        :endpoint => "assembly",
        :url => "assembly/list_actions"
      }
      # TODO: DEPRECATE execute_workflow
      # :execute_workflow => {
      #   :endpoint => "assembly",
      #   :url => "assembly/task_action_list"
      # }
    }
  }
end

.invisible_contextObject



77
78
79
# File 'lib/commands/thor/service.rb', line 77

def self.invisible_context()
  [:node]
end

.multi_context_childrenObject



147
148
149
# File 'lib/commands/thor/service.rb', line 147

def self.multi_context_children()
  [[:utils],[:node, :utils]]
end

.override_allowed_methodsObject

:all => include both for commands with command and identifier :command_only => only on command level :identifier_only => only on identifier level for given entity (command)



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/commands/thor/service.rb', line 166

def self.override_allowed_methods()
  override_methods = {
    :all => {
      # :node => [
        # ['delete-component',"delete-component COMPONENT-ID","# Delete component from assembly's node"],
        # ['list-components',"list-components","# List components associated with assembly's node."],
        # ['list-attributes',"list-attributes","# List attributes associated with assembly's node."]
      # ],
      :component => [
        ['list-attributes',"list-attributes","# List attributes associated with given component."]
      ]
    },
    :command_only => {
      :attribute => [
        ['list-attributes',"list-attributes","# List attributes."]
      ],
      :node => [
        ['delete',"delete NODE-NAME/ID [-y] ","# Delete node, terminating it if the node has been spun up."],
        ['list',"list","# List nodes."]
      ],
      :component => [
        ['delete',"delete COMPONENT-NAME/ID [-y] ","# Delete component from workspace."],
        ['list-components',"list-components","# List components."]
      ],
      :utils => [
# TODO: DTK-2027 might subsume by the dtk actions; currently server changes does not support this command
#            ['execute-tests',"execute-tests [--component COMPONENT-NAME] [--timeout TIMEOUT]","# Execute tests. --component filters execution per component, --timeout changes default execution timeout."],
        ['get-netstats',"get-netstats","# Get netstats."],
        ['get-ps',"get-ps [--filter PATTERN]","# Get ps."],
        ['grep',"grep LOG-PATH NODE-ID-PATTERN GREP-PATTERN [--first]","# Grep log from multiple nodes. --first option returns first match (latest log entry)."],
        ['tail',"tail LOG-PATH NODE-NAME [REGEX-PATTERN] [--more]","# Tail log from specified node. CTRL+C to quit."]
      ],
      :node_utils => [
        ['get-netstats',"get-netstats","# Get netstats."],
        ['get-ps',"get-ps [--filter PATTERN]","# Get ps."],
        ['grep',"grep LOG-PATH GREP-PATTERN [--first]","# Grep log from node. --first option returns first match (latest log entry)."],
        ['tail',"tail LOG-PATH [REGEX-PATTERN] [--more]","# Tail log from node. CTRL+C to quit."]
      ]
    },
    :identifier_only => {
      :node => [
        ['add-component',"add-component COMPONENT","# Add a component to the node."],
        ['delete-component',"delete-component COMPONENT-NAME [-y]","# Delete component from service's node"],
        ['info',"info","# Return info about node instance belonging to given workspace."],
        ['list-attributes',"list-attributes","# List attributes associated with service's node."],
        ['list-components',"list-components","# List components associated with service's node."],
        ['set-attribute',"set-attribute ATTRIBUTE-NAME [VALUE] [-u]","# (Un)Set attribute value. The option -u will unset the attribute's value."],
        ['start', "start", "# Start node instance."],
        ['stop', "stop", "# Stop node instance."],
        ['ssh', "ssh REMOTE-USER [-i PATH-TO-PEM]","# SSH into node, optional parameters are path to identity file."]
      ],
      :node_group => [
        ['start', "start", "# 2Start node instance."],
        ['stop', "stop", "# 2Stop node instance."],
        ['ssh', "ssh REMOTE-USER [-i PATH-TO-PEM]","# 2SSH into node, optional parameters are path to identity file."]
      ],
      :component => [
        ['info',"info","# Return info about component instance belonging to given node."],
        ['edit',"edit","# Edit component module related to given component."],
        ['link-components',"link-components ANTECEDENT-CMP-NAME [DEPENDENCY-NAME]","#Link components to satisfy component dependency relationship."],
        ['list-component-links',"list-component-links","# List component's links to other components."],
        ['unlink-components',"unlink-components SERVICE-TYPE","# Delete service link on component."]
      ],
      :attribute => [
        ['info',"info","# Return info about attribute instance belonging to given component."]
      ]
    }
  }

  if DTK::Configuration.get(:development_mode)
    override_methods[:identifier_only][:node] << ['test-action-agent', "test-action-agent BASH-COMMAND-LINE", "Run bash command on test action agent"]
  end

  return DTK::Shell::OverrideTasks.new(override_methods, [:utils])
end

.pretty_print_colsObject



69
70
71
# File 'lib/commands/thor/service.rb', line 69

def self.pretty_print_cols()
  PPColumns.get(:assembly)
end

.valid_child?(name_of_sub_context) ⇒ Boolean

Returns:

  • (Boolean)


151
152
153
# File 'lib/commands/thor/service.rb', line 151

def self.valid_child?(name_of_sub_context)
  return Service.valid_children().include?(name_of_sub_context.to_sym)
end

.valid_childrenObject



73
74
75
# File 'lib/commands/thor/service.rb', line 73

def self.valid_children()
  [:utils]
end

.validation_list(context_params) ⇒ Object



155
156
157
# File 'lib/commands/thor/service.rb', line 155

def self.validation_list(context_params)
  get_cached_response(:service, "assembly/list", {})
end

.whoamiObject



65
66
67
# File 'lib/commands/thor/service.rb', line 65

def self.whoami()
  return :service, "assembly/list", {:subtype  => 'instance'}
end

Instance Method Details

#action_info(context_params) ⇒ Object



511
512
513
# File 'lib/commands/thor/service.rb', line 511

def action_info(context_params)
  action_info_aux(context_params)
end

#add_component(context_params) ⇒ Object



703
704
705
706
707
708
709
710
# File 'lib/commands/thor/service.rb', line 703

def add_component(context_params)
  response = create_component_aux(context_params)

  @@invalidate_map << :service
  @@invalidate_map << :service_node

  response
end

#cancel_task(context_params) ⇒ Object



261
262
263
# File 'lib/commands/thor/service.rb', line 261

def cancel_task(context_params)
  cancel_task_aux(context_params)
end

#converge(context_params) ⇒ Object



332
333
334
335
336
# File 'lib/commands/thor/service.rb', line 332

def converge(context_params)
  opts = {}
  opts.merge!(:mode => :stream) if context_params.pure_cli_mode or options['stream-results']
  converge_aux(context_params, opts)
end

#create_assembly(context_params) ⇒ Object



269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/commands/thor/service.rb', line 269

def create_assembly(context_params)
  if options.description?
     if context_params.method_arguments.length > 2
       raise DtkError, "The number of arguments is invalid. If you are using -m with multiple words please put them under quotation marks"
     end
  end

  assembly_id, service_module_name, assembly_template_name = context_params.retrieve_arguments([:service_id!,:option_1!,:option_2!],method_argument_names)
  # need default_namespace for create-assembly because need to check if local service-module directory existst in promote_assembly_aux
  resp = post rest_url("namespace/default_namespace_name")
  return resp unless resp.ok?
  default_namespace = resp.data

  opts = {:default_namespace => default_namespace}
  if description = options.description
    description = "#{description}"
    opts.merge!(:description => description)
  end

  response = promote_assembly_aux(:create,assembly_id,service_module_name,assembly_template_name,opts)
  return response unless response.ok?

  @@invalidate_map << :assembly
  @@invalidate_map << :service

  Response::Ok.new()
end

#create_attribute(context_params) ⇒ Object



651
652
653
# File 'lib/commands/thor/service.rb', line 651

def create_attribute(context_params)
  create_attribute_aux(context_params)
end

#create_node(context_params) ⇒ Object



659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
# File 'lib/commands/thor/service.rb', line 659

def create_node(context_params)
  response = create_node_aux(context_params)

  @@invalidate_map << :assembly
  @@invalidate_map << :assembly_node
  @@invalidate_map << :service
  @@invalidate_map << :service_node
  @@invalidate_map << :workspace
  @@invalidate_map << :workspace_node

  return response unless response.ok?

  message = "Created node '#{response.data["display_name"]}'."
  OsUtil.print(message, :yellow)
end

#create_node_group(context_params) ⇒ Object



679
680
681
682
683
684
685
686
687
688
689
690
691
692
# File 'lib/commands/thor/service.rb', line 679

def create_node_group(context_params)
  response = create_node_group_aux(context_params)
  return response unless response.ok?

  @@invalidate_map << :assembly
  @@invalidate_map << :assembly_node
  @@invalidate_map << :service
  @@invalidate_map << :service_node
  @@invalidate_map << :workspace
  @@invalidate_map << :workspace_node

  message = "Created node group '#{response.data["display_name"]}'."
  OsUtil.print(message, :yellow)
end

#create_workspace(context_params) ⇒ Object



924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
# File 'lib/commands/thor/service.rb', line 924

def create_workspace(context_params)
  response = create_workspace_aux(context_params)
  return response unless response.ok?

  @@invalidate_map << :service
  @@invalidate_map << :assembly

  yaml_response = YAML.load(response.data)
  if workspace_instance = yaml_response['new_workspace_instance']
    MainContext.get_context.change_context(["/service/#{workspace_instance['name']}"])
  else
    fail DtkError.new('Workspace instance is not staged properly, please try again!')
  end

  response
end

#delete(context_params) ⇒ Object



746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
# File 'lib/commands/thor/service.rb', line 746

def delete(context_params)
  if context_params.is_last_command_eql_to?(:node)
    response = delete_node_aux(context_params)
    return response unless response.ok?
    @@invalidate_map << :service_node

    response
  elsif context_params.is_last_command_eql_to?(:component)
    response = delete_component_aux(context_params)
    return response unless response.ok?
    @@invalidate_map << :assembly_node_component

    response
  end
end

#delete_and_destroy(context_params) ⇒ Object



621
622
623
624
625
626
627
628
629
# File 'lib/commands/thor/service.rb', line 621

def delete_and_destroy(context_params)
  response = delete_and_destroy_aux(context_params)
  @@invalidate_map << :assembly
  @@invalidate_map << :assembly_node
  @@invalidate_map << :service
  @@invalidate_map << :service_node
  @@invalidate_map << :service_module
  response
end

#delete_component(context_params) ⇒ Object



771
772
773
774
775
776
777
778
779
# File 'lib/commands/thor/service.rb', line 771

def delete_component(context_params)
  response = delete_component_aux(context_params)

  @@invalidate_map << :service
  @@invalidate_map << :service_node
  @@invalidate_map << :service_node_component

  response
end

#delete_node(context_params) ⇒ Object



716
717
718
719
720
721
722
723
724
725
726
727
# File 'lib/commands/thor/service.rb', line 716

def delete_node(context_params)
  response = delete_node_aux(context_params)

  @@invalidate_map << :assembly
  @@invalidate_map << :assembly_node
  @@invalidate_map << :service
  @@invalidate_map << :service_node
  @@invalidate_map << :workspace
  @@invalidate_map << :workspace_node

  return response
end

#delete_node_group(context_params) ⇒ Object



732
733
734
735
736
737
738
739
740
741
742
743
# File 'lib/commands/thor/service.rb', line 732

def delete_node_group(context_params)
  response = delete_node_group_aux(context_params)

  @@invalidate_map << :assembly
  @@invalidate_map << :assembly_node
  @@invalidate_map << :service
  @@invalidate_map << :service_node
  @@invalidate_map << :workspace
  @@invalidate_map << :workspace_node

  return response
end

#deploy(context_params) ⇒ Object

method_option :settings, :type => :string, :aliases => ā€˜-sā€™



886
887
888
889
890
891
892
893
894
# File 'lib/commands/thor/service.rb', line 886

def deploy(context_params)
  response = deploy_aux(context_params)
  return response unless response.ok?

  @@invalidate_map << :service
  @@invalidate_map << :assembly

  response
end

#deploy_target(context_params) ⇒ Object

method_option :settings, :type => :string, :aliases => ā€˜-sā€™



868
869
870
871
872
873
874
875
876
# File 'lib/commands/thor/service.rb', line 868

def deploy_target(context_params)
  response = deploy_aux(context_params)
  return response unless response.ok?

  @@invalidate_map << :service
  @@invalidate_map << :assembly

  response
end

#destroy_and_reset_nodes(context_params) ⇒ Object



244
245
246
# File 'lib/commands/thor/service.rb', line 244

def destroy_and_reset_nodes(context_params)
  destroy_and_reset_nodes_aux(context_params)
end

#edit_action(context_params) ⇒ Object



394
395
396
# File 'lib/commands/thor/service.rb', line 394

def edit_action(context_params)
  edit_or_create_workflow_aux(context_params)
end

#edit_attributes(context_params) ⇒ Object



402
403
404
405
406
407
408
409
410
411
# File 'lib/commands/thor/service.rb', line 402

def edit_attributes(context_params)
  response = edit_attributes_aux(context_params)

  @@invalidate_map << :assembly
  @@invalidate_map << :assembly_node
  @@invalidate_map << :service
  @@invalidate_map << :service_node

  response
end

#edit_component_module(context_params) ⇒ Object



383
384
385
# File 'lib/commands/thor/service.rb', line 383

def edit_component_module(context_params)
  edit_module_aux(context_params)
end

#exec(context_params) ⇒ Object



298
299
300
# File 'lib/commands/thor/service.rb', line 298

def exec(context_params)
  exec_aux(context_params)
end

#exec_sync(context_params) ⇒ Object



303
304
305
# File 'lib/commands/thor/service.rb', line 303

def exec_sync(context_params)
  exec_sync_aux(context_params)
end

#get_netstats(context_params) ⇒ Object



783
784
785
# File 'lib/commands/thor/service.rb', line 783

def get_netstats(context_params)
  get_netstats_aux(context_params)
end

#get_ps(context_params) ⇒ Object



801
802
803
# File 'lib/commands/thor/service.rb', line 801

def get_ps(context_params)
  get_ps_aux(context_params)
end

#grant_access(context_params) ⇒ Object



592
593
594
# File 'lib/commands/thor/service.rb', line 592

def grant_access(context_params)
  grant_access_aux(context_params)
end

#grep(context_params) ⇒ Object



821
822
823
# File 'lib/commands/thor/service.rb', line 821

def grep(context_params)
  grep_aux(context_params)
end

#info(context_params) ⇒ Object



608
609
610
# File 'lib/commands/thor/service.rb', line 608

def info(context_params)
  info_aux(context_params)
end


613
614
615
# File 'lib/commands/thor/service.rb', line 613

def link_attributes(context_params)
  link_attributes_aux(context_params)
end


695
696
697
# File 'lib/commands/thor/service.rb', line 695

def link_components(context_params)
  link_components_aux(context_params)
end

#list(context_params) ⇒ Object



521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
# File 'lib/commands/thor/service.rb', line 521

def list(context_params)
  assembly_id, node_id, component_id, attribute_id, about = context_params.retrieve_arguments([:service_id,:node_id,:component_id,:attribute_id,:option_1],method_argument_names)
  detail_to_include = nil

  if about
    case about
      when "nodes"
        data_type = :node
      when "components"
        data_type = :component
        detail_to_include = [:component_dependencies]
      when "attributes"
        data_type = :attribute
        detail_to_include = [:attribute_links]
      when "tasks"
        data_type = :task
      else
        raise_validation_error_method_usage('list')
    end
  end

  post_body = {
    :assembly_id => assembly_id,
    :node_id => node_id,
    :component_id => component_id,
    :subtype     => 'instance'
  }
  post_body.merge!(:detail_to_include => detail_to_include) if detail_to_include
  rest_endpoint = "assembly/info_about"

  if context_params.is_last_command_eql_to?(:attribute)
    raise DtkError, "Not supported command for current context level." if attribute_id
    about, data_type = get_type_and_raise_error_if_invalid(about, "attributes", ["attributes"])
  elsif context_params.is_last_command_eql_to?(:component)
    if component_id
      about, data_type = get_type_and_raise_error_if_invalid(about, "attributes", ["attributes"])
    else
      about, data_type = get_type_and_raise_error_if_invalid(about, "components", ["attributes", "components"])
    end
  elsif context_params.is_last_command_eql_to?(:node)
    if node_id
      about, data_type = get_type_and_raise_error_if_invalid(about, "components", ["attributes", "components"])
    else
      about, data_type = get_type_and_raise_error_if_invalid(about, "nodes", ["attributes", "components", "nodes"])
    end
  else
    if assembly_id
      about, data_type = get_type_and_raise_error_if_invalid(about, "nodes", ["attributes", "components", "nodes", "tasks"])
    else
      data_type = :assembly
      post_body = { :subtype  => 'instance', :detail_level => 'nodes',:include_namespaces => true}
      rest_endpoint = "assembly/list"
    end
  end

  post_body[:about] = about
  response = post rest_url(rest_endpoint), post_body

  # set render view to be used
  response.render_table(data_type)

  return response
end

#list_actions(context_params) ⇒ Object



345
346
347
# File 'lib/commands/thor/service.rb', line 345

def list_actions(context_params)
  list_actions_aux(context_params)
end

#list_attributes(context_params) ⇒ Object



485
486
487
# File 'lib/commands/thor/service.rb', line 485

def list_attributes(context_params)
  list_attributes_aux(context_params)
end


468
469
470
# File 'lib/commands/thor/service.rb', line 468

def list_component_links(context_params)
  list_component_links_aux(context_params)
end

#list_component_modules(context_params) ⇒ Object



490
491
492
# File 'lib/commands/thor/service.rb', line 490

def list_component_modules(context_params)
  list_modules_aux(context_params)
end

#list_components(context_params) ⇒ Object



474
475
476
# File 'lib/commands/thor/service.rb', line 474

def list_components(context_params)
  list_components_aux(context_params)
end

#list_diffs(context_params) ⇒ Object



586
587
588
# File 'lib/commands/thor/service.rb', line 586

def list_diffs(context_params)
  list_remote_module_diffs(context_params)
end

#list_nodes(context_params) ⇒ Object



463
464
465
# File 'lib/commands/thor/service.rb', line 463

def list_nodes(context_params)
  list_nodes_aux(context_params)
end

#list_ssh_access(context_params) ⇒ Object



603
604
605
# File 'lib/commands/thor/service.rb', line 603

def list_ssh_access(context_params)
  list_ssh_access_aux(context_params)
end

#list_tasks(context_params) ⇒ Object



495
496
497
# File 'lib/commands/thor/service.rb', line 495

def list_tasks(context_params)
  list_tasks_aux(context_params)
end

#list_violations(context_params) ⇒ Object



501
502
503
# File 'lib/commands/thor/service.rb', line 501

def list_violations(context_params)
  list_violations_aux(context_params)
end


506
507
508
# File 'lib/commands/thor/service.rb', line 506

def print_includes(context_params)
  print_includes_aux(context_params)
end

#pull_base_component_module(context_params) ⇒ Object



372
373
374
# File 'lib/commands/thor/service.rb', line 372

def pull_base_component_module(context_params)
  pull_base_component_module_aux(context_params)
end

#push_assembly_updates(context_params) ⇒ Object



350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/commands/thor/service.rb', line 350

def push_assembly_updates(context_params)
  assembly_id, qualified_assembly_name = context_params.retrieve_arguments([:service_id!, :option_1], method_argument_names)
  service_module_name, assembly_template_name =
    if qualified_assembly_name
      if qualified_assembly_name =~ /(^[^\/]*)\/([^\/]*$)/
        [$1,$2]
      else
        raise DtkError, "The term (#{qualified_assembly_name}) must have form SERVICE-MODULE-NAME/ASSEMBLY-NAME"
      end
    else
      [nil, nil]
    end

  response = promote_assembly_aux(:update, assembly_id, service_module_name, assembly_template_name, :use_module_namespace => true)
  return response unless response.ok?
  @@invalidate_map << :assembly
  Response::Ok.new()
end

#push_component_module_updates(context_params) ⇒ Object



378
379
380
# File 'lib/commands/thor/service.rb', line 378

def push_component_module_updates(context_params)
  push_module_updates_aux(context_params)
end

#revoke_access(context_params) ⇒ Object



598
599
600
# File 'lib/commands/thor/service.rb', line 598

def revoke_access(context_params)
  revoke_access_aux(context_params)
end

#set_attribute(context_params) ⇒ Object



635
636
637
638
639
640
641
642
643
644
645
# File 'lib/commands/thor/service.rb', line 635

def set_attribute(context_params)
  response = set_attribute_aux(context_params)
  return response unless response.ok?

  @@invalidate_map << :assembly
  @@invalidate_map << :assembly_node
  @@invalidate_map << :service
  @@invalidate_map << :service_node

  response
end

#set_default_target(context_params) ⇒ Object



836
837
838
# File 'lib/commands/thor/service.rb', line 836

def set_default_target(context_params)
  set_default_target_aux(context_params)
end

#set_required_attributes(context_params) ⇒ Object



806
807
808
809
# File 'lib/commands/thor/service.rb', line 806

def set_required_attributes(context_params)
  assembly_id = context_params.retrieve_arguments([:service_id!],method_argument_names)
  set_required_attributes_aux(assembly_id,:assembly,:instance)
end

#set_required_attributes_and_converge(context_params) ⇒ Object



897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
# File 'lib/commands/thor/service.rb', line 897

def set_required_attributes_and_converge(context_params)
  begin
    response = set_required_attributes_converge_aux(context_params)
  rescue DtkError::InteractiveWizardError => e
    @@invalidate_map << :service
    @@invalidate_map << :assembly

    # if skip correction wizzard still go to newly created service instance
    if instance_name = (context_params.get_forwarded_options()||{})[:instance_name]
      MainContext.get_context.change_context(["/service/#{instance_name}"])
    end

    raise e
  end

  @@invalidate_map << :service
  @@invalidate_map << :assembly

  # if instance_name = opts[:instance_name]
  #   MainContext.get_context.change_context([instance_name])
  # end

  response
end

#stage(context_params) ⇒ Object



831
832
833
# File 'lib/commands/thor/service.rb', line 831

def stage(context_params)
  stage_aux(context_params)
end

#stage_target(context_params) ⇒ Object



849
850
851
852
853
854
855
856
857
858
# File 'lib/commands/thor/service.rb', line 849

def stage_target(context_params)
  response = stage_aux(context_params)
  return response unless response.ok?

  # when changing context send request for getting latest assemblies instead of getting from cache
  @@invalidate_map << :service
  @@invalidate_map << :assembly

  return response
end

#start(context_params) ⇒ Object



249
250
251
# File 'lib/commands/thor/service.rb', line 249

def start(context_params)
  start_aux(context_params)
end

#stop(context_params) ⇒ Object



255
256
257
# File 'lib/commands/thor/service.rb', line 255

def stop(context_params)
  stop_aux(context_params)
end

#tail(context_params) ⇒ Object



814
815
816
# File 'lib/commands/thor/service.rb', line 814

def tail(context_params)
  tail_aux(context_params)
end

#task_action_detail(context_params) ⇒ Object



458
459
460
# File 'lib/commands/thor/service.rb', line 458

def task_action_detail(context_params)
  task_action_detail_aw_aux(context_params)
end

#task_status(context_params) ⇒ Object



450
451
452
453
454
455
# File 'lib/commands/thor/service.rb', line 450

def task_status(context_params)
  response = task_status_aw_aux(context_params)
  @@invalidate_map << :service
  @@invalidate_map << :service_node
  response
end


763
764
765
# File 'lib/commands/thor/service.rb', line 763

def unlink_components(context_params)
  unlink_components_aux(context_params)
end