Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

domain record update data (not only name) #56

Closed
olli3 opened this issue Nov 11, 2014 · 5 comments
Closed

domain record update data (not only name) #56

olli3 opened this issue Nov 11, 2014 · 5 comments

Comments

@olli3
Copy link

olli3 commented Nov 11, 2014

would it be possible to update the data for a domain record,
i cant see it is in the code currently

$updated = $domainRecord->update('baz.dk', 123, 'new-name');

could this become

$updated = $domainRecord->updateData('baz.dk', 123, 'new-data');

@olli3
Copy link
Author

olli3 commented Nov 11, 2014

suggestion function

public function updateData($domainName, $recordId, $data)
{
$headers = array('Content-Type: application/json');
$content = sprintf('{"data":"%s"}', $data);

    $domainRecord = $this->adapter->put(sprintf('%s/domains/%s/records/%d', self::ENDPOINT, $domainName, $recordId), $headers, $content);
    $domainRecord = json_decode($domainRecord);

    return new DomainRecordEntity($domainRecord->domain_record);
}

@yassirh
Copy link
Contributor

yassirh commented Nov 11, 2014

The API doesn't support this possibility : https://developers.digitalocean.com/#update-a-domain-record

@olli3
Copy link
Author

olli3 commented Nov 11, 2014

i disagree :) it does :...

->data string The value to use for the DNS record.

and once more the code above works, it updates my a records with my dev server ip.

@yassirh
Copy link
Contributor

yassirh commented Nov 13, 2014

I think it can be done but it is not documented... i will look into it

@olli3
Copy link
Author

olli3 commented Nov 13, 2014

i did it with the code above :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants