UNPKG

@microsoft.azure/autorest.testserver

Version:
37 lines 1.51 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const api_1 = require("../../api"); api_1.app.category("azure", () => { // Initial call is 202 with no body and Location and Azure-AsyncOperation // Configured to follow Location // Then, should poll Azure-AsyncOperation and see it's done // Then, should do final GET on the initial Location // ARM guidance ok, and implemented in VM capture after 2018-04-01 api_1.app.post("/lro/LROPostDoubleHeadersFinalLocationGet", "LROPostDoubleHeadersFinalLocationPost", (req) => { return { status: 202, headers: { "Azure-AsyncOperation": `${req.baseUrl}/lro/LROPostDoubleHeadersFinalLocationGet/asyncOperationUrl`, "Location": `${req.baseUrl}/lro/LROPostDoubleHeadersFinalLocationGet/location`, }, }; }); api_1.app.get("/lro/LROPostDoubleHeadersFinalLocationGet/asyncOperationUrl", "LROPostDoubleHeadersFinalLocationAsync", (req) => { return { status: 200, body: (0, api_1.json)({ status: "succeeded", }), }; }); api_1.app.get("/lro/LROPostDoubleHeadersFinalLocationGet/location", "LROPostDoubleHeadersFinalLocationGet", (req) => { return { status: 200, body: (0, api_1.json)({ id: "100", name: "foo", }), }; }); }); //# sourceMappingURL=lro-double-headers.js.map