diff options
author | Andreas Eriksen <andreer@pvv.ntnu.no> | 2019-04-12 10:59:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-12 10:59:21 +0200 |
commit | 96f84332c9fd0ef0d7da82b8ed3874498c871234 (patch) | |
tree | 805ab2b5e06a1d60eed951355ca74ff2f69ed31e /controller-api | |
parent | 77d3a80ae3e7e9dd8755ada7cceb899d015aecde (diff) | |
parent | 88c2be7bf1e2b9ce83935ef493b8610f4a8fff7a (diff) |
Merge pull request #9102 from vespa-engine/andreer/create-txt-records
enable creation of TXT records
Diffstat (limited to 'controller-api')
2 files changed, 15 insertions, 0 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java index e8b0c8a66ef..63faadfe555 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java @@ -43,6 +43,13 @@ public class MemoryNameService implements NameService { } @Override + public Record createTxt(RecordName name, RecordData txtData) { + Record record = new Record(Record.Type.TXT, name, txtData); + records.add(record); + return record; + } + + @Override public List<Record> findRecords(Record.Type type, RecordName name) { return records.stream() .filter(record -> record.type() == type && record.name().equals(name)) diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/NameService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/NameService.java index 444c8dda8d3..1bac0f6cfc1 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/NameService.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/NameService.java @@ -29,6 +29,14 @@ public interface NameService { */ List<Record> createAlias(RecordName name, Set<AliasTarget> targets); + /** + * Create a new TXT record containing the provided data. + * @param name Name of the created record + * @param txtData TXT data for the record, consisting of one or more space-separated <em>double-quoted</em> strings: "string1" "string2" + * @return The created record + */ + Record createTxt(RecordName name, RecordData txtData); + /** Find all records matching given type and name */ List<Record> findRecords(Record.Type type, RecordName name); |