- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.google.cloud.dns.Zone.getName()
方法的一些代码示例,展示了Zone.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zone.getName()
方法的具体详情如下:
包路径:com.google.cloud.dns.Zone
类名称:Zone
方法名:getName
暂无
代码示例来源:origin: googleapis/google-cloud-java
/**
* Deletes the zone. The method deletes the zone by name.
*
* @return {@code true} is zone was found and deleted and {@code false} otherwise
* @throws DnsException upon failure
*/
public boolean delete() {
return dns.delete(getName());
}
代码示例来源:origin: googleapis/google-cloud-java
private static void printZone(Zone zone) {
System.out.printf("%nName: %s%n", zone.getName());
System.out.printf("ID: %s%n", zone.getGeneratedId());
System.out.printf("Description: %s%n", zone.getDescription());
System.out.printf("Created: %s%n", FORMATTER.print(zone.getCreationTimeMillis()));
System.out.printf("Name servers: %s%n", Joiner.on(", ").join(zone.getNameServers()));
}
代码示例来源:origin: googleapis/google-cloud-java
DNS.create(ZONE1, Dns.ZoneOption.fields(ZoneField.NAME));
Zone created = DNS.getZone(ZONE1.getName(), Dns.ZoneOption.fields(ZoneField.CREATION_TIME));
assertEquals(ZONE1.getName(), created.getName()); // always returned
assertNotNull(created.getCreationTimeMillis());
assertNull(created.getDescription());
assertNull(created.getGeneratedId());
created = DNS.getZone(ZONE1.getName(), Dns.ZoneOption.fields(ZoneField.DESCRIPTION));
assertEquals(ZONE1.getName(), created.getName()); // always returned
assertNull(created.getCreationTimeMillis());
assertEquals(ZONE1.getDescription(), created.getDescription());
assertNull(created.getGeneratedId());
created = DNS.getZone(ZONE1.getName(), Dns.ZoneOption.fields(ZoneField.DNS_NAME));
assertEquals(ZONE1.getName(), created.getName()); // always returned
assertNull(created.getCreationTimeMillis());
assertEquals(ZONE1.getDnsName(), created.getDnsName());
assertNull(created.getGeneratedId());
created = DNS.getZone(ZONE1.getName(), Dns.ZoneOption.fields(ZoneField.NAME));
assertEquals(ZONE1.getName(), created.getName()); // always returned
assertNull(created.getCreationTimeMillis());
assertNull(created.getDnsName());
assertNull(created.getGeneratedId());
created = DNS.getZone(ZONE1.getName(), Dns.ZoneOption.fields(ZoneField.NAME_SERVER_SET));
assertEquals(ZONE1.getName(), created.getName()); // always returned
assertNull(created.getCreationTimeMillis());
assertNull(created.getDnsName());
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testBuilder() {
// one for each build() call because it invokes a constructor
expect(dns.getOptions()).andReturn(OPTIONS).times(8);
replay(dns);
assertNotEquals(
zone,
zone.toBuilder()
.setGeneratedId(new BigInteger(zone.getGeneratedId()).add(BigInteger.ONE).toString())
.build());
assertNotEquals(zone, zone.toBuilder().setDnsName(zone.getName() + "aaaa").build());
assertNotEquals(
zone, zone.toBuilder().setNameServerSet(zone.getNameServerSet() + "aaaa").build());
assertNotEquals(
zone, zone.toBuilder().setNameServers(ImmutableList.of("nameserverpppp")).build());
assertNotEquals(zone, zone.toBuilder().setDnsName(zone.getDnsName() + "aaaa").build());
assertNotEquals(
zone, zone.toBuilder().setCreationTimeMillis(zone.getCreationTimeMillis() + 1).build());
Zone.Builder builder = zone.toBuilder();
builder
.setGeneratedId(ZONE_ID)
.setDnsName("example.com")
.setCreationTimeMillis(123478946464L)
.build();
assertEquals(zone, builder.build());
}
}
代码示例来源:origin: googleapis/google-cloud-java
try {
Zone created = DNS.create(ZONE1, Dns.ZoneOption.fields(ZoneField.CREATION_TIME));
assertEquals(ZONE1.getName(), created.getName()); // always returned
assertNotNull(created.getCreationTimeMillis());
assertNull(created.getDescription());
created.delete();
created = DNS.create(ZONE1, Dns.ZoneOption.fields(ZoneField.DESCRIPTION));
assertEquals(ZONE1.getName(), created.getName()); // always returned
assertNull(created.getCreationTimeMillis());
assertEquals(ZONE1.getDescription(), created.getDescription());
created.delete();
created = DNS.create(ZONE1, Dns.ZoneOption.fields(ZoneField.DNS_NAME));
assertEquals(ZONE1.getName(), created.getName()); // always returned
assertNull(created.getCreationTimeMillis());
assertEquals(ZONE1.getDnsName(), created.getDnsName());
created.delete();
created = DNS.create(ZONE1, Dns.ZoneOption.fields(ZoneField.NAME));
assertEquals(ZONE1.getName(), created.getName()); // always returned
assertNull(created.getCreationTimeMillis());
assertNull(created.getDnsName());
created.delete();
created = DNS.create(ZONE1, Dns.ZoneOption.fields(ZoneField.NAME_SERVER_SET));
assertEquals(ZONE1.getName(), created.getName()); // always returned
assertNull(created.getCreationTimeMillis());
assertNull(created.getDnsName());
代码示例来源:origin: googleapis/google-cloud-java
/**
* Retrieves the latest information about the zone. The method retrieves the zone by name.
*
* @param options optional restriction on what fields should be fetched
* @return zone object containing updated information or {@code null} if not not found
* @throws DnsException upon failure
*/
public Zone reload(Dns.ZoneOption... options) {
return dns.getZone(getName(), options);
}
代码示例来源:origin: googleapis/google-cloud-java
System.err.println("The thread was interrupted while waiting...");
changeRequest = dns.getChangeRequest(zone.getName(), changeRequest.getGeneratedId());
System.out.println(String.format("Record sets inside %s:", zone.getName()));
for (RecordSet recordSet : recordSetPage.iterateAll()) {
System.out.println(recordSet);
System.out.println(String.format("The history of changes in %s:", zone.getName()));
for (ChangeRequest currentChangeRequest : zone.listChangeRequests().iterateAll()) {
System.out.println(currentChangeRequest);
代码示例来源:origin: googleapis/google-cloud-java
batch.submit();
Zone created = timeResult.get();
assertEquals(ZONE1.getName(), created.getName()); // always returned
assertNotNull(created.getCreationTimeMillis());
assertNull(created.getDescription());
assertNull(created.getGeneratedId());
created = descriptionResult.get();
assertEquals(ZONE1.getName(), created.getName()); // always returned
assertNull(created.getCreationTimeMillis());
assertEquals(ZONE1.getDescription(), created.getDescription());
assertNull(created.getGeneratedId());
created = dnsNameResult.get();
assertEquals(ZONE1.getName(), created.getName()); // always returned
assertNull(created.getCreationTimeMillis());
assertEquals(ZONE1.getDnsName(), created.getDnsName());
assertNull(created.getGeneratedId());
created = nameResult.get();
assertEquals(ZONE1.getName(), created.getName()); // always returned
assertNull(created.getCreationTimeMillis());
assertNull(created.getDnsName());
assertNull(created.getGeneratedId());
created = nameServerSetResult.get();
assertEquals(ZONE1.getName(), created.getName()); // always returned
assertNull(created.getCreationTimeMillis());
assertNull(created.getDnsName());
代码示例来源:origin: googleapis/google-cloud-java
/**
* Lists all {@link RecordSet}s associated with this zone. The method searches for zone by name.
*
* @param options optional restriction on listing and fields of {@link RecordSet}s returned
* @return a page of record sets
* @throws DnsException upon failure or if the zone is not found
*/
public Page<RecordSet> listRecordSets(Dns.RecordSetListOption... options) {
return dns.listRecordSets(getName(), options);
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testCreateValidZone() {
try {
Zone created = DNS.create(ZONE1);
assertEquals(ZONE1.getDescription(), created.getDescription());
assertEquals(ZONE1.getDnsName(), created.getDnsName());
assertEquals(ZONE1.getName(), created.getName());
assertNotNull(created.getCreationTimeMillis());
assertNotNull(created.getNameServers());
assertNull(created.getNameServerSet());
assertNotNull(created.getGeneratedId());
Zone retrieved = DNS.getZone(ZONE1.getName());
assertEquals(created, retrieved);
created = DNS.create(ZONE_EMPTY_DESCRIPTION);
assertEquals(ZONE_EMPTY_DESCRIPTION.getDescription(), created.getDescription());
assertEquals(ZONE_EMPTY_DESCRIPTION.getDnsName(), created.getDnsName());
assertEquals(ZONE_EMPTY_DESCRIPTION.getName(), created.getName());
assertNotNull(created.getCreationTimeMillis());
assertNotNull(created.getNameServers());
assertNull(created.getNameServerSet());
assertNotNull(created.getGeneratedId());
retrieved = DNS.getZone(ZONE_EMPTY_DESCRIPTION.getName());
assertEquals(created, retrieved);
} finally {
DNS.delete(ZONE1.getName());
DNS.delete(ZONE_EMPTY_DESCRIPTION.getName());
}
}
代码示例来源:origin: googleapis/google-cloud-java
/**
* Retrieves all change requests for this zone. The method searches for zone by name. Returns a
* page of {@link ChangeRequest}s.
*
* @param options optional restriction on listing and fields to be returned
* @return a page of change requests
* @throws DnsException upon failure or if the zone is not found
*/
public Page<ChangeRequest> listChangeRequests(Dns.ChangeRequestListOption... options) {
return dns.listChangeRequests(getName(), options);
}
代码示例来源:origin: googleapis/google-cloud-java
assertEquals(ZONE1.getDescription(), created.getDescription());
assertEquals(ZONE1.getDnsName(), created.getDnsName());
assertEquals(ZONE1.getName(), created.getName());
assertNotNull(created.getCreationTimeMillis());
assertNotNull(created.getNameServers());
assertEquals(ZONE_EMPTY_DESCRIPTION.getDescription(), created.getDescription());
assertEquals(ZONE_EMPTY_DESCRIPTION.getDnsName(), created.getDnsName());
assertEquals(ZONE_EMPTY_DESCRIPTION.getName(), created.getName());
assertNotNull(created.getCreationTimeMillis());
assertNotNull(created.getNameServers());
代码示例来源:origin: googleapis/google-cloud-java
/**
* Submits {@link ChangeRequestInfo} to the service for it to applied to this zone. The method
* searches for zone by name.
*
* @param options optional restriction on what fields of {@link ChangeRequest} should be returned
* @return ChangeRequest with server-assigned ID
* @throws DnsException upon failure or if the zone is not found
*/
public ChangeRequest applyChangeRequest(
ChangeRequestInfo changeRequest, Dns.ChangeRequestOption... options) {
checkNotNull(changeRequest);
return dns.applyChangeRequest(getName(), changeRequest, options);
}
代码示例来源:origin: googleapis/google-cloud-java
/**
* Retrieves an updated information about a change request previously submitted to be applied to
* this zone. Returns a {@link ChangeRequest} or {@code null} if the change request was not found.
* Throws {@link DnsException} if the zone is not found.
*
* @param options optional restriction on what fields of {@link ChangeRequest} should be returned
* @return updated ChangeRequest
* @throws DnsException upon failure or if the zone is not found
* @throws NullPointerException if {@code changeRequestId} is null
*/
public ChangeRequest getChangeRequest(
String changeRequestId, Dns.ChangeRequestOption... options) {
checkNotNull(changeRequestId);
return dns.getChangeRequest(getName(), changeRequestId, options);
}
代码示例来源:origin: googleapis/google-cloud-java
/** Creates a zone with the provided name, DNS name and description (in this order). */
@Override
public void run(Dns dns, String... args) {
String zoneName = args[0];
String dnsName = args[1];
String description = args[2];
ZoneInfo zoneInfo = ZoneInfo.of(zoneName, dnsName, description);
Zone zone = dns.create(zoneInfo);
System.out.printf(
"Successfully created zone with name %s which was assigned ID %s.%n",
zone.getName(), zone.getGeneratedId());
}
代码示例来源:origin: googleapis/google-cloud-java
private static List<Zone> filter(Iterator<Zone> iterator) {
List<Zone> result = new LinkedList<>();
while (iterator.hasNext()) {
Zone zone = iterator.next();
if (ZONE_NAMES.contains(zone.getName())) {
result.add(zone);
}
}
return result;
}
代码示例来源: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
Zone zone = DNS.create(ZONE1, Dns.ZoneOption.fields(ZoneField.NAME));
ChangeRequest created = zone.applyChangeRequest(CHANGE_ADD_ZONE1);
ChangeRequest retrieved = DNS.getChangeRequest(zone.getName(), created.getGeneratedId());
assertEqChangesIgnoreStatus(created, retrieved);
waitForChangeToComplete(zone.getName(), created.getGeneratedId());
zone.applyChangeRequest(CHANGE_DELETE_ZONE1);
retrieved =
DNS.getChangeRequest(
zone.getName(),
created.getGeneratedId(),
Dns.ChangeRequestOption.fields(ChangeRequestField.ID));
assertEqChangesIgnoreStatus(created, retrieved);
waitForChangeToComplete(zone.getName(), created.getGeneratedId());
zone.applyChangeRequest(CHANGE_DELETE_ZONE1);
created =
retrieved =
DNS.getChangeRequest(
zone.getName(),
created.getGeneratedId(),
Dns.ChangeRequestOption.fields(ChangeRequestField.STATUS));
assertEqChangesIgnoreStatus(created, retrieved);
waitForChangeToComplete(zone.getName(), created.getGeneratedId());
zone.applyChangeRequest(CHANGE_DELETE_ZONE1);
created =
retrieved =
DNS.getChangeRequest(
代码示例来源:origin: googleapis/google-cloud-java
Zone zone = DNS.create(ZONE1, Dns.ZoneOption.fields(ZoneField.NAME));
ChangeRequest created = zone.applyChangeRequest(CHANGE_ADD_ZONE1);
waitForChangeToComplete(zone.getName(), created.getGeneratedId());
DnsBatch batch = DNS.batch();
DnsBatchResult<ChangeRequest> completeResult =
batch.getChangeRequest(zone.getName(), created.getGeneratedId());
DnsBatchResult<ChangeRequest> idResult =
batch.getChangeRequest(
zone.getName(),
created.getGeneratedId(),
Dns.ChangeRequestOption.fields(ChangeRequestField.ID));
DnsBatchResult<ChangeRequest> statusResult =
batch.getChangeRequest(
zone.getName(),
created.getGeneratedId(),
Dns.ChangeRequestOption.fields(ChangeRequestField.STATUS));
DnsBatchResult<ChangeRequest> timeResult =
batch.getChangeRequest(
zone.getName(),
created.getGeneratedId(),
Dns.ChangeRequestOption.fields(ChangeRequestField.START_TIME));
DnsBatchResult<ChangeRequest> additionsResult =
batch.getChangeRequest(
zone.getName(),
created.getGeneratedId(),
Dns.ChangeRequestOption.fields(ChangeRequestField.ADDITIONS));
DnsBatchResult<ChangeRequest> deletionsResult =
batch.getChangeRequest(
代码示例来源:origin: googleapis/google-cloud-java
ChangeRequestInfo deletion = ChangeRequest.newBuilder().delete(validA).build();
ChangeRequest request = zone.applyChangeRequest(deletion);
waitForChangeToComplete(zone.getName(), request.getGeneratedId());
我有一个 Cloud Run 服务,它通过 SQLAlchemy 访问 Cloud SQL 实例.但是,在 Cloud Run 的日志中,我看到 CloudSQL connection failed.
关闭。这个问题是opinion-based .它目前不接受答案。 想改善这个问题吗?更新问题,以便可以通过 editing this post 用事实和引文回答问题. 4年前关闭。 Improve t
在将 docker 容器镜像部署到 Cloud Run 时,我可以选择一个区域,这很好。 Cloud Run 将构建委托(delegate)给 Cloud Build,后者显然会创建两个存储桶来实现这
我正在尝试将 Cloud Functions 用作由 PubSub 触发的异步后台工作程序,并进行更长时间的工作(以分钟为单位)。完整代码在这里https://github.com/zdenulo/c
这是/etc/cloud/cloud.cfg的内容Ubuntu云16.04镜像: # The top level settings are used as module # and system co
如何从 Google Cloud Function 启动 Cloud Dataflow 作业?我想使用 Google Cloud Functions 作为启用跨服务组合的机制。 最佳答案 我已经包含了
我想使用 Cloud Shell 在我的第二代 Cloud Sql 实例上运行数据库迁移。 我找到了一个 example in the docs关于如何使用 gcloud 进行连接.但是当我运行命令时
我正在尝试使用 Google Cloud PubSub和我的 Google Cloud Dataproc群集,我收到如下身份验证范围错误: { "code" : 403, "errors" :
这是我的用例。 我已经有一个以私有(private)模式部署的 Cloud Run 服务。 (与云功能相同的问题) 我正在开发使用此 Cloud Run 的新服务。我在应用程序中使用默认凭据进行身份验
如何连接到 Cloud SQL 上的数据库,而无需在容器中添加我的凭据文件? 最佳答案 使用 UNIX 域套接字 (Java) 从云运行(完全托管)连接到云 SQL At this time Clou
我有一个google-cloud-ml作业,需要从gs存储桶加载numpy .npz文件。我遵循了this example上关于如何从gs加载.npy文件的操作,但是由于.npz文件已压缩,因此它对我
我想创建链接到另一个项目中的 Cloud Source Repository 的 Cloud Build 触发器。但是当我在应该选择存储库的步骤中时,列表是空的。我尝试了不同的许可,但没有运气。谁能告
向 Twilio 发送 SMS 时,Twilio 会向指定的 URL 发送多个请求,以通过 Webhook 提供该 SMS 传送的状态。我想让这个回调异步,所以我开发了一个 Cloud Functio
我需要更改我的项目 ID,因为要验证的 Firebase 身份验证链接在链接上显示了项目 ID,并且由于品牌 reshape ,项目名称已更改。根据我发现的信息,更改项目 ID 似乎不太可能。我正在考
用于部署我的 Angular 应用程序的 CI/CD 管道已关闭,但我看到 Google Cloud Run 在容器镜像更新后没有部署新修订版。 我已将 Cloud Build 设置为在 GitHub
报价https://cloud.google.com/load-balancing/docs/https/setting-up-https-serverless#enabling While Goog
Cloud Spanner 提供了两种不同的 API。 Cloud Spanner 读取与 Cloud Spanner SQL API 之间有什么区别? 最佳答案 在幕后,它们都使用相同的执行机制,因
我是 GCP 堆栈的新手,所以我对用于存储数据的 GCP 技术数量感到非常困惑: https://cloud.google.com/products/storage 虽然上面的文章中没有提到googl
我发现 Google Cloud Functions 的网络出站费用令人惊讶,我正在尝试了解发生这种情况的原因以及如何避免这种情况。 Stackdriver 监控表明有问题的函数是我的 ingest
我使用 Prisma使用 Cloud Run 和 Cloud SQL。在向 prisma.schema 提供 DATABASE_URL 后,它会在运行时抛出一个错误。 Can't reach data
我是一名优秀的程序员,十分优秀!