|
35 | 35 | redirect_https = redirects.create( |
36 | 36 | domain="source.domain.example.com", |
37 | 37 | path="/path", |
38 | | - target="https://www.ibm.com/products/ns1-connect" |
| 38 | + target="https://www.ibm.com/products/ns1-connect", |
39 | 39 | ) |
40 | 40 |
|
41 | 41 | # an http redirect, http://domain/path -> target, will not hold any certificate for the domain |
|
67 | 67 | ########## |
68 | 68 |
|
69 | 69 | # search; we can also use list() to get all redirects |
70 | | -reds = redirects.searchSource('example.com') |
71 | | -print(reds['total'], len(reds['results'])) |
| 70 | +reds = redirects.searchSource("example.com") |
| 71 | +print(reds["total"], len(reds["results"])) |
72 | 72 |
|
73 | | -certs = certificates.search('example.com') |
74 | | -print(certs['total'], len(certs['results'])) |
| 73 | +certs = certificates.search("example.com") |
| 74 | +print(certs["total"], len(certs["results"])) |
75 | 75 |
|
76 | 76 | ################# |
77 | 77 | # READ / UPDATE # |
|
93 | 93 | ########## |
94 | 94 |
|
95 | 95 | # delete redirects |
96 | | -redirects.delete(redirect_https['id']) |
97 | | -redirects.delete(redirect_http['id']) |
98 | | -redirects.delete(redirect_allsettings['id']) |
| 96 | +redirects.delete(redirect_https["id"]) |
| 97 | +redirects.delete(redirect_http["id"]) |
| 98 | +redirects.delete(redirect_allsettings["id"]) |
99 | 99 |
|
100 | 100 | # also revoke certificate; |
101 | 101 | # note that the domain in redirect_http is the same so the certificate is also the same |
102 | 102 | certificates.delete(redirect_https["certificate_id"]) |
103 | 103 | certificates.delete(redirect_allsettings["certificate_id"]) |
104 | 104 |
|
105 | | -api.zones().delete('example.com') |
| 105 | +api.zones().delete("example.com") |
0 commit comments