0

내 계정에서 사용할 수있는 모든 애널리틱스 엔진 인스턴스를 인쇄하고 싶습니다.내가 액세스 할 수있는 모든 Analytics Engine 인스턴스를 나열하는 방법은 무엇입니까?

내가 사용 내가 사용할 수있는 모든 조직과 공간을 인쇄 할 수 있습니다

! pip install --quiet --upgrade git+https://github.com/snowch/[email protected] 

을 다음

from ibm_analytics_engine import CloudFoundryAPI, CloudFoundryAPI 
from ibm_analytics_engine import IAE, IAEServicePlanGuid, IAEClusterSpecificationExamples 

cf = CloudFoundryAPI(api_key_filename='api_key.json') 
iae = IAE(cf_client=cf) 
cf.print_orgs_and_spaces() 

출력 : 나는 또한에 클러스터를 나열 할 수 있습니다 방법

------------------------------------------------------------------------- 
Org: [email protected]      12345-12345-12345678910 
> Spc: dev       12345-12345-12345678912 
> Spc: test       12345-12345-12345678913 

------------------------------------------------------------------------- 
Org: [email protected]     aaaaa-bbbbb-ccccccccccc 
> Spc: dev       aaaaa-bbbbb-ccccccccccd 
... 

이 공간들?

답변

0

당신은 같은 것을 수행 할 수 있습니다

ORG [email protected] | SPACE dev 

{ 'guid': 'abcd-abcd-abcdefghi', 
    'name': 'Analytics Engine', 
    'state': 'succeeded'} 

ORG [email protected] | SPACE test 

.... 
: 다음

from ibm_analytics_engine import CloudFoundryAPI, CloudFoundryAPI 
from ibm_analytics_engine import IAE, IAEServicePlanGuid, IAEClusterSpecificationExamples 

cf = CloudFoundryAPI(api_key_filename='api_key.json') 
iae = IAE(cf_client=cf) 

import pprint 
pp = pprint.PrettyPrinter(indent=4) 

for org in cf.orgs_and_spaces(): 
    for space in org['spaces']: 
     print('ORG {} | SPACE {}'.format(org['name'], space['name'])) 
     print() 

     clusters = iae.clusters(space_guid=space['guid']) 
     if len(clusters) > 0: 
      for cluster in clusters: 
       pp.pprint(cluster) 
       print() 

출력

! pip install --quiet --upgrade git+https://github.com/snowch/[email protected]