Search in sources :

Example 1 with DeploySpringCloudAppTask

use of com.microsoft.azure.toolkit.lib.springcloud.task.DeploySpringCloudAppTask in project azure-tools-for-java by Microsoft.

the class SpringCloudDeploymentConfigurationState method execute.

@AzureOperation(name = "springcloud|app.create_update", params = { "this.config.getAppConfig().getAppName()" }, type = AzureOperation.Type.ACTION)
public SpringCloudDeployment execute(IAzureMessager messager) {
    AzureMessager.getContext().setMessager(messager);
    AzureTelemetry.getContext().setProperties(getTelemetryProperties());
    final SpringCloudAppConfig appConfig = this.config.getAppConfig();
    final DeploySpringCloudAppTask task = new DeploySpringCloudAppTask(appConfig);
    final SpringCloudDeployment deployment = task.execute();
    final SpringCloudApp app = deployment.app();
    final SpringCloudCluster cluster = app.getCluster();
    if (!deployment.waitUntilReady(GET_STATUS_TIMEOUT)) {
        messager.warning(GET_DEPLOYMENT_STATUS_TIMEOUT, NOTIFICATION_TITLE);
    }
    printPublicUrl(app);
    return deployment;
}
Also used : DeploySpringCloudAppTask(com.microsoft.azure.toolkit.lib.springcloud.task.DeploySpringCloudAppTask) SpringCloudDeployment(com.microsoft.azure.toolkit.lib.springcloud.SpringCloudDeployment) SpringCloudCluster(com.microsoft.azure.toolkit.lib.springcloud.SpringCloudCluster) SpringCloudAppConfig(com.microsoft.azure.toolkit.lib.springcloud.config.SpringCloudAppConfig) SpringCloudApp(com.microsoft.azure.toolkit.lib.springcloud.SpringCloudApp) AzureOperation(com.microsoft.azure.toolkit.lib.common.operation.AzureOperation)

Example 2 with DeploySpringCloudAppTask

use of com.microsoft.azure.toolkit.lib.springcloud.task.DeploySpringCloudAppTask in project azure-tools-for-java by Microsoft.

the class CreateSpringCloudAppAction method createApp.

@AzureOperation(name = "springcloud|app.create", params = "config.getAppName()", type = AzureOperation.Type.ACTION)
private static void createApp(SpringCloudAppConfig config) {
    AzureTaskManager.getInstance().runInBackground(AzureOperationBundle.title("springcloud|app.create", config.getAppName()), () -> {
        final DeploySpringCloudAppTask task = new DeploySpringCloudAppTask(config);
        final SpringCloudDeployment deployment = task.execute();
        if (!deployment.waitUntilReady(GET_STATUS_TIMEOUT)) {
            AzureMessager.getMessager().warning(GET_DEPLOYMENT_STATUS_TIMEOUT, NOTIFICATION_TITLE);
        }
    });
}
Also used : DeploySpringCloudAppTask(com.microsoft.azure.toolkit.lib.springcloud.task.DeploySpringCloudAppTask) SpringCloudDeployment(com.microsoft.azure.toolkit.lib.springcloud.SpringCloudDeployment) AzureOperation(com.microsoft.azure.toolkit.lib.common.operation.AzureOperation)

Aggregations

AzureOperation (com.microsoft.azure.toolkit.lib.common.operation.AzureOperation)2 SpringCloudDeployment (com.microsoft.azure.toolkit.lib.springcloud.SpringCloudDeployment)2 DeploySpringCloudAppTask (com.microsoft.azure.toolkit.lib.springcloud.task.DeploySpringCloudAppTask)2 SpringCloudApp (com.microsoft.azure.toolkit.lib.springcloud.SpringCloudApp)1 SpringCloudCluster (com.microsoft.azure.toolkit.lib.springcloud.SpringCloudCluster)1 SpringCloudAppConfig (com.microsoft.azure.toolkit.lib.springcloud.config.SpringCloudAppConfig)1