Search in sources :

Example 1 with AzureSpringCloud

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

the class SpringCloudClusterComboBox method loadItems.

@NotNull
@Override
@AzureOperation(name = "springcloud|cluster.list.subscription", params = { "this.subscription.getId()" }, type = AzureOperation.Type.SERVICE)
protected List<? extends SpringCloudCluster> loadItems() throws Exception {
    if (Objects.nonNull(this.subscription)) {
        final String sid = this.subscription.getId();
        final AzureSpringCloud az = Azure.az(AzureSpringCloud.class).subscription(sid);
        return az.clusters();
    }
    return Collections.emptyList();
}
Also used : AzureSpringCloud(com.microsoft.azure.toolkit.lib.springcloud.AzureSpringCloud) AzureOperation(com.microsoft.azure.toolkit.lib.common.operation.AzureOperation) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with AzureSpringCloud

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

the class SpringCloudExplorerContributor method getModuleNode.

@Override
public Node<?> getModuleNode() {
    final AzureActionManager am = AzureActionManager.getInstance();
    final IAzureMessager messager = AzureMessager.getDefaultMessager();
    final AzureSpringCloud service = az(AzureSpringCloud.class);
    return new Node<>(service).view(new AzureServiceLabelView<>(service, "Spring Cloud", ICON)).actions(SpringCloudActionsContributor.SERVICE_ACTIONS).addChildren(AzureSpringCloud::clusters, (cluster, ascNode) -> new Node<>(cluster).view(new AzureResourceLabelView<>(cluster)).actions(SpringCloudActionsContributor.CLUSTER_ACTIONS).addChildren(SpringCloudCluster::apps, (app, clusterNode) -> new Node<>(app).view(new AzureResourceLabelView<>(app)).actions(SpringCloudActionsContributor.APP_ACTIONS)));
}
Also used : IExplorerContributor(com.microsoft.azure.toolkit.ide.common.IExplorerContributor) AzureResourceLabelView(com.microsoft.azure.toolkit.ide.common.component.AzureResourceLabelView) AzureServiceLabelView(com.microsoft.azure.toolkit.ide.common.component.AzureServiceLabelView) SpringCloudCluster(com.microsoft.azure.toolkit.lib.springcloud.SpringCloudCluster) Azure.az(com.microsoft.azure.toolkit.lib.Azure.az) IAzureMessager(com.microsoft.azure.toolkit.lib.common.messager.IAzureMessager) AzureActionManager(com.microsoft.azure.toolkit.lib.common.action.AzureActionManager) AzureMessager(com.microsoft.azure.toolkit.lib.common.messager.AzureMessager) AzureSpringCloud(com.microsoft.azure.toolkit.lib.springcloud.AzureSpringCloud) Node(com.microsoft.azure.toolkit.ide.common.component.Node) IAzureMessager(com.microsoft.azure.toolkit.lib.common.messager.IAzureMessager) Node(com.microsoft.azure.toolkit.ide.common.component.Node) AzureResourceLabelView(com.microsoft.azure.toolkit.ide.common.component.AzureResourceLabelView) AzureActionManager(com.microsoft.azure.toolkit.lib.common.action.AzureActionManager) AzureSpringCloud(com.microsoft.azure.toolkit.lib.springcloud.AzureSpringCloud)

Aggregations

AzureSpringCloud (com.microsoft.azure.toolkit.lib.springcloud.AzureSpringCloud)2 IExplorerContributor (com.microsoft.azure.toolkit.ide.common.IExplorerContributor)1 AzureResourceLabelView (com.microsoft.azure.toolkit.ide.common.component.AzureResourceLabelView)1 AzureServiceLabelView (com.microsoft.azure.toolkit.ide.common.component.AzureServiceLabelView)1 Node (com.microsoft.azure.toolkit.ide.common.component.Node)1 Azure.az (com.microsoft.azure.toolkit.lib.Azure.az)1 AzureActionManager (com.microsoft.azure.toolkit.lib.common.action.AzureActionManager)1 AzureMessager (com.microsoft.azure.toolkit.lib.common.messager.AzureMessager)1 IAzureMessager (com.microsoft.azure.toolkit.lib.common.messager.IAzureMessager)1 AzureOperation (com.microsoft.azure.toolkit.lib.common.operation.AzureOperation)1 SpringCloudCluster (com.microsoft.azure.toolkit.lib.springcloud.SpringCloudCluster)1 NotNull (org.jetbrains.annotations.NotNull)1