Skip to content

Commit 8319489

Browse files
authored
Merge pull request #7698 from fengshuaihu/users/v-shufeng/hdi-track1-to-track2
change track1 to track2
2 parents 167ddea + 2d84047 commit 8319489

File tree

65 files changed

+175
-872
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+175
-872
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/src/main/java/com/microsoft/intellij/helpers/UIHelperImpl.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import com.microsoft.tooling.msservices.model.storage.ClientStorageAccount;
3535
import com.microsoft.tooling.msservices.serviceexplorer.Node;
3636
import com.microsoft.tooling.msservices.serviceexplorer.azure.container.ContainerRegistryNode;
37-
import com.microsoft.tooling.msservices.serviceexplorer.azure.rediscache.RedisCacheNode;
3837
import lombok.extern.slf4j.Slf4j;
3938
import org.apache.commons.lang3.ArrayUtils;
4039
import org.apache.commons.lang3.StringUtils;
@@ -150,16 +149,6 @@ public File showFileSaver(String title, String fileName) {
150149
return null;
151150
}
152151

153-
@Override
154-
public void openRedisPropertyView(@NotNull RedisCacheNode node) {
155-
throw new UnsupportedOperationException("this method should not be called");
156-
}
157-
158-
@Override
159-
public void openRedisExplorer(RedisCacheNode redisCacheNode) {
160-
throw new UnsupportedOperationException("this method should not be called");
161-
}
162-
163152
@Override
164153
public void openInBrowser(String link) {
165154
try {

Utils/azure-explorer-common/src/com/microsoft/tooling/msservices/helpers/UIHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import com.microsoft.azuretools.azurecommons.helpers.NotNull;
99
import com.microsoft.tooling.msservices.serviceexplorer.Node;
1010
import com.microsoft.tooling.msservices.serviceexplorer.azure.container.ContainerRegistryNode;
11-
import com.microsoft.tooling.msservices.serviceexplorer.azure.rediscache.RedisCacheNode;
11+
//import com.microsoft.tooling.msservices.serviceexplorer.azure.rediscache.RedisCacheNode;
1212

1313
import javax.swing.*;
1414
import java.awt.*;
@@ -44,9 +44,9 @@ default boolean showConfirmation(@NotNull Component component, @NotNull String m
4444

4545
File showFileSaver(String title, String fileName);
4646

47-
void openRedisPropertyView(@NotNull RedisCacheNode node);
47+
// void openRedisPropertyView(@NotNull RedisCacheNode node);
4848

49-
void openRedisExplorer(@NotNull RedisCacheNode node);
49+
// void openRedisExplorer(@NotNull RedisCacheNode node);
5050

5151
void openInBrowser(String link);
5252

Utils/azure-explorer-common/src/com/microsoft/tooling/msservices/helpers/azure/sdk/AzureSDKManager.java

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,16 @@
55

66
package com.microsoft.tooling.msservices.helpers.azure.sdk;
77

8-
import com.google.gson.Gson;
9-
import com.google.gson.JsonArray;
10-
import com.google.gson.JsonObject;
11-
import com.google.gson.JsonParseException;
128
import com.microsoft.azure.toolkit.lib.applicationinsights.ApplicationInsight;
139
import com.microsoft.azure.toolkit.lib.applicationinsights.AzureApplicationInsights;
1410
import com.microsoft.azure.toolkit.lib.applicationinsights.task.GetOrCreateApplicationInsightsTask;
15-
import com.microsoft.azure.toolkit.lib.auth.AzureAccount;
1611
import com.microsoft.azure.toolkit.lib.common.model.Region;
1712
import com.microsoft.azure.toolkit.lib.common.model.Subscription;
1813
import com.microsoft.azure.toolkit.lib.monitor.LogAnalyticsWorkspaceConfig;
19-
import com.microsoft.azuretools.authmanage.IdeAzureAccount;
2014
import lombok.extern.slf4j.Slf4j;
21-
import org.apache.http.client.methods.CloseableHttpResponse;
22-
import org.apache.http.client.methods.HttpGet;
23-
import org.apache.http.impl.client.HttpClients;
2415

2516
import javax.annotation.Nonnull;
2617
import java.io.IOException;
27-
import java.io.InputStream;
28-
import java.io.InputStreamReader;
29-
import java.util.ArrayList;
30-
import java.util.Collections;
3118
import java.util.List;
3219

3320
@Slf4j
@@ -70,37 +57,4 @@ public static ApplicationInsight createInsightsResource(@Nonnull Subscription su
7057
return createInsightsResource(subscription.getId(), resourceGroupName, resourceName, location, workspaceConfig);
7158
}
7259

73-
public static List<String> getLocationsForInsights(String subscriptionId) throws IOException {
74-
final HttpGet request = new HttpGet(INSIGHTS_REGION_LIST_URL);
75-
final Subscription subscription = com.microsoft.azure.toolkit.lib.Azure.az(AzureAccount.class).account().getSubscription(subscriptionId);
76-
final String accessToken = IdeAzureAccount.getInstance().getAccessTokenForTrack1(subscription.getTenantId());
77-
request.setHeader("Authorization", String.format("Bearer %s", accessToken));
78-
final CloseableHttpResponse response = HttpClients.createDefault().execute(request);
79-
final InputStream responseStream = response.getEntity().getContent();
80-
try (final InputStreamReader isr = new InputStreamReader(responseStream)) {
81-
final Gson gson = new Gson();
82-
final JsonObject jsonContent = (gson).fromJson(isr, JsonObject.class);
83-
final JsonArray jsonResourceTypes = jsonContent.getAsJsonArray("resourceTypes");
84-
for (int i = 0; i < jsonResourceTypes.size(); ++i) {
85-
final Object obj = jsonResourceTypes.get(i);
86-
if (obj instanceof JsonObject) {
87-
final JsonObject jsonResourceType = (JsonObject) obj;
88-
final String resourceType = jsonResourceType.get("resourceType").getAsString();
89-
if (resourceType.equalsIgnoreCase("components")) {
90-
final JsonArray jsonLocations = jsonResourceType.getAsJsonArray("locations");
91-
return gson.fromJson(jsonLocations, new ArrayList().getClass());
92-
}
93-
}
94-
}
95-
} catch (final IOException | JsonParseException e) {
96-
log.error(e.getMessage(), e);
97-
}
98-
return Collections.emptyList();
99-
}
100-
101-
// TODO: AI SDK doesn't provide a method to list regions which are available regions to create AI,
102-
// we are requiring the SDK to provide that API, before SDK side fix, we will use our own impl
103-
public static List<String> getLocationsForInsights(Subscription subscription) throws IOException {
104-
return getLocationsForInsights(subscription.getId());
105-
}
10660
}

Utils/azure-explorer-common/src/com/microsoft/tooling/msservices/serviceexplorer/BasicActionBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import com.google.common.base.Preconditions;
99
import com.microsoft.azuretools.ActionConstants;
1010
import com.microsoft.tooling.msservices.serviceexplorer.azure.container.ContainerRegistryModule;
11-
import com.microsoft.tooling.msservices.serviceexplorer.azure.rediscache.RedisCacheModule;
11+
//import com.microsoft.tooling.msservices.serviceexplorer.azure.rediscache.RedisCacheModule;
1212
import com.microsoft.tooling.msservices.serviceexplorer.azure.storage.StorageModule;
1313
import com.microsoft.tooling.msservices.serviceexplorer.azure.vmarm.VMArmModule;
1414
import org.apache.commons.lang3.StringUtils;
@@ -40,7 +40,7 @@ public class BasicActionBuilder {
4040
private boolean promptable;
4141

4242
static {
43-
MODULE_NAME_TO_SERVICE_NAME_MAP.put(RedisCacheModule.MODULE_NAME, ActionConstants.RedisCache.MODULE);
43+
//MODULE_NAME_TO_SERVICE_NAME_MAP.put(RedisCacheModule.MODULE_NAME, ActionConstants.RedisCache.MODULE);
4444
MODULE_NAME_TO_SERVICE_NAME_MAP.put(VMArmModule.MODULE_NAME, ActionConstants.VirtualMachine.MODULE);
4545
MODULE_NAME_TO_SERVICE_NAME_MAP.put(StorageModule.MODULE_NAME, ActionConstants.StorageAccount.MODULE);
4646
MODULE_NAME_TO_SERVICE_NAME_MAP.put("Deployment of Resource Management", ActionConstants.ResourceManagement.MODULE);

Utils/azure-explorer-common/src/com/microsoft/tooling/msservices/serviceexplorer/azure/AzureModule.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import com.microsoft.tooling.msservices.serviceexplorer.AzureRefreshableNode;
2323
import com.microsoft.tooling.msservices.serviceexplorer.Node;
2424
import com.microsoft.tooling.msservices.serviceexplorer.azure.container.ContainerRegistryModule;
25-
import com.microsoft.tooling.msservices.serviceexplorer.azure.rediscache.RedisCacheModule;
25+
//import com.microsoft.tooling.msservices.serviceexplorer.azure.rediscache.RedisCacheModule;
2626
import com.microsoft.tooling.msservices.serviceexplorer.azure.storage.StorageModule;
2727
import com.microsoft.tooling.msservices.serviceexplorer.azure.vmarm.VMArmModule;
2828
import lombok.Setter;
@@ -42,8 +42,8 @@ public class AzureModule extends AzureRefreshableNode {
4242
private final Object project;
4343
@Nullable
4444
private VMArmModule vmArmServiceModule;
45-
@Nullable
46-
private RedisCacheModule redisCacheModule;
45+
// @Nullable
46+
// private RedisCacheModule redisCacheModule;
4747
@Nullable
4848
private StorageModule storageModule;
4949
@Nullable
@@ -67,7 +67,7 @@ public AzureModule(@Nullable Object project) {
6767
this.storageModule = new StorageModule(this);
6868
//this.hdInsightModule = new HDInsightRootModule(this);
6969
this.vmArmServiceModule = new VMArmModule(this);
70-
this.redisCacheModule = new RedisCacheModule(this);
70+
//this.redisCacheModule = new RedisCacheModule(this);
7171
this.containerRegistryModule = new ContainerRegistryModule(this);
7272
}
7373

@@ -126,9 +126,9 @@ protected void refreshItems() throws AzureCmdException {
126126
if (vmArmServiceModule != null && !isDirectChild(vmArmServiceModule)) {
127127
addChildNode(vmArmServiceModule);
128128
}
129-
if (redisCacheModule != null && !isDirectChild(redisCacheModule)) {
130-
addChildNode(redisCacheModule);
131-
}
129+
// if (redisCacheModule != null && !isDirectChild(redisCacheModule)) {
130+
// addChildNode(redisCacheModule);
131+
// }
132132
if (storageModule != null && !isDirectChild(storageModule)) {
133133
addChildNode(storageModule);
134134
}
@@ -158,9 +158,9 @@ protected void refreshFromAzure() throws AzureCmdException {
158158
if (vmArmServiceModule != null) {
159159
vmArmServiceModule.load(true);
160160
}
161-
if (redisCacheModule != null) {
162-
redisCacheModule.load(true);
163-
}
161+
// if (redisCacheModule != null) {
162+
// redisCacheModule.load(true);
163+
// }
164164
if (storageModule != null) {
165165
storageModule.load(true);
166166
}

Utils/azure-explorer-common/src/com/microsoft/tooling/msservices/serviceexplorer/azure/rediscache/RedisCacheModule.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

Utils/azure-explorer-common/src/com/microsoft/tooling/msservices/serviceexplorer/azure/rediscache/RedisCacheModulePresenter.java

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)