Updating entry with DNS and HTTP Proxy (CDN)
brunchybit opened this issue · 4 comments
brunchybit commented
Not sure if this is something I'm missing in the options for managing records with cloudflare, or if this is something missing in the gem, but whenever I manage a record via the gem, the setting for DNS and HTTP proxy (CDN) is toggled to off.
Is there an option I'm missing, or is this not supported by the current implementation on the gem?
Thanks for the assistance.
ioquatix commented
This is something we should test.
ioquatix commented
I think the latest version should fix this using the v4 API.
dknell commented
FYI, the following code results in the proxied
feature being disabled:
connection = Cloudflare.connect(key: key, email: email)
zone = connection.zones.find_by_name('example.com')
existing_record = zone.dns_records.find_by_name('batman.example.com')
if existing_record
existing_record.update_content('192.168.1.2')
end
This works:
connection = Cloudflare.connect(key: key, email: email)
zone = connection.zones.find_by_name('example.com')
existing_record = zone.dns_records.find_by_name('batman.example.com')
if existing_record
existing_record.put(
{
'type': 'A',
'name': 'batman',
'content': '192.168.1.2',
'proxied': true
}.to_json,
:content_type => 'application/json'
)
end
ioquatix commented
Do you want to submit a PR?