Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Connections API] NITs on Connection API and creating Action Platform folder #2377

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.6",
"regenerated": "2025-01-23 22:24:31.115985",
"spec_repo_commit": "6a31fa8c"
"regenerated": "2025-01-24 18:35:46.372072",
"spec_repo_commit": "9120bb44"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-23 22:24:31.131010",
"spec_repo_commit": "6a31fa8c"
"regenerated": "2025-01-24 18:35:46.386854",
"spec_repo_commit": "9120bb44"
}
}
}
68 changes: 41 additions & 27 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ components:
schema:
type: string
ConnectionId:
description: The ID of the action connection
description: The ID of the Action Connection.
in: path
name: connection_id
required: true
Expand Down Expand Up @@ -1221,23 +1221,23 @@ components:
description: The definition of `AWSAssumeRole` object.
properties:
account_id:
description: AWS account the connection is created for
description: AWS account the connection is created for.
example: '111222333444'
pattern: ^\d{12}$
type: string
external_id:
description: External ID used to scope which connection can be used to assume
the role
the role.
example: 33a1011635c44b38a064cf14e82e1d8f
readOnly: true
type: string
principal_id:
description: AWS account that will assume the role
description: AWS account that will assume the role.
example: '123456789012'
readOnly: true
type: string
role:
description: Role to assume
description: Role to assume.
example: my-role
type: string
type:
Expand All @@ -1259,7 +1259,7 @@ components:
description: The definition of `AWSAssumeRoleUpdate` object.
properties:
account_id:
description: AWS account the connection is created for
description: AWS account the connection is created for.
example: '111222333444'
pattern: ^\d{12}$
type: string
Expand Down Expand Up @@ -1669,7 +1669,7 @@ components:
integration:
$ref: '#/components/schemas/ActionConnectionIntegration'
name:
description: Name of the connection
description: Name of the connection.
example: My AWS Connection
type: string
required:
Expand All @@ -1682,7 +1682,7 @@ components:
integration:
$ref: '#/components/schemas/ActionConnectionIntegrationUpdate'
name:
description: Name of the connection
description: Name of the connection.
example: My AWS Connection
type: string
type: object
Expand All @@ -1692,7 +1692,7 @@ components:
attributes:
$ref: '#/components/schemas/ActionConnectionAttributes'
id:
description: The connection identifier
description: The connection identifier.
readOnly: true
type: string
type:
Expand Down Expand Up @@ -7193,15 +7193,15 @@ components:
x-enum-varnames:
- COST_BY_ORG
CreateActionConnectionRequest:
description: Request used to create an action connection.
description: Request used to create an Action Connection.
properties:
data:
$ref: '#/components/schemas/ActionConnectionData'
required:
- data
type: object
CreateActionConnectionResponse:
description: The response for a created connection
description: The response for a created connection.
properties:
data:
$ref: '#/components/schemas/ActionConnectionData'
Expand Down Expand Up @@ -12428,7 +12428,7 @@ components:
x-enum-varnames:
- GCP_SERVICE_ACCOUNT
GetActionConnectionResponse:
description: The response for found connection
description: The response for found connection.
properties:
data:
$ref: '#/components/schemas/ActionConnectionData'
Expand Down Expand Up @@ -12818,7 +12818,7 @@ components:
description: The definition of `HTTPIntegration` object.
properties:
base_url:
description: Base HTTP url for the integration
description: Base HTTP url for the integration.
example: http://datadoghq.com
pattern: url
type: string
Expand All @@ -12843,7 +12843,7 @@ components:
description: The definition of `HTTPIntegrationUpdate` object.
properties:
base_url:
description: Base HTTP url for the integration
description: Base HTTP url for the integration.
example: http://datadoghq.com
pattern: url
type: string
Expand Down Expand Up @@ -29362,7 +29362,7 @@ components:
type: string
type: object
UpdateActionConnectionRequest:
description: Request used to update an action connection.
description: Request used to update an Action Connection.
properties:
data:
$ref: '#/components/schemas/ActionConnectionDataUpdate'
Expand Down Expand Up @@ -30918,7 +30918,7 @@ openapi: 3.0.0
paths:
/api/v2/actions/connections:
post:
description: Create a new Action Connection
description: Create a new Action Connection.
operationId: CreateActionConnection
requestBody:
content:
Expand All @@ -30932,7 +30932,7 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/CreateActionConnectionResponse'
description: Successfully created Action Connection
description: Successfully created an Action Connection.
'400':
content:
application/json:
Expand All @@ -30954,9 +30954,13 @@ paths:
summary: Create a new Action Connection
tags:
- Action Connection
x-permission:
operator: OR
permissions:
- connection_read
/api/v2/actions/connections/{connection_id}:
delete:
description: Delete an existing Action Connection
description: Delete an existing Action Connection.
operationId: DeleteActionConnection
parameters:
- $ref: '#/components/parameters/ConnectionId'
Expand Down Expand Up @@ -30989,7 +30993,7 @@ paths:
permissions:
- connection_write
get:
description: Get an existing Action Connection
description: Get an existing Action Connection.
operationId: GetActionConnection
parameters:
- $ref: '#/components/parameters/ConnectionId'
Expand All @@ -30999,7 +31003,7 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/GetActionConnectionResponse'
description: Successfully get Action Connection
description: Successfully got an Action Connection.
'400':
content:
application/json:
Expand Down Expand Up @@ -31027,6 +31031,10 @@ paths:
summary: Get an existing Action Connection
tags:
- Action Connection
x-permission:
operator: OR
permissions:
- connection_read
patch:
description: Update an existing Action Connection
operationId: UpdateActionConnection
Expand All @@ -31037,15 +31045,15 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/UpdateActionConnectionRequest'
description: Update an existing Action Connection request body
description: Update an existing Action Connection request body.
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateActionConnectionResponse'
description: Successfully updated Action Connection
description: Successfully updated an Action Connection.
'400':
content:
application/json:
Expand Down Expand Up @@ -31073,6 +31081,10 @@ paths:
summary: Update an existing Action Connection
tags:
- Action Connection
x-permission:
operator: OR
permissions:
- connection_write
/api/v2/agentless_scanning/accounts/aws:
get:
description: Fetches the scan options configured for AWS accounts.
Expand Down Expand Up @@ -49080,13 +49092,15 @@ tags:
externalDocs:
url: https://docs.datadoghq.com/integrations/amazon_web_services/#log-collection
name: AWS Logs Integration
- description: "Action connections extend your installed integrations and allow you
to take action in your third-party systems\n(e.g. AWS, GitLab, and Statuspage)
with Datadog\u2019s Workflow Automation and App Builder products.\n\nDatadog\u2019s
- description: "Action Connections extend your installed integrations and allow you
to take action in your third-party systems\n(e.g. AWS, GitLab, and OpenAI) with
Datadog\u2019s [Workflow Automation](https://docs.datadoghq.com/service_management/workflows/)\nand
[App Builder](https://docs.datadoghq.com/service_management/app_builder/) products.\n\nDatadog\u2019s
Integrations automatically provide authentication for Slack, Microsoft Teams,
PagerDuty, Opsgenie,\nJIRA, GitHub, and Statuspage. You do not need additional
PagerDuty, Opsgenie,\nJira, GitHub, and Statuspage. You do not need additional
connections in order to access these tools within\nWorkflow Automation and App
Builder.\n\nWe offer granular access control for editing and resolving connections."
Builder.\n\nWe offer granular access control for editing and resolving connections.\n\n**Note:**
The Action Connection API currently supports AWS and HTTP integrations."
externalDocs:
description: Find out more at
url: https://docs.datadoghq.com/service_management/workflows/connections/
Expand Down
12 changes: 6 additions & 6 deletions examples/v2/action-connection/CreateActionConnection.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Create a new Action Connection returns "Successfully created Action Connection" response
Create a new Action Connection returns "Successfully created an Action Connection." response
"""

from datadog_api_client import ApiClient, Configuration
Expand All @@ -15,18 +15,18 @@

body = CreateActionConnectionRequest(
data=ActionConnectionData(
type=ActionConnectionDataType.ACTION_CONNECTION,
attributes=ActionConnectionAttributes(
name="Cassette Connection DELETE_ME",
integration=AWSIntegration(
type=AWSIntegrationType.AWS,
credentials=AWSAssumeRole(
account_id="111222333444",
role="my-role",
type=AWSAssumeRoleType.AWSASSUMEROLE,
role="MyRoleUpdated",
account_id="123456789123",
),
type=AWSIntegrationType.AWS,
),
name="My AWS Connection",
),
type=ActionConnectionDataType.ACTION_CONNECTION,
),
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""
Create a new Action Connection returns "Successfully created Action Connection" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi
from datadog_api_client.v2.model.action_connection_attributes import ActionConnectionAttributes
from datadog_api_client.v2.model.action_connection_data import ActionConnectionData
from datadog_api_client.v2.model.action_connection_data_type import ActionConnectionDataType
from datadog_api_client.v2.model.aws_assume_role import AWSAssumeRole
from datadog_api_client.v2.model.aws_assume_role_type import AWSAssumeRoleType
from datadog_api_client.v2.model.aws_integration import AWSIntegration
from datadog_api_client.v2.model.aws_integration_type import AWSIntegrationType
from datadog_api_client.v2.model.create_action_connection_request import CreateActionConnectionRequest

body = CreateActionConnectionRequest(
data=ActionConnectionData(
type=ActionConnectionDataType.ACTION_CONNECTION,
attributes=ActionConnectionAttributes(
name="Cassette Connection DELETE_ME",
integration=AWSIntegration(
type=AWSIntegrationType.AWS,
credentials=AWSAssumeRole(
type=AWSAssumeRoleType.AWSASSUMEROLE,
role="MyRoleUpdated",
account_id="123456789123",
),
),
),
),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = ActionConnectionApi(api_client)
response = api_instance.create_action_connection(body=body)

print(response)
4 changes: 2 additions & 2 deletions examples/v2/action-connection/GetActionConnection.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Get an existing Action Connection returns "Successfully get Action Connection" response
Get an existing Action Connection returns "Successfully got an Action Connection." response
"""

from datadog_api_client import ApiClient, Configuration
Expand All @@ -9,7 +9,7 @@
with ApiClient(configuration) as api_client:
api_instance = ActionConnectionApi(api_client)
response = api_instance.get_action_connection(
connection_id="cb460d51-3c88-4e87-adac-d47131d0423d",
connection_id="connection_id",
)

print(response)
15 changes: 15 additions & 0 deletions examples/v2/action-connection/GetActionConnection_2273648770.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
Get an existing Action Connection returns "Successfully get Action Connection" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = ActionConnectionApi(api_client)
response = api_instance.get_action_connection(
connection_id="cb460d51-3c88-4e87-adac-d47131d0423d",
)

print(response)
14 changes: 7 additions & 7 deletions examples/v2/action-connection/UpdateActionConnection.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Update an existing Action Connection returns "Successfully updated Action Connection" response
Update an existing Action Connection returns "Successfully updated an Action Connection." response
"""

from datadog_api_client import ApiClient, Configuration
Expand All @@ -15,24 +15,24 @@

body = UpdateActionConnectionRequest(
data=ActionConnectionDataUpdate(
type=ActionConnectionDataType.ACTION_CONNECTION,
attributes=ActionConnectionAttributesUpdate(
name="Cassette Connection",
integration=AWSIntegrationUpdate(
type=AWSIntegrationType.AWS,
credentials=AWSAssumeRoleUpdate(
account_id="111222333444",
role="my-role",
type=AWSAssumeRoleType.AWSASSUMEROLE,
role="MyRoleUpdated",
account_id="123456789123",
),
type=AWSIntegrationType.AWS,
),
name="My AWS Connection",
),
type=ActionConnectionDataType.ACTION_CONNECTION,
),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = ActionConnectionApi(api_client)
response = api_instance.update_action_connection(connection_id="cb460d51-3c88-4e87-adac-d47131d0423d", body=body)
response = api_instance.update_action_connection(connection_id="connection_id", body=body)

print(response)
Loading
Loading