OctoDNS Metaname Module¶
Reference documentation generated directly from the module docstrings.
Client¶
Thin wrapper around the Metaname JSON-RPC API used by OctoDNS.
Contact
dataclass
¶
Contact details used when provisioning domains via the API.
Source code in octodns_metaname/client.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
to_payload()
¶
Serialise the contact into the structure expected by Metaname.
Source code in octodns_metaname/client.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
ZoneRecord
dataclass
¶
Representation of a DNS record as returned by the Metaname API.
Source code in octodns_metaname/client.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
from_api(payload)
classmethod
¶
Construct a zone record from an API payload.
Source code in octodns_metaname/client.py
68 69 70 71 72 73 74 75 76 77 78 79 | |
to_api_payload()
¶
Serialise the record into the JSON-RPC payload schema.
Source code in octodns_metaname/client.py
81 82 83 84 85 86 87 88 89 90 91 92 | |
MetanameError
¶
Bases: RuntimeError
Generic error for Metaname client failures.
Source code in octodns_metaname/client.py
95 96 | |
MetanameAPIError
¶
Bases: MetanameError
Raised when the remote API reports an error.
Source code in octodns_metaname/client.py
99 100 101 102 103 104 105 106 107 | |
MetanameClient
¶
Convenience wrapper around Metaname's JSON-RPC 2.0 endpoints.
Source code in octodns_metaname/client.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | |
__init__(*, base_url=TEST_API_URL, timeout=10.0)
¶
Parameters¶
base_url: Target API URL. Defaults to the Metaname test endpoint. timeout: Timeout (seconds) applied to HTTP requests.
Source code in octodns_metaname/client.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
ping()
¶
Check authentication by querying the account balance.
Source code in octodns_metaname/client.py
163 164 165 166 | |
list_zone_records(domain, *, page_size=None)
¶
Retrieve all DNS records for domain.
Parameters¶
domain:
Fully-qualified domain (may end with a trailing dot).
page_size:
When provided, fetch records in chunks using dns_zone_chunk.
Source code in octodns_metaname/client.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
iter_zone_records(domain, *, page_size=None)
¶
Yield DNS records for domain optionally using pagination.
Source code in octodns_metaname/client.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
create_zone_record(domain, record)
¶
Create a DNS record within domain.
Source code in octodns_metaname/client.py
209 210 211 212 213 214 215 216 | |
update_zone_record(domain, reference, record)
¶
Update an existing record identified by reference.
Source code in octodns_metaname/client.py
218 219 220 221 222 223 224 225 226 227 228 | |
delete_zone_record(domain, reference)
¶
Delete a record from domain by reference.
Source code in octodns_metaname/client.py
230 231 232 233 234 | |
Secrets Resolver¶
Secret resolution helpers for the Metaname provider.
By default secrets are pulled straight from environment variables. Users can
optionally register a resolver (e.g., 1Password, Vault) via
set_secret_resolver or the OCTODNS_METANAME_SECRET_RESOLVER env var,
which should contain module:function. The resolver receives the secret name
and the value of <NAME>_REF (if present) and should return the resolved
secret or None when it cannot help.
MissingSecret
¶
Bases: RuntimeError
Raised when a required secret cannot be resolved.
Source code in octodns_metaname/secrets.py
21 22 | |
set_secret_resolver(resolver)
¶
Register a custom secret resolver (or clear when None).
Source code in octodns_metaname/secrets.py
25 26 27 28 29 30 | |
get_secret(name)
¶
Resolve a secret via env var or configured resolver.
Source code in octodns_metaname/secrets.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
clear_secret_resolver()
¶
Testing helper to reset resolver state.
Source code in octodns_metaname/secrets.py
75 76 77 78 79 80 | |