Skip to content

Commit 4ed095b

Browse files
api-clients-generation-pipeline[bot]zippolyteci.datadog-api-spec
authored
Add body step from file (#114)
* Add new body step from file * Regenerate client from commit 88ccf9e of spec repo Co-authored-by: Hippolyte HENRY <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent e74bea5 commit 4ed095b

38 files changed

+300
-291
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.4.1.dev6",
7-
"regenerated": "2021-04-29 09:07:08.158884",
8-
"spec_repo_commit": "ac83bf0"
7+
"regenerated": "2021-04-29 09:52:06.440851",
8+
"spec_repo_commit": "88ccf9e"
99
},
1010
"v2": {
1111
"apigentools_version": "1.4.1.dev6",
12-
"regenerated": "2021-04-29 09:07:13.597404",
13-
"spec_repo_commit": "ac83bf0"
12+
"regenerated": "2021-04-29 09:52:11.403008",
13+
"spec_repo_commit": "88ccf9e"
1414
}
1515
}
1616
}

features/step_definitions/request_steps.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { fixKeys, pathLookup } from "../support/templating";
66
import { Store } from "../support/store";
77
import { buildUndoFor, UndoActions } from "../support/undo";
88
import * as datadogApiClient from "../../index";
9+
import fs from "fs";
10+
import path from "path";
911

