Package io.fabric8.api

Examples of io.fabric8.api.FabricService


    public FabricResource() {
    }

    @GET
    public FabricDTO details() {
        FabricService fabricService = getFabricService();
        if (fabricService != null) {
            return new FabricDTO(fabricService, getLink("/containers"), getLink("/versions"), getLink("/status"), getLink("/requirements"), getLink("/registry"), getLink("/zookeeper"));
        } else {
            noFabricService();
        }
View Full Code Here


     * Returns the list of container IDs
     */
    @GET
    @Path("containers")
    public Map<String, String> containers() {
        FabricService fabricService = getFabricService();
        if (fabricService != null) {
            return mapToLinks(Containers.containerIds(fabricService.getContainers()), "/container/");
        } else {
            noFabricService();
        }
        return Collections.emptyMap();
    }
View Full Code Here

    /**
     * Accesses a container resource
     */
    @Path("container/{containerId}")
    public ContainerResource container(@PathParam("containerId") String containerId) {
        FabricService fabricService = getFabricService();
        if (fabricService != null && Strings.isNotBlank(containerId)) {
            Container container = fabricService.getContainer(containerId);
            if (container != null) {
                return new ContainerResource(this, container);
            }
            LOG.warn("No container found for: {}", container);
        }
View Full Code Here

     * Returns the list of version ids
     */
    @GET
    @Path("versions")
    public Map<String,String> versions() {
        FabricService fabricService = getFabricService();
        if (fabricService != null) {
            ProfileService profileService = fabricService.adapt(ProfileService.class);
            List<String> versionIds = profileService.getVersions();
            return mapToLinks(versionIds, "/version/");
        } else {
            noFabricService();
        }
View Full Code Here

    /**
     * Accesses a version resource
     */
    @Path("version/{versionId}")
    public VersionResource version(@PathParam("versionId") String versionId) {
        FabricService fabricService = getFabricService();
        if (fabricService != null && Strings.isNotBlank(versionId)) {
            ProfileService profileService = fabricService.adapt(ProfileService.class);
            Version version = profileService.getRequiredVersion(versionId);
            if (version != null) {
                return new VersionResource(this, version);
            } else {
                LOG.warn("No version found for: {}", version);
View Full Code Here

    }

    @GET
    @Path("status")
    public FabricStatusDTO status() {
        FabricService fabricService = getFabricService();
        if (fabricService != null) {
            return new FabricStatusDTO(fabricService.getFabricStatus());
        }
        return null;
    }
View Full Code Here

    @POST
    @Path("requirements")
    public void setRequirements(FabricRequirements requirements) throws IOException {
        Objects.notNull(requirements, "requirements");
        FabricService service = getFabricService();
        Objects.notNull(service, "FabricService");
        service.setRequirements(requirements);
    }
View Full Code Here

        return new ProfileDTO(profile, getLink("containers"), overlay, getLink("requirements"), getLink("fileNames"));
    }

    @DELETE
    public void deleteProfile() {
        FabricService fabricService = getFabricService();
        Objects.notNull(fabricService, "fabricService");
        ProfileService profileService = getProfileService();
        Objects.notNull(profileService, "profileService");
        profileService.deleteProfile(fabricService, profile.getVersion(), profile.getId(), true);
    }
View Full Code Here

     * Returns the list of container ID links for this profile
     */
    @GET
    @Path("containers")
    public Map<String, String> containers() {
        FabricService fabricService = getFabricService();
        if (fabricService != null) {
            List<Container> containers = Containers.containersForProfile(fabricService.getContainers(), profile.getId(), profile.getVersion());
            List<String> keys = Containers.containerIds(containers);

            // lets get the link to the fabric
            ResourceSupport node = this;
            for (int i = 0; i < 2 && node != null; i++) {
View Full Code Here

    }

    @POST
    @Path("requirements")
    public void setRequirements(ProfileRequirements profileRequirements) throws IOException {
        FabricService service = getFabricService();
        FabricRequirements requirements = service.getRequirements();
        if (requirements != null) {
            requirements.addOrUpdateProfileRequirements(profileRequirements);
            service.setRequirements(requirements);
        }
    }
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.