Examples of root()


Examples of org.openstack.client.common.OpenstackComputeClient.root()

        createTemplate.setDescription("Security group for instance: " + serverName);
        try {
          log.info("Creating security group: " + createTemplate.getName());
          createdSecurityGroup = computeClient.root().securityGroups().create(createTemplate);
        } catch (OpenstackException e) {
          for (SecurityGroup candidate : computeClient.root().securityGroups().list()) {
            if (Objects.equal(candidate.getName(), createTemplate.getName())) {
              createdSecurityGroup = candidate;
              break;
            }
          }
View Full Code Here

Examples of org.openstack.client.common.OpenstackComputeClient.root()

          newRule.setIpProtocol("tcp");
          newRule.setParentGroupId(createdSecurityGroup.getId());

          try {
            log.info("Creating security group rule for port: " + newRule.getToPort());
            SecurityGroupRule createdRule = computeClient.root().securityGroupRules().create(newRule);
          } catch (OpenstackException e) {
            String message = e.getMessage();
            if (message != null && message.contains("This rule already exists")) {
              log.warn("Ignoring 'rule already exists': " + e.getMessage());
            } else {
View Full Code Here

Examples of org.openstack.client.common.OpenstackComputeClient.root()

          metadata.getItems().add(meta);
        }

        newServerInfo.setMetadata(metadata);
        log.info("Tagging server: " + server.getId());
        computeClient.root().servers().server(server.getId()).update(newServerInfo);
      }

      return server;
    } catch (InterruptedException e) {
      ExceptionUtils.handleInterrupted(e);
View Full Code Here

Examples of org.openstack.client.common.OpenstackComputeClient.root()

    }

    final OpenstackComputeClient compute = getComputeClient(cloud);

    log.info("Creating floating IP");
    FloatingIp floatingIp = compute.root().floatingIps().create();

    // TODO: Don't abandon the IP e.g. if the attach fails
    log.info("Attching floating IP " + floatingIp.getIp() + " to " + server.getId());
    compute.root().servers().server(server.getId()).addFloatingIp(floatingIp.getIp());
View Full Code Here

Examples of org.openstack.client.common.OpenstackComputeClient.root()

    log.info("Creating floating IP");
    FloatingIp floatingIp = compute.root().floatingIps().create();

    // TODO: Don't abandon the IP e.g. if the attach fails
    log.info("Attching floating IP " + floatingIp.getIp() + " to " + server.getId());
    compute.root().servers().server(server.getId()).addFloatingIp(floatingIp.getIp());

    final String serverId = server.getId();

    try {
      server = TimeoutPoll.poll(TimeSpan.FIVE_MINUTES, TimeSpan.TEN_SECONDS, new PollFunction<Server>() {
View Full Code Here

Examples of org.openstack.client.common.OpenstackComputeClient.root()

    try {
      server = TimeoutPoll.poll(TimeSpan.FIVE_MINUTES, TimeSpan.TEN_SECONDS, new PollFunction<Server>() {
        @Override
        public Server call() throws Exception {
          log.info("Waiting for floating IP attach; polling server: " + serverId);
          Server server = compute.root().servers().server(serverId).show();

          List<Ip> publicIps = helpers.findPublicIps(cloud, server);
          if (publicIps.isEmpty()) {
            return null;
          }
View Full Code Here

Examples of org.openstack.client.common.OpenstackComputeClient.root()

    if (cloudBehaviours.supportsSecurityGroups()) {
      Server server = machine.getServer();
      SecurityGroup securityGroup = openstackHelpers.getMachineSecurityGroup(openstackComputeClient, server);

      securityGroup = openstackComputeClient.root().securityGroups().securityGroup(securityGroup.getId()).show();

      SecurityGroupRule matchingRule = findMatchingRule(securityGroup);

      if (OpsContext.isConfigure()) {
        if (matchingRule == null) {
View Full Code Here

Examples of org.openstack.client.common.OpenstackComputeClient.root()

          rule.setIpProtocol("tcp");
          rule.setFromPort(model.publicPort);
          rule.setToPort(model.publicPort);
          rule.setParentGroupId(securityGroup.getId());

          openstackComputeClient.root().securityGroupRules().create(rule);
        }
      }

      if (OpsContext.isDelete()) {
        if (matchingRule != null) {
View Full Code Here

Examples of org.openstack.client.common.OpenstackComputeClient.root()

        }
      }

      if (OpsContext.isDelete()) {
        if (matchingRule != null) {
          openstackComputeClient.root().securityGroupRules().securityGroupRule(matchingRule.id).delete();
        }
      }
    }
  }
View Full Code Here

Examples of org.openstack.client.common.OpenstackComputeClient.root()

    // Is it safe to assume that everyone has the same capabilities on a cloud??
    CachedInfo info = cachedInfo.get(cloud.endpoint);
    if (info == null) {
      OpenstackCloudHelpers helpers = new OpenstackCloudHelpers();
      OpenstackComputeClient compute = helpers.buildOpenstackComputeClient(cloud);
      List<Extension> extensions = Lists.newArrayList(compute.root().extensions().list());
      info = new CachedInfo(extensions);
      cachedInfo.put(cloud.endpoint, info);
    }
    return info;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.