mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Adding option to create a resource group in sql migration dms page. (#15856)
* Pushing all changes * Fixing more stuff * Added new to the newly created resource group * removing error message when user starts typing * removing unused import * Localizing some string adding aria lables and loading text * Adding focus to resource group input box * switching to name instead of display name as it contains (new) param * changing focus to resource group dropdown after creation of a new resource group * fixing typo
This commit is contained in:
@@ -69,6 +69,12 @@ declare module 'azureResource' {
|
||||
}
|
||||
|
||||
export interface AzureResourceResourceGroup extends AzureResource {
|
||||
location?: string;
|
||||
managedBy?: string;
|
||||
properties?: {
|
||||
provisioningState?: string
|
||||
};
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export interface AzureLocation {
|
||||
|
||||
@@ -7,7 +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 } from 'azurecore';
|
||||
import { AzureRestResponse, GetResourceGroupsResult, GetSubscriptionsResult, ResourceQueryResult, GetBlobContainersResult, GetFileSharesResult, HttpRequestMethod, GetLocationsResult, GetManagedDatabasesResult, CreateResourceGroupResult } from 'azurecore';
|
||||
import { azureResource } from 'azureResource';
|
||||
import { EOL } from 'os';
|
||||
import * as nls from 'vscode-nls';
|
||||
@@ -455,3 +455,15 @@ export async function getFileShares(account: azdata.Account, subscription: azure
|
||||
errors: response.errors ? response.errors : []
|
||||
};
|
||||
}
|
||||
|
||||
export async function createResourceGroup(account: azdata.Account, subscription: azureResource.AzureResourceSubscription, resourceGroupName: string, location: string, ignoreErrors: boolean): Promise<CreateResourceGroupResult> {
|
||||
const path = `/subscriptions/${subscription.id}/resourcegroups/${resourceGroupName}?api-version=2021-04-01`;
|
||||
const requestBody = {
|
||||
location: location
|
||||
};
|
||||
const response = await makeHttpRequest(account, subscription, path, HttpRequestMethod.PUT, requestBody, ignoreErrors);
|
||||
return {
|
||||
resourceGroup: response?.response?.data,
|
||||
errors: response.errors ? response.errors : []
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user