kec_instance_type.py 680 B

123456789101112131415161718192021222324
  1. # -*- encoding:utf-8 -*-
  2. from kscore.session import get_session
  3. if __name__ == "__main__":
  4. s = get_session()
  5. client = s.create_client("kec", "cn-beijing-6", use_ssl=False)
  6. #https://docs.ksyun.com/documents/5710
  7. result = client.describe_instance_type_configs()
  8. for item in result['InstanceTypeConfigSet']:
  9. print item['InstanceType']
  10. print item['AvailabilityZoneSet']
  11. # https://docs.ksyun.com/documents/5712
  12. result = client.describe_instance_familys()
  13. print result
  14. for item in result['InstanceFamilySet']:
  15. print item['InstanceFamilyName']
  16. if 'InstanceFamily' in item:
  17. print item['InstanceFamily']