{"issue":{"created_at":"2011-11-29T19:04:51Z","state":"open","updated_at":"2011-11-29T21:49:19Z","comments":2,"user":{"gravatar_id":"5888fc25101419e40b7de521f8524dad","id":975,"url":"https://api.github.com/users/ktheory","login":"ktheory","avatar_url":"https://secure.gravatar.com/avatar/5888fc25101419e40b7de521f8524dad?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Allow modifying a Route 53 dns record. It generates a single BatchRequest that deletes the current record and creates a record with the new attributes.\r\n\r\nE.g.:\r\n\r\n    # Create a record\r\n    record = zone.records.create(:name => 'example.tld', :value => 1.1.1.1, :ttl => 60, type => 'A')\r\n\r\n    # Change the value and ttl\r\n    record.modify(:value => 2.2.2.2, :ttl => 300)","assignee":null,"id":2390391,"labels":[],"pull_request":{"patch_url":"https://github.com/fog/fog/pull/626.patch","html_url":"https://github.com/fog/fog/pull/626","diff_url":"https://github.com/fog/fog/pull/626.diff"},"number":626,"title":"[aws|dns] Add Record#modify method","closed_at":null,"html_url":"https://github.com/fog/fog/issues/626","url":"https://api.github.com/repos/fog/fog/issues/626","milestone":null},"action":"created","comment":{"created_at":"2011-11-29T21:49:19Z","updated_at":"2011-11-29T21:49:19Z","user":{"gravatar_id":"5888fc25101419e40b7de521f8524dad","id":975,"url":"https://api.github.com/users/ktheory","login":"ktheory","avatar_url":"https://secure.gravatar.com/avatar/5888fc25101419e40b7de521f8524dad?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Implementing this with Record#save was my first thought, but I steered away from it b/c we can't use an identity to determine if the record has been saved or not.\r\n\r\nAWS Route 53 doesn't have a CRUD-like interface. In order to \"update\" it, we'd need to delete a record with the old attributes, and create a record with the new ones.\r\n\r\nTo support updates with #save, we'd have to redefine attribute methods to juggle two hashes of attributes (old and new each). That struck me as more of a hack than adding a #modify method.\r\n\r\nFWIW, I modelled the #modify method on the Fog::AWS::RDS::Server method, which exists for similar reasons: https://github.com/fog/fog/blob/master/lib/fog/aws/models/rds/server.rb#L62\r\n\r\nOn a related note, the Route 53 Record model is doing double-duty at the moment handling both \"resource record sets\" (which have name, ttl, type, and value attributes), and \"changes\" (which have an Id, status, and submittedAt attributes).\r\n\r\nSeems like \"changes\" should be split out into it's own model.\r\n\r\nThoughts?\r\n\r\nOn Nov 29, 2011, at 3:01 PM, Wesley Beary wrote:\r\n\r\n> I like the functionality, but it is a departure from other providers.  Would it be possible to do the same kind of thing inside of save and just make the decision based on whether or not it has an identity value (or something to that effect which can predict if it is an existing record).  I think that would make the interface remain consistent while adding function.  Thanks!\r\n> \r\n> --- \r\n> Reply to this email directly or view it on GitHub:\r\n> https://github.com/fog/fog/pull/626#issuecomment-2945078","id":2950759,"url":"https://api.github.com/repos/fog/fog/issues/comments/2950759"}}