Package io.fabric8.api

Examples of io.fabric8.api.FabricService


     * Start the container
     */
    @POST
    @Path("start")
    public void start() {
        FabricService fabricService = getFabricService();
        Objects.notNull(fabricService, "fabricService");
        fabricService.startContainer(container);
    }
View Full Code Here


        return CreateKubernetesContainerOptions.builder();
    }

    @Override
    public CreateKubernetesContainerMetadata create(CreateKubernetesContainerOptions options, CreationStateListener listener) throws Exception {
        FabricService service = getFabricService();
        List<String> kubelets = getKubeletFileNames(service, options);
        if (kubelets.size() > 0) {
            return doCreateKubernetesPodsControllersServices(service, options, kubelets);
        }
View Full Code Here

     * Stops the container
     */
    @DELETE
    @Path("start")
    public void stop() {
        FabricService fabricService = getFabricService();
        Objects.notNull(fabricService, "fabricService");
        fabricService.stopContainer(container);
    }
View Full Code Here

        assertValid();
        CreateKubernetesContainerMetadata containerMetadata = getContainerMetadata(container);
        CreateKubernetesContainerOptions options = containerMetadata.getCreateOptions();
        if (containerMetadata != null && containerMetadata.isKubelet()) {
            try {
                FabricService service = getFabricService();
                List<String> kubelets = getKubeletFileNames(service, options);
                if (kubelets.size() > 0) {
                    startKubletPodsReplicationControllersServices(service, options, kubelets, containerMetadata);
                }
            } catch (Exception e) {
View Full Code Here

    /**
     * Deletes this container
     */
    @DELETE
    public void delete() {
        FabricService fabricService = getFabricService();
        Objects.notNull(fabricService, "fabricService");
        fabricService.destroyContainer(container);
    }
View Full Code Here

        assertValid();
        CreateKubernetesContainerMetadata containerMetadata = getContainerMetadata(container);
        CreateKubernetesContainerOptions options = containerMetadata.getCreateOptions();
        if (containerMetadata != null && containerMetadata.isKubelet()) {
            try {
                FabricService service = getFabricService();
                List<String> kubelets = getKubeletFileNames(service, options);
                if (kubelets.size() > 0) {
                    stopKubletPodsReplicationControllersServices(service, options, kubelets, containerMetadata);
                }
            } catch (Exception e) {
View Full Code Here

        String jolokiaUrl = parameters.getJolokiaUrl();
        String name = options.getName();
        String image = containerConfig.getImage();
        Set<String> profileIds = options.getProfiles();
        String versionId = options.getVersion();
        FabricService service = getFabricService();

        PodSchema pod = new PodSchema();
        pod.setId(KubernetesHelpers.containerNameToPodId(name));

        Map<String, String> labels = updateLabels(null, service, name, profileIds, versionId);
View Full Code Here

    int bounds = 100;
    int column = 0;
    Function1 function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getProfile();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Profile");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getCount();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Count");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getMinimumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Minumum");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getMaximumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Maximum");
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return toHealth(status);
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Status",
        new HealthLabelProvider(function));
    function = new Function1() {
      @Override
      public Double apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getHealth(status.getCount());
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Health",
        new PercentFunctionLabelProvider(function));
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getDependentProfiles();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Dependencies");
View Full Code Here

   * @see
   * org.eclipse.jface.viewers.ColumnLabelProvider#getImage(java.lang.Object)
   */
  @Override
  public Image getImage(Object element) {
    LogEvent le = LogViewTabSection.toLogEvent(element);
    if (le != null) {
      return getLevelImage(le);
    }
    return super.getImage(element);
  }
View Full Code Here

   * @see
   * org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object)
   */
  @Override
  public String getText(Object element) {
    LogEvent le = LogViewTabSection.toLogEvent(element);
    if (le != null) {
      return le.getLevel();
    }
    return super.getText(element);
  }
View Full Code Here

TOP

Related Classes of io.fabric8.api.FabricService

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.