@azure/arm-security
Version:
A generated SDK for SecurityCenter.
154 lines • 5.87 kB
JavaScript
/*
* 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 SqlVulnerabilityAssessmentBaselineRules operations. */
export class SqlVulnerabilityAssessmentBaselineRulesImpl {
/**
* Initialize a new instance of the class SqlVulnerabilityAssessmentBaselineRules class.
* @param client Reference to the service client
*/
constructor(client) {
this.client = client;
}
/**
* Creates a Baseline for a rule in a database. Will overwrite any previously existing results.
* @param ruleId The rule Id.
* @param workspaceId The workspace Id.
* @param resourceId The identifier of the resource.
* @param options The options parameters.
*/
createOrUpdate(ruleId, workspaceId, resourceId, options) {
return this.client.sendOperationRequest({ ruleId, workspaceId, resourceId, options }, createOrUpdateOperationSpec);
}
/**
* Gets the results for a given rule in the Baseline.
* @param ruleId The rule Id.
* @param workspaceId The workspace Id.
* @param resourceId The identifier of the resource.
* @param options The options parameters.
*/
get(ruleId, workspaceId, resourceId, options) {
return this.client.sendOperationRequest({ ruleId, workspaceId, resourceId, options }, getOperationSpec);
}
/**
* Deletes a rule from the Baseline of a given database.
* @param ruleId The rule Id.
* @param workspaceId The workspace Id.
* @param resourceId The identifier of the resource.
* @param options The options parameters.
*/
delete(ruleId, workspaceId, resourceId, options) {
return this.client.sendOperationRequest({ ruleId, workspaceId, resourceId, options }, deleteOperationSpec);
}
/**
* Gets the results for all rules in the Baseline.
* @param workspaceId The workspace Id.
* @param resourceId The identifier of the resource.
* @param options The options parameters.
*/
list(workspaceId, resourceId, options) {
return this.client.sendOperationRequest({ workspaceId, resourceId, options }, listOperationSpec);
}
/**
* Add a list of baseline rules. Will overwrite any previously existing results (for all rules).
* @param workspaceId The workspace Id.
* @param resourceId The identifier of the resource.
* @param options The options parameters.
*/
add(workspaceId, resourceId, options) {
return this.client.sendOperationRequest({ workspaceId, resourceId, options }, addOperationSpec);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const createOrUpdateOperationSpec = {
path: "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.RuleResults
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.body4,
queryParameters: [Parameters.workspaceId, Parameters.apiVersion12],
urlParameters: [Parameters.$host, Parameters.resourceId, Parameters.ruleId],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const getOperationSpec = {
path: "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.RuleResults
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.workspaceId, Parameters.apiVersion12],
urlParameters: [Parameters.$host, Parameters.resourceId, Parameters.ruleId],
headerParameters: [Parameters.accept],
serializer
};
const deleteOperationSpec = {
path: "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.workspaceId, Parameters.apiVersion12],
urlParameters: [Parameters.$host, Parameters.resourceId, Parameters.ruleId],
headerParameters: [Parameters.accept],
serializer
};
const listOperationSpec = {
path: "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.RulesResults
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.workspaceId, Parameters.apiVersion12],
urlParameters: [Parameters.$host, Parameters.resourceId],
headerParameters: [Parameters.accept],
serializer
};
const addOperationSpec = {
path: "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.RulesResults
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.body5,
queryParameters: [Parameters.workspaceId, Parameters.apiVersion12],
urlParameters: [Parameters.$host, Parameters.resourceId],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
//# sourceMappingURL=sqlVulnerabilityAssessmentBaselineRules.js.map