use of com.netflix.spinnaker.halyard.config.model.v1.node.ArtifactProvider in project halyard by spinnaker.
the class ArtifactProviderService method getArtifactProvider.
public ArtifactProvider getArtifactProvider(String deploymentName, String providerName) {
NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setArtifactProvider(providerName);
List<ArtifactProvider> matching = lookupService.getMatchingNodesOfType(filter, ArtifactProvider.class);
switch(matching.size()) {
case 0:
throw new ConfigNotFoundException(new ConfigProblemBuilder(Severity.FATAL, "No provider with name \"" + providerName + "\" could be found").setRemediation("Create a new provider with name \"" + providerName + "\"").build());
case 1:
return matching.get(0);
default:
throw new IllegalConfigException(new ConfigProblemBuilder(Severity.FATAL, "More than one provider with name \"" + providerName + "\" found").setRemediation("Manually delete or rename duplicate providers with name \"" + providerName + "\" in your halconfig file").build());
}
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.ArtifactProvider in project halyard by spinnaker.
the class ArtifactProviderService method setEnabled.
public void setEnabled(String deploymentName, String providerName, boolean enabled) {
ArtifactProvider provider = getArtifactProvider(deploymentName, providerName);
provider.setEnabled(enabled);
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.ArtifactProvider in project halyard by spinnaker.
the class ArtifactAccountService method addArtifactAccount.
public void addArtifactAccount(String deploymentName, String providerName, ArtifactAccount newArtifactAccount) {
ArtifactProvider provider = artifactProviderService.getArtifactProvider(deploymentName, providerName);
provider.getAccounts().add(newArtifactAccount);
}
Aggregations