Package org.platformlayer.core.model

Examples of org.platformlayer.core.model.Tag


        String serverName = buildServerName();

        Server created = openstack.createInstance(cloud, serverName, request);

        {
          Tag instanceTag = Tag.build(Tag.ASSIGNED, created.getId());
          platformLayer.addTag(instance.getKey(), instanceTag);
        }

        assignedInstanceIds.add(created.getId());
      }
View Full Code Here


  @Inject
  DirectCloudUtils directHelpers;

  @Handler
  public void doOperation() throws OpsException, IOException {
    Tag tag = Tag.build(Tag.ASSIGNED, instance.getKey().getUrl());
    List<DirectHost> hosts = Lists.newArrayList(platformLayer.listItems(DirectHost.class, TagFilter.byTag(tag)));

    if (hosts.size() > 1) {
      // Huh?
      throw new OpsException("Multiple hosts already assigned");
View Full Code Here

    ZookeeperCluster cluster;
    String clusterId;

    @Override
    protected ZookeeperServer buildItemTemplate() throws OpsException {
      Tag parentTag = Tag.buildParentTag(cluster.getKey());

      ZookeeperServer server = new ZookeeperServer();

      server.clusterDnsName = cluster.dnsName;
      server.clusterId = clusterId;

      Tag uniqueTag = UniqueTag.build(cluster, clusterId);
      server.getTags().add(uniqueTag);
      server.getTags().add(parentTag);

      server.key = PlatformLayerKey.fromId(cluster.getId() + "-" + clusterId);
View Full Code Here

    networkConnection.setDestItem(nginxBackend.backend);
    networkConnection.setSourceItem(nginxService.getKey());
    networkConnection.setPort(port);
    networkConnection.setProtocol(protocol.toString());

    Tag parentTag = Tag.buildParentTag(nginxBackend.getKey());
    networkConnection.getTags().add(parentTag);
    Tag uniqueTag = UniqueTag.build(nginxService, nginxBackend);
    networkConnection.getTags().add(uniqueTag);

    String id = nginxBackend.getId();
    if (Strings.isNullOrEmpty(id)) {
      id = "nginx";
View Full Code Here

    if (transport != null) {
      publicEndpoint.transport = transport.toString();
    }
    // publicEndpoint.getTags().add(OpsSystem.get().createParentTag(instance));

    Tag uniqueTag = UniqueTag.build(instance, String.valueOf(publicPort));
    publicEndpoint.getTags().add(uniqueTag);

    return publicEndpoint;
  }
View Full Code Here

    DnsRecord record = new DnsRecord();
    record.setDnsName(nginxFrontend.hostname);
    record.getAddress().add(address);

    Tag parentTag = Tag.buildParentTag(nginxFrontend.getKey());
    record.getTags().add(parentTag);
    Tag uniqueTag = UniqueTag.build(nginxService, nginxFrontend);
    record.getTags().add(uniqueTag);

    record.key = PlatformLayerKey.fromId(nginxFrontend.hostname);

    return record;
View Full Code Here

  @Handler
  public void handler(PersistentInstance model) throws OpsException {
    Machine machine = null;

    Tag tagForInstance = Tag.buildParentTag(model.getKey());
    // boolean instanceIsTagged = false;

    // See if we have an instance id tag
    {
      // String instanceKey = model.getTags().findUnique(Tag.INSTANCE_KEY);
View Full Code Here

    if (uuid != null) {
      return uuid;
    }

    uuid = UUID.randomUUID();
    Tag uuidTag = Tag.UUID.build(uuid);
    tags.add(uuidTag);
    this.addTag(model.getKey(), uuidTag);
    return uuid;
  }
View Full Code Here

    // CloudImage image = imageStore.findImage(Lists.newArrayList(formatTag, BOOTSTRAP_IMAGE_TAG));
    // if (image != null) {
    // return image;
    // }

    Tag osDebian = Tag.build(Tag.IMAGE_OS_DISTRIBUTION, "debian.org");
    Tag osSqueeze = Tag.build(Tag.IMAGE_OS_VERSION, "6.0.4");

    Tag diskFormatTag;
    switch (format) {
    case DiskQcow2:
      diskFormatTag = format.toTag();
      break;
    default:
View Full Code Here

        PublicKey servicePublicKey = service.getSshKey().getKeyPair().getPublic();
        Instance created = computeClient.createInstance(cloud, request, servicePublicKey);

        {
          Tag instanceTag = Tag.build(Tag.ASSIGNED, created.getName());
          platformLayer.addTag(instance.getKey(), instanceTag);
        }

        assignedInstanceIds.add(created.getName());
      }
View Full Code Here

TOP

Related Classes of org.platformlayer.core.model.Tag

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.