@azure/arm-appservice
Version:
A generated SDK for WebSiteManagementClient.
1,230 lines • 58.8 kB
JavaScript
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { setContinuationToken } from "../pagingHelper.js";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers.js";
import * as Parameters from "../models/parameters.js";
import { createHttpPoller } from "@azure/core-lro";
import { createLroSpec } from "../lroImpl.js";
/// <reference lib="esnext.asynciterable" />
/** Class containing AppServicePlans operations. */
export class AppServicePlansImpl {
client;
/**
* Initialize a new instance of the class AppServicePlans class.
* @param client Reference to the service client
*/
constructor(client) {
this.client = client;
}
/**
* Description for Get all App Service plans for a subscription.
* @param options The options parameters.
*/
list(options) {
const iter = this.listPagingAll(options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listPagingPage(options, settings);
},
};
}
async *listPagingPage(options, settings) {
let result;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._list(options);
const page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listNext(continuationToken, options);
continuationToken = result.nextLink;
const page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
async *listPagingAll(options) {
for await (const page of this.listPagingPage(options)) {
yield* page;
}
}
/**
* Description for Get all App Service plans in a resource group.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param options The options parameters.
*/
listByResourceGroup(resourceGroupName, options) {
const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
},
};
}
async *listByResourceGroupPagingPage(resourceGroupName, options, settings) {
let result;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listByResourceGroup(resourceGroupName, options);
const page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options);
continuationToken = result.nextLink;
const page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
async *listByResourceGroupPagingAll(resourceGroupName, options) {
for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) {
yield* page;
}
}
/**
* Description for Get all apps that use a Hybrid Connection in an App Service Plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param namespaceName Name of the Hybrid Connection namespace.
* @param relayName Name of the Hybrid Connection relay.
* @param options The options parameters.
*/
listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, relayName, options) {
const iter = this.listWebAppsByHybridConnectionPagingAll(resourceGroupName, name, namespaceName, relayName, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listWebAppsByHybridConnectionPagingPage(resourceGroupName, name, namespaceName, relayName, options, settings);
},
};
}
async *listWebAppsByHybridConnectionPagingPage(resourceGroupName, name, namespaceName, relayName, options, settings) {
let result;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, relayName, options);
const page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listWebAppsByHybridConnectionNext(resourceGroupName, name, namespaceName, relayName, continuationToken, options);
continuationToken = result.nextLink;
const page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
async *listWebAppsByHybridConnectionPagingAll(resourceGroupName, name, namespaceName, relayName, options) {
for await (const page of this.listWebAppsByHybridConnectionPagingPage(resourceGroupName, name, namespaceName, relayName, options)) {
yield* page;
}
}
/**
* Description for Retrieve all Hybrid Connections in use in an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param options The options parameters.
*/
listHybridConnections(resourceGroupName, name, options) {
const iter = this.listHybridConnectionsPagingAll(resourceGroupName, name, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listHybridConnectionsPagingPage(resourceGroupName, name, options, settings);
},
};
}
async *listHybridConnectionsPagingPage(resourceGroupName, name, options, settings) {
let result;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listHybridConnections(resourceGroupName, name, options);
const page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listHybridConnectionsNext(resourceGroupName, name, continuationToken, options);
continuationToken = result.nextLink;
const page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
async *listHybridConnectionsPagingAll(resourceGroupName, name, options) {
for await (const page of this.listHybridConnectionsPagingPage(resourceGroupName, name, options)) {
yield* page;
}
}
/**
* Description for Get all apps associated with an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param options The options parameters.
*/
listWebApps(resourceGroupName, name, options) {
const iter = this.listWebAppsPagingAll(resourceGroupName, name, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listWebAppsPagingPage(resourceGroupName, name, options, settings);
},
};
}
async *listWebAppsPagingPage(resourceGroupName, name, options, settings) {
let result;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listWebApps(resourceGroupName, name, options);
const page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listWebAppsNext(resourceGroupName, name, continuationToken, options);
continuationToken = result.nextLink;
const page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
async *listWebAppsPagingAll(resourceGroupName, name, options) {
for await (const page of this.listWebAppsPagingPage(resourceGroupName, name, options)) {
yield* page;
}
}
/**
* Description for Gets server farm usage information
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of App Service Plan
* @param options The options parameters.
*/
listUsages(resourceGroupName, name, options) {
const iter = this.listUsagesPagingAll(resourceGroupName, name, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listUsagesPagingPage(resourceGroupName, name, options, settings);
},
};
}
async *listUsagesPagingPage(resourceGroupName, name, options, settings) {
let result;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listUsages(resourceGroupName, name, options);
const page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listUsagesNext(resourceGroupName, name, continuationToken, options);
continuationToken = result.nextLink;
const page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
async *listUsagesPagingAll(resourceGroupName, name, options) {
for await (const page of this.listUsagesPagingPage(resourceGroupName, name, options)) {
yield* page;
}
}
/**
* Description for Get all App Service plans for a subscription.
* @param options The options parameters.
*/
_list(options) {
return this.client.sendOperationRequest({ options }, listOperationSpec);
}
/**
* Description for Get all App Service plans in a resource group.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param options The options parameters.
*/
_listByResourceGroup(resourceGroupName, options) {
return this.client.sendOperationRequest({ resourceGroupName, options }, listByResourceGroupOperationSpec);
}
/**
* Description for Get an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param options The options parameters.
*/
get(resourceGroupName, name, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, options }, getOperationSpec);
}
/**
* Description for Creates or updates an App Service Plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param appServicePlan Details of the App Service plan.
* @param options The options parameters.
*/
async beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options) {
const directSendOperation = async (args, spec) => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (args, spec) => {
let currentRawResponse = undefined;
const providedCallback = args.options?.onResponse;
const callback = (rawResponse, flatResponse) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback,
},
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse.status,
body: currentRawResponse.parsedBody,
headers: currentRawResponse.headers.toJSON(),
},
};
};
const lro = createLroSpec({
sendOperationFn,
args: { resourceGroupName, name, appServicePlan, options },
spec: createOrUpdateOperationSpec,
});
const poller = await createHttpPoller(lro, {
restoreFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
});
await poller.poll();
return poller;
}
/**
* Description for Creates or updates an App Service Plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param appServicePlan Details of the App Service plan.
* @param options The options parameters.
*/
async beginCreateOrUpdateAndWait(resourceGroupName, name, appServicePlan, options) {
const poller = await this.beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options);
return poller.pollUntilDone();
}
/**
* Description for Delete an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param options The options parameters.
*/
delete(resourceGroupName, name, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, options }, deleteOperationSpec);
}
/**
* Description for Creates or updates an App Service Plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param appServicePlan Details of the App Service plan.
* @param options The options parameters.
*/
update(resourceGroupName, name, appServicePlan, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, appServicePlan, options }, updateOperationSpec);
}
/**
* Description for List all capabilities of an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param options The options parameters.
*/
listCapabilities(resourceGroupName, name, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, options }, listCapabilitiesOperationSpec);
}
/**
* Description for Get the RDP password for an IsCustomMode ServerFarm.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param options The options parameters.
*/
getServerFarmRdpPassword(resourceGroupName, name, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, options }, getServerFarmRdpPasswordOperationSpec);
}
/**
* Description for Retrieve a Hybrid Connection in use in an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param namespaceName Name of the Service Bus namespace.
* @param relayName Name of the Service Bus relay.
* @param options The options parameters.
*/
getHybridConnection(resourceGroupName, name, namespaceName, relayName, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, namespaceName, relayName, options }, getHybridConnectionOperationSpec);
}
/**
* Description for Delete a Hybrid Connection in use in an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param namespaceName Name of the Service Bus namespace.
* @param relayName Name of the Service Bus relay.
* @param options The options parameters.
*/
deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, namespaceName, relayName, options }, deleteHybridConnectionOperationSpec);
}
/**
* Description for Get the send key name and value of a Hybrid Connection.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param namespaceName The name of the Service Bus namespace.
* @param relayName The name of the Service Bus relay.
* @param options The options parameters.
*/
listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, namespaceName, relayName, options }, listHybridConnectionKeysOperationSpec);
}
/**
* Description for Get all apps that use a Hybrid Connection in an App Service Plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param namespaceName Name of the Hybrid Connection namespace.
* @param relayName Name of the Hybrid Connection relay.
* @param options The options parameters.
*/
_listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, relayName, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, namespaceName, relayName, options }, listWebAppsByHybridConnectionOperationSpec);
}
/**
* Description for Get the maximum number of Hybrid Connections allowed in an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param options The options parameters.
*/
getHybridConnectionPlanLimit(resourceGroupName, name, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, options }, getHybridConnectionPlanLimitOperationSpec);
}
/**
* Description for Retrieve all Hybrid Connections in use in an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param options The options parameters.
*/
_listHybridConnections(resourceGroupName, name, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, options }, listHybridConnectionsOperationSpec);
}
/**
* Description for Get the instance details for an app service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param options The options parameters.
*/
getServerFarmInstanceDetails(resourceGroupName, name, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, options }, getServerFarmInstanceDetailsOperationSpec);
}
/**
* Description for Restart all apps in an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param options The options parameters.
*/
restartWebApps(resourceGroupName, name, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, options }, restartWebAppsOperationSpec);
}
/**
* Description for Get all apps associated with an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param options The options parameters.
*/
_listWebApps(resourceGroupName, name, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, options }, listWebAppsOperationSpec);
}
/**
* Description for Gets all selectable SKUs for a given App Service Plan
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of App Service Plan
* @param options The options parameters.
*/
getServerFarmSkus(resourceGroupName, name, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, options }, getServerFarmSkusOperationSpec);
}
/**
* Description for Gets server farm usage information
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of App Service Plan
* @param options The options parameters.
*/
_listUsages(resourceGroupName, name, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, options }, listUsagesOperationSpec);
}
/**
* Description for Get all Virtual Networks associated with an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param options The options parameters.
*/
listVnets(resourceGroupName, name, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, options }, listVnetsOperationSpec);
}
/**
* Description for Get a Virtual Network associated with an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param vnetName Name of the Virtual Network.
* @param options The options parameters.
*/
getVnetFromServerFarm(resourceGroupName, name, vnetName, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, vnetName, options }, getVnetFromServerFarmOperationSpec);
}
/**
* Description for Get a Virtual Network gateway.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param vnetName Name of the Virtual Network.
* @param gatewayName Name of the gateway. Only the 'primary' gateway is supported.
* @param options The options parameters.
*/
getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, vnetName, gatewayName, options }, getVnetGatewayOperationSpec);
}
/**
* Description for Update a Virtual Network gateway.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param vnetName Name of the Virtual Network.
* @param gatewayName Name of the gateway. Only the 'primary' gateway is supported.
* @param connectionEnvelope Definition of the gateway.
* @param options The options parameters.
*/
updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options) {
return this.client.sendOperationRequest({
resourceGroupName,
name,
vnetName,
gatewayName,
connectionEnvelope,
options,
}, updateVnetGatewayOperationSpec);
}
/**
* Description for Get all routes that are associated with a Virtual Network in an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param vnetName Name of the Virtual Network.
* @param options The options parameters.
*/
listRoutesForVnet(resourceGroupName, name, vnetName, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, vnetName, options }, listRoutesForVnetOperationSpec);
}
/**
* Description for Get a Virtual Network route in an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param vnetName Name of the Virtual Network.
* @param routeName Name of the Virtual Network route.
* @param options The options parameters.
*/
getRouteForVnet(resourceGroupName, name, vnetName, routeName, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, vnetName, routeName, options }, getRouteForVnetOperationSpec);
}
/**
* Description for Create or update a Virtual Network route in an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param vnetName Name of the Virtual Network.
* @param routeName Name of the Virtual Network route.
* @param route Definition of the Virtual Network route.
* @param options The options parameters.
*/
createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, vnetName, routeName, route, options }, createOrUpdateVnetRouteOperationSpec);
}
/**
* Description for Delete a Virtual Network route in an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param vnetName Name of the Virtual Network.
* @param routeName Name of the Virtual Network route.
* @param options The options parameters.
*/
deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, vnetName, routeName, options }, deleteVnetRouteOperationSpec);
}
/**
* Description for Create or update a Virtual Network route in an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param vnetName Name of the Virtual Network.
* @param routeName Name of the Virtual Network route.
* @param route Definition of the Virtual Network route.
* @param options The options parameters.
*/
updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, vnetName, routeName, route, options }, updateVnetRouteOperationSpec);
}
/**
* Description for Reboot a worker machine in an App Service plan.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param workerName Name of worker machine, which typically starts with RD.
* @param options The options parameters.
*/
rebootWorker(resourceGroupName, name, workerName, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, workerName, options }, rebootWorkerOperationSpec);
}
/**
* Description for Recycles a managed instance worker machine.
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param workerName Name of worker machine.
* @param options The options parameters.
*/
recycleManagedInstanceWorker(resourceGroupName, name, workerName, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, workerName, options }, recycleManagedInstanceWorkerOperationSpec);
}
/**
* ListNext
* @param nextLink The nextLink from the previous successful call to the List method.
* @param options The options parameters.
*/
_listNext(nextLink, options) {
return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
}
/**
* ListByResourceGroupNext
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
* @param options The options parameters.
*/
_listByResourceGroupNext(resourceGroupName, nextLink, options) {
return this.client.sendOperationRequest({ resourceGroupName, nextLink, options }, listByResourceGroupNextOperationSpec);
}
/**
* ListWebAppsByHybridConnectionNext
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param namespaceName Name of the Hybrid Connection namespace.
* @param relayName Name of the Hybrid Connection relay.
* @param nextLink The nextLink from the previous successful call to the ListWebAppsByHybridConnection
* method.
* @param options The options parameters.
*/
_listWebAppsByHybridConnectionNext(resourceGroupName, name, namespaceName, relayName, nextLink, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, namespaceName, relayName, nextLink, options }, listWebAppsByHybridConnectionNextOperationSpec);
}
/**
* ListHybridConnectionsNext
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param nextLink The nextLink from the previous successful call to the ListHybridConnections method.
* @param options The options parameters.
*/
_listHybridConnectionsNext(resourceGroupName, name, nextLink, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, nextLink, options }, listHybridConnectionsNextOperationSpec);
}
/**
* ListWebAppsNext
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service plan.
* @param nextLink The nextLink from the previous successful call to the ListWebApps method.
* @param options The options parameters.
*/
_listWebAppsNext(resourceGroupName, name, nextLink, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, nextLink, options }, listWebAppsNextOperationSpec);
}
/**
* ListUsagesNext
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of App Service Plan
* @param nextLink The nextLink from the previous successful call to the ListUsages method.
* @param options The options parameters.
*/
_listUsagesNext(resourceGroupName, name, nextLink, options) {
return this.client.sendOperationRequest({ resourceGroupName, name, nextLink, options }, listUsagesNextOperationSpec);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec = {
path: "/subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.AppServicePlanCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion, Parameters.detailed],
urlParameters: [Parameters.$host, Parameters.subscriptionId],
headerParameters: [Parameters.accept],
serializer,
};
const listByResourceGroupOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.AppServicePlanCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName],
headerParameters: [Parameters.accept],
serializer,
};
const getOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.AppServicePlan,
},
404: {
isError: true,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
],
headerParameters: [Parameters.accept],
serializer,
};
const createOrUpdateOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.AppServicePlan,
},
201: {
bodyMapper: Mappers.AppServicePlan,
},
202: {
bodyMapper: Mappers.AppServicePlan,
},
204: {
bodyMapper: Mappers.AppServicePlan,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
requestBody: Parameters.appServicePlan,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer,
};
const deleteOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
],
headerParameters: [Parameters.accept],
serializer,
};
const updateOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}",
httpMethod: "PATCH",
responses: {
200: {
bodyMapper: Mappers.AppServicePlan,
},
202: {
bodyMapper: Mappers.AppServicePlan,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
requestBody: Parameters.appServicePlan1,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer,
};
const listCapabilitiesOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/capabilities",
httpMethod: "GET",
responses: {
200: {
bodyMapper: {
type: {
name: "Sequence",
element: { type: { name: "Composite", className: "Capability" } },
},
},
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
],
headerParameters: [Parameters.accept],
serializer,
};
const getServerFarmRdpPasswordOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/getrdppassword",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.ServerFarmRdpDetails,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
],
headerParameters: [Parameters.accept],
serializer,
};
const getHybridConnectionOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.HybridConnection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
Parameters.namespaceName,
Parameters.relayName,
],
headerParameters: [Parameters.accept],
serializer,
};
const deleteHybridConnectionOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
Parameters.namespaceName,
Parameters.relayName,
],
headerParameters: [Parameters.accept],
serializer,
};
const listHybridConnectionKeysOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.HybridConnectionKey,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
Parameters.namespaceName,
Parameters.relayName,
],
headerParameters: [Parameters.accept],
serializer,
};
const listWebAppsByHybridConnectionOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ResourceCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
Parameters.namespaceName,
Parameters.relayName,
],
headerParameters: [Parameters.accept],
serializer,
};
const getHybridConnectionPlanLimitOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionPlanLimits/limit",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.HybridConnectionLimits,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
],
headerParameters: [Parameters.accept],
serializer,
};
const listHybridConnectionsOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionRelays",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.HybridConnectionCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
],
headerParameters: [Parameters.accept],
serializer,
};
const getServerFarmInstanceDetailsOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/listinstances",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.ServerFarmInstanceDetails,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
],
headerParameters: [Parameters.accept],
serializer,
};
const restartWebAppsOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites",
httpMethod: "POST",
responses: {
204: {},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion, Parameters.softRestart],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
],
headerParameters: [Parameters.accept],
serializer,
};
const listWebAppsOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.WebAppCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.skipToken, Parameters.top],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
],
headerParameters: [Parameters.accept],
serializer,
};
const getServerFarmSkusOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/skus",
httpMethod: "GET",
responses: {
200: {
bodyMapper: {
type: { name: "Dictionary", value: { type: { name: "any" } } },
},
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
],
headerParameters: [Parameters.accept],
serializer,
};
const listUsagesOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/usages",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.CsmUsageQuotaCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion, Parameters.filter],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
],
headerParameters: [Parameters.accept],
serializer,
};
const listVnetsOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections",
httpMethod: "GET",
responses: {
200: {
bodyMapper: {
type: {
name: "Sequence",
element: {
type: { name: "Composite", className: "VnetInfoResource" },
},
},
},
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
],
headerParameters: [Parameters.accept],
serializer,
};
const getVnetFromServerFarmOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.VnetInfoResource,
},
404: {
isError: true,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
Parameters.vnetName,
],
headerParameters: [Parameters.accept],
serializer,
};
const getVnetGatewayOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.VnetGateway,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
Parameters.vnetName,
Parameters.gatewayName,
],
headerParameters: [Parameters.accept],
serializer,
};
const updateVnetGatewayOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.VnetGateway,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
requestBody: Parameters.connectionEnvelope,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.name,
Parameters.vnetName,
Parameters.gatewayName,
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer,
};
const listRoutesForVnetOperationSpec = {
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupNam