def linkRecord(self, existing_domain, new_domain, rtype, callback=None, errback=None, **kwargs): """ Create a new linked record in this zone. These records use the configuration (answers, ttl, filters, etc) from an existing record in the NSONE platform. :param str existing_domain: FQDN of the target record whose config \ should be used. Does not have to be in the same zone. :param str new_domain: Name of the new (linked) record. Zone name is\ appended automatically. :param str rtype: DNS record type, which must match the target record. :rtype: nsone.records.Record :return: new Record """ if '.' not in existing_domain: existing_domain = existing_domain + '.' + self.zone record = Record(self, new_domain, rtype) return record.create(answers=[], link=existing_domain, callback=callback, errback=errback, **kwargs)
def loadRecord(self, domain, rtype, callback=None, errback=None): """ Load a high level Record object from a domain within this Zone. :param str domain: The name of the record to load :param str rtype: The DNS record type :rtype: nsone.records.Record :return: new Record """ rec = Record(self, domain, rtype) return rec.load(callback=callback, errback=errback)
def onSaveNewRecord(new_data): if zone != self.zone: pZone = Zone(self.config, zone) else: pZone = self new_rec = Record(pZone, new_domain, rtype) new_rec._parseModel(new_data) if callback: return callback(new_rec) else: return new_rec
def add_X(domain, answers, callback=None, errback=None, **kwargs): kwargs['answers'] = answers record = Record(self, domain, rtype) return record.create(callback=callback, errback=errback, **kwargs)