@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
117 lines (115 loc) • 6.63 kB
JavaScript
export class AzureConstants {
/**
* Azure Resource Manager endpoint - Azure Global/Public cloud.
*/
static azureGlobalArmEndpoint = 'https://management.azure.com';
/**
* Azure public portal.
*/
static azureGlobalPortal = 'https://portal.azure.com';
/**
* Azure Resource Manager endpoint - Azure China cloud.
*/
static azureChinaArmEndpoint = 'https://management.chinacloudapi.cn';
/**
* Azure China portal.
*/
static azureChinaPortal = 'https://portal.azure.cn';
/**
* Azure Resource Manager endpoint - Azure US Govenment/Fairfax/Arlington.
*/
static azureUSGovArmEndpoint = 'https://management.usgovcloudapi.net';
/**
* Azure US Government portal.
*/
static azureUSGovPortal = 'https://portal.azure.us';
static armApiVersion = '?api-version=2016-06-01';
static azureSubscriptionUrl = '{0}/subscriptions?api-version=2016-06-01';
static armDeploymentUrl = '{0}/subscriptions/{1}/resourcegroups/{2}/providers/Microsoft.Resources/deployments/{3}?api-version=2018-02-01';
static validateAzureTemplate = '{0}/subscriptions/{1}/resourcegroups/{2}/providers/Microsoft.Resources/deployments/{3}/validate?api-version=2018-05-01';
static getAllGeoLocations = '{0}/subscriptions/{1}/locations?api-version=2016-06-01';
static getResourceGroupsUri = '{0}/subscriptions/{1}/resourcegroups?api-version=2018-02-01';
// Resource groups.
static listResourceGroups = '{0}/subscriptions/{1}/resourcegroups?api-version=2018-05-01';
static listResourceGroupsWithParameters = '{0}/subscriptions/{1}/resourcegroups?$filter={2}&$top={3}api-version=2018-05-01';
static resourceGroupUrl = '{0}/subscriptions/{1}/resourcegroups/{2}?api-version=2018-05-01';
// Template deployment urls.
static ArmDeploymentUrl = '{0}/subscriptions/{1}/resourcegroups/{2}/providers/Microsoft.Resources/deployments/{3}?api-version=2018-02-01';
// Request header keys and values
static bearer = 'Bearer ';
static authorizationHeaderKey = 'Authorization';
static acceptLanguageHeaderKey = 'Accept-Language';
static clientRequestHeaderKey = 'x-ms-client-request-id';
static returnClientRequestHeaderKey = 'x-ms-return-client-request-id';
// TODO: Remove work around for telemetry. Client request id shouldnt have any parameters.
static telemetryDataParameter = 'telemetryData={0}; ';
static telemetryDataInvalidValue = 'invalid';
static integrationTypeDataParameter = 'integrationType={0}; ';
static clientRequestIdQualifier = '{0}; ';
static sourceParameter = 'source=WindowsAdminCenter';
static maxEncodedTelemetryDataLength = 512;
static resourceDeploymentSubstring = 'Microsoft.Resources/deployments';
// ms-graph resource endpoint
static graphResourceEndpoint = '/providers/Microsoft.ResourceGraph/resources?api-version=2021-03-01';
// ms-graph query
static resourceTypeFilterQuery = `resources | where (type == "microsoft.hybridcompute/machines" or type == "microsoft.compute/virtualmachines")
and tolower(name) in ({0}) | project arcStatus = properties.status, nodeName = name, type`;
static azureVmsFilterQuery = `resources | where (type == \"microsoft.compute/virtualmachines\")\n and tolower(name) in ({0}) | project nodeName = name, type`;
static virtualMachine = "microsoft.compute/virtualmachines";
/**
* WAC URLS for azure arc machine agent
*/
static arcMachineAgentIssuesURL = "https://go.microsoft.com/fwlink/?linkid=2248533";
static expiredArcMachineAgentURL = "https://learn.microsoft.com/azure/azure-arc/servers/manage-agent?tabs=windows#step-2-disconnect-the-server-from-azure-arc";
/**
* The interval of running the graph query call.
* In this case it's 15 minutes
*/
static graphQueryInterval = 900000;
static arcStatusGraphQueryDelay = 7000;
static arcStatusGraphQueryRetryCount = 8;
}
/*
* Azure 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 when calling this.appContextService.azureManagerService.createRequestWithHeaders() or when a
* method like this.appContextService.azureManagerService.getSubscriptions() is called.
*/
export var AzureIntegrationType;
(function (AzureIntegrationType) {
AzureIntegrationType["Backup"] = "Backup";
AzureIntegrationType["Bridge"] = "Bridge";
AzureIntegrationType["FileSync"] = "FileSync";
AzureIntegrationType["HybridServices"] = "HybridServices";
AzureIntegrationType["Monitor"] = "Monitor";
AzureIntegrationType["NetworkAdapter"] = "NetworkAdapter";
AzureIntegrationType["SecurityCenter"] = "SecurityCenter";
AzureIntegrationType["SiteRecovery"] = "SiteRecovery";
AzureIntegrationType["AzureMigrate"] = "AzureMigrate";
AzureIntegrationType["SubnetStretch"] = "SubnetStretch";
AzureIntegrationType["S2SVPN"] = "S2SVPN";
AzureIntegrationType["UpdateManagement"] = "UpdateManagement";
AzureIntegrationType["VirtualMachineCreation"] = "VirtualMachineCreation";
AzureIntegrationType["VirtualMachineSelection"] = "VirtualMachineSelection";
})(AzureIntegrationType || (AzureIntegrationType = {}));
export var ArmTelemetry;
(function (ArmTelemetry) {
function toIntegrationType(moduleName) {
switch (moduleName) {
case 'msft.azure.azure-backup': return AzureIntegrationType.Backup;
case 'msft.sme.azure-file-sync': return AzureIntegrationType.FileSync;
case 'msft.sme.azure-center': return AzureIntegrationType.HybridServices;
case 'msft.sme.server-manager': return AzureIntegrationType.Monitor;
case 'msft.sme.network-settings': return AzureIntegrationType.NetworkAdapter;
case 'msft.azure.security-center': return AzureIntegrationType.SecurityCenter;
case 'msft.sme.hyperv': return AzureIntegrationType.SiteRecovery;
case 'msft.sme.subnet-stretch': return AzureIntegrationType.SubnetStretch;
case 'msft.sdn.vgw-network-connection': return AzureIntegrationType.S2SVPN;
case 'msft.sme.windows-update': return AzureIntegrationType.UpdateManagement;
default: return moduleName;
}
}
ArmTelemetry.toIntegrationType = toIntegrationType;
})(ArmTelemetry || (ArmTelemetry = {}));
//# sourceMappingURL=azure-constants.js.map