We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e1d0d64 commit 4002758Copy full SHA for 4002758
examples/dns/record.py
@@ -1,24 +1,27 @@
1
+import os
2
from cloudflare import Cloudflare
3
4
5
+zone_id = os.getenv("CLOUDFLARE_ZONE_ID")
6
+if zone_id is None:
7
+ sys.exit("CLOUDFLARE_ZONE_ID is not defined")
8
-cloudflare_token = "your-cloudflare-token"
-cloudflare_zone_id = "zone"
9
alias_name = "www.mydns.com"
10
cannonical_name = "cname.example.com"
11
-client = Cloudflare()
12
13
+client = Cloudflare()
14
15
16
# create dns using defined driver
17
record = client.dns.records.create(
- zone_id=cloudflare_zone_id,
18
+ zone_id=zone_id,
19
type='CNAME',
20
name=alias_name,
21
content=cannonical_name,
22
proxied=False
23
)
24
25
+
26
# print output
-print(record)
27
+print(record)
0 commit comments