Module: SfCli::Sf::Org::List
- Included in:
- Core
- Defined in:
- lib/sf_cli/sf/org/list.rb
Defined Under Namespace
Classes: OrgConfig
Instance Method Summary collapse
-
#list(raw_output: false) ⇒ Array
List orgs you’ve created or authenticated to.
Instance Method Details
#list(raw_output: false) ⇒ Array
Note:
this function returns org information including security sensitive things such as access token, username and so on.
List orgs you’ve created or authenticated to
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/sf_cli/sf/org/list.rb', line 52 def list(raw_output: false) flags = { # reserved for later option addition } output = org_exec(__method__, flags: flags, redirection: :null_stderr, raw_output: raw_output) return output if raw_output others = output['result']['other'].map{|config| OrgConfig.new(**config)} sandboxes = output['result']['sandboxes'].map{|config| OrgConfig.new(**config)} non_scratch_orgs = output['result']['nonScratchOrgs'].map{|config| OrgConfig.new(**config)} devhubs = output['result']['devHubs'].map{|config| OrgConfig.new(**config)} scratch_orgs = output['result']['scratchOrgs'].map{|config| OrgConfig.new(**config)} (others + sandboxes + non_scratch_orgs + devhubs + scratch_orgs).uniq{|config| config.alias} end |