From cb6ce7a874f44899211d4075becb806db1621a05 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 23 Oct 2025 11:36:01 +0000 Subject: [PATCH] Regenerate client from commit e118b2e of spec repo --- .generator/schemas/v2/openapi.yaml | 422 +++++++++++++ .../fleet-automation/CancelFleetDeployment.ts | 22 + .../CreateFleetDeploymentConfigure.ts | 40 ++ .../v2/fleet-automation/GetFleetDeployment.ts | 25 + .../fleet-automation/ListFleetDeployments.ts | 18 + features/support/scenarios_model_mapping.ts | 32 + features/v2/fleet_automation.feature | 89 +++ features/v2/given.json | 13 + features/v2/undo.json | 31 + .../configuration.ts | 4 + .../apis/FleetAutomationApi.ts | 590 ++++++++++++++++++ packages/datadog-api-client-v2/index.ts | 20 + .../models/FleetDeployment.ts | 73 +++ .../models/FleetDeploymentAttributes.ts | 87 +++ .../FleetDeploymentConfigureAttributes.ts | 62 ++ .../models/FleetDeploymentConfigureCreate.ts | 64 ++ .../FleetDeploymentConfigureCreateRequest.ts | 54 ++ .../models/FleetDeploymentFileOp.ts | 21 + .../models/FleetDeploymentOperation.ts | 78 +++ .../models/FleetDeploymentResourceType.ts | 14 + .../models/FleetDeploymentResponse.ts | 53 ++ .../models/FleetDeploymentsPage.ts | 53 ++ .../models/FleetDeploymentsResponse.ts | 63 ++ .../models/FleetDeploymentsResponseMeta.ts | 53 ++ .../models/ObjectSerializer.ts | 22 + 25 files changed, 2003 insertions(+) create mode 100644 examples/v2/fleet-automation/CancelFleetDeployment.ts create mode 100644 examples/v2/fleet-automation/CreateFleetDeploymentConfigure.ts create mode 100644 examples/v2/fleet-automation/GetFleetDeployment.ts create mode 100644 examples/v2/fleet-automation/ListFleetDeployments.ts create mode 100644 features/v2/fleet_automation.feature create mode 100644 packages/datadog-api-client-v2/apis/FleetAutomationApi.ts create mode 100644 packages/datadog-api-client-v2/models/FleetDeployment.ts create mode 100644 packages/datadog-api-client-v2/models/FleetDeploymentAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/FleetDeploymentConfigureAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/FleetDeploymentConfigureCreate.ts create mode 100644 packages/datadog-api-client-v2/models/FleetDeploymentConfigureCreateRequest.ts create mode 100644 packages/datadog-api-client-v2/models/FleetDeploymentFileOp.ts create mode 100644 packages/datadog-api-client-v2/models/FleetDeploymentOperation.ts create mode 100644 packages/datadog-api-client-v2/models/FleetDeploymentResourceType.ts create mode 100644 packages/datadog-api-client-v2/models/FleetDeploymentResponse.ts create mode 100644 packages/datadog-api-client-v2/models/FleetDeploymentsPage.ts create mode 100644 packages/datadog-api-client-v2/models/FleetDeploymentsResponse.ts create mode 100644 packages/datadog-api-client-v2/models/FleetDeploymentsResponseMeta.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 364018c47d51..f35df77478f2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -20093,6 +20093,179 @@ components: - PIPELINES_FAILED_DESCENDING - PIPELINES_DURATION_LOST_ASCENDING - PIPELINES_DURATION_LOST_DESCENDING + FleetDeployment: + description: A deployment that defines automated configuration changes for a + fleet of hosts. + properties: + attributes: + $ref: '#/components/schemas/FleetDeploymentAttributes' + id: + description: Unique identifier for the deployment. + example: aeadc05e-98a8-11ec-ac2c-da7ad0900001 + type: string + type: + $ref: '#/components/schemas/FleetDeploymentResourceType' + required: + - id + - type + - attributes + type: object + FleetDeploymentAttributes: + description: Attributes of a deployment in the response. + properties: + config_operations: + description: Ordered list of configuration file operations to perform on + the target hosts. + items: + $ref: '#/components/schemas/FleetDeploymentOperation' + type: array + estimated_end_time_unix: + description: Estimated completion time of the deployment as a Unix timestamp + (seconds since epoch). + example: 1699999999 + format: int64 + type: integer + filter_query: + description: Query used to filter and select target hosts for the deployment. + Uses the Datadog query syntax. + example: env:prod AND service:web + type: string + high_level_status: + description: Current high-level status of the deployment (for example, "pending", + "running", "completed", "failed"). + example: pending + type: string + total_hosts: + description: Total number of hosts targeted by this deployment. + example: 42 + format: int64 + type: integer + type: object + FleetDeploymentConfigureAttributes: + description: Attributes for creating a new configuration deployment. + properties: + config_operations: + description: Ordered list of configuration file operations to perform on + the target hosts. + items: + $ref: '#/components/schemas/FleetDeploymentOperation' + type: array + filter_query: + description: Query used to filter and select target hosts for the deployment. + Uses the Datadog query syntax. + example: env:prod AND service:web + type: string + required: + - config_operations + type: object + FleetDeploymentConfigureCreate: + description: Data for creating a new deployment. + properties: + attributes: + $ref: '#/components/schemas/FleetDeploymentConfigureAttributes' + type: + $ref: '#/components/schemas/FleetDeploymentResourceType' + required: + - type + - attributes + type: object + FleetDeploymentConfigureCreateRequest: + description: Request payload for creating a new deployment. + properties: + data: + $ref: '#/components/schemas/FleetDeploymentConfigureCreate' + required: + - data + type: object + FleetDeploymentFileOp: + description: "Type of file operation to perform on the target configuration + file.\n- `merge-patch`: Merges the provided patch data with the existing configuration + file.\n Creates the file if it doesn't exist.\n- `delete`: Removes the specified + configuration file from the target hosts." + enum: + - merge-patch + - delete + example: merge-patch + type: string + x-enum-varnames: + - MERGE_PATCH + - DELETE + FleetDeploymentOperation: + description: A single configuration file operation to perform on the target + hosts. + properties: + file_op: + $ref: '#/components/schemas/FleetDeploymentFileOp' + file_path: + description: Absolute path to the target configuration file on the host. + example: /datadog.yaml + type: string + patch: + additionalProperties: {} + description: 'Patch data in JSON format to apply to the configuration file. + + When using `merge-patch`, this object is merged with the existing configuration, + + allowing you to add, update, or override specific fields without replacing + the entire file. + + The structure must match the target configuration file format (for example, + YAML structure for Datadog Agent config). + + Not applicable when using the `delete` operation.' + example: + apm_config: + enabled: true + log_level: debug + logs_enabled: true + type: object + required: + - file_op + - file_path + type: object + FleetDeploymentResourceType: + default: deployment + description: The type of deployment resource. + enum: + - deployment + example: deployment + type: string + x-enum-varnames: + - DEPLOYMENT + FleetDeploymentResponse: + description: Response containing a single deployment. + properties: + data: + $ref: '#/components/schemas/FleetDeployment' + type: object + FleetDeploymentsPage: + description: Pagination details for the list of deployments. + properties: + total_count: + description: Total number of deployments available across all pages. + example: 25 + format: int64 + type: integer + type: object + FleetDeploymentsResponse: + description: Response containing a paginated list of deployments. + properties: + data: + description: Array of deployments matching the query criteria. + items: + $ref: '#/components/schemas/FleetDeployment' + type: array + meta: + $ref: '#/components/schemas/FleetDeploymentsResponseMeta' + required: + - data + type: object + FleetDeploymentsResponseMeta: + description: Metadata for the list of deployments, including pagination information. + properties: + page: + $ref: '#/components/schemas/FleetDeploymentsPage' + type: object FormulaLimit: description: 'Message for specifying limits to the number of values returned by a query. @@ -53094,6 +53267,249 @@ info: version: '1.0' openapi: 3.0.0 paths: + /api/unstable/fleet/deployments: + get: + description: 'Retrieve a list of all deployments for fleet automation. + + Use the `page_size` and `page_offset` parameters to paginate results.' + operationId: ListFleetDeployments + parameters: + - description: Number of deployments to return per page. Maximum value is 100. + in: query + name: page_size + required: false + schema: + default: 10 + format: int64 + maximum: 100 + type: integer + - description: Index of the first deployment to return. Use this with `page_size` + to paginate through results. + in: query + name: page_offset + required: false + schema: + default: 0 + format: int64 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FleetDeploymentsResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List all deployments + tags: + - Fleet Automation + x-permission: + operator: AND + permissions: + - hosts_read + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/unstable/fleet/deployments/configure: + post: + description: 'Create a new deployment to apply configuration changes + + to a fleet of hosts matching the specified filter query.' + operationId: CreateFleetDeploymentConfigure + requestBody: + content: + application/json: + examples: + add_log_integration: + summary: Add log integrations for multiple services + value: + data: + attributes: + config_operations: + - file_op: merge-patch + file_path: /conf.d/postgres.d/logs.yaml + patch: + logs: + - path: /var/log/postgres.log + service: postgres1 + source: postgres + type: file + - file_op: merge-patch + file_path: /conf.d/kafka.d/logs.yaml + patch: + logs: + - path: /var/log/kafka.log + service: kafka1 + source: kafka + type: file + filter_query: env:prod + type: deployment + delete_config_file: + summary: Delete a configuration file + value: + data: + attributes: + config_operations: + - file_op: delete + file_path: /conf.d/old-integration.yaml + filter_query: env:dev + type: deployment + enable_apm_and_logs: + summary: Enable APM and Logs products + 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 + simple_log_level: + summary: Set log level to info + value: + data: + attributes: + config_operations: + - file_op: merge-patch + file_path: /datadog.yaml + patch: + log_level: info + filter_query: env:staging + type: deployment + schema: + $ref: '#/components/schemas/FleetDeploymentConfigureCreateRequest' + description: Request payload containing the deployment details. + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/FleetDeploymentResponse' + description: CREATED + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a deployment + tags: + - Fleet Automation + x-permission: + operator: AND + permissions: + - agent_upgrade_write + - fleet_policies_write + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/unstable/fleet/deployments/{deployment_id}: + get: + description: Retrieve the details of a specific deployment using its unique + identifier. + operationId: GetFleetDeployment + parameters: + - description: The unique identifier of the deployment to retrieve. + example: abc-def-ghi + in: path + name: deployment_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FleetDeploymentResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a deployment by ID + tags: + - Fleet Automation + x-permission: + operator: AND + permissions: + - hosts_read + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/unstable/fleet/deployments/{deployment_id}/cancel: + post: + description: 'Cancel this deployment and stop all associated operations. + + If a workflow is currently running for this deployment, it is canceled immediately. + + Changes already applied to hosts are not rolled back.' + operationId: CancelFleetDeployment + parameters: + - description: The unique identifier of the deployment to cancel. + example: abc-def-ghi + in: path + name: deployment_id + required: true + schema: + type: string + responses: + '204': + description: Deployment successfully canceled. + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Cancel a deployment + tags: + - Fleet Automation + x-permission: + operator: AND + permissions: + - agent_upgrade_write + - fleet_policies_write + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/actions-datastores: get: description: Lists all datastores for the organization. @@ -79828,6 +80244,12 @@ tags: through the Datadog API. See the [Fastly integration page](https://docs.datadoghq.com/integrations/fastly/) for more information. name: Fastly Integration +- description: '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.' + name: Fleet Automation - description: 'Configure your Datadog-Google Cloud Platform (GCP) integration directly through the Datadog API. Read more about the [Datadog-Google Cloud Platform integration](https://docs.datadoghq.com/integrations/google_cloud_platform).' diff --git a/examples/v2/fleet-automation/CancelFleetDeployment.ts b/examples/v2/fleet-automation/CancelFleetDeployment.ts new file mode 100644 index 000000000000..f3a8960835f8 --- /dev/null +++ b/examples/v2/fleet-automation/CancelFleetDeployment.ts @@ -0,0 +1,22 @@ +/** + * Cancel a deployment returns "Deployment successfully canceled." response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.cancelFleetDeployment"] = true; +const apiInstance = new v2.FleetAutomationApi(configuration); + +const params: v2.FleetAutomationApiCancelFleetDeploymentRequest = { + deploymentId: "deployment_id", +}; + +apiInstance + .cancelFleetDeployment(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.ts b/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.ts new file mode 100644 index 000000000000..a3d271177a01 --- /dev/null +++ b/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.ts @@ -0,0 +1,40 @@ +/** + * Create a deployment returns "CREATED" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.createFleetDeploymentConfigure"] = true; +const apiInstance = new v2.FleetAutomationApi(configuration); + +const params: v2.FleetAutomationApiCreateFleetDeploymentConfigureRequest = { + body: { + data: { + attributes: { + configOperations: [ + { + fileOp: "merge-patch", + filePath: "/datadog.yaml", + patch: { + apm_config: "{'enabled': True}", + log_level: "debug", + logs_enabled: "True", + }, + }, + ], + filterQuery: "env:prod AND service:web", + }, + type: "deployment", + }, + }, +}; + +apiInstance + .createFleetDeploymentConfigure(params) + .then((data: v2.FleetDeploymentResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/fleet-automation/GetFleetDeployment.ts b/examples/v2/fleet-automation/GetFleetDeployment.ts new file mode 100644 index 000000000000..d032debb087f --- /dev/null +++ b/examples/v2/fleet-automation/GetFleetDeployment.ts @@ -0,0 +1,25 @@ +/** + * Get a deployment by ID returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.getFleetDeployment"] = true; +const apiInstance = new v2.FleetAutomationApi(configuration); + +// there is a valid "deployment" in the system +const DEPLOYMENT_ID = process.env.DEPLOYMENT_ID as string; + +const params: v2.FleetAutomationApiGetFleetDeploymentRequest = { + deploymentId: DEPLOYMENT_ID, +}; + +apiInstance + .getFleetDeployment(params) + .then((data: v2.FleetDeploymentResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/fleet-automation/ListFleetDeployments.ts b/examples/v2/fleet-automation/ListFleetDeployments.ts new file mode 100644 index 000000000000..3c42f97295db --- /dev/null +++ b/examples/v2/fleet-automation/ListFleetDeployments.ts @@ -0,0 +1,18 @@ +/** + * List all deployments returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.listFleetDeployments"] = true; +const apiInstance = new v2.FleetAutomationApi(configuration); + +apiInstance + .listFleetDeployments() + .then((data: v2.FleetDeploymentsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 6cfdc2b5d28e..81fa4d1b3711 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -2340,6 +2340,38 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { "v1.Validate": { "operationResponseType": "AuthenticationValidationResponse", }, + "v2.ListFleetDeployments": { + "pageSize": { + "type": "number", + "format": "int64", + }, + "pageOffset": { + "type": "number", + "format": "int64", + }, + "operationResponseType": "FleetDeploymentsResponse", + }, + "v2.CreateFleetDeploymentConfigure": { + "body": { + "type": "FleetDeploymentConfigureCreateRequest", + "format": "", + }, + "operationResponseType": "FleetDeploymentResponse", + }, + "v2.GetFleetDeployment": { + "deploymentId": { + "type": "string", + "format": "", + }, + "operationResponseType": "FleetDeploymentResponse", + }, + "v2.CancelFleetDeployment": { + "deploymentId": { + "type": "string", + "format": "", + }, + "operationResponseType": "{}", + }, "v2.ListDatastores": { "operationResponseType": "DatastoreArray", }, diff --git a/features/v2/fleet_automation.feature b/features/v2/fleet_automation.feature new file mode 100644 index 000000000000..2e91b6e0a852 --- /dev/null +++ b/features/v2/fleet_automation.feature @@ -0,0 +1,89 @@ +@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. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "FleetAutomation" API + + @generated @skip @team:DataDog/fleet-automation + Scenario: Cancel a deployment returns "Bad Request" response + Given operation "CancelFleetDeployment" enabled + And new "CancelFleetDeployment" 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: Cancel a deployment returns "Deployment successfully canceled." response + Given operation "CancelFleetDeployment" enabled + And new "CancelFleetDeployment" request + And request contains "deployment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 Deployment successfully canceled. + + @generated @skip @team:DataDog/fleet-automation + Scenario: Cancel a deployment returns "Not Found" response + Given operation "CancelFleetDeployment" enabled + And new "CancelFleetDeployment" 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: Create a 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 + 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 + 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 + 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 + + @skip @team:DataDog/fleet-automation + Scenario: Get a deployment by ID returns "OK" response + Given operation "GetFleetDeployment" enabled + And there is a valid "deployment" in the system + And new "GetFleetDeployment" request + And request contains "deployment_id" parameter from "deployment.id" + 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 + And new "ListFleetDeployments" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/fleet-automation + Scenario: List all deployments returns "OK" response + Given operation "ListFleetDeployments" enabled + And new "ListFleetDeployments" request + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/given.json b/features/v2/given.json index 23b1000e2cdf..a4ab9c24bd17 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1,4 +1,17 @@ [ + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"deployment\",\n \"attributes\": {\n \"filter_query\": \"env:prod AND service:{{ unique_lower }}\",\n \"config_operations\": [\n {\n \"file_op\": \"merge-patch\",\n \"file_path\": \"/datadog.yaml\",\n \"patch\": {\n \"log_level\": \"info\"\n }\n }\n ]\n }\n }\n}" + } + ], + "source": "data", + "step": "there is a valid \"deployment\" in the system", + "key": "deployment", + "tag": "Fleet Automation", + "operationId": "CreateFleetDeploymentConfigure" + }, { "parameters": [ { diff --git a/features/v2/undo.json b/features/v2/undo.json index 6c74e264b654..bb35cea36c2e 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1,4 +1,35 @@ { + "ListFleetDeployments": { + "tag": "Fleet Automation", + "undo": { + "type": "safe" + } + }, + "CreateFleetDeploymentConfigure": { + "tag": "Fleet Automation", + "undo": { + "operationId": "CancelFleetDeployment", + "parameters": [ + { + "name": "deployment_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "GetFleetDeployment": { + "tag": "Fleet Automation", + "undo": { + "type": "safe" + } + }, + "CancelFleetDeployment": { + "tag": "Fleet Automation", + "undo": { + "type": "idempotent" + } + }, "ListDatastores": { "tag": "Actions Datastores", "undo": { diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index 6ab51020668c..770c0eedfc63 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -222,6 +222,10 @@ export function createConfiguration( conf.backoffBase || 2, conf.backoffMultiplier || 2, { + "v2.cancelFleetDeployment": false, + "v2.createFleetDeploymentConfigure": false, + "v2.getFleetDeployment": false, + "v2.listFleetDeployments": false, "v2.createOpenAPI": false, "v2.deleteOpenAPI": false, "v2.getOpenAPI": false, diff --git a/packages/datadog-api-client-v2/apis/FleetAutomationApi.ts b/packages/datadog-api-client-v2/apis/FleetAutomationApi.ts new file mode 100644 index 000000000000..dffdd41fa0cd --- /dev/null +++ b/packages/datadog-api-client-v2/apis/FleetAutomationApi.ts @@ -0,0 +1,590 @@ +import { + BaseAPIRequestFactory, + RequiredError, +} from "../../datadog-api-client-common/baseapi"; +import { + Configuration, + applySecurityAuthentication, +} from "../../datadog-api-client-common/configuration"; +import { + RequestContext, + HttpMethod, + ResponseContext, +} from "../../datadog-api-client-common/http/http"; + +import { logger } from "../../../logger"; +import { ObjectSerializer } from "../models/ObjectSerializer"; +import { ApiException } from "../../datadog-api-client-common/exception"; + +import { APIErrorResponse } from "../models/APIErrorResponse"; +import { FleetDeploymentConfigureCreateRequest } from "../models/FleetDeploymentConfigureCreateRequest"; +import { FleetDeploymentResponse } from "../models/FleetDeploymentResponse"; +import { FleetDeploymentsResponse } from "../models/FleetDeploymentsResponse"; + +export class FleetAutomationApiRequestFactory extends BaseAPIRequestFactory { + public async cancelFleetDeployment( + deploymentId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'cancelFleetDeployment'"); + if (!_config.unstableOperations["v2.cancelFleetDeployment"]) { + throw new Error("Unstable operation 'cancelFleetDeployment' is disabled"); + } + + // verify required parameter 'deploymentId' is not null or undefined + if (deploymentId === null || deploymentId === undefined) { + throw new RequiredError("deploymentId", "cancelFleetDeployment"); + } + + // Path Params + const localVarPath = + "/api/unstable/fleet/deployments/{deployment_id}/cancel".replace( + "{deployment_id}", + encodeURIComponent(String(deploymentId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.FleetAutomationApi.cancelFleetDeployment") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async createFleetDeploymentConfigure( + body: FleetDeploymentConfigureCreateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createFleetDeploymentConfigure'"); + if (!_config.unstableOperations["v2.createFleetDeploymentConfigure"]) { + throw new Error( + "Unstable operation 'createFleetDeploymentConfigure' is disabled" + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createFleetDeploymentConfigure"); + } + + // Path Params + const localVarPath = "/api/unstable/fleet/deployments/configure"; + + // Make Request Context + const requestContext = _config + .getServer("v2.FleetAutomationApi.createFleetDeploymentConfigure") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "FleetDeploymentConfigureCreateRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getFleetDeployment( + deploymentId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'getFleetDeployment'"); + if (!_config.unstableOperations["v2.getFleetDeployment"]) { + throw new Error("Unstable operation 'getFleetDeployment' is disabled"); + } + + // verify required parameter 'deploymentId' is not null or undefined + if (deploymentId === null || deploymentId === undefined) { + throw new RequiredError("deploymentId", "getFleetDeployment"); + } + + // Path Params + const localVarPath = + "/api/unstable/fleet/deployments/{deployment_id}".replace( + "{deployment_id}", + encodeURIComponent(String(deploymentId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.FleetAutomationApi.getFleetDeployment") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async listFleetDeployments( + pageSize?: number, + pageOffset?: number, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'listFleetDeployments'"); + if (!_config.unstableOperations["v2.listFleetDeployments"]) { + throw new Error("Unstable operation 'listFleetDeployments' is disabled"); + } + + // Path Params + const localVarPath = "/api/unstable/fleet/deployments"; + + // Make Request Context + const requestContext = _config + .getServer("v2.FleetAutomationApi.listFleetDeployments") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page_size", + ObjectSerializer.serialize(pageSize, "number", "int64"), + "" + ); + } + if (pageOffset !== undefined) { + requestContext.setQueryParam( + "page_offset", + ObjectSerializer.serialize(pageOffset, "number", "int64"), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } +} + +export class FleetAutomationApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to cancelFleetDeployment + * @throws ApiException if the response code was not in [200, 299] + */ + public async cancelFleetDeployment(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createFleetDeploymentConfigure + * @throws ApiException if the response code was not in [200, 299] + */ + public async createFleetDeploymentConfigure( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: FleetDeploymentResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "FleetDeploymentResponse" + ) as FleetDeploymentResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: FleetDeploymentResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "FleetDeploymentResponse", + "" + ) as FleetDeploymentResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getFleetDeployment + * @throws ApiException if the response code was not in [200, 299] + */ + public async getFleetDeployment( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: FleetDeploymentResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "FleetDeploymentResponse" + ) as FleetDeploymentResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: FleetDeploymentResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "FleetDeploymentResponse", + "" + ) as FleetDeploymentResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listFleetDeployments + * @throws ApiException if the response code was not in [200, 299] + */ + public async listFleetDeployments( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: FleetDeploymentsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "FleetDeploymentsResponse" + ) as FleetDeploymentsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: FleetDeploymentsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "FleetDeploymentsResponse", + "" + ) as FleetDeploymentsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } +} + +export interface FleetAutomationApiCancelFleetDeploymentRequest { + /** + * The unique identifier of the deployment to cancel. + * @type string + */ + deploymentId: string; +} + +export interface FleetAutomationApiCreateFleetDeploymentConfigureRequest { + /** + * Request payload containing the deployment details. + * @type FleetDeploymentConfigureCreateRequest + */ + body: FleetDeploymentConfigureCreateRequest; +} + +export interface FleetAutomationApiGetFleetDeploymentRequest { + /** + * The unique identifier of the deployment to retrieve. + * @type string + */ + deploymentId: string; +} + +export interface FleetAutomationApiListFleetDeploymentsRequest { + /** + * Number of deployments to return per page. Maximum value is 100. + * @type number + */ + pageSize?: number; + /** + * Index of the first deployment to return. Use this with `page_size` to paginate through results. + * @type number + */ + pageOffset?: number; +} + +export class FleetAutomationApi { + private requestFactory: FleetAutomationApiRequestFactory; + private responseProcessor: FleetAutomationApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: FleetAutomationApiRequestFactory, + responseProcessor?: FleetAutomationApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = + requestFactory || new FleetAutomationApiRequestFactory(configuration); + this.responseProcessor = + responseProcessor || new FleetAutomationApiResponseProcessor(); + } + + /** + * Cancel this deployment and stop all associated operations. + * If a workflow is currently running for this deployment, it is canceled immediately. + * Changes already applied to hosts are not rolled back. + * @param param The request object + */ + public cancelFleetDeployment( + param: FleetAutomationApiCancelFleetDeploymentRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.cancelFleetDeployment( + param.deploymentId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.cancelFleetDeployment(responseContext); + }); + }); + } + + /** + * Create a new deployment to apply configuration changes + * to a fleet of hosts matching the specified filter query. + * @param param The request object + */ + public createFleetDeploymentConfigure( + param: FleetAutomationApiCreateFleetDeploymentConfigureRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.createFleetDeploymentConfigure(param.body, options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createFleetDeploymentConfigure( + responseContext + ); + }); + }); + } + + /** + * Retrieve the details of a specific deployment using its unique identifier. + * @param param The request object + */ + public getFleetDeployment( + param: FleetAutomationApiGetFleetDeploymentRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getFleetDeployment( + param.deploymentId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getFleetDeployment(responseContext); + }); + }); + } + + /** + * Retrieve a list of all deployments for fleet automation. + * Use the `page_size` and `page_offset` parameters to paginate results. + * @param param The request object + */ + public listFleetDeployments( + param: FleetAutomationApiListFleetDeploymentsRequest = {}, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.listFleetDeployments( + param.pageSize, + param.pageOffset, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listFleetDeployments(responseContext); + }); + }); + } +} diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 790a327f834e..28929834515c 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -337,6 +337,14 @@ export { FastlyIntegrationApi, } from "./apis/FastlyIntegrationApi"; +export { + FleetAutomationApiCancelFleetDeploymentRequest, + FleetAutomationApiCreateFleetDeploymentConfigureRequest, + FleetAutomationApiGetFleetDeploymentRequest, + FleetAutomationApiListFleetDeploymentsRequest, + FleetAutomationApi, +} from "./apis/FleetAutomationApi"; + export { GCPIntegrationApiCreateGCPSTSAccountRequest, GCPIntegrationApiDeleteGCPSTSAccountRequest, @@ -2057,6 +2065,18 @@ export { FlakyTestsSearchResponseMeta } from "./models/FlakyTestsSearchResponseM export { FlakyTestsSearchSort } from "./models/FlakyTestsSearchSort"; export { FlakyTestStats } from "./models/FlakyTestStats"; export { FlakyTestType } from "./models/FlakyTestType"; +export { FleetDeployment } from "./models/FleetDeployment"; +export { FleetDeploymentAttributes } from "./models/FleetDeploymentAttributes"; +export { FleetDeploymentConfigureAttributes } from "./models/FleetDeploymentConfigureAttributes"; +export { FleetDeploymentConfigureCreate } from "./models/FleetDeploymentConfigureCreate"; +export { FleetDeploymentConfigureCreateRequest } from "./models/FleetDeploymentConfigureCreateRequest"; +export { FleetDeploymentFileOp } from "./models/FleetDeploymentFileOp"; +export { FleetDeploymentOperation } from "./models/FleetDeploymentOperation"; +export { FleetDeploymentResourceType } from "./models/FleetDeploymentResourceType"; +export { FleetDeploymentResponse } from "./models/FleetDeploymentResponse"; +export { FleetDeploymentsPage } from "./models/FleetDeploymentsPage"; +export { FleetDeploymentsResponse } from "./models/FleetDeploymentsResponse"; +export { FleetDeploymentsResponseMeta } from "./models/FleetDeploymentsResponseMeta"; export { FormulaLimit } from "./models/FormulaLimit"; export { FrameworkHandleAndVersionResponseData } from "./models/FrameworkHandleAndVersionResponseData"; export { FreshserviceAPIKey } from "./models/FreshserviceAPIKey"; diff --git a/packages/datadog-api-client-v2/models/FleetDeployment.ts b/packages/datadog-api-client-v2/models/FleetDeployment.ts new file mode 100644 index 000000000000..8253be6c6b53 --- /dev/null +++ b/packages/datadog-api-client-v2/models/FleetDeployment.ts @@ -0,0 +1,73 @@ +/** + * 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. + */ +import { FleetDeploymentAttributes } from "./FleetDeploymentAttributes"; +import { FleetDeploymentResourceType } from "./FleetDeploymentResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A deployment that defines automated configuration changes for a fleet of hosts. + */ +export class FleetDeployment { + /** + * Attributes of a deployment in the response. + */ + "attributes": FleetDeploymentAttributes; + /** + * Unique identifier for the deployment. + */ + "id": string; + /** + * The type of deployment resource. + */ + "type": FleetDeploymentResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "FleetDeploymentAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "FleetDeploymentResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FleetDeployment.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/FleetDeploymentAttributes.ts b/packages/datadog-api-client-v2/models/FleetDeploymentAttributes.ts new file mode 100644 index 000000000000..8f9699a69130 --- /dev/null +++ b/packages/datadog-api-client-v2/models/FleetDeploymentAttributes.ts @@ -0,0 +1,87 @@ +/** + * 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. + */ +import { FleetDeploymentOperation } from "./FleetDeploymentOperation"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of a deployment in the response. + */ +export class FleetDeploymentAttributes { + /** + * Ordered list of configuration file operations to perform on the target hosts. + */ + "configOperations"?: Array; + /** + * Estimated completion time of the deployment as a Unix timestamp (seconds since epoch). + */ + "estimatedEndTimeUnix"?: number; + /** + * Query used to filter and select target hosts for the deployment. Uses the Datadog query syntax. + */ + "filterQuery"?: string; + /** + * Current high-level status of the deployment (for example, "pending", "running", "completed", "failed"). + */ + "highLevelStatus"?: string; + /** + * Total number of hosts targeted by this deployment. + */ + "totalHosts"?: number; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + configOperations: { + baseName: "config_operations", + type: "Array", + }, + estimatedEndTimeUnix: { + baseName: "estimated_end_time_unix", + type: "number", + format: "int64", + }, + filterQuery: { + baseName: "filter_query", + type: "string", + }, + highLevelStatus: { + baseName: "high_level_status", + type: "string", + }, + totalHosts: { + baseName: "total_hosts", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FleetDeploymentAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/FleetDeploymentConfigureAttributes.ts b/packages/datadog-api-client-v2/models/FleetDeploymentConfigureAttributes.ts new file mode 100644 index 000000000000..e731f54b952e --- /dev/null +++ b/packages/datadog-api-client-v2/models/FleetDeploymentConfigureAttributes.ts @@ -0,0 +1,62 @@ +/** + * 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. + */ +import { FleetDeploymentOperation } from "./FleetDeploymentOperation"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for creating a new configuration deployment. + */ +export class FleetDeploymentConfigureAttributes { + /** + * Ordered list of configuration file operations to perform on the target hosts. + */ + "configOperations": Array; + /** + * Query used to filter and select target hosts for the deployment. Uses the Datadog query syntax. + */ + "filterQuery"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + configOperations: { + baseName: "config_operations", + type: "Array", + required: true, + }, + filterQuery: { + baseName: "filter_query", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FleetDeploymentConfigureAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/FleetDeploymentConfigureCreate.ts b/packages/datadog-api-client-v2/models/FleetDeploymentConfigureCreate.ts new file mode 100644 index 000000000000..163332746308 --- /dev/null +++ b/packages/datadog-api-client-v2/models/FleetDeploymentConfigureCreate.ts @@ -0,0 +1,64 @@ +/** + * 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. + */ +import { FleetDeploymentConfigureAttributes } from "./FleetDeploymentConfigureAttributes"; +import { FleetDeploymentResourceType } from "./FleetDeploymentResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data for creating a new deployment. + */ +export class FleetDeploymentConfigureCreate { + /** + * Attributes for creating a new configuration deployment. + */ + "attributes": FleetDeploymentConfigureAttributes; + /** + * The type of deployment resource. + */ + "type": FleetDeploymentResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "FleetDeploymentConfigureAttributes", + required: true, + }, + type: { + baseName: "type", + type: "FleetDeploymentResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FleetDeploymentConfigureCreate.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/FleetDeploymentConfigureCreateRequest.ts b/packages/datadog-api-client-v2/models/FleetDeploymentConfigureCreateRequest.ts new file mode 100644 index 000000000000..f60761156385 --- /dev/null +++ b/packages/datadog-api-client-v2/models/FleetDeploymentConfigureCreateRequest.ts @@ -0,0 +1,54 @@ +/** + * 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. + */ +import { FleetDeploymentConfigureCreate } from "./FleetDeploymentConfigureCreate"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request payload for creating a new deployment. + */ +export class FleetDeploymentConfigureCreateRequest { + /** + * Data for creating a new deployment. + */ + "data": FleetDeploymentConfigureCreate; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "FleetDeploymentConfigureCreate", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FleetDeploymentConfigureCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/FleetDeploymentFileOp.ts b/packages/datadog-api-client-v2/models/FleetDeploymentFileOp.ts new file mode 100644 index 000000000000..edfa4ba25248 --- /dev/null +++ b/packages/datadog-api-client-v2/models/FleetDeploymentFileOp.ts @@ -0,0 +1,21 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type of file operation to perform on the target configuration file. + * - `merge-patch`: Merges the provided patch data with the existing configuration file. + * Creates the file if it doesn't exist. + * - `delete`: Removes the specified configuration file from the target hosts. + */ + +export type FleetDeploymentFileOp = + | typeof MERGE_PATCH + | typeof DELETE + | UnparsedObject; +export const MERGE_PATCH = "merge-patch"; +export const DELETE = "delete"; diff --git a/packages/datadog-api-client-v2/models/FleetDeploymentOperation.ts b/packages/datadog-api-client-v2/models/FleetDeploymentOperation.ts new file mode 100644 index 000000000000..d1eb6d12e664 --- /dev/null +++ b/packages/datadog-api-client-v2/models/FleetDeploymentOperation.ts @@ -0,0 +1,78 @@ +/** + * 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. + */ +import { FleetDeploymentFileOp } from "./FleetDeploymentFileOp"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A single configuration file operation to perform on the target hosts. + */ +export class FleetDeploymentOperation { + /** + * Type of file operation to perform on the target configuration file. + * - `merge-patch`: Merges the provided patch data with the existing configuration file. + * Creates the file if it doesn't exist. + * - `delete`: Removes the specified configuration file from the target hosts. + */ + "fileOp": FleetDeploymentFileOp; + /** + * Absolute path to the target configuration file on the host. + */ + "filePath": string; + /** + * Patch data in JSON format to apply to the configuration file. + * When using `merge-patch`, this object is merged with the existing configuration, + * allowing you to add, update, or override specific fields without replacing the entire file. + * The structure must match the target configuration file format (for example, YAML structure for Datadog Agent config). + * Not applicable when using the `delete` operation. + */ + "patch"?: { [key: string]: any }; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + fileOp: { + baseName: "file_op", + type: "FleetDeploymentFileOp", + required: true, + }, + filePath: { + baseName: "file_path", + type: "string", + required: true, + }, + patch: { + baseName: "patch", + type: "{ [key: string]: any; }", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FleetDeploymentOperation.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/FleetDeploymentResourceType.ts b/packages/datadog-api-client-v2/models/FleetDeploymentResourceType.ts new file mode 100644 index 000000000000..17f4745d4ce6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/FleetDeploymentResourceType.ts @@ -0,0 +1,14 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of deployment resource. + */ + +export type FleetDeploymentResourceType = typeof DEPLOYMENT | UnparsedObject; +export const DEPLOYMENT = "deployment"; diff --git a/packages/datadog-api-client-v2/models/FleetDeploymentResponse.ts b/packages/datadog-api-client-v2/models/FleetDeploymentResponse.ts new file mode 100644 index 000000000000..3da285d91cc5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/FleetDeploymentResponse.ts @@ -0,0 +1,53 @@ +/** + * 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. + */ +import { FleetDeployment } from "./FleetDeployment"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing a single deployment. + */ +export class FleetDeploymentResponse { + /** + * A deployment that defines automated configuration changes for a fleet of hosts. + */ + "data"?: FleetDeployment; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "FleetDeployment", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FleetDeploymentResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/FleetDeploymentsPage.ts b/packages/datadog-api-client-v2/models/FleetDeploymentsPage.ts new file mode 100644 index 000000000000..659d38d95135 --- /dev/null +++ b/packages/datadog-api-client-v2/models/FleetDeploymentsPage.ts @@ -0,0 +1,53 @@ +/** + * 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. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Pagination details for the list of deployments. + */ +export class FleetDeploymentsPage { + /** + * Total number of deployments available across all pages. + */ + "totalCount"?: number; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + totalCount: { + baseName: "total_count", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FleetDeploymentsPage.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/FleetDeploymentsResponse.ts b/packages/datadog-api-client-v2/models/FleetDeploymentsResponse.ts new file mode 100644 index 000000000000..389b1858b8bb --- /dev/null +++ b/packages/datadog-api-client-v2/models/FleetDeploymentsResponse.ts @@ -0,0 +1,63 @@ +/** + * 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. + */ +import { FleetDeployment } from "./FleetDeployment"; +import { FleetDeploymentsResponseMeta } from "./FleetDeploymentsResponseMeta"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing a paginated list of deployments. + */ +export class FleetDeploymentsResponse { + /** + * Array of deployments matching the query criteria. + */ + "data": Array; + /** + * Metadata for the list of deployments, including pagination information. + */ + "meta"?: FleetDeploymentsResponseMeta; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + meta: { + baseName: "meta", + type: "FleetDeploymentsResponseMeta", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FleetDeploymentsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/FleetDeploymentsResponseMeta.ts b/packages/datadog-api-client-v2/models/FleetDeploymentsResponseMeta.ts new file mode 100644 index 000000000000..3209466e3105 --- /dev/null +++ b/packages/datadog-api-client-v2/models/FleetDeploymentsResponseMeta.ts @@ -0,0 +1,53 @@ +/** + * 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. + */ +import { FleetDeploymentsPage } from "./FleetDeploymentsPage"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Metadata for the list of deployments, including pagination information. + */ +export class FleetDeploymentsResponseMeta { + /** + * Pagination details for the list of deployments. + */ + "page"?: FleetDeploymentsPage; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + page: { + baseName: "page", + type: "FleetDeploymentsPage", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FleetDeploymentsResponseMeta.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 462aa99fd8f7..5dc075eabb02 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -884,6 +884,16 @@ import { FlakyTestsSearchRequestAttributes } from "./FlakyTestsSearchRequestAttr import { FlakyTestsSearchRequestData } from "./FlakyTestsSearchRequestData"; import { FlakyTestsSearchResponse } from "./FlakyTestsSearchResponse"; import { FlakyTestsSearchResponseMeta } from "./FlakyTestsSearchResponseMeta"; +import { FleetDeployment } from "./FleetDeployment"; +import { FleetDeploymentAttributes } from "./FleetDeploymentAttributes"; +import { FleetDeploymentConfigureAttributes } from "./FleetDeploymentConfigureAttributes"; +import { FleetDeploymentConfigureCreate } from "./FleetDeploymentConfigureCreate"; +import { FleetDeploymentConfigureCreateRequest } from "./FleetDeploymentConfigureCreateRequest"; +import { FleetDeploymentOperation } from "./FleetDeploymentOperation"; +import { FleetDeploymentResponse } from "./FleetDeploymentResponse"; +import { FleetDeploymentsPage } from "./FleetDeploymentsPage"; +import { FleetDeploymentsResponse } from "./FleetDeploymentsResponse"; +import { FleetDeploymentsResponseMeta } from "./FleetDeploymentsResponseMeta"; import { FormulaLimit } from "./FormulaLimit"; import { FrameworkHandleAndVersionResponseData } from "./FrameworkHandleAndVersionResponseData"; import { FreshserviceAPIKey } from "./FreshserviceAPIKey"; @@ -2964,6 +2974,8 @@ const enumsMap: { [key: string]: any[] } = { "pipelines_duration_lost", "-pipelines_duration_lost", ], + FleetDeploymentFileOp: ["merge-patch", "delete"], + FleetDeploymentResourceType: ["deployment"], FreshserviceAPIKeyType: ["FreshserviceAPIKey"], FreshserviceIntegrationType: ["Freshservice"], GCPIntegrationType: ["GCP"], @@ -5099,6 +5111,16 @@ const typeMap: { [index: string]: any } = { FlakyTestsSearchRequestData: FlakyTestsSearchRequestData, FlakyTestsSearchResponse: FlakyTestsSearchResponse, FlakyTestsSearchResponseMeta: FlakyTestsSearchResponseMeta, + FleetDeployment: FleetDeployment, + FleetDeploymentAttributes: FleetDeploymentAttributes, + FleetDeploymentConfigureAttributes: FleetDeploymentConfigureAttributes, + FleetDeploymentConfigureCreate: FleetDeploymentConfigureCreate, + FleetDeploymentConfigureCreateRequest: FleetDeploymentConfigureCreateRequest, + FleetDeploymentOperation: FleetDeploymentOperation, + FleetDeploymentResponse: FleetDeploymentResponse, + FleetDeploymentsPage: FleetDeploymentsPage, + FleetDeploymentsResponse: FleetDeploymentsResponse, + FleetDeploymentsResponseMeta: FleetDeploymentsResponseMeta, FormulaLimit: FormulaLimit, FrameworkHandleAndVersionResponseData: FrameworkHandleAndVersionResponseData, FreshserviceAPIKey: FreshserviceAPIKey,