Search in sources :

Example 6 with ConfigNotFoundException

use of com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException in project halyard by spinnaker.

the class ArtifactAccountService method getAllArtifactAccounts.

public List<ArtifactAccount> getAllArtifactAccounts(String deploymentName, String providerName) {
    NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setArtifactProvider(providerName).withAnyArtifactAccount();
    List<ArtifactAccount> matchingArtifactAccounts = lookupService.getMatchingNodesOfType(filter, ArtifactAccount.class);
    if (matchingArtifactAccounts.size() == 0) {
        throw new ConfigNotFoundException(new ConfigProblemBuilder(Severity.FATAL, "No accounts could be found").build());
    } else {
        return matchingArtifactAccounts;
    }
}
Also used : ConfigProblemBuilder(com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemBuilder) ConfigNotFoundException(com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException) NodeFilter(com.netflix.spinnaker.halyard.config.model.v1.node.NodeFilter) ArtifactAccount(com.netflix.spinnaker.halyard.config.model.v1.node.ArtifactAccount)

Example 7 with ConfigNotFoundException

use of com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException in project halyard by spinnaker.

the class BakeryService method getAllBaseImages.

public List<BaseImage> getAllBaseImages(String deploymentName, String providerName) {
    NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setProvider(providerName).setBakeryDefaults().withAnyBaseImage();
    List<BaseImage> matchingBaseImages = lookupService.getMatchingNodesOfType(filter, BaseImage.class);
    if (matchingBaseImages.size() == 0) {
        throw new ConfigNotFoundException(new ConfigProblemBuilder(Severity.FATAL, "No base images could be found").build());
    } else {
        return matchingBaseImages;
    }
}
Also used : ConfigProblemBuilder(com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemBuilder) ConfigNotFoundException(com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException) BaseImage(com.netflix.spinnaker.halyard.config.model.v1.node.BaseImage) NodeFilter(com.netflix.spinnaker.halyard.config.model.v1.node.NodeFilter)

Example 8 with ConfigNotFoundException

use of com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException in project halyard by spinnaker.

the class ClusterService method getAllClusters.

public List<Cluster> getAllClusters(String deploymentName, String providerName) {
    NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setProvider(providerName).withAnyCluster();
    List<Cluster> matchingClusters = lookupService.getMatchingNodesOfType(filter, Cluster.class);
    if (matchingClusters.size() == 0) {
        throw new ConfigNotFoundException(new ConfigProblemBuilder(Problem.Severity.FATAL, "No clusters could be found").build());
    } else {
        return matchingClusters;
    }
}
Also used : ConfigProblemBuilder(com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemBuilder) ConfigNotFoundException(com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException) Cluster(com.netflix.spinnaker.halyard.config.model.v1.node.Cluster) NodeFilter(com.netflix.spinnaker.halyard.config.model.v1.node.NodeFilter)

Example 9 with ConfigNotFoundException

use of com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException in project halyard by spinnaker.

the class AccountService method getAllAccounts.

public List<Account> getAllAccounts(String deploymentName, String providerName) {
    NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setProvider(providerName).withAnyAccount();
    List<Account> matchingAccounts = lookupService.getMatchingNodesOfType(filter, Account.class);
    if (matchingAccounts.size() == 0) {
        throw new ConfigNotFoundException(new ConfigProblemBuilder(Severity.FATAL, "No accounts could be found").build());
    } else {
        return matchingAccounts;
    }
}
Also used : Account(com.netflix.spinnaker.halyard.config.model.v1.node.Account) ConfigProblemBuilder(com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemBuilder) ConfigNotFoundException(com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException) NodeFilter(com.netflix.spinnaker.halyard.config.model.v1.node.NodeFilter)

Example 10 with ConfigNotFoundException

use of com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException in project halyard by spinnaker.

the class ArtifactProviderService method getAllArtifactProviders.

public List<ArtifactProvider> getAllArtifactProviders(String deploymentName) {
    NodeFilter filter = new NodeFilter().setDeployment(deploymentName).withAnyArtifactProvider();
    List<ArtifactProvider> matching = lookupService.getMatchingNodesOfType(filter, ArtifactProvider.class);
    if (matching.size() == 0) {
        throw new ConfigNotFoundException(new ConfigProblemBuilder(Severity.FATAL, "No providers could be found").build());
    } else {
        return matching;
    }
}
Also used : GitHubArtifactProvider(com.netflix.spinnaker.halyard.config.model.v1.artifacts.github.GitHubArtifactProvider) ArtifactProvider(com.netflix.spinnaker.halyard.config.model.v1.node.ArtifactProvider) HttpArtifactProvider(com.netflix.spinnaker.halyard.config.model.v1.artifacts.http.HttpArtifactProvider) GcsArtifactProvider(com.netflix.spinnaker.halyard.config.model.v1.artifacts.gcs.GcsArtifactProvider) ConfigProblemBuilder(com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemBuilder) ConfigNotFoundException(com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException) NodeFilter(com.netflix.spinnaker.halyard.config.model.v1.node.NodeFilter)

Aggregations

ConfigNotFoundException (com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException)19 ConfigProblemBuilder (com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemBuilder)18 NodeFilter (com.netflix.spinnaker.halyard.config.model.v1.node.NodeFilter)16 IllegalConfigException (com.netflix.spinnaker.halyard.config.error.v1.IllegalConfigException)8 DeploymentConfiguration (com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)3 GcsArtifactProvider (com.netflix.spinnaker.halyard.config.model.v1.artifacts.gcs.GcsArtifactProvider)2 GitHubArtifactProvider (com.netflix.spinnaker.halyard.config.model.v1.artifacts.github.GitHubArtifactProvider)2 HttpArtifactProvider (com.netflix.spinnaker.halyard.config.model.v1.artifacts.http.HttpArtifactProvider)2 Account (com.netflix.spinnaker.halyard.config.model.v1.node.Account)2 ArtifactProvider (com.netflix.spinnaker.halyard.config.model.v1.node.ArtifactProvider)2 Ci (com.netflix.spinnaker.halyard.config.model.v1.node.Ci)2 Pubsub (com.netflix.spinnaker.halyard.config.model.v1.node.Pubsub)2 GooglePubsub (com.netflix.spinnaker.halyard.config.model.v1.pubsub.google.GooglePubsub)2 AbstractCanaryAccount (com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryAccount)1 AbstractCanaryServiceIntegration (com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryServiceIntegration)1 ArtifactAccount (com.netflix.spinnaker.halyard.config.model.v1.node.ArtifactAccount)1 BaseImage (com.netflix.spinnaker.halyard.config.model.v1.node.BaseImage)1 Cluster (com.netflix.spinnaker.halyard.config.model.v1.node.Cluster)1 Master (com.netflix.spinnaker.halyard.config.model.v1.node.Master)1 Notification (com.netflix.spinnaker.halyard.config.model.v1.node.Notification)1