1012
Given('a valid "apiKeyAuth" key in the system', function (this: World) {
1113
this.authMethods["apiKeyAuth"] = process.env.DD_TEST_CLIENT_API_KEY;
@@ -28,10 +30,17 @@ Given(
2830
}
2931
);
3032

31-
Given(/body (.*)/, function (this: World, body: string) {
33+
Given(/body with value (.*)/, function (this: World, body: string) {
3234
this.opts["body"] = JSON.parse(body.templated(this.fixtures), fixKeys);
3335
});
3436

37+
Given(/body from file "(.*)"/, function (this: World, filename: string) {
38+
const content = fs
39+
.readFileSync(path.join(__dirname, `../${this.apiVersion}`, filename))
40+
.toString();
41+
this.opts["body"] = JSON.parse(content.templated(this.fixtures), fixKeys);
42+
});
43+
3544
Given(
3645
"request contains {string} parameter from {string}",
3746
function (this: World, parameterName: string, fixturePath: string) {

features/v1/aws_integration.feature

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,70 +12,70 @@ Feature: AWS Integration
1212
@generated @skip
1313
Scenario: Create an AWS integration returns "Bad Request" response
1414
Given new "CreateAWSAccount" request
15-
And body {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
15+
And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
1616
When the request is sent
1717
Then the response status is 400 Bad Request
1818

1919
@generated @skip
2020
Scenario: Create an AWS integration returns "Conflict Error" response
2121
Given new "CreateAWSAccount" request
22-
And body {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
22+
And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
2323
When the request is sent
2424
Then the response status is 409 Conflict Error
2525

2626
@generated @skip
2727
Scenario: Create an AWS integration returns "OK" response
2828
Given new "CreateAWSAccount" request
29-
And body {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
29+
And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
3030
When the request is sent
3131
Then the response status is 200 OK
3232

3333
@generated @skip
3434
Scenario: Delete a tag filtering entry returns "Bad Request" response
3535
Given new "DeleteAWSTagFilter" request
36-
And body {"account_id": "FAKEAC0FAKEAC2FAKEAC", "namespace": "elb"}
36+
And body with value {"account_id": "FAKEAC0FAKEAC2FAKEAC", "namespace": "elb"}
3737
When the request is sent
3838
Then the response status is 400 Bad Request
3939

4040
@generated @skip
4141
Scenario: Delete a tag filtering entry returns "OK" response
4242
Given new "DeleteAWSTagFilter" request
43-
And body {"account_id": "FAKEAC0FAKEAC2FAKEAC", "namespace": "elb"}
43+
And body with value {"account_id": "FAKEAC0FAKEAC2FAKEAC", "namespace": "elb"}
4444
When the request is sent
4545
Then the response status is 200 OK
4646

4747
@generated @skip
4848
Scenario: Delete an AWS integration returns "Bad Request" response
4949
Given new "DeleteAWSAccount" request
50-
And body {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
50+
And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
5151
When the request is sent
5252
Then the response status is 400 Bad Request
5353

5454
@generated @skip
5555
Scenario: Delete an AWS integration returns "Conflict Error" response
5656
Given new "DeleteAWSAccount" request
57-
And body {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
57+
And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
5858
When the request is sent
5959
Then the response status is 409 Conflict Error
6060

6161
@generated @skip
6262
Scenario: Delete an AWS integration returns "OK" response
6363
Given new "DeleteAWSAccount" request
64-
And body {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
64+
And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
6565
When the request is sent
6666
Then the response status is 200 OK
6767

6868
@generated @skip
6969
Scenario: Generate a new external ID returns "Bad Request" response
7070
Given new "CreateNewAWSExternalID" request
71-
And body {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
71+
And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
7272
When the request is sent
7373
Then the response status is 400 Bad Request
7474

7575
@generated @skip
7676
Scenario: Generate a new external ID returns "OK" response
7777
Given new "CreateNewAWSExternalID" request
78-
And body {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
78+
And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
7979
When the request is sent
8080
Then the response status is 200 OK
8181

@@ -112,34 +112,34 @@ Feature: AWS Integration
112112
@generated @skip
113113
Scenario: Set an AWS tag filter returns "Bad Request" response
114114
Given new "CreateAWSTagFilter" request
115-
And body {"account_id": "1234567", "namespace": "elb", "tag_filter_str": "prod*"}
115+
And body with value {"account_id": "1234567", "namespace": "elb", "tag_filter_str": "prod*"}
116116
When the request is sent
117117
Then the response status is 400 Bad Request
118118

119119
@generated @skip
120120
Scenario: Set an AWS tag filter returns "OK" response
121121
Given new "CreateAWSTagFilter" request
122-
And body {"account_id": "1234567", "namespace": "elb", "tag_filter_str": "prod*"}
122+
And body with value {"account_id": "1234567", "namespace": "elb", "tag_filter_str": "prod*"}
123123
When the request is sent
124124
Then the response status is 200 OK
125125

126126
@generated @skip
127127
Scenario: Update an AWS integration returns "Bad Request" response
128128
Given new "UpdateAWSAccount" request
129-
And body {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
129+
And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
130130
When the request is sent
131131
Then the response status is 400 Bad Request
132132

133133
@generated @skip
134134
Scenario: Update an AWS integration returns "Conflict Error" response
135135
Given new "UpdateAWSAccount" request
136-
And body {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
136+
And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
137137
When the request is sent
138138
Then the response status is 409 Conflict Error
139139

140140
@generated @skip
141141
Scenario: Update an AWS integration returns "OK" response
142142
Given new "UpdateAWSAccount" request
143-
And body {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
143+
And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
144144
When the request is sent
145145
Then the response status is 200 OK

features/v1/aws_logs_integration.feature

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,70 +12,70 @@ Feature: AWS Logs Integration
1212
@generated @skip
1313
Scenario: Add AWS Log Lambda ARN returns "Bad Request" response
1414
Given new "CreateAWSLambdaARN" request
15-
And body {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"}
15+
And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"}
1616
When the request is sent
1717
Then the response status is 400 Bad Request
1818

1919
@generated @skip
2020
Scenario: Add AWS Log Lambda ARN returns "OK" response
2121
Given new "CreateAWSLambdaARN" request
22-
And body {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"}
22+
And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"}
2323
When the request is sent
2424
Then the response status is 200 OK
2525

2626
@generated @skip
2727
Scenario: Check permissions for log services returns "Bad Request" response
2828
Given new "CheckAWSLogsServicesAsync" request
29-
And body {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]}
29+
And body with value {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]}
3030
When the request is sent
3131
Then the response status is 400 Bad Request
3232

3333
@generated @skip
3434
Scenario: Check permissions for log services returns "OK" response
3535
Given new "CheckAWSLogsServicesAsync" request
36-
And body {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]}
36+
And body with value {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]}
3737
When the request is sent
3838
Then the response status is 200 OK
3939

4040
@generated @skip
4141
Scenario: Check that an AWS Lambda Function exists returns "Bad Request" response
4242
Given new "CheckAWSLogsLambdaAsync" request
43-
And body {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"}
43+
And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"}
4444
When the request is sent
4545
Then the response status is 400 Bad Request
4646

4747
@generated @skip
4848
Scenario: Check that an AWS Lambda Function exists returns "OK" response
4949
Given new "CheckAWSLogsLambdaAsync" request
50-
And body {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"}
50+
And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"}
5151
When the request is sent
5252
Then the response status is 200 OK
5353

5454
@generated @skip
5555
Scenario: Delete an AWS Logs integration returns "Bad Request" response
5656
Given new "DeleteAWSLambdaARN" request
57-
And body {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"}
57+
And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"}
5858
When the request is sent
5959
Then the response status is 400 Bad Request
6060

6161
@generated @skip
6262
Scenario: Delete an AWS Logs integration returns "OK" response
6363
Given new "DeleteAWSLambdaARN" request
64-
And body {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"}
64+
And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"}
6565
When the request is sent
6666
Then the response status is 200 OK
6767

6868
@generated @skip
6969
Scenario: Enable an AWS Logs integration returns "Bad Request" response
7070
Given new "EnableAWSLogServices" request
71-
And body {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]}
71+
And body with value {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]}
7272
When the request is sent
7373
Then the response status is 400 Bad Request
7474

7575
@generated @skip
7676
Scenario: Enable an AWS Logs integration returns "OK" response
7777
Given new "EnableAWSLogServices" request
78-
And body {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]}
78+
And body with value {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]}
7979
When the request is sent
8080
Then the response status is 200 OK
8181

0 commit comments

Comments
 (0)