Class: Resources::MdsPullAccount
- Inherits:
-
BaseResource
- Object
- BaseResource
- Resources::MdsPullAccount
- Defined in:
- lib/pvdgm-svc-client/resources/mds_pull_account.rb
Instance Attribute Summary
Attributes inherited from BaseResource
Instance Method Summary collapse
Methods included from ConfiguredAccountPrompter
Methods included from ServiceDefinitionPrompter
Methods included from ServicePrompter
Methods inherited from BaseResource
Constructor Details
This class inherits a constructor from BaseResource
Instance Method Details
#list ⇒ Object
8 9 10 11 12 13 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/pvdgm-svc-client/resources/mds_pull_account.rb', line 8 def list result = nil sv_id = service_id sd_id = service_definition_id(true) if sd_id > 0 ca_id = configured_account_id(true) if ca_id > 0 result = get("services/services/#{sv_id}/service_definitions/#{sd_id}/configured_accounts/#{ca_id}/mds_pull_accounts#{status_prompt}") else result = get("services/services/#{sv_id}/service_definitions/#{sd_id}/mds_pull_accounts#{status_prompt}") end else result = get("services/services/#{sv_id}/mds_pull_accounts#{status_prompt}") end puts "\nMds Pull Accounts" table = Terminal::Table.new headings: [ 'CA Id', 'Account', 'Status', 'Attempt', 'Created', 'Updated' ] do |t| result.each do | mds_pull_account | t << [ mds_pull_account['configured_account_id'], "#{mds_pull_account['account_name']} (#{mds_pull_account['account_id']})", mds_pull_account['status'], mds_pull_account['attempt'], mds_pull_account['created_at'], mds_pull_account['updated_at'] ] end end prompter.say table.to_s puts end |
#status_prompt ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/pvdgm-svc-client/resources/mds_pull_account.rb', line 38 def status_prompt puts status = prompter.choose do | | .prompt = "Select the status to filter the results with: " .choice("Do not filter by status") { -1 } .choice("New") { 0 } .choice("Providers Identified") { 1 } .choice("Assessments Requested") { 2 } .choice("Files Identified") { 3 } .choice("Files Downloaded") { 4 } .choice("Submitted to abaqis") { 5 } .choice("File System Clean") { 6 } .choice("Remote Clean") { 7 } .choice("Not Remote Clean") { 0x17 } end status < 0 ? "" : "?status=#{status}" end |