gpt4 book ai didi

org.jclouds.cloudstack.domain.Zone.builder()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 06:57:31 26 4
gpt4 key购买 nike

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

Zone.builder介绍

暂无

代码示例

代码示例来源:origin: jclouds/legacy-jclouds

@Test
public void testSupportsSecurityGroups() {
 assertTrue(supportsSecurityGroups().apply(
   Zone.builder().id("43").securityGroupsEnabled(true).build()
 ));
 assertFalse(supportsSecurityGroups().apply(
   Zone.builder().id("44").securityGroupsEnabled(false).build()
 ));
}

代码示例来源:origin: jclouds/legacy-jclouds

@Test
public void testSupportsAdvancedNetworks() {
 assertTrue(supportsAdvancedNetworks().apply(
   Zone.builder().id("41").networkType(NetworkType.ADVANCED).build()
 ));
 assertFalse(supportsAdvancedNetworks().apply(
   Zone.builder().id("42").networkType(NetworkType.BASIC).build()
 ));
}

代码示例来源:origin: apache/jclouds

@Test
public void testSupportsAdvancedNetworks() {
 assertTrue(supportsAdvancedNetworks().apply(
   Zone.builder().id("41").networkType(NetworkType.ADVANCED).build()
 ));
 assertFalse(supportsAdvancedNetworks().apply(
   Zone.builder().id("42").networkType(NetworkType.BASIC).build()
 ));
}

代码示例来源:origin: apache/jclouds

@Test
public void testSupportsSecurityGroups() {
 assertTrue(supportsSecurityGroups().apply(
   Zone.builder().id("43").securityGroupsEnabled(true).build()
 ));
 assertFalse(supportsSecurityGroups().apply(
   Zone.builder().id("44").securityGroupsEnabled(false).build()
 ));
}

代码示例来源:origin: jclouds/legacy-jclouds

@Override
  @SelectJson("zone")
  public Set<Zone> expected() {
   return ImmutableSet.of(Zone.builder().id("1").name("San Jose 1").networkType(NetworkType.ADVANCED)
      .securityGroupsEnabled(false).build(),
      Zone.builder().id("2").name("Chicago").networkType(NetworkType.ADVANCED).securityGroupsEnabled(true).build());
  }
}

代码示例来源:origin: jclouds/legacy-jclouds

public void testUpdateZoneWhenResponseIs2xxAnd404() {
 HttpRequest request = HttpRequest.builder()
   .method("GET")
   .endpoint(
    URI.create("http://localhost:8080/client/api?response=json&command=updateZone&" +
      "id=6&name=test-zone&dns1=8.8.8.8&apiKey=identity&signature=v19FdHKHztdT0IRloYFFn0eNbWM%3D"))
   .headers(
    ImmutableMultimap.<String, String>builder()
      .put("Accept", "application/json")
      .build())
   .build();
 GlobalZoneClient client = requestSendsResponse(request,
   HttpResponse.builder()
    .statusCode(200)
    .payload(payloadFromResource("/updatezoneresponse.json"))
    .build());
 assertEquals(client.updateZone("6", name("test-zone").externalDns(ImmutableList.of("8.8.8.8"))),
   Zone.builder()
    .id("6")
    .name("test-zone")
    .DNS(ImmutableList.of("8.8.8.8"))
    .internalDNS(ImmutableList.of("10.10.10.10"))
    .networkType(NetworkType.BASIC)
    .securityGroupsEnabled(true)
    .allocationState(AllocationState.ENABLED)
    .zoneToken("7b6e27df-30a6-3024-9d8b-7971a3127f64")
    .dhcpProvider("DhcpServer").build());
 client = requestSendsResponse(request, HttpResponse.builder().statusCode(404).build());
 assertNull(client.updateZone("6", name("test-zone").externalDns(ImmutableList.of("8.8.8.8"))));
}

代码示例来源:origin: jclouds/legacy-jclouds

