Class: Zillabyte::Command::Nuke

Inherits:
Base
  • Object
show all
Defined in:
lib/zillabyte/cli/nuke.rb

Overview

HIDDEN: resets all user state

Constant Summary

Constants inherited from Base

Base::META_COLUMNS

Instance Attribute Summary

Attributes inherited from Base

#args, #options

Instance Method Summary collapse

Methods inherited from Base

#api, #initialize, namespace

Methods included from Helpers

#app, #ask, #command, #create_git_remote, #display, #error, #extract_app_from_git_config, #extract_app_in_dir, #format_with_bang, #friendly_dir, #get_flow_ui_link, #get_info, #get_rich_info, #git, #handle_downloading_manifest, #has_git?, #longest, #read_multiline, #truncate_message, #version_okay?, #with_tty

Constructor Details

This class inherits a constructor from Zillabyte::Command::Base

Instance Method Details

#indexObject

apps:nuke

Destroys all state associated with the current user.

–force # This option must always be given



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/zillabyte/cli/nuke.rb', line 14

def index
  
  unless options[:force]
    fail("--force must be given") 
    raise
  end
  
  res = api.request(
    :expects => 200,
    :method  => :post,
    :path    => "/nukes",
    :body    => options.to_json
  )
  res.body
  
  if options[:output_type] == "json"
    display res.body.to_json
  else
    display "Nuked #{res.body['deleted_apps']} app(s) and #{res.body['deleted_apps']} dataset(s)"
  end
  

end