Comments (8)
I was able to update the record when hitting the API directly:
$ curl -X PUT "https://api.cloudflare.com/client/v4/zones/5058354498babe04ef58c4168949b099/dns_records/2dc525087c2ff8b02289eef8a0ec1d68" \
> -H "X-Auth-Email: ***" \
> -H "X-Auth-Key: ***" \
> -H "Content-Type: application/json" \
> --data '{"type":"A","name":"CFAPI-modified","content":"192.168.10.10","ttl":120,"proxied":false}'
{"result":{"id":"2dc525087c2ff8b02289eef8a0ec1d68","type":"A","name":"cfapi-modified.wave-juno.com","content":"192.168.10.10","proxiable":false,"proxied":false,"ttl":120,"locked":false,"zone_id":"5058354498babe04ef58c4168949b099","zone_name":"wave-juno.com","modified_on":"2016-12-20T20:45:04.595545Z","created_on":"2016-12-20T20:45:04.595545Z","meta":{"auto_added":false}},"success":true,"errors":[],"messages":[]}
from cloudflare-go.
Ah, there is indeed a very stupid bug here. I think when it was originally written an assumption was made that anything but the label name would be changed, so UpdateDNSRecord
is actually fetching the existing record (based on the recordID
) and overwriting the name :-(
I'm not sure why the TTL isn't being updated, though. Maybe an artefact of the entire record not being updated?
from cloudflare-go.
Hopefully the PR fixes this for you. Are you able to test it before merging?
from cloudflare-go.
@jamesog I'd be happy to test, but not sure how.. I tried checking out origin/jamesog/97-updatednsrecord
in $GOPATH/src/github/cloudflare/cloudflare-go
and then re-ran my script, however I'm seeing the same result (just a record named cfapi
).
Not sure if this is an issue with how I did things or if there's still an issue with the library. Maybe you could add some debug output so I'm sure that I'm actually running your code? 😄
Output
2016/12/20 17:04:26 [DEBUG] CloudFlare Record create configuration: cloudflare.DNSRecord{ID:"", Type:"A", Name:"CFAPI", Content:"127.0.0.1", Proxiable:false, Proxied:false, TTL:3600, Locked:false, ZoneID:"5058354498babe04ef58c4168949b099", ZoneName:"wave-juno.com", CreatedOn:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}, ModifiedOn:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}, Data:interface {}(nil), Meta:interface {}(nil), Priority:0}
2016/12/20 17:04:27 [INFO] CloudFlare Record ID: be0df701e59406ea97c8dc818813b8b5
2016/12/20 17:04:27 [DEBUG] CloudFlare Record update configuration: cloudflare.DNSRecord{ID:"be0df701e59406ea97c8dc818813b8b5", Type:"A", Name:"CFAPI-modified", Content:"192.168.10.10", Proxiable:false, Proxied:true, TTL:120, Locked:false, ZoneID:"5058354498babe04ef58c4168949b099", ZoneName:"wave-juno.com", CreatedOn:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}, ModifiedOn:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}, Data:interface {}(nil), Meta:interface {}(nil), Priority:0}
Web Console
from cloudflare-go.
@jamesog I added some extra debugging logs, and noticed I was trying to update the record to proxied = true
which wasn't valid and causing the update to fail. After I resolved this, I was able to successfully update the name:
from cloudflare-go.
Cool, thanks!
from cloudflare-go.
@jamesog Awesome, thanks for the quick response on this! 👍
from cloudflare-go.
Welcome :-)
from cloudflare-go.
Related Issues (20)
- Version tag not recognized by go (`V0.77.0` instead of `v0.77.0`) HOT 3
- Add `maxDurationSeconds` and `Expiry` for TUS Uploads
- Zerotrust / Access User endpoints. HOT 2
- All API documentation links are incorrect HOT 1
- What does "foo" mean in `CHANGELOG.md`? HOT 3
- ListLoadBalancerPools doesn't return Pagination details to impossible to tell if you have more results to go through HOT 1
- Support for List Images v2 and continuation tokens
- I've asked repeatedly HOT 1
- Support for Send Email Worker Bindings
- Delete by filters HOT 1
- Zone command group doesn't work in flarectl amd64 build of v0.83.0 github release HOT 4
- Stream file in UploadImage to reduce memory usage
- No pagination options for ListOriginCertificates
- UpdateAccessUsersSeats does not work because API expects an Array, and method sends a single object HOT 1
- ListAccessUsers returns wrong results for AccessSeat and GatewaySeat when it paginates due to loop variable HOT 1
- Add missing draft property to Image struct
- Support for Build Cache of Pages Project
- Add support for Hyperdrive
- Add Support for Images Variants HOT 1
- Streaming Worker Content
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudflare-go.