<commit_before>#
# Copyright (C) 2010-2016 dtk contributors
#
# This file is part of the dtk project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
module DTK::Client
  class Operation::Service
    class Uninstall < self
      def self.execute(args = Args.new)
        wrap_operation(args) do |args|
          service_instance = args.required(:service_instance)
          recursive        = args.required(:recursive)
          delete           = args.required(:delete)
          path             = args[:directory_path]
          node             = []

          unless args[:skip_prompt]
            return false unless Console.prompt_yes_no("Are you sure you want to uninstall the infrastructure associated with '#{service_instance}' and delete this service instance from the server?", :add_options => true)
          end

          post_body = PostBody.new(
            :service_instance => service_instance,
            :recursive?  => recursive,
            :delete      => delete
          )
          response = rest_post("#{BaseRoute}/uninstall", post_body)

          ClientModuleDir.rm_f(path) if args[:purge]

          info = "DTK module '#{service_instance}' has been uninstalled successfully." 
          OsUtil.print_info(info)
          Delete.display_node_info(response.data) if delete
        end
      end


    end
  end
end<commit_msg>Add message to uninstall to point user to use task-status for more details<commit_after>#
# Copyright (C) 2010-2016 dtk contributors
#
# This file is part of the dtk project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
module DTK::Client
  class Operation::Service
    class Uninstall < self
      def self.execute(args = Args.new)
        wrap_operation(args) do |args|
          service_instance = args.required(:service_instance)
          recursive        = args.required(:recursive)
          delete           = args.required(:delete)
          path             = args[:directory_path]
          node             = []

          unless args[:skip_prompt]
            return false unless Console.prompt_yes_no("Are you sure you want to uninstall the infrastructure associated with '#{service_instance}' and delete this service instance from the server?", :add_options => true)
          end

          post_body = PostBody.new(
            :service_instance => service_instance,
            :recursive?  => recursive,
            :delete      => delete
          )
          response = rest_post("#{BaseRoute}/uninstall", post_body)

          ClientModuleDir.rm_f(path) if args[:purge]

          # info = "DTK module '#{service_instance}' has been uninstalled successfully."
          info = "Delete procedure started. For more information use 'dtk task-status'."
          OsUtil.print_info(info)
          Delete.display_node_info(response.data) if delete
        end
      end


    end
  end
end
{'fraction_non_alphanumeric': 0.08033169214822493, 'fraction_numerical': 0.006219227779217414, 'mean_word_length': 2.6278195488721803, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '119968', 'n_tokens_mistral': 1011, 'n_tokens_neox': 968, 'n_words': 367}