Search in sources :

Example 1 with Provider

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

the class AbstractAddArtifactAccountCommand method executeThis.

@Override
protected void executeThis() {
    String accountName = getArtifactAccountName();
    ArtifactAccount account = buildArtifactAccount(accountName);
    String providerName = getArtifactProviderName();
    String currentDeployment = getCurrentDeployment();
    new OperationHandler<Void>().setFailureMesssage("Failed to add artifact account " + accountName + " for artifact provider " + providerName + ".").setSuccessMessage("Successfully added artifact account " + accountName + " for artifact provider " + providerName + ".").setOperation(Daemon.addArtifactAccount(currentDeployment, providerName, !noValidate, account)).get();
}
Also used : ArtifactAccount(com.netflix.spinnaker.halyard.config.model.v1.node.ArtifactAccount) OperationHandler(com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler)

Example 2 with Provider

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

the class ClouddriverBootstrapProfileFactory method disableAllProviders.

private void disableAllProviders(Providers providers) {
    NodeIterator providerNodes = providers.getChildren();
    Provider provider;
    while ((provider = (Provider) providerNodes.getNext()) != null) {
        provider.setEnabled(false);
    }
}
Also used : NodeIterator(com.netflix.spinnaker.halyard.config.model.v1.node.NodeIterator) Provider(com.netflix.spinnaker.halyard.config.model.v1.node.Provider) DockerRegistryProvider(com.netflix.spinnaker.halyard.config.model.v1.providers.dockerRegistry.DockerRegistryProvider)

Example 3 with Provider

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

the class DCOSAddClusterCommand method executeThis.

@Override
protected void executeThis() {
    DCOSCluster cluster = new DCOSCluster();
    cluster.setName(getClusterName()).setDcosUrl(dcosUrl).setCaCertFile(caCertFile).setInsecureSkipTlsVerify(insecureSkipTlsVerify);
    if (nonNull(loadBalancerImage)) {
        final DCOSCluster.LoadBalancer loadBalancer = new DCOSCluster.LoadBalancer().setImage(loadBalancerImage).setServiceAccountSecret(loadBalancerServiceAccountSecret);
        cluster.setLoadBalancer(loadBalancer);
    }
    new OperationHandler<Void>().setFailureMesssage("Failed to add cluster " + getClusterName() + " for provider " + getProviderName() + ".").setSuccessMessage("Successfully added cluster " + getClusterName() + " for provider " + getProviderName() + ".").setOperation(Daemon.addCluster(getCurrentDeployment(), getProviderName(), !noValidate, cluster)).get();
}
Also used : DCOSCluster(com.netflix.spinnaker.halyard.config.model.v1.providers.dcos.DCOSCluster) OperationHandler(com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler)

Example 4 with Provider

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

the class DCOSListClusterCommand method executeThis.

@Override
protected void executeThis() {
    Provider provider = getProvider();
    DCOSProvider dcosProvider = (DCOSProvider) provider;
    List<DCOSCluster> clusters = dcosProvider.getClusters();
    if (clusters.isEmpty()) {
        AnsiUi.success("No configured clusters for " + getProviderName() + ".");
    } else {
        AnsiUi.success("Clusters for " + getProviderName() + ":");
        clusters.forEach(cluster -> AnsiUi.listItem(cluster.getName()));
    }
}
Also used : DCOSProvider(com.netflix.spinnaker.halyard.config.model.v1.providers.dcos.DCOSProvider) DCOSCluster(com.netflix.spinnaker.halyard.config.model.v1.providers.dcos.DCOSCluster) Provider(com.netflix.spinnaker.halyard.config.model.v1.node.Provider) DCOSProvider(com.netflix.spinnaker.halyard.config.model.v1.providers.dcos.DCOSProvider)

Example 5 with Provider

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

the class AbstractEditProviderCommand method executeThis.

@Override
protected void executeThis() {
    String providerName = getProviderName();
    String currentDeployment = getCurrentDeployment();
    Provider provider = new OperationHandler<Provider>().setFailureMesssage("Failed to get provider " + providerName + ".").setOperation(Daemon.getProvider(currentDeployment, providerName, false)).get();
    int originalHash = provider.hashCode();
    provider = editProvider((P) provider);
    if (originalHash == provider.hashCode()) {
        AnsiUi.failure("No changes supplied.");
        return;
    }
    new OperationHandler<Void>().setFailureMesssage("Failed to edit provider " + providerName + ".").setSuccessMessage("Successfully edited provider " + providerName + ".").setOperation(Daemon.setProvider(currentDeployment, providerName, !noValidate, provider)).get();
}
Also used : Provider(com.netflix.spinnaker.halyard.config.model.v1.node.Provider) OperationHandler(com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler)

Aggregations

Provider (com.netflix.spinnaker.halyard.config.model.v1.node.Provider)13 Account (com.netflix.spinnaker.halyard.config.model.v1.node.Account)9 OperationHandler (com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler)8 ConfigProblemBuilder (com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemBuilder)8 DockerRegistryProvider (com.netflix.spinnaker.halyard.config.model.v1.providers.dockerRegistry.DockerRegistryProvider)7 ArtifactProvider (com.netflix.spinnaker.halyard.config.model.v1.node.ArtifactProvider)6 DeploymentConfiguration (com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)6 ConfigNotFoundException (com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException)4 IllegalConfigException (com.netflix.spinnaker.halyard.config.error.v1.IllegalConfigException)4 ArtifactAccount (com.netflix.spinnaker.halyard.config.model.v1.node.ArtifactAccount)4 NodeIterator (com.netflix.spinnaker.halyard.config.model.v1.node.NodeIterator)4 AppengineProvider (com.netflix.spinnaker.halyard.config.model.v1.providers.appengine.AppengineProvider)4 AwsProvider (com.netflix.spinnaker.halyard.config.model.v1.providers.aws.AwsProvider)4 AzureProvider (com.netflix.spinnaker.halyard.config.model.v1.providers.azure.AzureProvider)4 DCOSCluster (com.netflix.spinnaker.halyard.config.model.v1.providers.dcos.DCOSCluster)4 DCOSProvider (com.netflix.spinnaker.halyard.config.model.v1.providers.dcos.DCOSProvider)4 DeploymentEnvironment (com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentEnvironment)3 HasImageProvider (com.netflix.spinnaker.halyard.config.model.v1.node.HasImageProvider)3 NodeFilter (com.netflix.spinnaker.halyard.config.model.v1.node.NodeFilter)3 GoogleProvider (com.netflix.spinnaker.halyard.config.model.v1.providers.google.GoogleProvider)3