Skip to content

Commit

Permalink
Regenerate client from commit 17f09b79 of spec repo (#709)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Jun 20, 2022
1 parent ba60cd5 commit 9a9f989
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.2",
"regenerated": "2022-06-17 19:27:05.223438",
"spec_repo_commit": "ba61a429"
"regenerated": "2022-06-20 06:54:41.109272",
"spec_repo_commit": "17f09b79"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-06-17 19:27:05.236837",
"spec_repo_commit": "ba61a429"
"regenerated": "2022-06-20 06:54:41.128692",
"spec_repo_commit": "17f09b79"
}
}
}
28 changes: 28 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6469,6 +6469,10 @@ components:
$ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsForgetAfter'
learningDuration:
$ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsLearningDuration'
learningMethod:
$ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsLearningMethod'
learningThreshold:
$ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsLearningThreshold'
type: object
SecurityMonitoringRuleNewValueOptionsForgetAfter:
description: The duration in days after which a learned value is forgotten.
Expand All @@ -6489,6 +6493,7 @@ components:
- THREE_WEEKS
- FOUR_WEEKS
SecurityMonitoringRuleNewValueOptionsLearningDuration:
default: 0
description: 'The duration in days during which values are learned, and after
which signals will be generated for values that
Expand All @@ -6504,6 +6509,29 @@ components:
- ZERO_DAYS
- ONE_DAY
- SEVEN_DAYS
SecurityMonitoringRuleNewValueOptionsLearningMethod:
default: duration
description: The learning method used to determine when signals should be generated
for values that weren't learned.
enum:
- duration
- threshold
type: string
x-enum-varnames:
- DURATION
- THRESHOLD
SecurityMonitoringRuleNewValueOptionsLearningThreshold:
default: 0
description: A number of occurrences after which signals will be generated for
values that weren't learned.
enum:
- 0
- 1
format: int32
type: integer
x-enum-varnames:
- ZERO_OCCURRENCES
- ONE_OCCURRENCE
SecurityMonitoringRuleOptions:
description: Options on rules.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const params: v2.SecurityMonitoringApiUpdateSecurityMonitoringRuleRequest = {
newValueOptions: {
forgetAfter: 1,
learningDuration: 0,
learningMethod: "duration",
learningThreshold: 0,
},
},
queries: [
Expand Down
6 changes: 3 additions & 3 deletions features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -226,22 +226,22 @@ Feature: Security Monitoring
Scenario: Update an existing rule returns "Bad Request" response
Given new "UpdateSecurityMonitoringRule" request
And request contains "rule_id" parameter from "REPLACE.ME"
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": []}], "tags": [], "version": 1}
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": []}], "tags": [], "version": 1}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/security-monitoring
Scenario: Update an existing rule returns "Not Found" response
Given new "UpdateSecurityMonitoringRule" request
And request contains "rule_id" parameter from "REPLACE.ME"
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": []}], "tags": [], "version": 1}
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": []}], "tags": [], "version": 1}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/security-monitoring
Scenario: Update an existing rule returns "OK" response
Given new "UpdateSecurityMonitoringRule" request
And request contains "rule_id" parameter from "REPLACE.ME"
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": []}], "tags": [], "version": 1}
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": []}], "tags": [], "version": 1}
When the request is sent
Then the response status is 200 OK
2 changes: 2 additions & 0 deletions packages/datadog-api-client-v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,8 @@ export { SecurityMonitoringRuleMaxSignalDuration } from "./models/SecurityMonito
export { SecurityMonitoringRuleNewValueOptions } from "./models/SecurityMonitoringRuleNewValueOptions";
export { SecurityMonitoringRuleNewValueOptionsForgetAfter } from "./models/SecurityMonitoringRuleNewValueOptionsForgetAfter";
export { SecurityMonitoringRuleNewValueOptionsLearningDuration } from "./models/SecurityMonitoringRuleNewValueOptionsLearningDuration";
export { SecurityMonitoringRuleNewValueOptionsLearningMethod } from "./models/SecurityMonitoringRuleNewValueOptionsLearningMethod";
export { SecurityMonitoringRuleNewValueOptionsLearningThreshold } from "./models/SecurityMonitoringRuleNewValueOptionsLearningThreshold";
export { SecurityMonitoringRuleOptions } from "./models/SecurityMonitoringRuleOptions";
export { SecurityMonitoringRuleQuery } from "./models/SecurityMonitoringRuleQuery";
export { SecurityMonitoringRuleQueryAggregation } from "./models/SecurityMonitoringRuleQueryAggregation";
Expand Down
5 changes: 5 additions & 0 deletions packages/datadog-api-client-v2/models/ObjectSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,11 @@ const enumsMap: { [key: string]: any[] } = {
],
SecurityMonitoringRuleNewValueOptionsForgetAfter: [1, 2, 7, 14, 21, 28],
SecurityMonitoringRuleNewValueOptionsLearningDuration: [0, 1, 7],
SecurityMonitoringRuleNewValueOptionsLearningMethod: [
"duration",
"threshold",
],
SecurityMonitoringRuleNewValueOptionsLearningThreshold: [0, 1],
SecurityMonitoringRuleQueryAggregation: [
"count",
"cardinality",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
import { SecurityMonitoringRuleNewValueOptionsForgetAfter } from "./SecurityMonitoringRuleNewValueOptionsForgetAfter";
import { SecurityMonitoringRuleNewValueOptionsLearningDuration } from "./SecurityMonitoringRuleNewValueOptionsLearningDuration";
import { SecurityMonitoringRuleNewValueOptionsLearningMethod } from "./SecurityMonitoringRuleNewValueOptionsLearningMethod";
import { SecurityMonitoringRuleNewValueOptionsLearningThreshold } from "./SecurityMonitoringRuleNewValueOptionsLearningThreshold";

import { AttributeTypeMap } from "../../datadog-api-client-common/util";

Expand All @@ -21,6 +23,14 @@ export class SecurityMonitoringRuleNewValueOptions {
* weren't learned. If set to 0, a signal will be generated for all new values after the first value is learned.
*/
"learningDuration"?: SecurityMonitoringRuleNewValueOptionsLearningDuration;
/**
* The learning method used to determine when signals should be generated for values that weren't learned.
*/
"learningMethod"?: SecurityMonitoringRuleNewValueOptionsLearningMethod;
/**
* A number of occurrences after which signals will be generated for values that weren't learned.
*/
"learningThreshold"?: SecurityMonitoringRuleNewValueOptionsLearningThreshold;

/**
* @ignore
Expand All @@ -41,6 +51,15 @@ export class SecurityMonitoringRuleNewValueOptions {
type: "SecurityMonitoringRuleNewValueOptionsLearningDuration",
format: "int32",
},
learningMethod: {
baseName: "learningMethod",
type: "SecurityMonitoringRuleNewValueOptionsLearningMethod",
},
learningThreshold: {
baseName: "learningThreshold",
type: "SecurityMonitoringRuleNewValueOptionsLearningThreshold",
format: "int32",
},
};

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/

export type SecurityMonitoringRuleNewValueOptionsLearningMethod =
| typeof DURATION
| typeof THRESHOLD;
export const DURATION = "duration";
export const THRESHOLD = "threshold";
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/

export type SecurityMonitoringRuleNewValueOptionsLearningThreshold =
| typeof ZERO_OCCURRENCES
| typeof ONE_OCCURRENCE;
export const ZERO_OCCURRENCES = 0;
export const ONE_OCCURRENCE = 1;

0 comments on commit 9a9f989

Please sign in to comment.