Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
export declare const testPollingOptions: {
updateIntervalInMs: number | undefined;
};
//# sourceMappingURL=web_examples.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"web_examples.d.ts","sourceRoot":"","sources":["../../test/web_examples.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,kBAAkB;;CAE9B,CAAC"}
+206
View File
@@ -0,0 +1,206 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { __asyncValues, __awaiter } from "tslib";
import { env, Recorder, isPlaybackMode, } from "@azure-tools/test-recorder";
import { createTestCredential } from "@azure-tools/test-credential";
import { assert } from "chai";
import { WebSiteManagementClient } from "../src/webSiteManagementClient";
const replaceableVariables = {
AZURE_CLIENT_ID: "azure_client_id",
AZURE_CLIENT_SECRET: "azure_client_secret",
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
SUBSCRIPTION_ID: "azure_subscription_id"
};
const recorderOptions = {
envSetupForPlayback: replaceableVariables
};
export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};
describe("Web test", () => {
let recorder;
let subscriptionId;
let client;
let location;
let resourceGroup;
let appservicePlanName;
let name;
beforeEach(function () {
return __awaiter(this, void 0, void 0, function* () {
recorder = new Recorder(this.currentTest);
yield recorder.start(recorderOptions);
subscriptionId = env.SUBSCRIPTION_ID || '';
// This is an example of how the environment variables are used
const credential = createTestCredential();
client = new WebSiteManagementClient(credential, subscriptionId, recorder.configureClientOptions({}));
location = "eastus";
resourceGroup = "myjstest";
appservicePlanName = "myappserviceplanxxx";
name = "mysitexxxx";
});
});
afterEach(function () {
return __awaiter(this, void 0, void 0, function* () {
yield recorder.stop();
});
});
it("appServicePlans create test", function () {
return __awaiter(this, void 0, void 0, function* () {
const res = yield client.appServicePlans.beginCreateOrUpdateAndWait(resourceGroup, appservicePlanName, {
location: "eastus",
sku: {
name: "S1",
tier: "STANDARD",
capacity: 1,
},
perSiteScaling: false,
isXenon: false
}, testPollingOptions);
assert.equal(res.name, appservicePlanName);
});
});
it("webApps create test", function () {
return __awaiter(this, void 0, void 0, function* () {
const res = yield client.webApps.beginCreateOrUpdateAndWait(resourceGroup, name, {
location: "eastus",
serverFarmId: "/subscriptions/" +
subscriptionId +
"/resourceGroups/myjstest/providers/Microsoft.Web/serverfarms/myappserviceplanxxx",
reserved: false,
isXenon: false,
hyperV: false,
siteConfig: {
netFrameworkVersion: "v4.6",
appSettings: [
{
name: "WEBSITE_NODE_DEFAULT_VERSION",
value: "10.14",
},
],
localMySqlEnabled: false,
http20Enabled: true,
},
scmSiteAlsoStopped: false,
httpsOnly: false
}, testPollingOptions);
assert.equal(res.name, name);
});
});
it("appServicePlans get test", function () {
return __awaiter(this, void 0, void 0, function* () {
const res = yield client.appServicePlans.get(resourceGroup, appservicePlanName);
assert.equal(res.name, appservicePlanName);
});
});
it("webApps get test", function () {
return __awaiter(this, void 0, void 0, function* () {
const res = yield client.webApps.get(resourceGroup, name);
assert.equal(res.name, name);
});
});
it("appServicePlans list test", function () {
var e_1, _a;
return __awaiter(this, void 0, void 0, function* () {
const resArray = new Array();
try {
for (var _b = __asyncValues(client.appServicePlans.listByResourceGroup(resourceGroup)), _c; _c = yield _b.next(), !_c.done;) {
let item = _c.value;
resArray.push(item);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
assert.equal(resArray.length, 1);
});
});
it("webApps list test", function () {
var e_2, _a;
return __awaiter(this, void 0, void 0, function* () {
const resArray = new Array();
try {
for (var _b = __asyncValues(client.webApps.listByResourceGroup(resourceGroup)), _c; _c = yield _b.next(), !_c.done;) {
let item = _c.value;
resArray.push(item);
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
}
finally { if (e_2) throw e_2.error; }
}
assert.equal(resArray.length, 1);
});
});
it("webApps update test", function () {
return __awaiter(this, void 0, void 0, function* () {
const res = yield client.webApps.update(resourceGroup, name, {
serverFarmId: "/subscriptions/" + subscriptionId + "/resourceGroups/myjstest/providers/Microsoft.Web/serverfarms/myappserviceplanxxx",
reserved: false,
isXenon: false,
hyperV: false,
siteConfig: {
netFrameworkVersion: "v4.6",
localMySqlEnabled: false,
http20Enabled: true,
},
scmSiteAlsoStopped: false
});
assert.equal(res.name, name);
});
});
it("webApps delete test", function () {
var e_3, _a;
return __awaiter(this, void 0, void 0, function* () {
const res = yield client.webApps.delete(resourceGroup, name);
const resArray = new Array();
try {
for (var _b = __asyncValues(client.webApps.listByResourceGroup(resourceGroup)), _c; _c = yield _b.next(), !_c.done;) {
let item = _c.value;
resArray.push(item);
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
}
finally { if (e_3) throw e_3.error; }
}
assert.equal(resArray.length, 0);
});
});
it("appServicePlans delete test", function () {
var e_4, _a;
return __awaiter(this, void 0, void 0, function* () {
const res = yield client.appServicePlans.delete(resourceGroup, appservicePlanName);
const resArray = new Array();
try {
for (var _b = __asyncValues(client.appServicePlans.listByResourceGroup(resourceGroup)), _c; _c = yield _b.next(), !_c.done;) {
let item = _c.value;
resArray.push(item);
}
}
catch (e_4_1) { e_4 = { error: e_4_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
}
finally { if (e_4) throw e_4.error; }
}
assert.equal(resArray.length, 0);
});
});
});
//# sourceMappingURL=web_examples.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"web_examples.js","sourceRoot":"","sources":["../../test/web_examples.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;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