2
0

dns.py 576 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. dnsClient = s.create_client("dns", region, use_ssl=True)
  10. allZones=dnsClient.describe_hosted_zones(**{'HostedZoneId':'319076f8-15cb-4e2a-b784-9d18fbaf95ca'})
  11. allRecords = dnsClient.describe_resource_records(**{'HostedZoneId':'319076f8-15cb-4e2a-b784-9d18fbaf95ca'})
  12. prettyPrinter().pprint(allZones)
  13. prettyPrinter().pprint(allRecords)