Package io.fabric8.api

Examples of io.fabric8.api.FabricRequirements


        }
        ContainersNode containersNode = fabric.getContainersNode();
        if (containersNode != null) {
          List<Container> selectedContainers = getSelectedContainers();
          if (!selectedContainers.isEmpty()) {
            Container container = selectedContainers.get(0);
            ContainerNode containerNode = containersNode
                .getContainerNode(container.getId());
            if (containerNode != null) {
              Selections.setSingleSelection(
                  fabric.getRefreshableUI(), containerNode);
            }
          }
View Full Code Here


    IStructuredSelection selection = getSelection();
    if (selection != null) {
      boolean changed = false;
      Iterator iterator = selection.iterator();
      while (iterator.hasNext()) {
        Container container = ContainerNode
            .toContainer(iterator.next());
        if (container != null) {
          containers.add(container);
        }
      }
View Full Code Here

          public boolean apply(Container container) {
            return container != null && container.isRoot();
          }
        }));
    if (rootContainers.size() == 1 && fabric != null) {
      Container rootContainer = rootContainers.get(0);
      ContainersNode containersNode = fabric.getContainersNode();
      if (containersNode != null) {
        return containersNode.getContainerNode(rootContainer.getId());
      }
    }
    return null;
  }
View Full Code Here

    }
    return null;
  }

  public boolean matches(ProfileNode profile) {
    Container ag = getContainer();
    Profile[] profiles = ag.getProfiles();
    for (Profile prof : profiles) {
      if (Objects.equal(prof.getId(), profile.getId())) {
        if (Objects.equal(ag.getVersionId(), profile.getVersion())) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

          CreateJCloudsContainerOptions opts = args.withUser(args.getUser(), args.getPassword(), "admin").build();

          FabricPlugin.getLogger().debug("Compute Service: " + opts.getComputeService());

          // finally create the image
          final CreateJCloudsContainerMetadata metadata = provider.create(opts, new CreationStateListener() {
            @Override
            public void onStateChange(String message) {
              monitor.subTask(message);
            }
          });
View Full Code Here

          }
        }
      });
      return (T) answerHolder[0];
    } catch (Exception e) {
      throw new FabricException(e);
    }

  }
View Full Code Here

    public void testMaximumProfileCountPerHost() throws Exception {
        String hostSmall = "small";
        String hostMedium = "medium";
        String hostBig = "big";

        FabricRequirements requirements = new FabricRequirements();
        requirements.sshConfiguration().defaultPath("/opt/fuse").defaultUsername("root").defaultPassword("adminuser").defaultPassPhrase("cheese");
        requirements.sshHost(hostSmall).hostName(hostSmall).maximumContainerCount(1);
        requirements.sshHost(hostMedium).hostName(hostMedium).maximumContainerCount(2);
        requirements.sshHost(hostBig).hostName(hostBig).maximumContainerCount(8);
        requirements.profile(mqProfileId).minimumInstances(2).maximumInstancesPerHost(1).sshScaling().hostPatterns("!small");
        requirements.profile(exampleProfileId).minimumInstances(5).dependentProfiles(mqProfileId);

        HostProfileCounter hostProfileCounter = assertSshAutoScale(requirements);
        assertHostHasProfileCount(hostProfileCounter, hostSmall, exampleProfileId, 1);
        assertHostHasProfileCount(hostProfileCounter, hostMedium, exampleProfileId, 1);
        assertHostHasProfileCount(hostProfileCounter, hostMedium, mqProfileId, 1);
View Full Code Here

    @Test
    public void testAllocateEquallyUsingTags() throws Exception {
        String[] mqBoxes = {"mq1", "mq2"};
        String[] esbBoxes = {"esb1", "esb2", "esb3", "esb4"};

        FabricRequirements requirements = new FabricRequirements();
        requirements.sshConfiguration().defaultUsername("root");

        for (String box : mqBoxes) {
            requirements.sshHost(box).tags("mq");
        }
        for (String box : esbBoxes) {
            requirements.sshHost(box).tags("esb");
        }
        requirements.profile(mqProfileId).minimumInstances(2).sshScaling().hostTags("mq");
        requirements.profile(exampleProfileId).minimumInstances(8).dependentProfiles(mqProfileId).sshScaling().hostTags("esb");

        HostProfileCounter hostProfileCounter = assertSshAutoScale(requirements);
        for (String box : mqBoxes) {
            assertHostHasProfileCount(hostProfileCounter, box, mqProfileId, 1);
        }
View Full Code Here

    @Test
    public void testAllocateInHostListOrder() throws Exception {
        String[] esbBoxes = {"esb1", "esb2", "esb3", "esb4"};

        FabricRequirements requirements = new FabricRequirements();
        requirements.sshConfiguration().defaultUsername("root");

        for (String box : esbBoxes) {
            requirements.sshHost(box);
        }
        requirements.profile(exampleProfileId).minimumInstances(2);

        HostProfileCounter hostProfileCounter = assertSshAutoScale(requirements);
        assertHostHasProfileCount(hostProfileCounter, "esb1", exampleProfileId, 1);
        assertHostHasProfileCount(hostProfileCounter, "esb2", exampleProfileId, 1);
        assertHostHasProfileCount(hostProfileCounter, "esb3", exampleProfileId, 0);
View Full Code Here

        profile = profileService.updateProfile(builder.getProfile());

        Integer minimumInstances = requirements.getMinimumInstances();
        if (minimumInstances != null) {
            FabricRequirements fabricRequirements = fabricService.get().getRequirements();
            ProfileRequirements profileRequirements = fabricRequirements.getOrCreateProfileRequirement(profile.getId());
            profileRequirements.setMinimumInstances(minimumInstances);
            fabricService.get().setRequirements(fabricRequirements);
        }

        // lets find a hawtio profile and version
View Full Code Here

TOP

Related Classes of io.fabric8.api.FabricRequirements

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.