mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add subscription ID to all graph query items (#12133)
* Add subscription ID to all graph query items * fix machine-learning
This commit is contained in:
@@ -24,6 +24,7 @@ declare module 'azureResource' {
|
||||
export interface AzureResource {
|
||||
name: string;
|
||||
id: string;
|
||||
subscriptionId: string;
|
||||
tenant?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ export class AzureResourceDatabaseService implements IAzureResourceService<azure
|
||||
serverName: server.name,
|
||||
serverFullName: server.properties.fullyQualifiedDomainName,
|
||||
loginName: server.properties.administratorLogin,
|
||||
subscriptionId: db.subscriptionId,
|
||||
tenant: db.tenantId
|
||||
});
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ export class AzureResourceDatabaseServerService extends ResourceServiceBase<DbSe
|
||||
fullName: resource.properties.fullyQualifiedDomainName,
|
||||
loginName: resource.properties.administratorLogin,
|
||||
defaultDatabaseName: 'master',
|
||||
subscriptionId: resource.subscriptionId,
|
||||
tenant: resource.tenantId
|
||||
};
|
||||
}
|
||||
|
||||
@@ -28,7 +28,9 @@ export class KustoResourceService extends ResourceServiceBase<KustoGraphData, az
|
||||
name: resource.name,
|
||||
fullName: resource.properties.uri.replace('https://', ''),
|
||||
loginName: '',
|
||||
defaultDatabaseName: ''
|
||||
defaultDatabaseName: '',
|
||||
subscriptionId: resource.subscriptionId,
|
||||
tenant: resource.tenantId
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ export class PostgresServerArcService extends ResourceServiceBase<PostgresArcSer
|
||||
fullName: resource.name,
|
||||
loginName: resource.properties.admin,
|
||||
defaultDatabaseName: 'postgres',
|
||||
subscriptionId: resource.subscriptionId,
|
||||
tenant: resource.tenantId
|
||||
};
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ export class PostgresServerService extends ResourceServiceBase<DbServerGraphData
|
||||
fullName: resource.properties.fullyQualifiedDomainName,
|
||||
loginName: resource.properties.administratorLogin,
|
||||
defaultDatabaseName: 'postgres',
|
||||
subscriptionId: resource.subscriptionId,
|
||||
tenant: resource.tenantId
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,7 +16,9 @@ export class AzureResourceGroupService extends ResourceServiceBase<DbServerGraph
|
||||
protected convertResource(resource: DbServerGraphData): azureResource.AzureResourceResourceGroup {
|
||||
return {
|
||||
id: resource.id,
|
||||
name: resource.name
|
||||
name: resource.name,
|
||||
subscriptionId: resource.subscriptionId,
|
||||
tenant: resource.tenantId
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ export abstract class ResourceTreeDataProviderBase<T extends azureResource.Azure
|
||||
}
|
||||
|
||||
export interface GraphData {
|
||||
subscriptionId: string,
|
||||
tenantId: string;
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
@@ -28,6 +28,7 @@ export class SqlInstanceResourceService extends ResourceServiceBase<SqlInstanceG
|
||||
fullName: resource.properties.fullyQualifiedDomainName,
|
||||
loginName: resource.properties.administratorLogin,
|
||||
defaultDatabaseName: 'master',
|
||||
subscriptionId: resource.subscriptionId,
|
||||
tenant: resource.tenantId
|
||||
};
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ export class SqlInstanceArcResourceService extends ResourceServiceBase<SqlInstan
|
||||
fullName: resource.name,
|
||||
loginName: resource.properties.admin,
|
||||
defaultDatabaseName: 'master',
|
||||
subscriptionId: resource.subscriptionId,
|
||||
tenant: resource.tenantId
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ export class AzureResourceSubscriptionService implements IAzureResourceSubscript
|
||||
subs.forEach((sub) => subscriptions.push({
|
||||
id: sub.subscriptionId,
|
||||
name: sub.displayName,
|
||||
subscriptionId: sub.subscriptionId,
|
||||
tenant: tenantId
|
||||
}));
|
||||
|
||||
|
||||
@@ -42,11 +42,12 @@ const mockAccount: AzureAccount = {
|
||||
};
|
||||
|
||||
const mockTenantId: string = 'mock_tenant';
|
||||
|
||||
const mockSubscriptionId = 'mock_subscription';
|
||||
|
||||
const mockSubscription: azureResource.AzureResourceSubscription = {
|
||||
id: 'mock_subscription',
|
||||
id: mockSubscriptionId,
|
||||
name: 'mock subscription',
|
||||
subscriptionId: mockSubscriptionId,
|
||||
tenant: mockTenantId
|
||||
};
|
||||
|
||||
@@ -75,14 +76,16 @@ const mockDatabases: azureResource.AzureResourceDatabase[] = [
|
||||
id: 'mock-id-1',
|
||||
serverName: 'mock database server 1',
|
||||
serverFullName: 'mock database server full name 1',
|
||||
loginName: 'mock login'
|
||||
loginName: 'mock login',
|
||||
subscriptionId: 'mock_subscription'
|
||||
},
|
||||
{
|
||||
name: 'mock database 2',
|
||||
id: 'mock-id-2',
|
||||
serverName: 'mock database server 2',
|
||||
serverFullName: 'mock database server full name 2',
|
||||
loginName: 'mock login'
|
||||
loginName: 'mock login',
|
||||
subscriptionId: 'mock_subscription'
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -42,10 +42,11 @@ const mockAccount: AzureAccount = {
|
||||
};
|
||||
|
||||
const mockTenantId: string = 'mock_tenant';
|
||||
|
||||
const mockSubscriptionId = 'mock_subscription';
|
||||
const mockSubscription: azureResource.AzureResourceSubscription = {
|
||||
id: 'mock_subscription',
|
||||
id: mockSubscriptionId,
|
||||
name: 'mock subscription',
|
||||
subscriptionId: mockSubscriptionId,
|
||||
tenant: mockTenantId
|
||||
};
|
||||
|
||||
@@ -74,14 +75,16 @@ const mockDatabaseServers: azureResource.AzureResourceDatabaseServer[] = [
|
||||
id: 'mock-id-1',
|
||||
fullName: 'mock database server full name 1',
|
||||
loginName: 'mock login',
|
||||
defaultDatabaseName: 'master'
|
||||
defaultDatabaseName: 'master',
|
||||
subscriptionId: 'mock_subscription'
|
||||
},
|
||||
{
|
||||
name: 'mock database server 2',
|
||||
id: 'mock-id-2',
|
||||
fullName: 'mock database server full name 2',
|
||||
loginName: 'mock login',
|
||||
defaultDatabaseName: 'master'
|
||||
defaultDatabaseName: 'master',
|
||||
subscriptionId: 'mock_subscription'
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -34,10 +34,12 @@ const mockAccount: AzureAccount = {
|
||||
};
|
||||
|
||||
const mockTenantId: string = 'mock_tenant';
|
||||
const mockSubscriptionId ='mock_subscription';
|
||||
|
||||
const mockSubscription: azureResource.AzureResourceSubscription = {
|
||||
id: 'mock_subscription',
|
||||
id: mockSubscriptionId,
|
||||
name: 'mock subscription',
|
||||
subscriptionId: mockSubscriptionId,
|
||||
tenant: mockTenantId
|
||||
};
|
||||
|
||||
|
||||
@@ -37,10 +37,12 @@ const mockAccount: AzureAccount = {
|
||||
};
|
||||
|
||||
const mockTenantId: string = 'mock_tenant';
|
||||
const mockSubscriptionId = 'mock_subscription';
|
||||
|
||||
const mockSubscription: azureResource.AzureResourceSubscription = {
|
||||
id: 'mock_subscription',
|
||||
id: mockSubscriptionId,
|
||||
name: 'mock subscription',
|
||||
subscriptionId: mockSubscriptionId,
|
||||
tenant: mockTenantId
|
||||
};
|
||||
|
||||
|
||||
@@ -59,15 +59,19 @@ const mockAccount: azdata.Account = {
|
||||
isStale: false
|
||||
};
|
||||
|
||||
const mock_subscription_id_1 = 'mock_subscription_1';
|
||||
const mockSubscription1: azureResource.AzureResourceSubscription = {
|
||||
id: 'mock_subscription_1',
|
||||
id: mock_subscription_id_1,
|
||||
name: 'mock subscription 1',
|
||||
subscriptionId: mock_subscription_id_1,
|
||||
tenant: mockTenantId
|
||||
};
|
||||
|
||||
const mock_subscription_id_2 = 'mock_subscription_2';
|
||||
const mockSubscription2: azureResource.AzureResourceSubscription = {
|
||||
id: 'mock_subscription_2',
|
||||
id: mock_subscription_id_2,
|
||||
name: 'mock subscription 2',
|
||||
subscriptionId: mock_subscription_id_2,
|
||||
tenant: mockTenantId
|
||||
};
|
||||
|
||||
|
||||
@@ -44,10 +44,12 @@ const mockAccount: azdata.Account = {
|
||||
};
|
||||
|
||||
const mockTenantId: string = 'mock_tenant';
|
||||
const mockSubscriptionId: string = 'mock_subscription';
|
||||
|
||||
const mockSubscription: azureResource.AzureResourceSubscription = {
|
||||
id: 'mock_subscription',
|
||||
id: mockSubscriptionId,
|
||||
name: 'mock subscription',
|
||||
subscriptionId: mockSubscriptionId,
|
||||
tenant: mockTenantId
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user