vpc.py 439 B

1234567891011121314151617181920
  1. #!/usr/bin/python
  2. # -*- encoding:utf-8 -*-
  3. import json,pprint
  4. from prettyprinter import prettyPrinter
  5. from kscore.session import get_session
  6. if __name__ == "__main__":
  7. s = get_session()
  8. region='cn-beijing-6'
  9. #region='cn-shanghai-2'
  10. vpcClient = s.create_client("vpc", region, use_ssl=True)
  11. allVpcs=vpcClient.describe_vpcs()
  12. #allNics=vpcClient.describe_network_interfaces()
  13. prettyPrinter().pprint(allVpcs)