Package com.elastisys.scale.cloudadapters.commons.adapter.scalinggroup

Examples of com.elastisys.scale.cloudadapters.commons.adapter.scalinggroup.ScalingGroupException


      ScalingGroupException {
    List<Flavor> flavors;
    try {
      flavors = new ListSizesRequest(getAccount()).call();
    } catch (Exception e) {
      throw new ScalingGroupException(String.format(
          "failed to fetch the list of available flavors: %s",
          e.getMessage()), e);
    }
    for (Flavor flavor : flavors) {
      if (flavor.getName().equals(this.flavorName)) {
View Full Code Here


      ScalingGroupException {
    List<Image> images;
    try {
      images = new ListImagesRequest(getAccount()).call();
    } catch (Exception e) {
      throw new ScalingGroupException(String.format(
          "failed to fetch the list of available images: %s",
          e.getMessage()), e);
    }
    for (Image image : images) {
      if (image.getName().equals(this.imageName)) {
View Full Code Here

  @Override
  public Void doRequest(NovaApi api) {
    ServerApi serverApi = api.getServerApiForZone(getAccount().getRegion());
    Server server = serverApi.get(this.server.getId());
    if (server == null) {
      throw new ScalingGroupException(format(
          "failed to update meta data on server '%s': "
              + "server not found", this.server.getName()));
    }
    // set tags
    Map<String, String> tags = new HashMap<>(server.getMetadata());
View Full Code Here

    Server victimServer = serverApi.get(this.victimId);
    if (victimServer != null) {
      releaseFloatingIps(api, getAccount().getRegion(), victimServer);
      boolean wasDeleted = serverApi.delete(this.victimId);
      if (!wasDeleted) {
        throw new ScalingGroupException(
            "failed to delete victim server " + this.victimId);
      }

      try {
        awaitTermination(victimServer.getId());
      } catch (Exception e) {
        throw new ScalingGroupException(String.format(
            "timed out waiting for server %s to be terminated",
            e.getMessage()), e);
      }
      return null;
    }
View Full Code Here

      this.config.set(config);
      this.scalingGroupName.set(scalingGroupConfig.getName());
      this.client.configure(config);
    } catch (Exception e) {
      Throwables.propagateIfInstanceOf(e, ScalingGroupException.class);
      throw new ScalingGroupException(String.format(
          "failed to apply configuration: %s", e.getMessage()), e);
    }
  }
View Full Code Here

    try {
      List<Server> servers = this.client.getServers(
          Constants.SCALING_GROUP_TAG, getScalingGroupName());
      return transform(servers, new ServerToMachine());
    } catch (Exception e) {
      throw new ScalingGroupException(format(
          "failed to retrieve machines in scaling group \"%s\": %s",
          this.scalingGroupName, e.getMessage()), e);
    }
  }
View Full Code Here

      this.client.terminateServer(machineId);
    } catch (Exception e) {
      Throwables.propagateIfInstanceOf(e, ScalingGroupException.class);
      String message = format("failed to terminate server \"%s\": %s",
          machineId, e.getMessage());
      throw new ScalingGroupException(message, e);
    }
  }
View Full Code Here

      checkNotNull(this.tenantName, "missing tenantName");
      checkNotNull(this.userName, "missing userName");
      checkNotNull(this.password, "missing password");
    } catch (Exception e) {
      // no need to wrap further if already a config exception
      throw new ScalingGroupException(format(
          "failed to validate cloud client configuration: %s",
          e.getMessage()), e);
    }
  }
View Full Code Here

      config.validate();
      this.config.set(config);
      this.scalingGroupName.set(scalingGroupConfig.getName());
      this.client.configure(config);
    } catch (Exception e) {
      throw new ScalingGroupException(format(
          "failed to apply configuration: %s", e.getMessage()), e);
    }
  }
View Full Code Here

          Constants.SCALING_GROUP_TAG_FILTER_KEY).withValues(
          getScalingGroupName());
      List<Instance> instances = this.client.getInstances(asList(filter));
      return Lists.transform(instances, new InstanceToMachine());
    } catch (Exception e) {
      throw new ScalingGroupException(format(
          "failed to retrieve machines in scaling group \"%s\": %s",
          getScalingGroupName(), e.getMessage()), e);
    }
  }
View Full Code Here

TOP

Related Classes of com.elastisys.scale.cloudadapters.commons.adapter.scalinggroup.ScalingGroupException

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.