Comment 4 for bug 1804563

Revision history for this message
Newell Jensen (newell-jensen) wrote :

I was able to update the name of the dnsresource using the cli. The docs for this api endpoint were wrong as we should have been using "name" instead of "fqdn":

root@maas-bionic:~# maas admin dnsresources read domain=com
Success.
Machine-readable output follows:
[
    {
        "address_ttl": null,
        "id": 3,
        "ip_addresses": [],
        "fqdn": "something.com",
        "resource_records": [],
        "resource_uri": "/MAAS/api/2.0/dnsresources/3/"
    },
    {
        "address_ttl": null,
        "id": 4,
        "ip_addresses": [
            {
                "created": "2019-05-29T21:52:51.432",
                "ip": "10.0.0.14",
                "alloc_type": 4,
                "subnet": {
                    "name": "10.0.0.0/24",
                    "vlan": {
                        "vid": 0,
                        "mtu": 1500,
                        "dhcp_on": true,
                        "external_dhcp": null,
                        "relay_vlan": null,
                        "id": 5002,
                        "name": "untagged",
                        "fabric": "fabric-1",
                        "space": "undefined",
                        "secondary_rack": null,
                        "fabric_id": 1,
                        "primary_rack": "6ef4cn",
                        "resource_uri": "/MAAS/api/2.0/vlans/5002/"
                    },
                    "cidr": "10.0.0.0/24",
                    "rdns_mode": 2,
                    "gateway_ip": "10.0.0.1",
                    "dns_servers": [],
                    "allow_dns": true,
                    "allow_proxy": true,
                    "active_discovery": false,
                    "managed": true,
                    "id": 2,
                    "space": "undefined",
                    "resource_uri": "/MAAS/api/2.0/subnets/2/"
                },
                "alloc_type_name": "User reserved",
                "interface_set": [],
                "owner": {
                    "is_superuser": true,
                    "username": "admin",
                    "email": "<email address hidden>",
                    "is_local": true,
                    "resource_uri": "/MAAS/api/2.0/users/admin/"
                },
                "resource_uri": "/MAAS/api/2.0/ipaddresses/"
            }
        ],
        "fqdn": "yodawg.com",
        "resource_records": [],
        "resource_uri": "/MAAS/api/2.0/dnsresources/4/"
    }
]
root@maas-bionic:~# maas admin dnsresource update 4 name=yodel
Success.
Machine-readable output follows:
{
    "address_ttl": null,
    "fqdn": "yodel.com",
    "resource_records": [],
    "ip_addresses": [
        {
            "created": "2019-05-29T21:52:51.432",
            "ip": "10.0.0.14",
            "alloc_type": 4,
            "subnet": {
                "name": "10.0.0.0/24",
                "vlan": {
                    "vid": 0,
                    "mtu": 1500,
                    "dhcp_on": true,
                    "external_dhcp": null,
                    "relay_vlan": null,
                    "name": "untagged",
                    "id": 5002,
                    "primary_rack": "6ef4cn",
                    "fabric_id": 1,
                    "fabric": "fabric-1",
                    "secondary_rack": null,
                    "space": "undefined",
                    "resource_uri": "/MAAS/api/2.0/vlans/5002/"
                },
                "cidr": "10.0.0.0/24",
                "rdns_mode": 2,
                "gateway_ip": "10.0.0.1",
                "dns_servers": [],
                "allow_dns": true,
                "allow_proxy": true,
                "active_discovery": false,
                "managed": true,
                "id": 2,
                "space": "undefined",
                "resource_uri": "/MAAS/api/2.0/subnets/2/"
            },
            "interface_set": [],
            "alloc_type_name": "User reserved",
            "owner": {
                "is_superuser": true,
                "username": "admin",
                "email": "<email address hidden>",
                "is_local": true,
                "resource_uri": "/MAAS/api/2.0/users/admin/"
            },
            "resource_uri": "/MAAS/api/2.0/ipaddresses/"
        }
    ],
    "id": 4,
    "resource_uri": "/MAAS/api/2.0/dnsresources/4/"
}