Skip to content
Merged
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
1,080 changes: 1,062 additions & 18 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

202 changes: 195 additions & 7 deletions features/v2/fleet_automation.feature
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
@endpoint(fleet-automation) @endpoint(fleet-automation-v2)
Feature: Fleet Automation
Manage automated deployments across your fleet of hosts. Use these
endpoints to create, retrieve, and cancel deployments that apply
configuration changes to multiple hosts at once.
Manage automated deployments across your fleet of hosts. Fleet Automation
provides two types of deployments: Configuration Deployments
(`/configure`): - Apply configuration file changes to target hosts -
Support merge-patch operations to update specific configuration fields -
Support delete operations to remove configuration files - Useful for
updating Datadog Agent settings, integration configs, and more Package
Upgrade Deployments (`/upgrade`): - Upgrade the Datadog Agent to specific
versions

Background:
Given a valid "apiKeyAuth" key in the system
Expand Down Expand Up @@ -34,37 +39,85 @@ Feature: Fleet Automation
Then the response status is 404 Not Found

@generated @skip @team:DataDog/fleet-automation
Scenario: Create a deployment returns "Bad Request" response
Scenario: Create a configuration deployment returns "Bad Request" response
Given operation "CreateFleetDeploymentConfigure" enabled
And new "CreateFleetDeploymentConfigure" request
And body with value {"data": {"attributes": {"config_operations": [{"file_op": "merge-patch", "file_path": "/datadog.yaml", "patch": {"apm_config": {"enabled": true}, "log_level": "debug", "logs_enabled": true}}], "filter_query": "env:prod AND service:web"}, "type": "deployment"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/fleet-automation
Scenario: Create a deployment returns "CREATED" response
Scenario: Create a configuration deployment returns "CREATED" response
Given operation "CreateFleetDeploymentConfigure" enabled
And new "CreateFleetDeploymentConfigure" request
And body with value {"data": {"attributes": {"config_operations": [{"file_op": "merge-patch", "file_path": "/datadog.yaml", "patch": {"apm_config": {"enabled": true}, "log_level": "debug", "logs_enabled": true}}], "filter_query": "env:prod AND service:web"}, "type": "deployment"}}
When the request is sent
Then the response status is 201 CREATED

@generated @skip @team:DataDog/fleet-automation
Scenario: Get a deployment by ID returns "Bad Request" response
Scenario: Create a schedule returns "Bad Request" response
Given operation "CreateFleetSchedule" enabled
And new "CreateFleetSchedule" request
And body with value {"data": {"attributes": {"name": "Weekly Production Agent Updates", "query": "env:prod AND service:web", "rule": {"days_of_week": ["Mon", "Wed", "Fri"], "maintenance_window_duration": 1200, "start_maintenance_window": "02:00", "timezone": "America/New_York"}, "status": "active", "version_to_latest": 0}, "type": "schedule"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/fleet-automation
Scenario: Create a schedule returns "CREATED" response
Given operation "CreateFleetSchedule" enabled
And new "CreateFleetSchedule" request
And body with value {"data": {"attributes": {"name": "Weekly Production Agent Updates", "query": "env:prod AND service:web", "rule": {"days_of_week": ["Mon", "Wed", "Fri"], "maintenance_window_duration": 1200, "start_maintenance_window": "02:00", "timezone": "America/New_York"}, "status": "active", "version_to_latest": 0}, "type": "schedule"}}
When the request is sent
Then the response status is 201 CREATED

@generated @skip @team:DataDog/fleet-automation
Scenario: Delete a schedule returns "Bad Request" response
Given operation "DeleteFleetSchedule" enabled
And new "DeleteFleetSchedule" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/fleet-automation
Scenario: Delete a schedule returns "Not Found" response
Given operation "DeleteFleetSchedule" enabled
And new "DeleteFleetSchedule" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/fleet-automation
Scenario: Delete a schedule returns "Schedule successfully deleted." response
Given operation "DeleteFleetSchedule" enabled
And new "DeleteFleetSchedule" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 Schedule successfully deleted.

@generated @skip @team:DataDog/fleet-automation
Scenario: Get a configuration deployment by ID returns "Bad Request" response
Given operation "GetFleetDeployment" enabled
And new "GetFleetDeployment" request
And request contains "deployment_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/fleet-automation
Scenario: Get a deployment by ID returns "Not Found" response
Scenario: Get a configuration deployment by ID returns "Not Found" response
Given operation "GetFleetDeployment" enabled
And new "GetFleetDeployment" request
And request contains "deployment_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/fleet-automation
Scenario: Get a configuration deployment by ID returns "OK" response
Given operation "GetFleetDeployment" enabled
And new "GetFleetDeployment" request
And request contains "deployment_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@skip @team:DataDog/fleet-automation
Scenario: Get a deployment by ID returns "OK" response
Given operation "GetFleetDeployment" enabled
Expand All @@ -74,6 +127,52 @@ Feature: Fleet Automation
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/fleet-automation
Scenario: Get a schedule by ID returns "Bad Request" response
Given operation "GetFleetSchedule" enabled
And new "GetFleetSchedule" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/fleet-automation
Scenario: Get a schedule by ID returns "Not Found" response
Given operation "GetFleetSchedule" enabled
And new "GetFleetSchedule" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@skip @team:DataDog/fleet-automation
Scenario: Get a schedule by ID returns "OK" response
Given operation "GetFleetSchedule" enabled
And there is a valid "fleet_schedule" in the system
And new "GetFleetSchedule" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/fleet-automation
Scenario: List all available Agent versions returns "Bad Request" response
Given operation "ListFleetAgentVersions" enabled
And new "ListFleetAgentVersions" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/fleet-automation
Scenario: List all available Agent versions returns "Not Found" response
Given operation "ListFleetAgentVersions" enabled
And new "ListFleetAgentVersions" request
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/fleet-automation
Scenario: List all available Agent versions returns "OK" response
Given operation "ListFleetAgentVersions" enabled
And new "ListFleetAgentVersions" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/fleet-automation
Scenario: List all deployments returns "Bad Request" response
Given operation "ListFleetDeployments" enabled
Expand All @@ -87,3 +186,92 @@ Feature: Fleet Automation
And new "ListFleetDeployments" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/fleet-automation
Scenario: List all schedules returns "Bad Request" response
Given operation "ListFleetSchedules" enabled
And new "ListFleetSchedules" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/fleet-automation
Scenario: List all schedules returns "OK" response
Given operation "ListFleetSchedules" enabled
And new "ListFleetSchedules" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/fleet-automation
Scenario: Trigger a schedule deployment returns "Bad Request" response
Given operation "TriggerFleetSchedule" enabled
And new "TriggerFleetSchedule" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/fleet-automation
Scenario: Trigger a schedule deployment returns "CREATED - Deployment successfully created and started." response
Given operation "TriggerFleetSchedule" enabled
And new "TriggerFleetSchedule" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 201 CREATED - Deployment successfully created and started.

@generated @skip @team:DataDog/fleet-automation
Scenario: Trigger a schedule deployment returns "Not Found" response
Given operation "TriggerFleetSchedule" enabled
And new "TriggerFleetSchedule" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/fleet-automation
Scenario: Update a schedule returns "Bad Request" response
Given operation "UpdateFleetSchedule" enabled
And new "UpdateFleetSchedule" request
And request contains "id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "Weekly Production Agent Updates", "query": "env:prod AND service:web", "rule": {"days_of_week": ["Mon", "Wed", "Fri"], "maintenance_window_duration": 1200, "start_maintenance_window": "02:00", "timezone": "America/New_York"}, "status": "active", "version_to_latest": 0}, "type": "schedule"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/fleet-automation
Scenario: Update a schedule returns "Not Found" response
Given operation "UpdateFleetSchedule" enabled
And new "UpdateFleetSchedule" request
And request contains "id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "Weekly Production Agent Updates", "query": "env:prod AND service:web", "rule": {"days_of_week": ["Mon", "Wed", "Fri"], "maintenance_window_duration": 1200, "start_maintenance_window": "02:00", "timezone": "America/New_York"}, "status": "active", "version_to_latest": 0}, "type": "schedule"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/fleet-automation
Scenario: Update a schedule returns "OK" response
Given operation "UpdateFleetSchedule" enabled
And new "UpdateFleetSchedule" request
And request contains "id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "Weekly Production Agent Updates", "query": "env:prod AND service:web", "rule": {"days_of_week": ["Mon", "Wed", "Fri"], "maintenance_window_duration": 1200, "start_maintenance_window": "02:00", "timezone": "America/New_York"}, "status": "active", "version_to_latest": 0}, "type": "schedule"}}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/fleet-automation
Scenario: Upgrade hosts returns "Bad Request" response
Given operation "CreateFleetDeploymentUpgrade" enabled
And new "CreateFleetDeploymentUpgrade" request
And body with value {"data": {"attributes": {"filter_query": "env:prod AND service:web", "target_packages": [{"name": "datadog-agent", "version": "7.52.0"}]}, "type": "deployment"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/fleet-automation
Scenario: Upgrade hosts returns "CREATED" response
Given operation "CreateFleetDeploymentUpgrade" enabled
And new "CreateFleetDeploymentUpgrade" request
And body with value {"data": {"attributes": {"filter_query": "env:prod AND service:web", "target_packages": [{"name": "datadog-agent", "version": "7.52.0"}]}, "type": "deployment"}}
When the request is sent
Then the response status is 201 CREATED

@generated @skip @team:DataDog/fleet-automation
Scenario: Upgrade hosts returns "Not Found" response
Given operation "CreateFleetDeploymentUpgrade" enabled
And new "CreateFleetDeploymentUpgrade" request
And body with value {"data": {"attributes": {"filter_query": "env:prod AND service:web", "target_packages": [{"name": "datadog-agent", "version": "7.52.0"}]}, "type": "deployment"}}
When the request is sent
Then the response status is 404 Not Found
26 changes: 26 additions & 0 deletions features/v2/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,32 @@
"tag": "Fleet Automation",
"operationId": "CreateFleetDeploymentConfigure"
},
{
"parameters": [
{
"name": "body",
"value": "{\n \"data\": {\n \"type\": \"deployment\",\n \"attributes\": {\n \"filter_query\": \"env:prod AND service:{{ unique_lower }}\",\n \"target_packages\": [\n {\n \"name\": \"datadog-agent\",\n \"version\": \"7.52.0\"\n }\n ]\n }\n }\n}"
}
],
"source": "data",
"step": "there is a valid \"package_deployment\" in the system",
"key": "package_deployment",
"tag": "Fleet Automation",
"operationId": "CreateFleetDeploymentUpgrade"
},
{
"parameters": [
{
"name": "body",
"value": "{\n \"data\": {\n \"type\": \"schedule\",\n \"attributes\": {\n \"name\": \"Weekly {{ unique }} Updates\",\n \"query\": \"env:prod AND service:{{ unique_lower }}\",\n \"status\": \"active\",\n \"version_to_latest\": 0,\n \"rule\": {\n \"days_of_week\": [\"Mon\"],\n \"start_maintenance_window\": \"02:00\",\n \"maintenance_window_duration\": 120,\n \"timezone\": \"America/New_York\"\n }\n }\n }\n}"
}
],
"source": "data",
"step": "there is a valid \"fleet_schedule\" in the system",
"key": "schedule",
"tag": "Fleet Automation",
"operationId": "CreateFleetSchedule"
},
{
"parameters": [
{
Expand Down
69 changes: 69 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"ListFleetAgentVersions": {
"tag": "Fleet Automation",
"undo": {
"type": "safe"
}
},
"ListFleetDeployments": {
"tag": "Fleet Automation",
"undo": {
Expand All @@ -18,6 +24,19 @@
"type": "unsafe"
}
},
"CreateFleetDeploymentUpgrade": {
"tag": "Fleet Automation",
"undo": {
"operationId": "CancelFleetDeployment",
"parameters": [
{
"name": "deployment_id",
"source": "data.id"
}
],
"type": "unsafe"
}
},
"GetFleetDeployment": {
"tag": "Fleet Automation",
"undo": {
Expand All @@ -30,6 +49,56 @@
"type": "idempotent"
}
},
"ListFleetSchedules": {
"tag": "Fleet Automation",
"undo": {
"type": "safe"
}
},
"CreateFleetSchedule": {
"tag": "Fleet Automation",
"undo": {
"operationId": "DeleteFleetSchedule",
"parameters": [
{
"name": "id",
"source": "data.id"
}
],
"type": "unsafe"
}
},
"DeleteFleetSchedule": {
"tag": "Fleet Automation",
"undo": {
"type": "unsafe"
}
},
"GetFleetSchedule": {
"tag": "Fleet Automation",
"undo": {
"type": "safe"
}
},
"UpdateFleetSchedule": {
"tag": "Fleet Automation",
"undo": {
"type": "idempotent"
}
},
"TriggerFleetSchedule": {
"tag": "Fleet Automation",
"undo": {
"operationId": "CancelFleetDeployment",
"parameters": [
{
"name": "deployment_id",
"source": "data.id"
}
],
"type": "unsafe"
}
},
"ListDatastores": {
"tag": "Actions Datastores",
"undo": {
Expand Down
Loading