Search in sources :

Example 6 with BakeryDefaults

use of com.netflix.spinnaker.halyard.config.model.v1.node.BakeryDefaults in project halyard by spinnaker.

the class AbstractListBaseImagesCommand method executeThis.

@Override
protected void executeThis() {
    String providerName = getProviderName();
    String currentDeployment = getCurrentDeployment();
    BakeryDefaults bakeryDefaults = new OperationHandler<BakeryDefaults>().setFailureMesssage("Failed to get bakery defaults for " + providerName + "'s bakery.").setOperation(Daemon.getBakeryDefaults(currentDeployment, providerName, !noValidate)).get();
    List<BaseImage> baseImages = bakeryDefaults.getBaseImages();
    if (baseImages.isEmpty()) {
        AnsiUi.success("No configured base images for " + getProviderName() + ".");
    } else {
        AnsiUi.success("Base images for " + getProviderName() + ":");
        baseImages.forEach(baseImage -> AnsiUi.listItem(baseImage.getBaseImage().getId()));
    }
}
Also used : BakeryDefaults(com.netflix.spinnaker.halyard.config.model.v1.node.BakeryDefaults) BaseImage(com.netflix.spinnaker.halyard.config.model.v1.node.BaseImage)

Example 7 with BakeryDefaults

use of com.netflix.spinnaker.halyard.config.model.v1.node.BakeryDefaults in project halyard by spinnaker.

the class BakeryService method addBaseImage.

public void addBaseImage(String deploymentName, String bakeryDefaultsName, BaseImage newBaseImage) {
    BakeryDefaults bakeryDefaults = getBakeryDefaults(deploymentName, bakeryDefaultsName);
    bakeryDefaults.getBaseImages().add(newBaseImage);
}
Also used : BakeryDefaults(com.netflix.spinnaker.halyard.config.model.v1.node.BakeryDefaults)

Aggregations

BakeryDefaults (com.netflix.spinnaker.halyard.config.model.v1.node.BakeryDefaults)6 HasImageProvider (com.netflix.spinnaker.halyard.config.model.v1.node.HasImageProvider)2 OperationHandler (com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler)1 BaseImage (com.netflix.spinnaker.halyard.config.model.v1.node.BaseImage)1 NodeFilter (com.netflix.spinnaker.halyard.config.model.v1.node.NodeFilter)1 ConfigProblemBuilder (com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemBuilder)1 UpdateRequestBuilder (com.netflix.spinnaker.halyard.core.DaemonResponse.UpdateRequestBuilder)1 HalException (com.netflix.spinnaker.halyard.core.error.v1.HalException)1 ProblemSet (com.netflix.spinnaker.halyard.core.problem.v1.ProblemSet)1 Path (java.nio.file.Path)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1