Summary
The yandex protocol (for Yandex DNS) is currently a LegacyProtocol, using the deprecated wantip key and legacy recap fields. The update logic only updates A records (type not checked in list response). This is a prerequisite for closing #172.
Current behaviour
nic_yandex_update reads delete $config{$host}{'wantip'} — a single IP regardless of family. The flow is two-step:
GET https://<server>/api2/admin/dns/list?domain=<login> — list all DNS records, with PddToken: <password> header. Finds the record whose fqdn matches the host (regardless of type — A or AAAA).
POST https://<server>/api2/admin/dns/edit — updates the found record with domain=<login>&record_id=<id>&content=<ip>.
There is no type filtering in the list step, so if both A and AAAA records exist for the host, only the first match is updated. Results are stored in recap{$host}{'ip'}, recap{$host}{'mtime'}, recap{$host}{'status'}.
Migration requirements
- Convert to
Protocol->new (replacing LegacyProtocol->new).
- Read
wantipv4 and wantipv6 instead of wantip.
- In the list step, filter records by
type == 'A' for IPv4 and type == 'AAAA' for IPv6.
- Run two independent update passes (one per family) when both IPs are wanted.
- Store results in
recap{$host}{'ipv4'} / recap{$host}{'status-ipv4'} and recap{$host}{'ipv6'} / recap{$host}{'status-ipv6'}.
- Remove the hardcoded
https:// prefix from both URL constructions.
- Add
t/protocol_yandex.pl with test coverage for: IPv4 success, IPv6 success, record-not-found, JSON error response, HTTP error, no-op.
References
Summary
The
yandexprotocol (for Yandex DNS) is currently aLegacyProtocol, using the deprecatedwantipkey and legacyrecapfields. The update logic only updates A records (type not checked in list response). This is a prerequisite for closing #172.Current behaviour
nic_yandex_updatereadsdelete $config{$host}{'wantip'}— a single IP regardless of family. The flow is two-step:GET https://<server>/api2/admin/dns/list?domain=<login>— list all DNS records, withPddToken: <password>header. Finds the record whosefqdnmatches the host (regardless of type — A or AAAA).POST https://<server>/api2/admin/dns/edit— updates the found record withdomain=<login>&record_id=<id>&content=<ip>.There is no type filtering in the list step, so if both A and AAAA records exist for the host, only the first match is updated. Results are stored in
recap{$host}{'ip'},recap{$host}{'mtime'},recap{$host}{'status'}.Migration requirements
Protocol->new(replacingLegacyProtocol->new).wantipv4andwantipv6instead ofwantip.type == 'A'for IPv4 andtype == 'AAAA'for IPv6.recap{$host}{'ipv4'}/recap{$host}{'status-ipv4'}andrecap{$host}{'ipv6'}/recap{$host}{'status-ipv6'}.https://prefix from both URL constructions.t/protocol_yandex.plwith test coverage for: IPv4 success, IPv6 success, record-not-found, JSON error response, HTTP error, no-op.References