Package com.sequenceiq.cloudbreak.domain

Examples of com.sequenceiq.cloudbreak.domain.Stack


        LOGGER.info("Updated stack: [ambariIp: '{}'].", ambariIp);
        return stack;
    }

    private Stack doUpdateNodeCount(Long stackId, Integer nodeCount) {
        Stack stack = stackRepository.findById(stackId);
        MDCBuilder.buildMdcContext(stack);
        stack.setNodeCount(nodeCount);
        stack = stackRepository.save(stack);
        LOGGER.info("Updated stack: [nodeCount: '{}'].", nodeCount);
        return stack;
    }
View Full Code Here


        LOGGER.info("Updated stack: [nodeCount: '{}'].", nodeCount);
        return stack;
    }

    private Stack doUpdateStackCluster(Long stackId, Cluster cluster) {
        Stack stack = stackRepository.findById(stackId);
        MDCBuilder.buildMdcContext(cluster);
        stack.setCluster(cluster);
        stack = stackRepository.save(stack);
        LOGGER.info("Saved cluster '{}' for stack.", cluster.getId());
        return stack;
    }
View Full Code Here

        LOGGER.info("Saved cluster '{}' for stack.", cluster.getId());
        return stack;
    }

    private Stack doUpdateStackCreateComplete(Long stackId) {
        Stack stack = stackRepository.findById(stackId);
        MDCBuilder.buildMdcContext(stack);
        stack.setStackCompleted(true);
        stack = stackRepository.save(stack);
        LOGGER.info("Updated stack: [cfStackCompleted: 'true'].");
        return stack;
    }
View Full Code Here

        LOGGER.info("Updated stack: [cfStackCompleted: 'true'].");
        return stack;
    }

    private Stack doUpdateMetadataReady(Long stackId, boolean ready) {
        Stack stack = stackRepository.findById(stackId);
        MDCBuilder.buildMdcContext(stack);
        stack.setMetadataReady(ready);
        stack = stackRepository.save(stack);
        LOGGER.info("Updated stack: [metadataReady: 'true'].");
        return stack;
    }
View Full Code Here

        LOGGER.info("Updated stack: [metadataReady: 'true'].");
        return stack;
    }

    private Stack doUpdateResources(Long stackId, Set<Resource> resources) {
        Stack stack = stackRepository.findById(stackId);
        MDCBuilder.buildMdcContext(stack);
        stack.setResources(resources);
        stack = stackRepository.save(stack);
        LOGGER.info("Updated stack resources: [status: '{}', statusReason: '{}'].");
        return stack;
    }
View Full Code Here

    }

    @RequestMapping(value = "stacks/{id}", method = RequestMethod.GET)
    @ResponseBody
    public ResponseEntity<StackJson> getStack(@PathVariable Long id) {
        Stack stack = stackService.get(id);
        StackDescription stackDescription = stackService.getStackDescription(stack);
        StackJson stackJson = stackConverter.convert(stack, stackDescription);
        return new ResponseEntity<>(stackJson, HttpStatus.OK);
    }
View Full Code Here

    }

    @RequestMapping(value = "stacks/ambari", method = RequestMethod.POST)
    @ResponseBody
    public ResponseEntity<StackJson> getStackForAmbari(@RequestBody AmbariAddressJson json) {
        Stack stack = stackService.get(json.getAmbariAddress());
        return new ResponseEntity<>(stackConverter.convert(stack), HttpStatus.OK);
    }
View Full Code Here

        Stack stack = stackService.get(json.getAmbariAddress());
        return new ResponseEntity<>(stackConverter.convert(stack), HttpStatus.OK);
    }

    private ResponseEntity<IdJson> createStack(CbUser user, StackJson stackRequest, Boolean publicInAccount) {
        Stack stack = stackConverter.convert(stackRequest);
        stack.setPublicInAccount(publicInAccount);
        stack = stackService.create(user, stack);
        return new ResponseEntity<>(new IdJson(stack.getId()), HttpStatus.CREATED);
    }
View Full Code Here

        return Arrays.asList(new Resource(resourceType(), stack.getName(), stack));
    }

    @Override
    public Boolean delete(Resource resource, GccDeleteContextObject d) throws Exception {
        Stack stack = stackRepository.findById(d.getStackId());
        try {
            GccTemplate gccTemplate = (GccTemplate) stack.getTemplate();
            GccCredential gccCredential = (GccCredential) stack.getCredential();
            Operation execute = d.getCompute().networks().delete(gccCredential.getProjectId(), resource.getResourceName()).execute();
            Compute.ZoneOperations.Get zoneOperations = createZoneOperations(d.getCompute(), gccCredential, gccTemplate, execute);
            Compute.GlobalOperations.Get globalOperations = createGlobalOperations(d.getCompute(), gccCredential, gccTemplate, execute);
            GccRemoveReadyPollerObject gccRemoveReady =
                    new GccRemoveReadyPollerObject(zoneOperations, globalOperations, stack, resource.getResourceName());
View Full Code Here

        return true;
    }

    @Override
    public Optional<String> describe(Resource resource, GccDescribeContextObject dco) throws Exception {
        Stack stack = stackRepository.findById(dco.getStackId());
        GccCredential gccCredential = (GccCredential) stack.getCredential();
        try {
            Compute.Networks.Get getNetwork = dco.getCompute().networks().get(gccCredential.getProjectId(), resource.getResourceName());
            return Optional.fromNullable(getNetwork.execute().toPrettyString());
        } catch (IOException e) {
            return Optional.fromNullable(jsonHelper.createJsonFromString(String.format("{\"Network\": {%s}}", ERROR)).toString());
View Full Code Here

TOP

Related Classes of com.sequenceiq.cloudbreak.domain.Stack

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.