mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Combine azure-resource.d.ts into azurecore.d.ts (#19047)
This commit is contained in:
@@ -7,7 +7,7 @@ import * as azdata from 'azdata';
|
||||
import { AppContext } from './appContext';
|
||||
import { AzureResourceServiceNames } from './azureResource/constants';
|
||||
import { IAzureResourceSubscriptionService } from './azureResource/interfaces';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
import * as azureResourceUtils from './azureResource/utils';
|
||||
import * as constants from './constants';
|
||||
import * as loc from './localizedConstants';
|
||||
|
||||
@@ -1,158 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare module 'azureResource' {
|
||||
import { TreeDataProvider } from 'vscode';
|
||||
import { DataProvider, TreeItem } from 'azdata';
|
||||
import { BlobItem } from '@azure/storage-blob';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
|
||||
export namespace azureResource {
|
||||
|
||||
/**
|
||||
* AzureCore core extension supports following resource types of Azure Resource Graph.
|
||||
* To add more resources, please refer this guide: https://docs.microsoft.com/en-us/azure/governance/resource-graph/reference/supported-tables-resources
|
||||
*/
|
||||
export const enum AzureResourceType {
|
||||
resourceGroup = 'microsoft.resources/subscriptions/resourcegroups',
|
||||
sqlServer = 'microsoft.sql/servers',
|
||||
sqlDatabase = 'microsoft.sql/servers/databases',
|
||||
sqlManagedInstance = 'microsoft.sql/managedinstances',
|
||||
azureArcSqlManagedInstance = 'microsoft.azuredata/sqlmanagedinstances',
|
||||
virtualMachines = 'microsoft.compute/virtualmachines',
|
||||
kustoClusters = 'microsoft.kusto/clusters',
|
||||
azureArcPostgresServer = 'microsoft.azuredata/postgresinstances',
|
||||
postgresServer = 'microsoft.dbforpostgresql/servers',
|
||||
azureArcService = 'microsoft.azuredata/datacontrollers',
|
||||
storageAccount = 'microsoft.storage/storageaccounts',
|
||||
logAnalytics = 'microsoft.operationalinsights/workspaces'
|
||||
}
|
||||
|
||||
export interface IAzureResourceProvider extends DataProvider {
|
||||
getTreeDataProvider(): IAzureResourceTreeDataProvider;
|
||||
}
|
||||
|
||||
export interface IAzureResourceTreeDataProvider extends TreeDataProvider<IAzureResourceNode> {
|
||||
browseConnectionMode: boolean;
|
||||
}
|
||||
|
||||
export interface IAzureResourceNode {
|
||||
readonly account: AzureAccount;
|
||||
readonly subscription: AzureResourceSubscription;
|
||||
readonly tenantId: string;
|
||||
readonly treeItem: TreeItem;
|
||||
}
|
||||
|
||||
export interface IAzureSubscriptionInfo {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface AzureResource {
|
||||
name: string;
|
||||
id: string;
|
||||
subscription: IAzureSubscriptionInfo;
|
||||
resourceGroup?: string;
|
||||
tenant?: string;
|
||||
}
|
||||
|
||||
export interface AzureResourceSubscription extends Omit<AzureResource, 'subscription'> {
|
||||
}
|
||||
|
||||
export interface AzureSqlResource extends AzureResource {
|
||||
loginName: string;
|
||||
}
|
||||
|
||||
export interface AzureGraphResource extends Omit<AzureResource, 'tenant' | 'subscription'> {
|
||||
tenantId: string;
|
||||
subscriptionId: string;
|
||||
type: string;
|
||||
location: string;
|
||||
}
|
||||
|
||||
export interface AzureResourceResourceGroup extends AzureResource {
|
||||
location?: string;
|
||||
managedBy?: string;
|
||||
properties?: {
|
||||
provisioningState?: string
|
||||
};
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export interface AzureLocation {
|
||||
id: string,
|
||||
name: string,
|
||||
displayName: string,
|
||||
regionalDisplayName: string,
|
||||
metadata: {
|
||||
regionType: string,
|
||||
regionCategory: string,
|
||||
geographyGroup: string,
|
||||
longitude: number,
|
||||
latitude: number,
|
||||
physicalLocation: string,
|
||||
pairedRegion: {
|
||||
name: string,
|
||||
id: string,
|
||||
}[],
|
||||
},
|
||||
}
|
||||
|
||||
export interface AzureSqlManagedInstance extends AzureGraphResource {
|
||||
sku: {
|
||||
capacity: number;
|
||||
family: string;
|
||||
name: string;
|
||||
tier: 'GeneralPurpose' | 'BusinessCritical';
|
||||
},
|
||||
properties: {
|
||||
provisioningState: string,
|
||||
storageAccountType: string,
|
||||
maintenanceConfigurationId: string,
|
||||
state: string,
|
||||
licenseType: string,
|
||||
zoneRedundant: false,
|
||||
fullyQualifiedDomainName: string,
|
||||
collation: string,
|
||||
administratorLogin: string,
|
||||
minimalTlsVersion: string,
|
||||
subnetId: string,
|
||||
publicDataEndpointEnabled: boolean,
|
||||
storageSizeInGB: number,
|
||||
timezoneId: string,
|
||||
proxyOverride: string,
|
||||
vCores: number,
|
||||
dnsZone: string,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export interface ManagedDatabase {
|
||||
id: string,
|
||||
location: string,
|
||||
name: string,
|
||||
properties: {
|
||||
sourceDatabaseId: string,
|
||||
status: string
|
||||
},
|
||||
type: string
|
||||
}
|
||||
|
||||
export interface AzureResourceDatabase extends AzureSqlResource {
|
||||
serverName: string;
|
||||
serverFullName: string;
|
||||
}
|
||||
|
||||
export interface AzureResourceDatabaseServer extends AzureSqlResource {
|
||||
fullName: string;
|
||||
defaultDatabaseName: string;
|
||||
}
|
||||
export interface BlobContainer extends AzureResource { }
|
||||
|
||||
export interface FileShare extends AzureResource { }
|
||||
|
||||
export interface Blob extends BlobItem { }
|
||||
}
|
||||
}
|
||||
@@ -9,13 +9,12 @@ import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
import { AppContext } from '../appContext';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { TreeNode } from './treeNode';
|
||||
import { AzureResourceTreeProvider } from './tree/treeProvider';
|
||||
import { AzureResourceAccountTreeNode } from './tree/accountTreeNode';
|
||||
import { IAzureResourceSubscriptionService, IAzureResourceSubscriptionFilterService, IAzureTerminalService } from '../azureResource/interfaces';
|
||||
import { AzureResourceServiceNames } from './constants';
|
||||
import { AzureAccount, Tenant } from 'azurecore';
|
||||
import { AzureAccount, Tenant, azureResource } from 'azurecore';
|
||||
import { FlatAccountTreeNode } from './tree/flatAccountTreeNode';
|
||||
import { ConnectionDialogTreeProvider } from './tree/connectionDialogTreeProvider';
|
||||
import { AzureResourceErrorMessageUtil } from './utils';
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
import * as msRest from '@azure/ms-rest-js';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureAccount, Tenant } from 'azurecore';
|
||||
import { AzureAccount, Tenant, azureResource } from 'azurecore';
|
||||
|
||||
export interface IAzureResourceSubscriptionService {
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { ExtensionContext } from 'vscode';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { AzureMonitorTreeDataProvider as AzureMonitorTreeDataProvider } from './azuremonitorTreeDataProvider';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
import { ResourceServiceBase, GraphData } from '../resourceTreeDataProviderBase';
|
||||
|
||||
export interface AzureMonitorGraphData extends GraphData {
|
||||
|
||||
@@ -12,8 +12,7 @@ import { AzureResourceItemType } from '../../constants';
|
||||
import { generateGuid } from '../../utils';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { ResourceTreeDataProviderBase } from '../resourceTreeDataProviderBase';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
export class AzureMonitorTreeDataProvider extends ResourceTreeDataProviderBase<azureResource.AzureResourceDatabaseServer> {
|
||||
private static readonly containerId = 'azure.resource.providers.AzureMonitorContainer';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { ExtensionContext } from 'vscode';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
import { AzureResourceDatabaseTreeDataProvider } from './databaseTreeDataProvider';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ServiceClientCredentials } from '@azure/ms-rest-js';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { serversQuery, DbServerGraphData } from '../databaseServer/databaseServerService';
|
||||
import { ResourceGraphClient } from '@azure/arm-resourcegraph';
|
||||
import { queryGraphResources, GraphData } from '../resourceTreeDataProviderBase';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
interface DatabaseGraphData extends GraphData {
|
||||
kind: string;
|
||||
|
||||
@@ -8,12 +8,11 @@ import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureResourceItemType } from '../../../azureResource/constants';
|
||||
import { generateGuid } from '../../utils';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { ResourceTreeDataProviderBase } from '../resourceTreeDataProviderBase';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
export class AzureResourceDatabaseTreeDataProvider extends ResourceTreeDataProviderBase<azureResource.AzureResourceDatabase> {
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { ExtensionContext } from 'vscode';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { AzureResourceDatabaseServerTreeDataProvider } from './databaseServerTreeDataProvider';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
|
||||
import { ResourceServiceBase, GraphData } from '../resourceTreeDataProviderBase';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
|
||||
export interface DbServerGraphData extends GraphData {
|
||||
properties: {
|
||||
|
||||
@@ -12,8 +12,7 @@ import { AzureResourceItemType } from '../../../azureResource/constants';
|
||||
import { generateGuid } from '../../utils';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { ResourceTreeDataProviderBase } from '../resourceTreeDataProviderBase';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
export class AzureResourceDatabaseServerTreeDataProvider extends ResourceTreeDataProviderBase<azureResource.AzureResourceDatabaseServer> {
|
||||
private static readonly containerId = 'azure.resource.providers.databaseServer.treeDataProvider.databaseServerContainer';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { ExtensionContext } from 'vscode';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { KustoTreeDataProvider as KustoTreeDataProvider } from './kustoTreeDataProvider';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
import { ResourceServiceBase, GraphData } from '../resourceTreeDataProviderBase';
|
||||
|
||||
export interface KustoGraphData extends GraphData {
|
||||
|
||||
@@ -12,8 +12,7 @@ import { AzureResourceItemType } from '../../constants';
|
||||
import { generateGuid } from '../../utils';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { ResourceTreeDataProviderBase } from '../resourceTreeDataProviderBase';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
export class KustoTreeDataProvider extends ResourceTreeDataProviderBase<azureResource.AzureResourceDatabaseServer> {
|
||||
private static readonly containerId = 'azure.resource.providers.KustoContainer';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { ExtensionContext } from 'vscode';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { PostgresServerArcTreeDataProvider as PostgresServerArcTreeDataProvider } from './postgresServerTreeDataProvider';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ResourceServiceBase, GraphData } from '../resourceTreeDataProviderBase';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
|
||||
export interface PostgresArcServerGraphData extends GraphData {
|
||||
properties: {
|
||||
|
||||
@@ -12,8 +12,7 @@ import { AzureResourceItemType } from '../../constants';
|
||||
import { generateGuid } from '../../utils';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { ResourceTreeDataProviderBase } from '../resourceTreeDataProviderBase';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
export class PostgresServerArcTreeDataProvider extends ResourceTreeDataProviderBase<azureResource.AzureResourceDatabaseServer> {
|
||||
private static readonly containerId = 'azure.resource.providers.postgresArcServer.treeDataProvider.postgresServerContainer';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { ExtensionContext } from 'vscode';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { PostgresServerTreeDataProvider as PostgresServerTreeDataProvider } from './postgresServerTreeDataProvider';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
|
||||
import { ResourceServiceBase, GraphData } from '../resourceTreeDataProviderBase';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
|
||||
|
||||
interface DbServerGraphData extends GraphData {
|
||||
|
||||
@@ -12,8 +12,7 @@ import { AzureResourceItemType } from '../../constants';
|
||||
import { generateGuid } from '../../utils';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { ResourceTreeDataProviderBase } from '../resourceTreeDataProviderBase';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
export class PostgresServerTreeDataProvider extends ResourceTreeDataProviderBase<azureResource.AzureResourceDatabaseServer> {
|
||||
private static readonly containerId = 'azure.resource.providers.databaseServer.treeDataProvider.postgresServerContainer';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { DbServerGraphData } from '../databaseServer/databaseServerService';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
import { ResourceServiceBase } from '../resourceTreeDataProviderBase';
|
||||
|
||||
export class AzureResourceGroupService extends ResourceServiceBase<DbServerGraphData, azureResource.AzureResourceResourceGroup> {
|
||||
|
||||
@@ -6,11 +6,10 @@
|
||||
import * as azdata from 'azdata';
|
||||
import * as msRest from '@azure/ms-rest-js';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { IAzureResourceService } from '../interfaces';
|
||||
import { AzureResourceErrorMessageUtil } from '../utils';
|
||||
import { ResourceGraphClient } from '@azure/arm-resourcegraph';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
export abstract class ResourceTreeDataProviderBase<T extends azureResource.AzureResource> implements azureResource.IAzureResourceTreeDataProvider {
|
||||
public browseConnectionMode: boolean = false;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { ExtensionContext } from 'vscode';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { SqlInstanceTreeDataProvider as SqlInstanceTreeDataProvider } from './sqlInstanceTreeDataProvider';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
import { ResourceServiceBase, GraphData } from '../resourceTreeDataProviderBase';
|
||||
|
||||
interface SqlInstanceGraphData extends GraphData {
|
||||
|
||||
@@ -12,8 +12,7 @@ import { AzureResourceItemType } from '../../constants';
|
||||
import { generateGuid } from '../../utils';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { ResourceTreeDataProviderBase } from '../resourceTreeDataProviderBase';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
export class SqlInstanceTreeDataProvider extends ResourceTreeDataProviderBase<azureResource.AzureResourceDatabaseServer> {
|
||||
private static readonly containerId = 'azure.resource.providers.sqlInstanceContainer';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { ExtensionContext } from 'vscode';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { SqlInstanceArcTreeDataProvider as SqlInstanceArcTreeDataProvider } from './sqlInstanceArcTreeDataProvider';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ResourceServiceBase, GraphData } from '../resourceTreeDataProviderBase';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { azureResource } from 'azurecore';
|
||||
|
||||
export interface SqlInstanceArcGraphData extends GraphData {
|
||||
properties: {
|
||||
|
||||
@@ -12,8 +12,7 @@ import { AzureResourceItemType } from '../../constants';
|
||||
import { generateGuid } from '../../utils';
|
||||
import { IAzureResourceService } from '../../interfaces';
|
||||
import { ResourceTreeDataProviderBase } from '../resourceTreeDataProviderBase';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
export class SqlInstanceArcTreeDataProvider extends ResourceTreeDataProviderBase<azureResource.AzureResourceDatabaseServer> {
|
||||
private static readonly containerId = 'azure.resource.providers.sqlInstanceArcContainer';
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
|
||||
import { extensions, TreeItem } from 'vscode';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { IAzureResourceNodeWithProviderId } from './interfaces';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
export class AzureResourceService {
|
||||
private _areResourceProvidersLoaded: boolean = false;
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
import { IAzureResourceSubscriptionFilterService, IAzureResourceCacheService } from '../interfaces';
|
||||
|
||||
interface AzureResourceSelectedSubscriptionsCache {
|
||||
|
||||
@@ -6,15 +6,13 @@
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { SubscriptionClient } from '@azure/arm-subscriptions';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
import { IAzureResourceSubscriptionService } from '../interfaces';
|
||||
import { TokenCredentials } from '@azure/ms-rest-js';
|
||||
import { AzureSubscriptionError } from '../errors';
|
||||
import { AzureResourceErrorMessageUtil } from '../utils';
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export class AzureResourceSubscriptionService implements IAzureResourceSubscriptionService {
|
||||
|
||||
@@ -10,7 +10,6 @@ import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
import { AppContext } from '../../appContext';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { TreeNode } from '../treeNode';
|
||||
import { AzureSubscriptionError } from '../errors';
|
||||
import { AzureResourceContainerTreeNodeBase } from './baseTreeNodes';
|
||||
@@ -20,7 +19,7 @@ import { AzureResourceMessageTreeNode } from '../messageTreeNode';
|
||||
import { AzureResourceErrorMessageUtil } from '../utils';
|
||||
import { IAzureResourceTreeChangeHandler } from './treeChangeHandler';
|
||||
import { IAzureResourceSubscriptionService, IAzureResourceSubscriptionFilterService } from '../../azureResource/interfaces';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
export class AzureResourceAccountTreeNode extends AzureResourceContainerTreeNodeBase {
|
||||
public constructor(
|
||||
|
||||
@@ -10,14 +10,13 @@ import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
import { AppContext } from '../../appContext';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { TreeNode } from '../treeNode';
|
||||
import { AzureSubscriptionError } from '../errors';
|
||||
import { AzureResourceContainerTreeNodeBase } from './baseTreeNodes';
|
||||
import { AzureResourceItemType, AzureResourceServiceNames } from '../constants';
|
||||
import { IAzureResourceTreeChangeHandler } from './treeChangeHandler';
|
||||
import { IAzureResourceSubscriptionService, IAzureResourceSubscriptionFilterService } from '../../azureResource/interfaces';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
import { AzureResourceService } from '../resourceService';
|
||||
import { AzureResourceResourceTreeNode } from '../resourceTreeNode';
|
||||
import { AzureResourceErrorMessageUtil } from '../utils';
|
||||
|
||||
@@ -9,7 +9,6 @@ import { AppContext } from '../../appContext';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { TreeNode } from '../treeNode';
|
||||
import { IAzureResourceNodeWithProviderId } from '../interfaces';
|
||||
import { AzureResourceContainerTreeNodeBase } from './baseTreeNodes';
|
||||
@@ -19,7 +18,7 @@ import { AzureResourceMessageTreeNode } from '../messageTreeNode';
|
||||
import { AzureResourceErrorMessageUtil } from '../utils';
|
||||
import { AzureResourceService } from '../resourceService';
|
||||
import { AzureResourceResourceTreeNode } from '../resourceTreeNode';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
export class AzureResourceSubscriptionTreeNode extends AzureResourceContainerTreeNodeBase {
|
||||
public constructor(
|
||||
|
||||
@@ -7,8 +7,7 @@ import { ResourceGraphClient } from '@azure/arm-resourcegraph';
|
||||
import { TokenCredentials } from '@azure/ms-rest-js';
|
||||
import axios, { AxiosRequestConfig } from 'axios';
|
||||
import * as azdata from 'azdata';
|
||||
import { AzureRestResponse, GetResourceGroupsResult, GetSubscriptionsResult, ResourceQueryResult, GetBlobContainersResult, GetFileSharesResult, HttpRequestMethod, GetLocationsResult, GetManagedDatabasesResult, CreateResourceGroupResult, GetBlobsResult, GetStorageAccountAccessKeyResult, AzureAccount } from 'azurecore';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureRestResponse, GetResourceGroupsResult, GetSubscriptionsResult, ResourceQueryResult, GetBlobContainersResult, GetFileSharesResult, HttpRequestMethod, GetLocationsResult, GetManagedDatabasesResult, CreateResourceGroupResult, GetBlobsResult, GetStorageAccountAccessKeyResult, AzureAccount, azureResource } from 'azurecore';
|
||||
import { EOL } from 'os';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { AppContext } from '../appContext';
|
||||
|
||||
150
extensions/azurecore/src/azurecore.d.ts
vendored
150
extensions/azurecore/src/azurecore.d.ts
vendored
@@ -5,7 +5,8 @@
|
||||
|
||||
declare module 'azurecore' {
|
||||
import * as azdata from 'azdata';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { TreeDataProvider } from 'vscode';
|
||||
import { BlobItem } from '@azure/storage-blob';
|
||||
|
||||
/**
|
||||
* Covers defining what the azurecore extension exports to other extensions
|
||||
@@ -320,4 +321,151 @@ declare module 'azurecore' {
|
||||
export type AzureRestResponse = { response: any, errors: Error[] };
|
||||
export type GetBlobsResult = { blobs: azureResource.Blob[], errors: Error[] };
|
||||
export type GetStorageAccountAccessKeyResult = { keyName1: string, keyName2: string, errors: Error[] };
|
||||
|
||||
export namespace azureResource {
|
||||
|
||||
/**
|
||||
* AzureCore core extension supports following resource types of Azure Resource Graph.
|
||||
* To add more resources, please refer this guide: https://docs.microsoft.com/en-us/azure/governance/resource-graph/reference/supported-tables-resources
|
||||
*/
|
||||
export const enum AzureResourceType {
|
||||
resourceGroup = 'microsoft.resources/subscriptions/resourcegroups',
|
||||
sqlServer = 'microsoft.sql/servers',
|
||||
sqlDatabase = 'microsoft.sql/servers/databases',
|
||||
sqlManagedInstance = 'microsoft.sql/managedinstances',
|
||||
azureArcSqlManagedInstance = 'microsoft.azuredata/sqlmanagedinstances',
|
||||
virtualMachines = 'microsoft.compute/virtualmachines',
|
||||
kustoClusters = 'microsoft.kusto/clusters',
|
||||
azureArcPostgresServer = 'microsoft.azuredata/postgresinstances',
|
||||
postgresServer = 'microsoft.dbforpostgresql/servers',
|
||||
azureArcService = 'microsoft.azuredata/datacontrollers',
|
||||
storageAccount = 'microsoft.storage/storageaccounts',
|
||||
logAnalytics = 'microsoft.operationalinsights/workspaces'
|
||||
}
|
||||
|
||||
export interface IAzureResourceProvider extends azdata.DataProvider {
|
||||
getTreeDataProvider(): IAzureResourceTreeDataProvider;
|
||||
}
|
||||
|
||||
export interface IAzureResourceTreeDataProvider extends TreeDataProvider<IAzureResourceNode> {
|
||||
browseConnectionMode: boolean;
|
||||
}
|
||||
|
||||
export interface IAzureResourceNode {
|
||||
readonly account: AzureAccount;
|
||||
readonly subscription: AzureResourceSubscription;
|
||||
readonly tenantId: string;
|
||||
readonly treeItem: azdata.TreeItem;
|
||||
}
|
||||
|
||||
export interface IAzureSubscriptionInfo {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface AzureResource {
|
||||
name: string;
|
||||
id: string;
|
||||
subscription: IAzureSubscriptionInfo;
|
||||
resourceGroup?: string;
|
||||
tenant?: string;
|
||||
}
|
||||
|
||||
export interface AzureResourceSubscription extends Omit<AzureResource, 'subscription'> {
|
||||
}
|
||||
|
||||
export interface AzureSqlResource extends AzureResource {
|
||||
loginName: string;
|
||||
}
|
||||
|
||||
export interface AzureGraphResource extends Omit<AzureResource, 'tenant' | 'subscription'> {
|
||||
tenantId: string;
|
||||
subscriptionId: string;
|
||||
type: string;
|
||||
location: string;
|
||||
}
|
||||
|
||||
export interface AzureResourceResourceGroup extends AzureResource {
|
||||
location?: string;
|
||||
managedBy?: string;
|
||||
properties?: {
|
||||
provisioningState?: string
|
||||
};
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export interface AzureLocation {
|
||||
id: string,
|
||||
name: string,
|
||||
displayName: string,
|
||||
regionalDisplayName: string,
|
||||
metadata: {
|
||||
regionType: string,
|
||||
regionCategory: string,
|
||||
geographyGroup: string,
|
||||
longitude: number,
|
||||
latitude: number,
|
||||
physicalLocation: string,
|
||||
pairedRegion: {
|
||||
name: string,
|
||||
id: string,
|
||||
}[],
|
||||
},
|
||||
}
|
||||
|
||||
export interface AzureSqlManagedInstance extends AzureGraphResource {
|
||||
sku: {
|
||||
capacity: number;
|
||||
family: string;
|
||||
name: string;
|
||||
tier: 'GeneralPurpose' | 'BusinessCritical';
|
||||
},
|
||||
properties: {
|
||||
provisioningState: string,
|
||||
storageAccountType: string,
|
||||
maintenanceConfigurationId: string,
|
||||
state: string,
|
||||
licenseType: string,
|
||||
zoneRedundant: false,
|
||||
fullyQualifiedDomainName: string,
|
||||
collation: string,
|
||||
administratorLogin: string,
|
||||
minimalTlsVersion: string,
|
||||
subnetId: string,
|
||||
publicDataEndpointEnabled: boolean,
|
||||
storageSizeInGB: number,
|
||||
timezoneId: string,
|
||||
proxyOverride: string,
|
||||
vCores: number,
|
||||
dnsZone: string,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export interface ManagedDatabase {
|
||||
id: string,
|
||||
location: string,
|
||||
name: string,
|
||||
properties: {
|
||||
sourceDatabaseId: string,
|
||||
status: string
|
||||
},
|
||||
type: string
|
||||
}
|
||||
|
||||
export interface AzureResourceDatabase extends AzureSqlResource {
|
||||
serverName: string;
|
||||
serverFullName: string;
|
||||
}
|
||||
|
||||
export interface AzureResourceDatabaseServer extends AzureSqlResource {
|
||||
fullName: string;
|
||||
defaultDatabaseName: string;
|
||||
}
|
||||
export interface BlobContainer extends AzureResource { }
|
||||
|
||||
export interface FileShare extends AzureResource { }
|
||||
|
||||
export interface Blob extends BlobItem { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ import { SqlInstanceArcProvider } from './azureResource/providers/sqlinstanceArc
|
||||
import { SqlInstanceArcResourceService } from './azureResource/providers/sqlinstanceArc/sqlInstanceArcService';
|
||||
import { PostgresServerArcProvider } from './azureResource/providers/postgresArcServer/postgresServerProvider';
|
||||
import { PostgresServerArcService } from './azureResource/providers/postgresArcServer/postgresServerService';
|
||||
import { azureResource } from 'azureResource';
|
||||
import * as azurecore from 'azurecore';
|
||||
import * as azureResourceUtils from './azureResource/utils';
|
||||
import * as utils from './utils';
|
||||
@@ -120,15 +119,15 @@ export async function activate(context: vscode.ExtensionContext): Promise<azurec
|
||||
? azureResourceUtils.getSelectedSubscriptions(appContext, account, ignoreErrors)
|
||||
: azureResourceUtils.getSubscriptions(appContext, account, ignoreErrors);
|
||||
},
|
||||
getResourceGroups(account?: azurecore.AzureAccount, subscription?: azureResource.AzureResourceSubscription, ignoreErrors?: boolean): Promise<azurecore.GetResourceGroupsResult> { return azureResourceUtils.getResourceGroups(appContext, account, subscription, ignoreErrors); },
|
||||
getResourceGroups(account?: azurecore.AzureAccount, subscription?: azurecore.azureResource.AzureResourceSubscription, ignoreErrors?: boolean): Promise<azurecore.GetResourceGroupsResult> { return azureResourceUtils.getResourceGroups(appContext, account, subscription, ignoreErrors); },
|
||||
getLocations(account?: azurecore.AzureAccount,
|
||||
subscription?: azureResource.AzureResourceSubscription,
|
||||
subscription?: azurecore.azureResource.AzureResourceSubscription,
|
||||
ignoreErrors?: boolean): Promise<azurecore.GetLocationsResult> {
|
||||
return azureResourceUtils.getLocations(appContext, account, subscription, ignoreErrors);
|
||||
},
|
||||
provideResources(): azureResource.IAzureResourceProvider[] {
|
||||
provideResources(): azurecore.azureResource.IAzureResourceProvider[] {
|
||||
const arcFeaturedEnabled = vscode.workspace.getConfiguration(constants.extensionConfigSectionName).get('enableArcFeatures');
|
||||
const providers: azureResource.IAzureResourceProvider[] = [
|
||||
const providers: azurecore.azureResource.IAzureResourceProvider[] = [
|
||||
new KustoProvider(new KustoResourceService(), extensionContext),
|
||||
new AzureMonitorProvider(new AzureMonitorResourceService(), extensionContext),
|
||||
new AzureResourceDatabaseServerProvider(new AzureResourceDatabaseServerService(), extensionContext),
|
||||
@@ -145,65 +144,65 @@ export async function activate(context: vscode.ExtensionContext): Promise<azurec
|
||||
return providers;
|
||||
},
|
||||
getSqlManagedInstances(account: azurecore.AzureAccount,
|
||||
subscriptions: azureResource.AzureResourceSubscription[],
|
||||
subscriptions: azurecore.azureResource.AzureResourceSubscription[],
|
||||
ignoreErrors: boolean): Promise<azurecore.GetSqlManagedInstancesResult> {
|
||||
return azureResourceUtils.runResourceQuery(account, subscriptions, ignoreErrors, `where type == "${azureResource.AzureResourceType.sqlManagedInstance}"`);
|
||||
return azureResourceUtils.runResourceQuery(account, subscriptions, ignoreErrors, `where type == "${azurecore.azureResource.AzureResourceType.sqlManagedInstance}"`);
|
||||
},
|
||||
getManagedDatabases(account: azurecore.AzureAccount,
|
||||
subscription: azureResource.AzureResourceSubscription,
|
||||
managedInstance: azureResource.AzureSqlManagedInstance,
|
||||
subscription: azurecore.azureResource.AzureResourceSubscription,
|
||||
managedInstance: azurecore.azureResource.AzureSqlManagedInstance,
|
||||
ignoreErrors: boolean): Promise<azurecore.GetManagedDatabasesResult> {
|
||||
return azureResourceUtils.getManagedDatabases(account, subscription, managedInstance, ignoreErrors);
|
||||
},
|
||||
getSqlServers(account: azurecore.AzureAccount,
|
||||
subscriptions: azureResource.AzureResourceSubscription[],
|
||||
subscriptions: azurecore.azureResource.AzureResourceSubscription[],
|
||||
ignoreErrors: boolean): Promise<azurecore.GetSqlServersResult> {
|
||||
return azureResourceUtils.runResourceQuery(account, subscriptions, ignoreErrors, `where type == "${azureResource.AzureResourceType.sqlServer}"`);
|
||||
return azureResourceUtils.runResourceQuery(account, subscriptions, ignoreErrors, `where type == "${azurecore.azureResource.AzureResourceType.sqlServer}"`);
|
||||
},
|
||||
getSqlVMServers(account: azurecore.AzureAccount,
|
||||
subscriptions: azureResource.AzureResourceSubscription[],
|
||||
subscriptions: azurecore.azureResource.AzureResourceSubscription[],
|
||||
ignoreErrors: boolean): Promise<azurecore.GetSqlVMServersResult> {
|
||||
return azureResourceUtils.runResourceQuery(account, subscriptions, ignoreErrors, `where type == "${azureResource.AzureResourceType.virtualMachines}" and properties.storageProfile.imageReference.publisher == "microsoftsqlserver"`);
|
||||
return azureResourceUtils.runResourceQuery(account, subscriptions, ignoreErrors, `where type == "${azurecore.azureResource.AzureResourceType.virtualMachines}" and properties.storageProfile.imageReference.publisher == "microsoftsqlserver"`);
|
||||
},
|
||||
getStorageAccounts(account: azurecore.AzureAccount,
|
||||
subscriptions: azureResource.AzureResourceSubscription[],
|
||||
subscriptions: azurecore.azureResource.AzureResourceSubscription[],
|
||||
ignoreErrors: boolean): Promise<azurecore.GetStorageAccountResult> {
|
||||
return azureResourceUtils.runResourceQuery(account, subscriptions, ignoreErrors, `where type == "${azureResource.AzureResourceType.storageAccount}"`);
|
||||
return azureResourceUtils.runResourceQuery(account, subscriptions, ignoreErrors, `where type == "${azurecore.azureResource.AzureResourceType.storageAccount}"`);
|
||||
},
|
||||
getBlobContainers(account: azurecore.AzureAccount,
|
||||
subscription: azureResource.AzureResourceSubscription,
|
||||
storageAccount: azureResource.AzureGraphResource,
|
||||
subscription: azurecore.azureResource.AzureResourceSubscription,
|
||||
storageAccount: azurecore.azureResource.AzureGraphResource,
|
||||
ignoreErrors: boolean): Promise<azurecore.GetBlobContainersResult> {
|
||||
return azureResourceUtils.getBlobContainers(account, subscription, storageAccount, ignoreErrors);
|
||||
},
|
||||
getFileShares(account: azurecore.AzureAccount,
|
||||
subscription: azureResource.AzureResourceSubscription,
|
||||
storageAccount: azureResource.AzureGraphResource,
|
||||
subscription: azurecore.azureResource.AzureResourceSubscription,
|
||||
storageAccount: azurecore.azureResource.AzureGraphResource,
|
||||
ignoreErrors: boolean): Promise<azurecore.GetFileSharesResult> {
|
||||
return azureResourceUtils.getFileShares(account, subscription, storageAccount, ignoreErrors);
|
||||
},
|
||||
getStorageAccountAccessKey(account: azurecore.AzureAccount,
|
||||
subscription: azureResource.AzureResourceSubscription,
|
||||
storageAccount: azureResource.AzureGraphResource,
|
||||
subscription: azurecore.azureResource.AzureResourceSubscription,
|
||||
storageAccount: azurecore.azureResource.AzureGraphResource,
|
||||
ignoreErrors: boolean): Promise<azurecore.GetStorageAccountAccessKeyResult> {
|
||||
return azureResourceUtils.getStorageAccountAccessKey(account, subscription, storageAccount, ignoreErrors);
|
||||
},
|
||||
getBlobs(account: azurecore.AzureAccount,
|
||||
subscription: azureResource.AzureResourceSubscription,
|
||||
storageAccount: azureResource.AzureGraphResource,
|
||||
subscription: azurecore.azureResource.AzureResourceSubscription,
|
||||
storageAccount: azurecore.azureResource.AzureGraphResource,
|
||||
containerName: string,
|
||||
ignoreErrors: boolean): Promise<azurecore.GetBlobsResult> {
|
||||
return azureResourceUtils.getBlobs(account, subscription, storageAccount, containerName, ignoreErrors);
|
||||
},
|
||||
createResourceGroup(account: azurecore.AzureAccount,
|
||||
subscription: azureResource.AzureResourceSubscription,
|
||||
subscription: azurecore.azureResource.AzureResourceSubscription,
|
||||
resourceGroupName: string,
|
||||
location: string,
|
||||
ignoreErrors: boolean): Promise<azurecore.CreateResourceGroupResult> {
|
||||
return azureResourceUtils.createResourceGroup(account, subscription, resourceGroupName, location, ignoreErrors);
|
||||
},
|
||||
makeAzureRestRequest(account: azurecore.AzureAccount,
|
||||
subscription: azureResource.AzureResourceSubscription,
|
||||
subscription: azurecore.azureResource.AzureResourceSubscription,
|
||||
path: string,
|
||||
requestType: azurecore.HttpRequestMethod,
|
||||
requestBody: any,
|
||||
@@ -213,8 +212,8 @@ export async function activate(context: vscode.ExtensionContext): Promise<azurec
|
||||
return azureResourceUtils.makeHttpRequest(account, subscription, path, requestType, requestBody, ignoreErrors, host, requestHeaders);
|
||||
},
|
||||
getRegionDisplayName: utils.getRegionDisplayName,
|
||||
runGraphQuery<T extends azureResource.AzureGraphResource>(account: azurecore.AzureAccount,
|
||||
subscriptions: azureResource.AzureResourceSubscription[],
|
||||
runGraphQuery<T extends azurecore.azureResource.AzureGraphResource>(account: azurecore.AzureAccount,
|
||||
subscriptions: azurecore.azureResource.AzureResourceSubscription[],
|
||||
ignoreErrors: boolean,
|
||||
query: string): Promise<azurecore.ResourceQueryResult<T>> {
|
||||
return azureResourceUtils.runResourceQuery(account, subscriptions, ignoreErrors, query);
|
||||
|
||||
@@ -10,11 +10,10 @@ import * as vscode from 'vscode';
|
||||
import * as sinon from 'sinon';
|
||||
import 'mocha';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureResourceDatabaseTreeDataProvider } from '../../../../azureResource/providers/database/databaseTreeDataProvider';
|
||||
import { AzureResourceItemType } from '../../../../azureResource/constants';
|
||||
import { IAzureResourceService } from '../../../../azureResource/interfaces';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
import settings from '../../../../account-provider/providerSettings';
|
||||
|
||||
// Mock services
|
||||
|
||||
@@ -10,7 +10,6 @@ import * as vscode from 'vscode';
|
||||
import * as sinon from 'sinon';
|
||||
import 'mocha';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureResourceDatabaseServerTreeDataProvider } from '../../../../azureResource/providers/databaseServer/databaseServerTreeDataProvider';
|
||||
import { AzureResourceItemType } from '../../../../azureResource/constants';
|
||||
import { IAzureResourceService } from '../../../../azureResource/interfaces';
|
||||
@@ -19,7 +18,7 @@ import { IAzureResourceService } from '../../../../azureResource/interfaces';
|
||||
let mockDatabaseServerService: TypeMoq.IMock<IAzureResourceService<azureResource.AzureResourceDatabaseServer>>;
|
||||
let mockExtensionContext: TypeMoq.IMock<vscode.ExtensionContext>;
|
||||
import settings from '../../../../account-provider/providerSettings';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
// Mock test data
|
||||
const mockAccount: AzureAccount = {
|
||||
|
||||
@@ -8,9 +8,8 @@ import * as TypeMoq from 'typemoq';
|
||||
import 'mocha';
|
||||
import { fail } from 'assert';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureResourceService } from '../../azureResource/resourceService';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
import settings from '../../account-provider/providerSettings';
|
||||
|
||||
// Mock test data
|
||||
|
||||
@@ -8,13 +8,12 @@ import * as TypeMoq from 'typemoq';
|
||||
import * as vscode from 'vscode';
|
||||
import 'mocha';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { AzureResourceService } from '../../azureResource/resourceService';
|
||||
import { AzureResourceResourceTreeNode } from '../../azureResource/resourceTreeNode';
|
||||
import { AppContext } from '../../appContext';
|
||||
import { AzureResourceServiceNames } from '../../azureResource/constants';
|
||||
import settings from '../../account-provider/providerSettings';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
// Mock test data
|
||||
const mockAccount: AzureAccount = {
|
||||
|
||||
@@ -11,7 +11,6 @@ import * as sinon from 'sinon';
|
||||
import 'mocha';
|
||||
import { AppContext } from '../../../appContext';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import {
|
||||
IAzureResourceCacheService,
|
||||
IAzureResourceSubscriptionService,
|
||||
@@ -23,7 +22,7 @@ import { AzureResourceSubscriptionTreeNode } from '../../../azureResource/tree/s
|
||||
import { AzureResourceItemType, AzureResourceServiceNames } from '../../../azureResource/constants';
|
||||
import { AzureResourceMessageTreeNode } from '../../../azureResource/messageTreeNode';
|
||||
import { generateGuid } from '../../../azureResource/utils';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
// Mock services
|
||||
let mockExtensionContext: TypeMoq.IMock<vscode.ExtensionContext>;
|
||||
|
||||
@@ -9,7 +9,6 @@ import * as vscode from 'vscode';
|
||||
import 'mocha';
|
||||
import { AppContext } from '../../../appContext';
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import { IAzureResourceTreeChangeHandler } from '../../../azureResource/tree/treeChangeHandler';
|
||||
import { AzureResourceSubscriptionTreeNode } from '../../../azureResource/tree/subscriptionTreeNode';
|
||||
import { AzureResourceItemType, AzureResourceServiceNames } from '../../../azureResource/constants';
|
||||
@@ -17,7 +16,7 @@ import { AzureResourceService } from '../../../azureResource/resourceService';
|
||||
import { AzureResourceResourceTreeNode } from '../../../azureResource/resourceTreeNode';
|
||||
import { IAzureResourceCacheService } from '../../../azureResource/interfaces';
|
||||
import { generateGuid } from '../../../azureResource/utils';
|
||||
import { AzureAccount } from 'azurecore';
|
||||
import { AzureAccount, azureResource } from 'azurecore';
|
||||
|
||||
// Mock services
|
||||
let appContext: AppContext;
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { azureResource } from 'azureResource';
|
||||
import * as loc from './localizedConstants';
|
||||
import { AzureRegion } from 'azurecore';
|
||||
import { AzureRegion, azureResource } from 'azurecore';
|
||||
import { AppContext } from './appContext';
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user