public void testCreateZoneWhenResponseIs2xxAnd404() {
 GlobalZoneClient client = requestSendsResponse(createZone,
   HttpResponse.builder()
    .statusCode(200)
    .payload(payloadFromResource("/createzoneresponse.json"))
    .build());
 assertEquals(client.createZone("test-zone", NetworkType.BASIC, "8.8.8.8", "10.10.10.10"),
   Zone.builder()
    .id("6")
    .name("test-zone")
    .DNS(ImmutableList.of("8.8.8.8"))
    .internalDNS(ImmutableList.of("10.10.10.10"))
    .networkType(NetworkType.BASIC)
    .securityGroupsEnabled(true)
    .allocationState(AllocationState.ENABLED)
    .zoneToken("7b6e27df-30a6-3024-9d8b-7971a3127f64")
    .dhcpProvider("DhcpServer").build());
 client = requestSendsResponse(createZone, HttpResponse.builder().statusCode(404).build());
 assertNull(client.createZone("test-zone", NetworkType.BASIC, "8.8.8.8", "10.10.10.10"));
}

代码示例来源:origin: jclouds/legacy-jclouds

public void testListZonesWhenResponseIs2xx() {
 ZoneClient client = requestSendsResponse(
   HttpRequest.builder().method("GET")
        .endpoint("http://localhost:8080/client/api")
        .addQueryParam("response", "json")
        .addQueryParam("command", "listZones")
        .addQueryParam("listAll", "true")
        .addQueryParam("apiKey", "identity")
        .addQueryParam("signature", "8iHCtck0qfxFTqJ8reyAObRf31I%3D")
        .addHeader("Accept", "application/json")
        .build(),
   HttpResponse.builder()
         .statusCode(200)
         .payload(payloadFromResource("/listzonesresponse.json"))
         .build());
 assertEquals(client.listZones(),
   ImmutableSet.of(
    Zone.builder()
      .id("1")
      .name("San Jose 1")
      .networkType(NetworkType.ADVANCED)
      .securityGroupsEnabled(false).build(),
    Zone.builder()
      .id("2")
      .name("Chicago")
      .networkType(NetworkType.ADVANCED)
      .securityGroupsEnabled(true).build()));
}

代码示例来源:origin: apache/jclouds

public void testCreateZoneWhenResponseIs2xxAnd404() {
 GlobalZoneApi client = requestSendsResponse(createZone,
   HttpResponse.builder()
    .statusCode(200)
    .payload(payloadFromResource("/createzoneresponse.json"))
    .build());
 assertEquals(client.createZone("test-zone", NetworkType.BASIC, "8.8.8.8", "10.10.10.10"),
   Zone.builder()
    .id("6")
    .name("test-zone")
    .DNS(ImmutableList.of("8.8.8.8"))
    .internalDNS(ImmutableList.of("10.10.10.10"))
    .networkType(NetworkType.BASIC)
    .securityGroupsEnabled(true)
    .allocationState(AllocationState.ENABLED)
    .zoneToken("7b6e27df-30a6-3024-9d8b-7971a3127f64")
    .dhcpProvider("DhcpServer").build());
 client = requestSendsResponse(createZone, HttpResponse.builder().statusCode(404).build());
 assertNull(client.createZone("test-zone", NetworkType.BASIC, "8.8.8.8", "10.10.10.10"));
}

代码示例来源:origin: apache/jclouds

Zone.builder()
 .id("6")
 .name("test-zone")

代码示例来源:origin: apache/jclouds

@Override
  @SelectJson("zone")
  public Set<Zone> expected() {
   return          ImmutableSet.of(
      Zone.builder()
         .id("1")
         .name("San Jose 1")
         .networkType(NetworkType.ADVANCED)
         .securityGroupsEnabled(false).build(),
      Zone.builder()
         .id("2")
         .name("Chicago")
         .networkType(NetworkType.ADVANCED)
         .securityGroupsEnabled(true)
         .tags(Tag.builder()
            .account("1")
            .domain("ROOT")
            .domainId("1")
            .key("some-tag")
            .resourceId("2")
            .resourceType(Tag.ResourceType.ZONE)
            .value("some-value")
            .build())
         .build());
  }
}

代码示例来源:origin: apache/jclouds

Zone.builder()
  .id("1")
  .name("San Jose 1")
  .networkType(NetworkType.ADVANCED)
  .securityGroupsEnabled(false).build(),
Zone.builder()
   .id("2")
   .name("Chicago")

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