UNPKG

@azure/arm-monitor

Version:
124 lines 4.5 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 * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; /** Class containing DiagnosticSettings operations. */ export class DiagnosticSettingsImpl { /** * Initialize a new instance of the class DiagnosticSettings class. * @param client Reference to the service client */ constructor(client) { this.client = client; } /** * Gets the active diagnostic settings for the specified resource. * @param resourceUri The identifier of the resource. * @param name The name of the diagnostic setting. * @param options The options parameters. */ get(resourceUri, name, options) { return this.client.sendOperationRequest({ resourceUri, name, options }, getOperationSpec); } /** * Creates or updates diagnostic settings for the specified resource. * @param resourceUri The identifier of the resource. * @param name The name of the diagnostic setting. * @param parameters Parameters supplied to the operation. * @param options The options parameters. */ createOrUpdate(resourceUri, name, parameters, options) { return this.client.sendOperationRequest({ resourceUri, name, parameters, options }, createOrUpdateOperationSpec); } /** * Deletes existing diagnostic settings for the specified resource. * @param resourceUri The identifier of the resource. * @param name The name of the diagnostic setting. * @param options The options parameters. */ delete(resourceUri, name, options) { return this.client.sendOperationRequest({ resourceUri, name, options }, deleteOperationSpec); } /** * Gets the active diagnostic settings list for the specified resource. * @param resourceUri The identifier of the resource. * @param options The options parameters. */ list(resourceUri, options) { return this.client.sendOperationRequest({ resourceUri, options }, listOperationSpec); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec = { path: "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DiagnosticSettingsResource }, default: { bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion2], urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], headerParameters: [Parameters.accept], serializer }; const createOrUpdateOperationSpec = { path: "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.DiagnosticSettingsResource }, default: { bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion2], urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; const deleteOperationSpec = { path: "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion2], urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], headerParameters: [Parameters.accept], serializer }; const listOperationSpec = { path: "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DiagnosticSettingsResourceCollection }, default: { bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion2], urlParameters: [Parameters.$host, Parameters.resourceUri], headerParameters: [Parameters.accept], serializer }; //# sourceMappingURL=diagnosticSettings.js.map