Skip to content

Commit 818a261

Browse files
committed
add dns service and examples
1 parent 20b80d1 commit 818a261

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed

examples/dns.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/python
2+
3+
# -*- encoding:utf-8 -*-
4+
5+
import json,pprint
6+
from prettyprinter import prettyPrinter
7+
from kscore.session import get_session
8+
9+
if __name__ == "__main__":
10+
s = get_session()
11+
12+
region='cn-beijing-6'
13+
dnsClient = s.create_client("dns", region, use_ssl=True)
14+
15+
allZones=dnsClient.describe_hosted_zones(**{'HostedZoneId':'319076f8-15cb-4e2a-b784-9d18fbaf95ca'})
16+
allRecords = dnsClient.describe_resource_records(**{'HostedZoneId':'319076f8-15cb-4e2a-b784-9d18fbaf95ca'})
17+
18+
19+
prettyPrinter().pprint(allZones)
20+
prettyPrinter().pprint(allRecords)
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
version: '2.0'
3+
metadata:
4+
apiVersion: '2016-06-07'
5+
endpointPrefix: dns
6+
jsonVersion: '1.1'
7+
serviceFullName: dns Service
8+
signatureVersion: v4
9+
targetPrefix: dns
10+
protocol: query-json
11+
12+
operations:
13+
RegionList:
14+
name: RegionList
15+
http:
16+
method: GET
17+
input:
18+
shape: Empty
19+
CreateHostedZone:
20+
name: CreateHostedZone
21+
http:
22+
method: GET
23+
DeleteHostedZone:
24+
name: DeleteHostedZone
25+
http:
26+
method: GET
27+
DescribeHostedZones:
28+
name: DescribeHostedZones
29+
http:
30+
method: GET
31+
CreateResourceRecord:
32+
name: CreateResourceRecord
33+
http:
34+
method: GET
35+
ModifyResourceRecord:
36+
name: ModifyResourceRecord
37+
http:
38+
method: GET
39+
DeleteResourceRecord:
40+
name: DeleteResourceRecord
41+
http:
42+
method: GET
43+
DescribeResourceRecords:
44+
name: DescribeResourceRecords
45+
http:
46+
method: GET
47+
ResourceRecordChangeType:
48+
name: ResourceRecordChangeType
49+
http:
50+
method: GET
51+
GetGeolocations:
52+
name: GetGeolocations
53+
http:
54+
method: GET
55+
56+
57+
58+
shapes:
59+
Id:
60+
type: string #list/map/structure
61+
62+
Bool:
63+
type: bool
64+
65+
Int:
66+
type: long
67+
68+
DataTime:
69+
type: timestamp
70+
71+
Empty:
72+
type: structure
73+
members: {}
74+
documentation: ""
75+
76+
NonEmptyString:
77+
type: string
78+
min: 1
79+
80+
Message:
81+
type: string
82+
83+
InstanceId:
84+
type: structure
85+
required:
86+
- id
87+
members:
88+
id:
89+
shape: Id
90+
documentation: ""

0 commit comments

Comments
 (0)