Package com.abiquo.server.core.infrastructure.network

Examples of com.abiquo.server.core.infrastructure.network.VLANNetworkDto


                  .payload(
                        payloadFromResourceWithContentType("/payloads/publicips-lastpage.xml",
                              normalize(PublicIpsDto.MEDIA_TYPE))) //
                  .build());

      VLANNetworkDto vlan = new VLANNetworkDto();
      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/datacenters/1/network/1/ips"));

      IpOptions options = IpOptions.builder().startWith(3).build();
      PaginatedCollection<PublicIpDto, PublicIpsDto> ips = api.listPublicIps(vlan, options);

      assertEquals(ips.size(), 2);
View Full Code Here


                  .payload(
                        payloadFromResourceWithContentType("/payloads/externalips-lastpage.xml",
                              normalize(ExternalIpsDto.MEDIA_TYPE))) //
                  .build());

      VLANNetworkDto vlan = new VLANNetworkDto();
      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips"));

      PagedIterable<ExternalIpDto> publicIps = api.listExternalIps(vlan);
      List<ExternalIpDto> ips = publicIps.concat().toList();

      assertEquals(ips.size(), 4);
View Full Code Here

                  .payload(
                        payloadFromResourceWithContentType("/payloads/externalips-lastpage.xml",
                              normalize(ExternalIpsDto.MEDIA_TYPE))) //
                  .build());

      VLANNetworkDto vlan = new VLANNetworkDto();
      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips"));

      IpOptions options = IpOptions.builder().startWith(3).build();
      PaginatedCollection<ExternalIpDto, ExternalIpsDto> ips = api.listExternalIps(vlan, options);

      assertEquals(ips.size(), 2);
View Full Code Here

                  .payload(
                        payloadFromResourceWithContentType("/payloads/unmanagedips-lastpage.xml",
                              normalize(UnmanagedIpsDto.MEDIA_TYPE))) //
                  .build());

      VLANNetworkDto vlan = new VLANNetworkDto();
      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips"));

      PagedIterable<UnmanagedIpDto> unmanagedIps = api.listUnmanagedIps(vlan);
      List<UnmanagedIpDto> ips = unmanagedIps.concat().toList();

      assertEquals(ips.size(), 4);
View Full Code Here

                  .payload(
                        payloadFromResourceWithContentType("/payloads/unmanagedips-lastpage.xml",
                              normalize(UnmanagedIpsDto.MEDIA_TYPE))) //
                  .build());

      VLANNetworkDto vlan = new VLANNetworkDto();
      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips"));

      IpOptions options = IpOptions.builder().startWith(3).build();
      PaginatedCollection<UnmanagedIpDto, UnmanagedIpsDto> ips = api.listUnmanagedIps(vlan, options);

      assertEquals(ips.size(), 2);
View Full Code Here

   public void testSetGatewayNetwork() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(CloudApi.class, "setGatewayNetwork", VirtualMachineDto.class,
            VLANNetworkDto.class);

      VirtualMachineDto vm = CloudResources.virtualMachinePut();
      VLANNetworkDto network = NetworkResources.privateNetworkPut();

      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(vm, network)));

      String configLink = vm.searchLink("configurations").getHref() + "/" + network.getId();

      assertRequestLineEquals(
            request,
            "PUT http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/configurations HTTP/1.1");
      assertNonPayloadHeadersEqual(request, "");
View Full Code Here

                  .payload(
                        payloadFromResourceWithContentType("/payloads/privateips-lastpage.xml",
                              normalize(PrivateIpsDto.MEDIA_TYPE))) //
                  .build());

      VLANNetworkDto vlan = new VLANNetworkDto();
      vlan.addLink(new RESTLink("ips", "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips"));

      PagedIterable<PrivateIpDto> privateIps = api.listPrivateNetworkIps(vlan);
      List<PrivateIpDto> ips = privateIps.concat().toList();

      assertEquals(ips.size(), 2);
View Full Code Here

                  .payload(
                        payloadFromResourceWithContentType("/payloads/privateips-lastpage.xml",
                              normalize(PrivateIpsDto.MEDIA_TYPE))) //
                  .build());

      VLANNetworkDto vlan = new VLANNetworkDto();
      vlan.addLink(new RESTLink("ips", "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips"));

      IpOptions options = IpOptions.builder().startWith(1).build();
      PaginatedCollection<PrivateIpDto, PrivateIpsDto> ips = api.listPrivateNetworkIps(vlan, options);

      assertEquals(ips.size(), 1);
View Full Code Here

         this.networkServiceType = Optional.of(networkServiceType);
         return this;
      }

      public UnmanagedNetwork build() {
         VLANNetworkDto dto = new VLANNetworkDto();
         dto.setName(name);
         dto.setTag(tag);
         dto.setGateway(gateway);
         dto.setAddress(address);
         dto.setMask(mask);
         dto.setPrimaryDNS(primaryDNS);
         dto.setSecondaryDNS(secondaryDNS);
         dto.setSufixDNS(suffixDNS);
         dto.setDefaultNetwork(defaultNetwork);
         dto.setUnmanaged(true);
         dto.setType(NetworkType.UNMANAGED);

         NetworkServiceType nst = networkServiceType.or(datacenter.defaultNetworkServiceType());
         dto.getLinks().add(new RESTLink("networkservicetype", nst.unwrap().getEditLink().getHref()));

         UnmanagedNetwork network = new UnmanagedNetwork(context, dto);
         network.datacenter = datacenter;
         network.enterprise = enterprise;
View Full Code Here

      checkArgument(checkNotNull(input, "input") instanceof VLANNetworkDto,
            "this binder is only valid for VLANNetworkDto");
      GeneratedHttpRequest gRequest = (GeneratedHttpRequest) request;
      checkState(gRequest.getInvocation().getArgs() != null, "args should be initialized at this point");

      VLANNetworkDto network = (VLANNetworkDto) input;
      VirtualMachineDto vm = (VirtualMachineDto) Iterables.find(gRequest.getInvocation().getArgs(),
            Predicates.instanceOf(VirtualMachineDto.class));

      RESTLink configLink = checkNotNull(vm.searchLink("configurations"), "missing required link");

      LinksDto dto = new LinksDto();
      dto.addLink(new RESTLink("network_configuration", configLink.getHref() + "/" + network.getId()));

      return super.bindToRequest(request, dto);
   }
View Full Code Here

TOP

Related Classes of com.abiquo.server.core.infrastructure.network.VLANNetworkDto

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.