gpt4 book ai didi

com.google.cloud.dns.Zone.listRecordSets()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 08:11:31 27 4
gpt4 key购买 nike

本文整理了Java中com.google.cloud.dns.Zone.listRecordSets()方法的一些代码示例,展示了Zone.listRecordSets()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zone.listRecordSets()方法的具体详情如下:
包路径:com.google.cloud.dns.Zone
类名称:Zone
方法名:listRecordSets

Zone.listRecordSets介绍

[英]Lists all RecordSets associated with this zone. The method searches for zone by name.
[中]列出与此区域关联的所有记录集。该方法按名称搜索区域。

代码示例

代码示例来源:origin: googleapis/google-cloud-java

@Test
public void listDnsRecordsByNameAndFound() {
 @SuppressWarnings("unchecked")
 Page<RecordSet> pageMock = createStrictMock(Page.class);
 replay(pageMock);
 expect(dns.listRecordSets(ZONE_NAME)).andReturn(pageMock).times(2);
 // again for options
 expect(dns.listRecordSets(ZONE_NAME, DNS_RECORD_OPTIONS)).andReturn(pageMock).times(2);
 replay(dns);
 Page<RecordSet> result = zone.listRecordSets();
 assertSame(pageMock, result);
 result = zoneNoId.listRecordSets();
 assertSame(pageMock, result);
 verify(pageMock);
 zone.listRecordSets(DNS_RECORD_OPTIONS); // check options
 zoneNoId.listRecordSets(DNS_RECORD_OPTIONS); // check options
}

代码示例来源:origin: googleapis/google-cloud-java

replay(dns);
try {
 zoneNoId.listRecordSets();
 fail("Parent container not found, should throw an exception.");
} catch (DnsException e) {
 zone.listRecordSets();
 fail("Parent container not found, should throw an exception.");
} catch (DnsException e) {
 zoneNoId.listRecordSets(DNS_RECORD_OPTIONS); // check options
 fail("Parent container not found, should throw an exception.");
} catch (DnsException e) {
 zone.listRecordSets(DNS_RECORD_OPTIONS); // check options
 fail("Parent container not found, should throw an exception.");
} catch (DnsException e) {

代码示例来源:origin: googleapis/google-cloud-java

private static void clear() {
 for (String zoneName : ZONE_NAMES) {
  Zone zone = DNS.getZone(zoneName);
  if (zone != null) {
   /* We wait for all changes to complete before retrieving a list of DNS records to be
   deleted. Waiting is necessary as changes potentially might create more records between
   when the list has been retrieved and executing the subsequent delete operation. */
   Iterator<ChangeRequest> iterator = zone.listChangeRequests().iterateAll().iterator();
   while (iterator.hasNext()) {
    waitForChangeToComplete(zoneName, iterator.next().getGeneratedId());
   }
   Iterator<RecordSet> recordSetIterator = zone.listRecordSets().iterateAll().iterator();
   List<RecordSet> toDelete = new LinkedList<>();
   while (recordSetIterator.hasNext()) {
    RecordSet recordSet = recordSetIterator.next();
    if (!ImmutableList.of(RecordSet.Type.NS, RecordSet.Type.SOA)
      .contains(recordSet.getType())) {
     toDelete.add(recordSet);
    }
   }
   if (!toDelete.isEmpty()) {
    ChangeRequest deletion =
      zone.applyChangeRequest(ChangeRequest.newBuilder().setDeletions(toDelete).build());
    waitForChangeToComplete(zone.getName(), deletion.getGeneratedId());
   }
   zone.delete();
  }
 }
}

代码示例来源:origin: googleapis/google-cloud-java

Page<RecordSet> recordSetPage = zone.listRecordSets();
for (RecordSet current : recordSetPage.iterateAll()) {
 if (toCreate.getName().equals(current.getName())

代码示例来源:origin: googleapis/google-cloud-java

for (RecordSet current : zone.listRecordSets().iterateAll()) {
 if (toCreate.getName().equals(current.getName())
   && toCreate.getType().equals(current.getType())) {

代码示例来源:origin: googleapis/google-cloud-java

Iterator<RecordSet> recordSetIterator = zone.listRecordSets().iterateAll().iterator();
LinkedList<RecordSet> deletions = new LinkedList<>();
LinkedList<RecordSet> additions = new LinkedList<>();

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com