UNPKG

@azure/arm-security

Version:
51 lines 2.75 kB
/* * 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 { __awaiter } from "tslib"; // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { SecurityCenter } from "@azure/arm-security"; import { DefaultAzureCredential } from "@azure/identity"; /** * This sample demonstrates how to Get a security assessment on your scanned resource * * @summary Get a security assessment on your scanned resource * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessment_example.json */ function getSecurityRecommendationTaskFromSecurityDataLocation() { return __awaiter(this, void 0, void 0, function* () { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const resourceId = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2"; const assessmentName = "21300918-b2e3-0346-785f-c77ff57d243b"; const credential = new DefaultAzureCredential(); const client = new SecurityCenter(credential, subscriptionId); const result = yield client.assessments.get(resourceId, assessmentName); console.log(result); }); } getSecurityRecommendationTaskFromSecurityDataLocation().catch(console.error); /** * This sample demonstrates how to Get a security assessment on your scanned resource * * @summary Get a security assessment on your scanned resource * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessmentWithExpand_example.json */ function getSecurityRecommendationTaskFromSecurityDataLocationWithExpandParameter() { return __awaiter(this, void 0, void 0, function* () { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const resourceId = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2"; const assessmentName = "21300918-b2e3-0346-785f-c77ff57d243b"; const expand = "links"; const options = { expand }; const credential = new DefaultAzureCredential(); const client = new SecurityCenter(credential, subscriptionId); const result = yield client.assessments.get(resourceId, assessmentName, options); console.log(result); }); } getSecurityRecommendationTaskFromSecurityDataLocationWithExpandParameter().catch(console.error); //# sourceMappingURL=assessmentsGetSample.js.map