Skip to content

Commit 8cd1163

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
[OnCall] replacing connection name with unique name (#2474)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent d3600aa commit 8cd1163

File tree

20 files changed

+82
-48
lines changed

20 files changed

+82
-48
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-04-04 12:49:27.974787",
8-
"spec_repo_commit": "73e22797"
7+
"regenerated": "2025-04-04 16:55:45.187360",
8+
"spec_repo_commit": "da94868e"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-04-04 12:49:27.990030",
13-
"spec_repo_commit": "73e22797"
12+
"regenerated": "2025-04-04 16:55:45.204117",
13+
"spec_repo_commit": "da94868e"
1414
}
1515
}
1616
}

examples/v2/action-connection/CreateActionConnection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
data=ActionConnectionData(
1818
type=ActionConnectionDataType.ACTION_CONNECTION,
1919
attributes=ActionConnectionAttributes(
20-
name="Cassette Connection DELETE_ME",
20+
name="Cassette Connection exampleactionconnection",
2121
integration=AWSIntegration(
2222
type=AWSIntegrationType.AWS,
2323
credentials=AWSAssumeRole(

examples/v2/action-connection/DeleteActionConnection.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22
Delete an existing Action Connection returns "The resource was deleted successfully." response
33
"""
44

5+
from os import environ
56
from datadog_api_client import ApiClient, Configuration
67
from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi
78

9+
# there is a valid "action_connection" in the system
10+
ACTION_CONNECTION_DATA_ID = environ["ACTION_CONNECTION_DATA_ID"]
11+
812
configuration = Configuration()
913
with ApiClient(configuration) as api_client:
1014
api_instance = ActionConnectionApi(api_client)
1115
api_instance.delete_action_connection(
12-
connection_id="connection_id",
16+
connection_id=ACTION_CONNECTION_DATA_ID,
1317
)

examples/v2/action-connection/DeleteActionConnection_2142905164.py

-17
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-06T22:02:35.383Z
1+
2025-03-26T20:24:59.622Z
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-06T22:02:35.598Z
1+
2025-03-26T20:24:59.727Z

tests/v2/cassettes/test_scenarios/test_create_a_new_action_connection_returns_successfully_created_action_connection_response.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: '{"data":{"attributes":{"integration":{"credentials":{"account_id":"123456789123","role":"MyRoleUpdated","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette
4-
Connection DELETE_ME"},"type":"action_connection"}}'
4+
Connection testcreateanewactionconnectionreturnssuccessfullycreatedactionconnectionresponse1743020699"},"type":"action_connection"}}'
55
headers:
66
accept:
77
- application/json
@@ -11,8 +11,8 @@ interactions:
1111
uri: https://api.datadoghq.com/api/v2/actions/connections
1212
response:
1313
body:
14-
string: '{"data":{"id":"db41b6cb-ef93-45bd-9857-548e9474737c","type":"action_connection","attributes":{"integration":{"credentials":{"account_id":"123456789123","role":"MyRoleUpdated","external_id":"c6f62d439f14423b963e4dd4246af4a7","principal_id":"464622532012","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette
15-
Connection DELETE_ME"}}}'
14+
string: '{"data":{"id":"67aa2f61-266d-48d1-a1ee-cf7c3acc6b20","type":"action_connection","attributes":{"integration":{"credentials":{"account_id":"123456789123","external_id":"70f4660c99684420821b0c13a67eb4d1","principal_id":"464622532012","role":"MyRoleUpdated","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette
15+
Connection testcreateanewactionconnectionreturnssuccessfullycreatedactionconnectionresponse1743020699"}}}'
1616
headers:
1717
content-type:
1818
- application/vnd.api+json
@@ -25,7 +25,7 @@ interactions:
2525
accept:
2626
- '*/*'
2727
method: DELETE
28-
uri: https://api.datadoghq.com/api/v2/actions/connections/db41b6cb-ef93-45bd-9857-548e9474737c
28+
uri: https://api.datadoghq.com/api/v2/actions/connections/67aa2f61-266d-48d1-a1ee-cf7c3acc6b20
2929
response:
3030
body:
3131
string: ''
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-06T22:02:36.467Z
1+
2025-03-26T20:25:00.311Z
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-03-26T20:25:00.458Z
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
interactions:
2+
- request:
3+
body: '{"data":{"attributes":{"integration":{"credentials":{"account_id":"123456789123","role":"MyRole","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette
4+
Connection testdeleteanexistingactionconnectionreturnstheresourcewasdeletedsuccessfullyresponse1743020700"},"type":"action_connection"}}'
5+
headers:
6+
accept:
7+
- application/json
8+
content-type:
9+
- application/json
10+
method: POST
11+
uri: https://api.datadoghq.com/api/v2/actions/connections
12+
response:
13+
body:
14+
string: '{"data":{"id":"c3c3d83b-c495-4c1b-bb1d-592825d21db0","type":"action_connection","attributes":{"integration":{"credentials":{"account_id":"123456789123","external_id":"6183670d1ceb4278808cf2df9aa03a07","principal_id":"464622532012","role":"MyRole","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette
15+
Connection testdeleteanexistingactionconnectionreturnstheresourcewasdeletedsuccessfullyresponse1743020700"}}}'
16+
headers:
17+
content-type:
18+
- application/vnd.api+json
19+
status:
20+
code: 201
21+
message: Created
22+
- request:
23+
body: null
24+
headers:
25+
accept:
26+
- '*/*'
27+
method: DELETE
28+
uri: https://api.datadoghq.com/api/v2/actions/connections/c3c3d83b-c495-4c1b-bb1d-592825d21db0
29+
response:
30+
body:
31+
string: ''
32+
headers: {}
33+
status:
34+
code: 204
35+
message: No Content
36+
- request:
37+
body: null
38+
headers:
39+
accept:
40+
- '*/*'
41+
method: DELETE
42+
uri: https://api.datadoghq.com/api/v2/actions/connections/c3c3d83b-c495-4c1b-bb1d-592825d21db0
43+
response:
44+
body:
45+
string: '{"errors":[{"title":"Generic Error","detail":"error deleting connection:
46+
rpc error: code = NotFound desc = connection not found"}]}'
47+
headers:
48+
content-type:
49+
- application/vnd.api+json
50+
status:
51+
code: 404
52+
message: Not Found
53+
version: 1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-06T22:02:37.403Z
1+
2025-03-26T20:25:01.150Z
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-06T22:02:37.563Z
1+
2025-03-26T20:25:01.247Z
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-06T22:02:37.743Z
1+
2025-03-26T20:25:01.398Z

tests/v2/cassettes/test_scenarios/test_get_an_existing_action_connection_returns_successfully_get_action_connection_response.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interactions:
88
uri: https://api.datadoghq.com/api/v2/actions/connections/cb460d51-3c88-4e87-adac-d47131d0423d
99
response:
1010
body:
11-
string: '{"data":{"id":"cb460d51-3c88-4e87-adac-d47131d0423d","type":"action_connection","attributes":{"integration":{"credentials":{"account_id":"123456789123","role":"MyRoleUpdated","external_id":"909b33b1242748cfbef42f20011e2fa0","principal_id":"464622532012","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette
11+
string: '{"data":{"id":"cb460d51-3c88-4e87-adac-d47131d0423d","type":"action_connection","attributes":{"integration":{"credentials":{"account_id":"123456789123","external_id":"909b33b1242748cfbef42f20011e2fa0","principal_id":"464622532012","role":"MyRoleUpdated","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette
1212
Connection"}}}'
1313
headers:
1414
content-type:
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-06T22:02:38.001Z
1+
2025-03-26T20:25:01.521Z
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-06T22:02:38.092Z
1+
2025-03-26T20:25:01.625Z
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-01-06T22:02:38.186Z
1+
2025-03-26T20:25:01.719Z

tests/v2/cassettes/test_scenarios/test_update_an_existing_action_connection_returns_successfully_updated_action_connection_response.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interactions:
1111
uri: https://api.datadoghq.com/api/v2/actions/connections/cb460d51-3c88-4e87-adac-d47131d0423d
1212
response:
1313
body:
14-
string: '{"data":{"id":"cb460d51-3c88-4e87-adac-d47131d0423d","type":"action_connection","attributes":{"integration":{"credentials":{"account_id":"123456789123","role":"MyRoleUpdated","external_id":"909b33b1242748cfbef42f20011e2fa0","principal_id":"464622532012","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette
14+
string: '{"data":{"id":"cb460d51-3c88-4e87-adac-d47131d0423d","type":"action_connection","attributes":{"integration":{"credentials":{"account_id":"123456789123","external_id":"909b33b1242748cfbef42f20011e2fa0","principal_id":"464622532012","role":"MyRoleUpdated","type":"AWSAssumeRole"},"type":"AWS"},"name":"Cassette
1515
Connection"}}}'
1616
headers:
1717
content-type:

tests/v2/features/action_connection.feature

+2-9
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Feature: Action Connection
2424
@team:DataDog/workflow-automation-dev
2525
Scenario: Create a new Action Connection returns "Successfully created Action Connection" response
2626
Given new "CreateActionConnection" request
27-
And body with value {"data":{"type":"action_connection","attributes":{"name":"Cassette Connection DELETE_ME","integration":{"type":"AWS","credentials":{"type":"AWSAssumeRole","role":"MyRoleUpdated","account_id":"123456789123"}}}}}
27+
And body with value {"data":{"type":"action_connection","attributes":{"name":"Cassette Connection {{ unique_lower_alnum }}","integration":{"type":"AWS","credentials":{"type":"AWSAssumeRole","role":"MyRoleUpdated","account_id":"123456789123"}}}}}
2828
When the request is sent
2929
Then the response status is 201 Successfully created Action Connection
3030

@@ -36,20 +36,13 @@ Feature: Action Connection
3636
Then the response status is 404 Not Found
3737

3838
@team:DataDog/workflow-automation-dev
39-
Scenario: Delete an existing Action Connection returns "Successfully deleted Action Connection" response
39+
Scenario: Delete an existing Action Connection returns "The resource was deleted successfully." response
4040
Given there is a valid "action_connection" in the system
4141
And new "DeleteActionConnection" request
4242
And request contains "connection_id" parameter from "action_connection.data.id"
4343
When the request is sent
4444
Then the response status is 204 The resource was deleted successfully.
4545

46-
@generated @skip @team:DataDog/workflow-automation-dev
47-
Scenario: Delete an existing Action Connection returns "The resource was deleted successfully." response
48-
Given new "DeleteActionConnection" request
49-
And request contains "connection_id" parameter from "REPLACE.ME"
50-
When the request is sent
51-
Then the response status is 204 The resource was deleted successfully.
52-
5346
@team:DataDog/workflow-automation-dev
5447
Scenario: Get an existing Action Connection returns "Bad Request" response
5548
Given new "GetActionConnection" request

tests/v2/features/given.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"parameters": [
44
{
55
"name": "body",
6-
"value": "{\n \"data\": {\n \"type\": \"action_connection\",\n \"attributes\": {\n \"name\": \"Cassette Connection DELETE\",\n \"integration\": {\n \"type\": \"AWS\",\n \"credentials\": {\n \"type\": \"AWSAssumeRole\",\n \"role\": \"MyRole\",\n \"account_id\": \"123456789123\"\n }\n }\n }\n }\n}"
6+
"value": "{\n \"data\": {\n \"type\": \"action_connection\",\n \"attributes\": {\n \"name\": \"Cassette Connection {{ unique_lower_alnum }}\",\n \"integration\": {\n \"type\": \"AWS\",\n \"credentials\": {\n \"type\": \"AWSAssumeRole\",\n \"role\": \"MyRole\",\n \"account_id\": \"123456789123\"\n }\n }\n }\n }\n}"
77
}
88
],
99
"step": "there is a valid \"action_connection\" in the system",

0 commit comments

Comments
 (0)