Package com.vmware.bdd.apitypes

Examples of com.vmware.bdd.apitypes.NodeRead


        List<NodeGroupRead> nodeGroups = new ArrayList<NodeGroupRead>();
        NodeGroupRead workerGroup = new NodeGroupRead();
        workerGroup.setName("worker");
        workerGroup.setInstanceNum(1);
        List<NodeRead> instances = new ArrayList<NodeRead>();
        NodeRead instance1 = new NodeRead();
        instance1.setName("worker1");
        instance1.setStatus("PoweredOn");
        instance1.setAction("Getting IP...");
        instances.add(instance1);
        workerGroup.setInstances(instances);
        nodeGroups.add(workerGroup);
        cluster.setNodeGroups(nodeGroups);
        buildReqRespWithoutReqBody("https://127.0.0.1:8443/serengeti/api/cluster/cluster1", HttpMethod.GET,
                HttpStatus.OK, mapper.writeValueAsString(cluster));

        task.setProgress(1.0);
        task.setStatus(Status.COMPLETED);
        buildReqRespWithoutReqBody("https://127.0.0.1:8443/serengeti/api/task/12", HttpMethod.GET, HttpStatus.OK,
                mapper.writeValueAsString(task));

        instance1.setStatus("Service Running");
        instance1.setIpConfigs(createIpConfigs("1.2.3.4"));
        instance1.setAction(null);
        buildReqRespWithoutReqBody("https://127.0.0.1:8443/serengeti/api/cluster/cluster1", HttpMethod.GET,
                HttpStatus.OK, mapper.writeValueAsString(cluster));

        clusterCommands.createCluster("cluster1", null, "HADOOP", null, null, null, null, null, null, null, null, false, false, true, false, "");
        CookieCache.clear();
View Full Code Here


        sr1.setType("Type1");
        sr1.setSizeGB(100);
        StorageRead sr2 = new StorageRead();
        sr2.setType("Type2");
        sr2.setSizeGB(200);
        NodeRead nr1 = new NodeRead();
        nr1.setHostName("test1.vmware.com");
        nr1.setIpConfigs(createIpConfigs("10.1.1.99"));
        nr1.setName("node1");
        nr1.setStatus("running");
        nr1.setRack("rack1");
        NodeRead nr2 = new NodeRead();
        nr2.setHostName("test2.vmware.com");
        nr2.setIpConfigs(createIpConfigs("10.1.1.100"));
        nr2.setName("node2");
        nr2.setStatus("running");
        nr2.setRack("rack1");
        NodeRead nr3 = new NodeRead();
        nr3.setHostName("test3.vmware.com");
        nr3.setIpConfigs(createIpConfigs("10.1.1.101"));
        nr3.setName("node3");
        nr3.setStatus("running");
        nr3.setRack("rack1");
        NodeRead nr4 = new NodeRead();
        nr4.setHostName("test4.vmware.com");
        nr4.setIpConfigs(createIpConfigs("10.1.1.102"));
        nr4.setName("node4");
        nr4.setStatus("create");
        nr4.setRack("rack1");
        List<NodeRead> instances1 = new LinkedList<NodeRead>();
        instances1.add(nr1);
        instances1.add(nr2);
        List<NodeRead> instances2 = new LinkedList<NodeRead>();
        instances2.add(nr3);
View Full Code Here

      }
   }

   // if includeVolumes is true, this method must be called inside a transaction
   public NodeRead toNodeRead(boolean includeVolumes) {
      NodeRead node = new NodeRead();
      node.setRack(this.rack);
      node.setHostName(this.hostName);
      // For class NodeRead, keep "ipConfigsInfo" structure since it's used by software provision
      node.setIpConfigs(convertToIpConfigInfo());
      node.setName(this.vmName);
      node.setMoId(this.moId);
      node.setStatus(this.status != null ? this.status.toString() : null);
      node.setAction(this.action);
      node.setVersion(this.version);
      if (this.cpuNum != null) {
         node.setCpuNumber(this.cpuNum);
      }
      if (this.memorySize != null) {
         node.setMemory(this.memorySize);
      }
      List<String> roleNames = nodeGroup.getRoleNameList();
      node.setRoles(roleNames);
      if (includeVolumes)
         node.setVolumes(this.getVolumns());
      if (actionFailed) {
         node.setActionFailed(true);
      }
      if (errMessage != null && !errMessage.isEmpty()) {
         node.setErrMessage(errMessage);
      }
      return node;
   }
View Full Code Here

                  cluster.setTopologyPolicy(TopologyType.NONE);
                  List<NodeGroupRead> nodeGroups =
                        new ArrayList<NodeGroupRead>();
                  NodeGroupRead nodeGroup = new NodeGroupRead();
                  List<NodeRead> nodes = new ArrayList<NodeRead>();
                  NodeRead node = new NodeRead();
                  node.setRack("rack1");
                  node.setHostName("host1.com");
                  Map<NetTrafficType, List<IpConfigInfo>> ipConfigs =
                        new HashMap<NetTrafficType, List<IpConfigInfo>>();
                  IpConfigInfo ipConfigInfo1 =
                        new IpConfigInfo(NetTrafficType.MGT_NETWORK, "nw1",
                              "portgroup1", "192.168.1.100");
                  List<IpConfigInfo> ipConfigInfos1 =
                        new ArrayList<IpConfigInfo>();
                  ipConfigInfos1.add(ipConfigInfo1);
                  IpConfigInfo ipConfigInfo2 =
                        new IpConfigInfo(NetTrafficType.HDFS_NETWORK, "nw2",
                              "portgroup2", "192.168.2.100");
                  IpConfigInfo ipConfigInfo3 =
                        new IpConfigInfo(NetTrafficType.HDFS_NETWORK, "nw3",
                              "portgroup3", "192.168.3.100");
                  List<IpConfigInfo> ipConfigInfos2 =
                        new ArrayList<IpConfigInfo>();
                  ipConfigInfos2.add(ipConfigInfo2);
                  ipConfigInfos2.add(ipConfigInfo3);
                  ipConfigs.put(NetTrafficType.MGT_NETWORK, ipConfigInfos1);
                  ipConfigs.put(NetTrafficType.HDFS_NETWORK, ipConfigInfos2);
                  node.setIpConfigs(ipConfigs);
                  nodes.add(node);
                  nodeGroup.setInstances(nodes);
                  nodeGroups.add(nodeGroup);
                  cluster.setNodeGroups(nodeGroups);
                  return cluster;
View Full Code Here

         return read;
      }

      List<NodeRead> nodeReads = new ArrayList<NodeRead>();
      for (NodeEntity node : nodes) {
         NodeRead nodeRead = node.toNodeRead(false);
         nodeReads.add(nodeRead);
      }
      Collections.sort(nodeReads, new Comparator<NodeRead>() {
         @Override
         public int compare(NodeRead arg0, NodeRead arg1) {
View Full Code Here

TOP

Related Classes of com.vmware.bdd.apitypes.NodeRead

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.