- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Error getting the cname record in a zone updated
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2022 04:41 PM - edited 08-30-2022 04:45 PM
I could get/delete via postman, but not update (put) a cname record. I got the following error. I tried in curl, also the same issue. The object_reference variable has the object reference ID, which I got from the get request of the new.abc record.
Appreciate any prompt feedback/insight, the sooner the better please.
new.abc = old cname
new1.abc = new cname
Solved! Go to Solution.
Re: Error getting the cname record in a zone updated
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2022 04:31 AM
Be sure to tell it you're sending JSON data, otherwise it expects plain text key/value pairs.
Under the headers section, include:
"Content-Type" = "application/json"
Without it, I got the same errors you saw. With it, I was able to send successfully.
Re: Error getting the cname record in a zone updated
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2022 08:00 AM
Thanks MRichard. I do have json setting in the header already. Any other thought?
So, in the body, I specify the new cname (ie, new1.abc), but in the WAPI url request, I specify the old cname (new.abc in my case) right? I have the documentation, but it isn't as clear.
Re: Error getting the cname record in a zone updated
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2022 09:26 AM
I got it working. Apparently, these 2 get requests give different object references. The 2nd one gives the right object reference. Shouldn't they give the same obj reference?
h t t p s://{{grid_master}}/wapi/v2.7/allrecords?zone=abc
h t t p s://{{grid_master}}/wapi/v2.7/record:cname
Re: Error getting the cname record in a zone updated
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2022 04:27 AM
Yeah, it's rather annoying but the responses from an allrecords search are synthetic search results, not the acual object.
From the docs:
allrecords : AllRecords object.
The allrecords object is a read-only synthetic object used to retrieve records that belong to a particular zone.
Since this is a synthetic object, it supports reading only by specifying search parameters, not by reference.
if you want the actual object ref from an allrecords search you can ask for the "record" field to be added to the response:
wapi/v2.7/allrecords?zone=example.com&_return_fields%2b=record
and the response will loook like this:
{ "_ref": "allrecords/ZG5zLnpvbmVfc2VhcmNoX2luZGV4JGRucy5iaW5kX2NuYW1lJC5fZGVmYXVsdC5uZXR3b3JrLnJpY2hhcmQuY25hbWU:cname", "comment": "", "name": "cname", "record": { "_ref": "record:cname/ZG5zLmJpbmRfY25hbWUkLl9kZWZhdWx0Lm5ldHdvcmsucmljaGFyZC5jbmFtZQ:cname.example.com/Internal%20DNS", "canonical": "target.example.com", "name": "cname.example.com", "view": "Internal DNS" }, "type": "record:cname", "view": "Internal DNS", "zone": "example.com" },
Re: Error getting the cname record in a zone updated
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2022 08:00 AM
That helps! Thanks MRichard.