Package com.abiquo.server.core.enterprise

Examples of com.abiquo.server.core.enterprise.DatacenterLimitsDto


    *      "http://community.abiquo.com/display/ABI20/Enterprise+Resource#EnterpriseResource-Getthelistofexternalnetworks"
    *      > http://community.abiquo.com/display/ABI20/Enterprise+Resource#
    *      EnterpriseResource- Getthelistofexternalnetworks</a>
    */
   public List<ExternalNetwork> listExternalNetworks(final Datacenter datacenter) {
      DatacenterLimitsDto limitForDatacenter = getLimits(datacenter);

      HttpResponse response = context.getApi().get(limitForDatacenter.searchLink("externalnetworks"));

      ParseXMLWithJAXB<VLANNetworksDto> parser = new ParseXMLWithJAXB<VLANNetworksDto>(context.utils().xml(),
            TypeLiteral.get(VLANNetworksDto.class));

      return wrap(context, ExternalNetwork.class, parser.apply(response).getCollection());
View Full Code Here


   public ExternalNetwork findExternalNetwork(final Datacenter datacenter, final Predicate<Network<ExternalIp>> filter) {
      return Iterables.getFirst(filter(listExternalNetworks(datacenter), filter), null);
   }

   public List<UnmanagedNetwork> listUnmanagedNetworks(final Datacenter datacenter) {
      DatacenterLimitsDto limitForDatacenter = getLimits(datacenter);

      // The "rel" for the unmanaged networks is the same than the one used for
      // external networks
      HttpResponse response = context.getApi().get(limitForDatacenter.searchLink("externalnetworks"));

      ParseXMLWithJAXB<VLANNetworksDto> parser = new ParseXMLWithJAXB<VLANNetworksDto>(context.utils().xml(),
            TypeLiteral.get(VLANNetworksDto.class));

      return wrap(context, UnmanagedNetwork.class, parser.apply(response).getCollection());
View Full Code Here

    *      Resource#
    *      DatacenterLimitsResource-CreateanewLimitforanenterpriseinadatacenter
    *      </a>
    */
   public Limits allowDatacenter(final Datacenter datacenter) {
      DatacenterLimitsDto dto;

      try {
         // Create new limits
         Limits limits = Limits.builder(context).build();

View Full Code Here

         this.repositoryHard = hard;
         return this;
      }

      public Limits build() {
         DatacenterLimitsDto dto = new DatacenterLimitsDto();
         dto.setRamLimitsInMb(ramSoftLimitInMb, ramHardLimitInMb);
         dto.setCpuCountLimits(cpuCountSoftLimit, cpuCountHardLimit);
         dto.setHdLimitsInMb(hdSoftLimitInMb, hdHardLimitInMb);
         dto.setStorageLimits(storageSoft, storageHard);
         dto.setVlansLimits(vlansSoft, vlansHard);
         dto.setPublicIPLimits(publicIpsSoft, publicIpsHard);
         dto.setRepositoryHardLimitsInMb(repositoryHard);
         dto.setRepositorySoftLimitsInMb(repositorySoft);

         Limits limits = new Limits(context, dto);

         return limits;
      }
View Full Code Here

    *      "http://community.abiquo.com/display/ABI20/Enterprise+Resource#EnterpriseResource-Getthelistofexternalnetworks"
    *      > http://community.abiquo.com/display/ABI20/Enterprise+Resource#
    *      EnterpriseResource- Getthelistofexternalnetworks</a>
    */
   public Iterable<ExternalNetwork> listExternalNetworks(final Datacenter datacenter) {
      DatacenterLimitsDto limitForDatacenter = getLimits(datacenter);

      HttpResponse response = context.getApi().get(limitForDatacenter.searchLink("externalnetworks"));

      ParseXMLWithJAXB<VLANNetworksDto> parser = new ParseXMLWithJAXB<VLANNetworksDto>(context.utils().xml(),
            TypeLiteral.get(VLANNetworksDto.class));

      return wrap(context, ExternalNetwork.class, parser.apply(response).getCollection());
View Full Code Here

      return wrap(context, ExternalNetwork.class, parser.apply(response).getCollection());
   }

   public Iterable<UnmanagedNetwork> listUnmanagedNetworks(final Datacenter datacenter) {
      DatacenterLimitsDto limitForDatacenter = getLimits(datacenter);

      // The "rel" for the unmanaged networks is the same than the one used for
      // external networks
      HttpResponse response = context.getApi().get(limitForDatacenter.searchLink("externalnetworks"));

      ParseXMLWithJAXB<VLANNetworksDto> parser = new ParseXMLWithJAXB<VLANNetworksDto>(context.utils().xml(),
            TypeLiteral.get(VLANNetworksDto.class));

      return wrap(context, UnmanagedNetwork.class, parser.apply(response).getCollection());
View Full Code Here

    *      Resource#
    *      DatacenterLimitsResource-CreateanewLimitforanenterpriseinadatacenter
    *      </a>
    */
   public Limits allowDatacenter(final Datacenter datacenter) {
      DatacenterLimitsDto dto;

      try {
         // Create new limits
         Limits limits = Limits.builder(context, datacenter).build();

View Full Code Here

         this.repositoryHard = hard;
         return this;
      }

      public Limits build() {
         DatacenterLimitsDto dto = new DatacenterLimitsDto();
         dto.setRamLimitsInMb(ramSoftLimitInMb, ramHardLimitInMb);
         dto.setCpuCountLimits(cpuCountSoftLimit, cpuCountHardLimit);
         dto.setHdLimitsInMb(hdSoftLimitInMb, hdHardLimitInMb);
         dto.setStorageLimits(storageSoft, storageHard);
         dto.setVlansLimits(vlansSoft, vlansHard);
         dto.setPublicIPLimits(publicIpsSoft, publicIpsHard);
         dto.setRepositoryHardLimitsInMb(repositoryHard);
         dto.setRepositorySoftLimitsInMb(repositorySoft);

         // Establish the relation with the physical datacenter
         dto.addLink(new RESTLink(ParentLinkName.DATACENTER, checkNotNull(datacenter.unwrap().getEditLink(),
                 "missing edit link").getHref()));

         Limits limits = new Limits(context, dto);

         return limits;
View Full Code Here

      limits.setRepositorySoftLimitsInMb(0);
      return limits;
   }

   public static DatacenterLimitsDto datacenterLimitsPut(final EnterpriseDto enterprise) {
      DatacenterLimitsDto limits = datacenterLimitsPost();
      limits.setId(1);
      limits.addLink(new RESTLink("edit", "http://localhost/api/admin/enterprises/" + enterprise.getId() + "/limits/1"));
      return limits;
   }
View Full Code Here

      buffer.append("</role>");
      return buffer.toString();
   }

   public static DatacenterLimitsDto datacenterLimitsPost() {
      DatacenterLimitsDto limits = new DatacenterLimitsDto();
      limits.setCpuCountLimits(0, 0);
      limits.setHdLimitsInMb(0, 0);
      limits.setPublicIPLimits(0, 0);
      limits.setRamLimitsInMb(0, 0);
      limits.setStorageLimits(0, 0);
      limits.setVlansLimits(0, 0);
      limits.setRepositoryHardLimitsInMb(0);
      limits.setRepositorySoftLimitsInMb(0);
      return limits;
   }
View Full Code Here

TOP

Related Classes of com.abiquo.server.core.enterprise.DatacenterLimitsDto

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.