import { Observable } from 'rxjs'; import { AjaxRequest, AjaxResponse } from 'rxjs/ajax'; import { Http } from '../data/http'; import { Rpc } from '../rpc/rpc'; import { ConnectionProperties } from '../security/connection'; import { AzureIntegrationType } from './azure-constants'; import { DeploymentOperationResponse } from './resources/deployment-operation-response'; import { LocationsOperationResult } from './resources/location-data'; import { ResourceGroupOperationResult, ResourceGroupRequestBody, ResourceGroupsOperationResult } from './resources/resource-group-data'; import { SubscriptionsOperationResult } from './resources/subscription-data'; /** * Azure Manager class. Handles detecting and configuring Azure on a set of servers. */ export declare class AzureManager { private rpc; private http; private watcher; private azureLogging; private readonly AzureGlobal; private readonly AzureChina; private readonly AzureUSGov; /** * Initializes a new instance of the Azure Manager class * @param rpc The rpc to forward auth requests to a parent window */ constructor(rpc: Rpc, http: Http); /** * Initialize the azure manager */ initialize(): void; /** * Get application from gateway */ getAppInfo(): Observable; /** * Open the register Aad dialog */ openRegisterAadDialog(): Observable; /** * Signs in user. */ signIn(): Observable; /** * Signs out user. */ signOut(): Observable; /** * Switches user accounts. */ switchAccounts(): Observable; /** * Get user token from azure */ getToken(): Observable; /** * Get the Azure AD graph token from azure */ getGraphToken(): Observable; /** * Get the Microsoft graph token from azure * @param scopes The set of permissions for which the token has to be requested. * https://docs.microsoft.com/en-us/graph/permissions-reference * A null value will request default scopes - openid and profile. */ getMicrosoftGraphToken(scopes?: string[]): Observable; /** * Checks to see if user is signed in. Returns true if signed in, else false. */ checkUserSignedIn(): Observable; /** * Get Azure subscriptions. * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based * on the name of the module. If a repository has more than one tool/service then the integration type needs to be * explicitly set. */ getSubscriptions(integrationType?: AzureIntegrationType): Observable; /** * Check whether a resource group exists or not. * @param subscriptionId The subscription id. * @param resourceGroupName The resource group name. * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based * on the name of the module. If a repository has more than one tool/service then the integration type needs to be * explicitly set. */ checkResourceGroupExists(subscriptionId: string, resourceGroupName: string, integrationType?: AzureIntegrationType): Observable<{ status: number; }>; /** * Create or update (if it exists) resource group. * @param subscriptionId The subscription id. * @param resourceGroupName The resource group name. * @param body request body. Optional. See definition of ResourceGroupRequestBody for what fields can be inside this body. * If this is not provided, a default of { \'location\': \'West US\' } will be used. * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based * on the name of the module. If a repository has more than one tool/service then the integration type needs to be * explicitly set. */ createResourceGroup(subscriptionId: string, resourceGroupName: string, body?: ResourceGroupRequestBody, integrationType?: AzureIntegrationType): Observable; /** * List all resource groups in a subscription. * @param subscriptionId The subscription id. * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based * on the name of the module. If a repository has more than one tool/service then the integration type needs to be * explicitly set. */ getResourceGroups(subscriptionId: string, integrationType?: AzureIntegrationType): Observable; /** * Delete resource group. * @param subscriptionId The subscription id. * @param resourceGroupName The resource group name. * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based * on the name of the module. If a repository has more than one tool/service then the integration type needs to be * explicitly set. */ deleteResourceGroup(subscriptionId: string, resourceGroupName: string, integrationType?: AzureIntegrationType): Observable<{ status: number; }>; /** * Get all available geo-locations. * @param subscriptionId The subscription id. * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based * on the name of the module. If a repository has more than one tool/service then the integration type needs to be * explicitly set. */ getAllAzureLocations(subscriptionId: string, integrationType?: AzureIntegrationType): Observable; /** * Deploy resources with Resource Manager templates and Resource Manager REST API. * @param subscriptionId The subscription id. * @param resourceGroupName The resource group name. * @param deploymentName The deployment name. * @param resourceTemplate The resource template content. * @param templateParameters The resource template parameters. * @param deploymentMode The mode that is used to deploy resources.This value can be either Incremental or Complete. * In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based * on the name of the module. If a repository has more than one tool/service then the integration type needs to be * explicitly set. */ DeployAzureTemplate(subscriptionId: string, resourceGroupName: string, deploymentName: string, resourceTemplate: string, templateParameters: string, deploymentMode?: string, integrationType?: AzureIntegrationType): Observable; /** * Validate resources with Resource Manager templates and Resource Manager REST API. * @param subscriptionId The subscription id. * @param resourceGroupName The resource group name. * @param deploymentName The deployment name. * @param resourceTemplate The resource template content. * @param templateParameters The resource template parameters. * @param deploymentMode The mode that is used to deploy resources.This value can be either Incremental or Complete. * In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based * on the name of the module. If a repository has more than one tool/service then the integration type needs to be * explicitly set. */ validateAzureTemplate(subscriptionId: string, resourceGroupName: string, deploymentName: string, resourceTemplate: string, templateParameters: string, deploymentMode?: string, integrationType?: AzureIntegrationType): Observable; /** * Creates azure request with headers * @param token bearer token for ARM request * @param options additional information that can be send in the headers of the request. * - additionalHeaders any headers besides 'Authorization' * - integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based * on the name of the module. If a repository has more than one tool/service then the integration type needs to be * explicitly set. * 'x-ms-client-request-id', 'x-ms-return-client-request-id', and 'Accept-Language'. * @return formatted AjaxRequest for an ARM call */ createRequestWithHeaders(token: string, options?: { additionalHeaders?: any; integrationType?: AzureIntegrationType; connectionProperties?: ConnectionProperties; }): AjaxRequest; /** * Gets the arm token. */ getArmToken(): Observable; /** * Parses connection properties for ARM telemetry data and encode in hex * @param connectionProperties properties on the current active connection * @return hex encoded json object. */ hexEncodeTelemetryData(connectionProperties?: ConnectionProperties): string; private formatClientRequestId; /** * Send request to RPC * @param request RpcAzureOperation */ private sendRequest; /** * Send token request to RPC * @param request RpcAzureOperation */ private sendTokenRequest; /** * Handles Rpc response. */ private onRpcResponse; /** * Determine cloud specific ARM endpoint based on the cloud that gateway is registered to. * @param cloudName cloudName from gateway's app registration. * @returns Returns cloud specific ARM endpoint. */ getArmEndpoint(cloudNameParam: string): string; /** * Make a GET request using ARM token. * @param url endpoint for request * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based * on the name of the module. If a repository has more than one tool/service then the integration type needs to be * explicitly set. */ getRequestWithArmToken(url: string, integrationType?: AzureIntegrationType): Observable>; /** * Make a POST request using ARM token. * @param url endpoint for request * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based * on the name of the module. If a repository has more than one tool/service then the integration type needs to be * explicitly set. */ postRequestWithArmToken(url: string, body: any, integrationType?: AzureIntegrationType): Observable>; /** * Make a PUT request using ARM token. * @param url endpoint for request * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based * on the name of the module. If a repository has more than one tool/service then the integration type needs to be * explicitly set. */ putRequestWithArmToken(url: string, body: any, integrationType?: AzureIntegrationType): Observable>; /** * Make a DELETE request using ARM token. * @param url endpoint for request * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based * on the name of the module. If a repository has more than one tool/service then the integration type needs to be * explicitly set. */ deleteRequestWithArmToken(url: string, integrationType?: AzureIntegrationType): Observable>; createDeploymentOperationResponse(result: AjaxResponse): DeploymentOperationResponse; logTelemetry(response: any): void; }