Sha256: b387ae02410cf8a63a27aa75d0d4d53d201013ad28c0ce1e489731501b063a07
Contents?: true
Size: 1.14 KB
Versions: 13
Compression:
Stored size: 1.14 KB
Contents
module ThreeScaleToolbox module Commands module ServiceCommand class DeleteSubcommand < Cri::CommandRunner include ThreeScaleToolbox::Command def self.command Cri::Command.define do name 'delete' usage 'delete <remote> <service-id_or_system-name>' summary 'Delete a service' description 'Delete a service' runner DeleteSubcommand param :remote param :service_id_or_system_name end end def run service.delete puts "Service with id: #{service.id} deleted" end private def remote @remote ||= threescale_client(arguments[:remote]) end def ref @ref ||= arguments[:service_id_or_system_name] end def service @service ||= find_service end def find_service Entities::Service::find(remote: remote, ref: ref).tap do |svc| raise ThreeScaleToolbox::Error, "Service #{ref} does not exist" if svc.nil? end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems