Examples of NodeMetadata


Examples of edu.uci.ics.jung.io.graphml.NodeMetadata

         //TODO evaluate
         return new DirectedSparseGraph<NavigationEntry, String>();
      }
      else if (metadata instanceof NodeMetadata)
      {
         NodeMetadata nodeMetadata = (NodeMetadata) metadata;
         Properties result = new Properties();
         result.put(NavigationEntry.ID, nodeMetadata.getId());
         result.putAll(nodeMetadata.getProperties());
         return new NavigationEntry( result);
      }
      else if (metadata instanceof EdgeMetadata)
      {
         EdgeMetadata edgeMetadata = (EdgeMetadata) metadata;
View Full Code Here

Examples of net.sf.katta.protocol.metadata.NodeMetaData

    LOG.info("started node '" + _nodeName + "'");
  }

  private void init() {
    redeployInstalledShards();
    NodeMetaData nodeMetaData = new NodeMetaData(_nodeName);
    NodeQueue nodeOperationQueue = _protocol.publishNode(this, nodeMetaData);
    startOperatorThread(nodeOperationQueue);
  }
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

            } else {
               logger.error("maximum pool size reached (%s)", maxSize);
               throw new IllegalStateException(String.format("maximum pool size reached (%s)", maxSize));
            }
         }
         NodeMetadata userNode = Iterables.get(availableNodes, 0);
         NodeMetadata node = metadataStore.store(userNode, options, group);
         logger.info("pool node assigned");
         return new NodeWithInitialCredentials(node);
      }
   }
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

               new AdminAccess.Builder());
   }

   @Override
   public NodeMetadata getNode(String id) {
      NodeMetadata backendMetadata = backendComputeService.get().getNodeMetadata(id);
      if (backendMetadata == null) {
         return null;
      }
      return metadataStore.load(backendMetadata);
   }
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

      if (backendNodes == null || backendNodes.isEmpty()) {
         return ImmutableSet.of();
      }
      final Set<NodeMetadata> loadedSet = Sets.newLinkedHashSet();
      for (NodeMetadata input : backendNodes) {
         NodeMetadata loaded = load(input);
         if (loaded != null) {
            loadedSet.add(loaded);
         }

      }
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

   }

   @Test(groups = "live")
   public void testCanRunCommandAsCurrentUser() throws Exception {
      Set<? extends NodeMetadata> nodes = view.getComputeService().createNodesInGroup("goo", 1);
      NodeMetadata node = Iterables.get(nodes, 0);

      try {
         ExecResponse response = view.getComputeService().runScriptOnNode(node.getId(), exec("id"),
                  wrapInInitScript(false).runAsRoot(false));
         assert response.getOutput().trim().contains(System.getProperty("user.name")) : node + ": " + response;
      } finally {
         view.getComputeService().destroyNode(node.getId());
      }
   }
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

               + "\"user\":\"testuser\",\"password\":\"testpass\",\"privateKey\":\"pk\",\"authenticateSudo\":true}");
   }

   @Test(groups = "unit", dependsOnMethods = "testStore")
   public void testLoad() {
      NodeMetadata loaded = store.load(nodeMeta1);
      assertEquals(loaded.getId(), nodeMeta1.getId());
      assertTrue(loaded.getTags().contains("tag1"));
      assertTrue(loaded.getTags().contains("tag2"));
      assertTrue(loaded.getUserMetadata().containsKey("testmetakey")
               && loaded.getUserMetadata().get("testmetakey").equals("testmetavalue"));
      assertTrue(loaded.getUserMetadata().containsKey("testmetakey2")
               && loaded.getUserMetadata().get("testmetakey2").equals("testmetavalue2"));
      assertEquals(loaded.getCredentials().getUser(), "testuser");
      assertEquals(loaded.getCredentials().getPassword(), "testpass");
      assertEquals(loaded.getCredentials().getPrivateKey(), "pk");
      assertEquals(loaded.getCredentials().shouldAuthenticateSudo(), true);
      assertEquals(loaded.getGroup(), "testgroup");
   }
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

      TemplateOptions options = apiThatCreatesNode.templateOptions().blockUntilRunning(false);
     
      assertTrue(options.as(JoyentCloudTemplateOptions.class).shouldGenerateKey().get());

      NodeMetadata node = Iterables.getOnlyElement(apiThatCreatesNode.createNodesInGroup("test", 1, options));
     
      assertEquals(node.getCredentials().getPrivateKey(), keyPair.get("private"));
   }
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

      MachineInDatacenterToNodeMetadata converter = new MachineInDatacenterToNodeMetadata(
            JoyentCloudComputeServiceContextModule.toPortableNodeStatus, locationIndex,
            Suppliers.<Set<? extends Image>> ofInstance(images),
            Suppliers.<Set<? extends Hardware>> ofInstance(hardwares), namingConvention);

      NodeMetadata convertedNodeMetadata = converter.apply(machineInDatacenterToConvert);

      assertEquals(machineInDatacenterToConvert.slashEncode(), convertedNodeMetadata.getId());
      assertEquals(machineToConvert.getId(), convertedNodeMetadata.getProviderId());

      assertEquals(convertedNodeMetadata.getLocation().getScope(), LocationScope.ZONE);
      assertEquals(convertedNodeMetadata.getLocation().getId(), "us-sw-1");

      assertEquals(machineToConvert.getName(), convertedNodeMetadata.getName());
      assertEquals(convertedNodeMetadata.getGroup(), "sample");

      assertEquals(convertedNodeMetadata.getImageId(), expectedImageId);
      assertEquals(convertedNodeMetadata.getOperatingSystem(), expectedOs);

      assertEquals(convertedNodeMetadata.getHardware(), expectedHardware);

      assertEquals(JoyentCloudComputeServiceContextModule.toPortableNodeStatus.get(machineToConvert.getState()),
            convertedNodeMetadata.getStatus());

      assertNotNull(convertedNodeMetadata.getPrivateAddresses());
      assertEquals(convertedNodeMetadata.getPrivateAddresses(), ImmutableSet.of("10.224.0.63"));

      assertNotNull(convertedNodeMetadata.getPublicAddresses());
      assertEquals(convertedNodeMetadata.getPublicAddresses(), ImmutableSet.of("37.153.96.62"));

      assertNotNull(convertedNodeMetadata.getUserMetadata());
      // ensure filtered out root_authorized_keys!
      assertEquals(convertedNodeMetadata.getUserMetadata(), ImmutableMap.<String, String> of());
   }
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

    * @param clone the target machine
    * @param guestOsUser the user to access the target machine
    * @param guestOsPassword the password to access the target machine
    */
   private void postConfigurations(IMachine clone, String guestOsUser, String guestOsPassword) {
      NodeMetadata partialNodeMetadata = buildPartialNodeMetadata(clone, guestOsUser, guestOsPassword);
      machineUtils.runScriptOnNode(partialNodeMetadata, new DeleteGShadowLock(), RunScriptOptions.NONE);
      machineUtils.runScriptOnNode(partialNodeMetadata, new PasswordlessSudo(partialNodeMetadata.getCredentials().identity), RunScriptOptions.Builder.runAsRoot(true));
   }
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.