diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6bc9597abb..65fad37525 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -20573,6 +20573,48 @@ components: - PIPELINES_FAILED_DESCENDING - PIPELINES_DURATION_LOST_ASCENDING - PIPELINES_DURATION_LOST_DESCENDING + FleetAgentVersion: + description: Represents an available Datadog Agent version. + properties: + attributes: + $ref: '#/components/schemas/FleetAgentVersionAttributes' + id: + description: Unique identifier for the Agent version (same as version). + example: 7.50.0 + type: string + type: + $ref: '#/components/schemas/FleetAgentVersionResourceType' + required: + - id + - type + type: object + FleetAgentVersionAttributes: + properties: + version: + description: The Agent version string. + example: 7.50.0 + type: string + type: object + FleetAgentVersionResourceType: + default: agent_version + description: The type of Agent version resource. + enum: + - agent_version + example: agent_version + type: string + x-enum-varnames: + - AGENT_VERSION + FleetAgentVersionsResponse: + description: Response containing a list of available Agent versions. + properties: + data: + description: Array of available Agent versions. + items: + $ref: '#/components/schemas/FleetAgentVersion' + type: array + required: + - data + type: object FleetDeployment: description: A deployment that defines automated configuration changes for a fleet of hosts. @@ -20611,10 +20653,30 @@ components: 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"). + description: 'Current high-level status of the deployment (for example, + "pending", "running", + + "completed", "failed").' example: pending type: string + hosts: + description: 'Paginated list of hosts in this deployment with their individual + statuses. Only included + + when fetching a single deployment by ID. Use the `limit` and `page` query + parameters to + + navigate through pages. Pagination metadata is included in the response + `meta.hosts` field.' + items: + $ref: '#/components/schemas/FleetDeploymentHost' + type: array + packages: + description: List of packages to deploy to target hosts. Present only for + package upgrade deployments. + items: + $ref: '#/components/schemas/FleetDeploymentPackage' + type: array total_hosts: description: Total number of hosts targeted by this deployment. example: 42 @@ -20639,7 +20701,7 @@ components: - config_operations type: object FleetDeploymentConfigureCreate: - description: Data for creating a new deployment. + description: Data for creating a new configuration deployment. properties: attributes: $ref: '#/components/schemas/FleetDeploymentConfigureAttributes' @@ -20650,7 +20712,7 @@ components: - attributes type: object FleetDeploymentConfigureCreateRequest: - description: Request payload for creating a new deployment. + description: Request payload for creating a new configuration deployment. properties: data: $ref: '#/components/schemas/FleetDeploymentConfigureCreate' @@ -20670,6 +20732,76 @@ components: x-enum-varnames: - MERGE_PATCH - DELETE + FleetDeploymentHost: + description: A host that is part of a deployment with its current status. + properties: + error: + description: Error message if the deployment failed on this host. + example: '' + type: string + hostname: + description: The hostname of the agent. + example: web-server-01.example.com + type: string + status: + description: Current deployment status for this specific host. + example: succeeded + type: string + versions: + description: List of packages and their versions currently installed on + this host. + items: + $ref: '#/components/schemas/FleetDeploymentHostPackage' + type: array + type: object + FleetDeploymentHostPackage: + description: 'Package version information for a host, showing the initial version + before deployment, + + the target version to deploy, and the current version on the host.' + properties: + current_version: + description: The current version of the package on the host. + example: 7.51.0 + type: string + initial_version: + description: The initial version of the package on the host before the deployment + started. + example: 7.51.0 + type: string + package_name: + description: The name of the package. + example: datadog-agent + type: string + target_version: + description: The target version that the deployment is attempting to install. + example: 7.52.0 + type: string + type: object + FleetDeploymentHostsPage: + description: Pagination details for the list of hosts in a deployment. + properties: + current_page: + description: Current page index (zero-based). + example: 0 + format: int64 + type: integer + page_size: + description: Number of hosts returned per page. + example: 50 + format: int64 + type: integer + total_hosts: + description: Total number of hosts in this deployment. + example: 150 + format: int64 + type: integer + total_pages: + description: Total number of pages available. + example: 3 + format: int64 + type: integer + type: object FleetDeploymentOperation: description: A single configuration file operation to perform on the target hosts. @@ -20690,9 +20822,9 @@ components: the entire file. The structure must match the target configuration file format (for example, - YAML structure for Datadog Agent config). + YAML structure - Not applicable when using the `delete` operation.' + for Datadog Agent config). Not applicable when using the `delete` operation.' example: apm_config: enabled: true @@ -20703,6 +20835,57 @@ components: - file_op - file_path type: object + FleetDeploymentPackage: + description: A package and its target version for deployment. + properties: + name: + description: The name of the package to deploy. + example: datadog-agent + type: string + version: + description: The target version of the package to deploy. + example: 7.52.0 + type: string + required: + - name + - version + type: object + FleetDeploymentPackageUpgradeAttributes: + description: Attributes for creating a new package upgrade deployment. + properties: + 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 + target_packages: + description: List of packages and their target versions to deploy to the + selected hosts. + items: + $ref: '#/components/schemas/FleetDeploymentPackage' + type: array + required: + - target_packages + type: object + FleetDeploymentPackageUpgradeCreate: + description: Data for creating a new package upgrade deployment. + properties: + attributes: + $ref: '#/components/schemas/FleetDeploymentPackageUpgradeAttributes' + type: + $ref: '#/components/schemas/FleetDeploymentResourceType' + required: + - type + - attributes + type: object + FleetDeploymentPackageUpgradeCreateRequest: + description: Request payload for creating a new package upgrade deployment. + properties: + data: + $ref: '#/components/schemas/FleetDeploymentPackageUpgradeCreate' + required: + - data + type: object FleetDeploymentResourceType: default: deployment description: The type of deployment resource. @@ -20717,6 +20900,15 @@ components: properties: data: $ref: '#/components/schemas/FleetDeployment' + meta: + $ref: '#/components/schemas/FleetDeploymentResponseMeta' + type: object + FleetDeploymentResponseMeta: + description: Metadata for a single deployment response, including pagination + information for hosts. + properties: + hosts: + $ref: '#/components/schemas/FleetDeploymentHostsPage' type: object FleetDeploymentsPage: description: Pagination details for the list of deployments. @@ -20746,6 +20938,262 @@ components: page: $ref: '#/components/schemas/FleetDeploymentsPage' type: object + FleetSchedule: + description: A schedule that automatically creates deployments based on a recurrence + rule. + properties: + attributes: + $ref: '#/components/schemas/FleetScheduleAttributes' + id: + description: Unique identifier for the schedule. + example: abc-def-ghi-123 + type: string + type: + $ref: '#/components/schemas/FleetScheduleResourceType' + required: + - id + - type + - attributes + type: object + FleetScheduleAttributes: + description: Attributes of a schedule in the response. + properties: + created_at_unix: + description: Unix timestamp (seconds since epoch) when the schedule was + created. + example: 1699999999 + format: int64 + type: integer + created_by: + description: User handle of the person who created the schedule. + example: user@example.com + type: string + name: + description: Human-readable name for the schedule. + example: Weekly Production Agent Updates + type: string + query: + description: Query used to filter and select target hosts for scheduled + deployments. Uses the Datadog query syntax. + example: env:prod AND service:web + type: string + rule: + $ref: '#/components/schemas/FleetScheduleRecurrenceRule' + status: + $ref: '#/components/schemas/FleetScheduleStatus' + updated_at_unix: + description: Unix timestamp (seconds since epoch) when the schedule was + last updated. + example: 1699999999 + format: int64 + type: integer + updated_by: + description: User handle of the person who last updated the schedule. + example: user@example.com + type: string + version_to_latest: + description: 'Number of major versions behind the latest to target for upgrades. + + - 0: Always upgrade to the latest version + + - 1: Upgrade to latest minus 1 major version + + - 2: Upgrade to latest minus 2 major versions + + Maximum value is 2.' + example: 0 + format: int64 + maximum: 2 + minimum: 0 + type: integer + type: object + FleetScheduleCreate: + description: Data for creating a new schedule. + properties: + attributes: + $ref: '#/components/schemas/FleetScheduleCreateAttributes' + type: + $ref: '#/components/schemas/FleetScheduleResourceType' + required: + - type + - attributes + type: object + FleetScheduleCreateAttributes: + description: Attributes for creating a new schedule. + properties: + name: + description: Human-readable name for the schedule. + example: Weekly Production Agent Updates + type: string + query: + description: Query used to filter and select target hosts for scheduled + deployments. Uses the Datadog query syntax. + example: env:prod AND service:web + type: string + rule: + $ref: '#/components/schemas/FleetScheduleRecurrenceRule' + status: + $ref: '#/components/schemas/FleetScheduleStatus' + version_to_latest: + description: 'Number of major versions behind the latest to target for upgrades. + + - 0: Always upgrade to the latest version (default) + + - 1: Upgrade to latest minus 1 major version + + - 2: Upgrade to latest minus 2 major versions + + Maximum value is 2.' + example: 0 + format: int64 + maximum: 2 + minimum: 0 + type: integer + required: + - name + - query + - rule + type: object + FleetScheduleCreateRequest: + description: Request payload for creating a new schedule. + properties: + data: + $ref: '#/components/schemas/FleetScheduleCreate' + required: + - data + type: object + FleetSchedulePatch: + description: Data for partially updating a schedule. + properties: + attributes: + $ref: '#/components/schemas/FleetSchedulePatchAttributes' + type: + $ref: '#/components/schemas/FleetScheduleResourceType' + required: + - type + type: object + FleetSchedulePatchAttributes: + description: Attributes for partially updating a schedule. All fields are optional. + properties: + name: + description: Human-readable name for the schedule. + example: Weekly Production Agent Updates + type: string + query: + description: Query used to filter and select target hosts for scheduled + deployments. Uses the Datadog query syntax. + example: env:prod AND service:web + type: string + rule: + $ref: '#/components/schemas/FleetScheduleRecurrenceRule' + status: + $ref: '#/components/schemas/FleetScheduleStatus' + version_to_latest: + description: 'Number of major versions behind the latest to target for upgrades. + + - 0: Always upgrade to the latest version + + - 1: Upgrade to latest minus 1 major version + + - 2: Upgrade to latest minus 2 major versions + + Maximum value is 2.' + example: 0 + format: int64 + maximum: 2 + minimum: 0 + type: integer + type: object + FleetSchedulePatchRequest: + description: Request payload for partially updating a schedule. + properties: + data: + $ref: '#/components/schemas/FleetSchedulePatch' + required: + - data + type: object + FleetScheduleRecurrenceRule: + description: 'Defines the recurrence pattern for the schedule. Specifies when + deployments should be + + automatically triggered based on maintenance windows.' + properties: + days_of_week: + description: 'List of days of the week when the schedule should trigger. + Valid values are: + + "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun".' + example: + - Mon + - Wed + - Fri + items: + type: string + type: array + maintenance_window_duration: + description: Duration of the maintenance window in minutes. + example: 1200 + format: int64 + type: integer + start_maintenance_window: + description: 'Start time of the maintenance window in 24-hour clock format + (HH:MM). + + Deployments will be triggered at this time on the specified days.' + example: 02:00 + type: string + timezone: + description: Timezone for the schedule in IANA Time Zone Database format + (e.g., "America/New_York", "UTC"). + example: America/New_York + type: string + required: + - days_of_week + - start_maintenance_window + - maintenance_window_duration + - timezone + type: object + FleetScheduleResourceType: + default: schedule + description: The type of schedule resource. + enum: + - schedule + example: schedule + type: string + x-enum-varnames: + - SCHEDULE + FleetScheduleResponse: + description: Response containing a single schedule. + properties: + data: + $ref: '#/components/schemas/FleetSchedule' + type: object + FleetScheduleStatus: + description: 'The status of the schedule. + + - `active`: The schedule is active and will create deployments according to + its recurrence rule. + + - `inactive`: The schedule is inactive and will not create any deployments.' + enum: + - active + - inactive + example: active + type: string + x-enum-varnames: + - ACTIVE + - INACTIVE + FleetSchedulesResponse: + description: Response containing a list of schedules. + properties: + data: + description: Array of schedules. + items: + $ref: '#/components/schemas/FleetSchedule' + type: array + required: + - data + type: object FormulaLimit: description: 'Message for specifying limits to the number of values returned by a query. @@ -54359,6 +54807,49 @@ info: version: '1.0' openapi: 3.0.0 paths: + /api/unstable/fleet/agents: + get: + description: 'Retrieve a list of all available Datadog Agent versions. + + + This endpoint returns the available Agent versions that can be deployed to + your fleet. + + These versions are used when creating deployments or configuring schedules + for + + automated Agent upgrades.' + operationId: ListFleetAgentVersions + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FleetAgentVersionsResponse' + 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: List all available Agent versions + 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: get: description: 'Retrieve a list of all deployments for fleet automation. @@ -54414,9 +54905,15 @@ paths: 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.' + description: "Create a new deployment to apply configuration changes\nto a fleet + of hosts matching the specified filter query.\n\nThis endpoint supports two + types of configuration operations:\n- `merge-patch`: Merges the provided patch + data with the existing configuration file,\n creating the file if it doesn't + exist\n- `delete`: Removes the specified configuration file from the target + hosts\n\nThe deployment is created and started automatically. You can specify + multiple configuration\noperations that will be executed in order on each + target host. Use the filter query to target\nspecific hosts using the Datadog + query syntax." operationId: CreateFleetDeploymentConfigure requestBody: content: @@ -54505,7 +55002,88 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Create a deployment + summary: Create a configuration 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/upgrade: + post: + description: 'Create and immediately start a new package upgrade + + on hosts matching the specified filter query. + + + This endpoint allows you to upgrade the Datadog Agent to a specific version + + on hosts matching the specified filter query. + + + The deployment is created and started automatically. The system will: + + 1. Identify all hosts matching the filter query + + 2. Validate that the specified version is available + + 3. Begin rolling out the package upgrade to the target hosts' + operationId: CreateFleetDeploymentUpgrade + requestBody: + content: + application/json: + examples: + upgrade_agent: + summary: Upgrade Datadog Agent to version 7.52.0 + value: + data: + attributes: + filter_query: env:prod AND service:web + target_packages: + - name: datadog-agent + version: 7.52.0 + type: deployment + upgrade_multiple_packages: + summary: Upgrade multiple packages + value: + data: + attributes: + filter_query: env:staging + target_packages: + - name: datadog-agent + version: 7.52.0-1 + - name: datadog-apm-inject + version: 0.10.0 + type: deployment + schema: + $ref: '#/components/schemas/FleetDeploymentPackageUpgradeCreateRequest' + description: Request payload containing the package upgrade 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' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Upgrade hosts tags: - Fleet Automation x-permission: @@ -54518,8 +55096,22 @@ paths: 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. + description: "Retrieve detailed information about a specific deployment using + its unique identifier.\nThis endpoint returns comprehensive information about + a deployment, including:\n- Deployment metadata (ID, type, filter query)\n- + Total number of target hosts\n- Current high-level status (pending, running, + succeeded, failed)\n- Estimated completion time\n- Configuration operations + that were or are being applied\n- Detailed host list: A paginated array of + hosts included in this deployment with individual\n host status, current + package versions, and any errors\n\nThe host list provides visibility into + the per-host execution status, allowing you to:\n- Monitor which hosts have + completed successfully\n- Identify hosts that are still in progress\n- Investigate + failures on specific hosts\n- View current package versions installed on each + host (including initial, target, and current\n versions for each package)\n\nPagination: + Use the `limit` and `page` query parameters to paginate through hosts. The + response\nincludes pagination metadata in the `meta.hosts` field with information + about the current page,\ntotal pages, and total host count. The default page + size is 50 hosts, with a maximum of 100." operationId: GetFleetDeployment parameters: - description: The unique identifier of the deployment to retrieve. @@ -54529,6 +55121,25 @@ paths: required: true schema: type: string + - description: Maximum number of hosts to return per page. Default is 50, maximum + is 100. + in: query + name: limit + required: false + schema: + default: 50 + format: int64 + maximum: 100 + type: integer + - description: Page index for pagination (zero-based). Use this to retrieve + subsequent pages of hosts. + in: query + name: page + required: false + schema: + default: 0 + format: int64 + type: integer responses: '200': content: @@ -54549,7 +55160,7 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Get a deployment by ID + summary: Get a configuration deployment by ID tags: - Fleet Automation x-permission: @@ -54561,11 +55172,23 @@ paths: 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. + description: 'Cancel an active deployment and stop all pending operations. + + When you cancel a deployment: + + - All pending operations on hosts that haven''t started yet are stopped - If a workflow is currently running for this deployment, it is canceled immediately. + - Operations currently in progress on hosts may complete or be interrupted, + depending on their current state - Changes already applied to hosts are not rolled back.' + - Configuration changes or package upgrades already applied to hosts are not + rolled back + + + After cancellation, you can view the final state of the deployment using the + GET endpoint to see which hosts + + were successfully updated before the cancellation.' operationId: CancelFleetDeployment parameters: - description: The unique identifier of the deployment to cancel. @@ -54601,6 +55224,412 @@ paths: - 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/schedules: + get: + description: 'Retrieve a list of all schedules for automated fleet deployments. + + + Schedules allow you to automate package upgrades by defining maintenance windows + + and recurrence rules. Each schedule automatically creates deployments based + on its + + configuration.' + operationId: ListFleetSchedules + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FleetSchedulesResponse' + 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 schedules + 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/).' + post: + description: 'Create a new schedule for automated package upgrades. + + + Schedules define when and how often to automatically deploy package upgrades + to a fleet + + of hosts. Each schedule includes: + + - A filter query to select target hosts + + - A recurrence rule defining maintenance windows + + - A version strategy (e.g., always latest, or N versions behind latest) + + + When the schedule triggers during a maintenance window, it automatically creates + a + + deployment that upgrades the Datadog Agent to the specified version on all + matching hosts.' + operationId: CreateFleetSchedule + requestBody: + content: + application/json: + examples: + conservative_staging: + summary: Conservative staging updates (N-1 version) + value: + data: + attributes: + name: Staging Environment - Conservative Updates + query: env:staging + rule: + days_of_week: + - Fri + maintenance_window_duration: 240 + start_maintenance_window: '22:00' + timezone: UTC + status: active + version_to_latest: 1 + type: schedule + weekly_production_update: + summary: Weekly production agent updates + value: + data: + attributes: + name: Weekly Production Agent Updates + query: env:prod + rule: + days_of_week: + - Mon + - Wed + maintenance_window_duration: 180 + start_maintenance_window: 02:00 + timezone: America/New_York + status: active + version_to_latest: 0 + type: schedule + schema: + $ref: '#/components/schemas/FleetScheduleCreateRequest' + description: Request payload containing the schedule details. + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/FleetScheduleResponse' + 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 schedule + tags: + - Fleet Automation + x-permission: + operator: AND + permissions: + - agent_upgrade_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/schedules/{id}: + delete: + description: 'Delete a schedule permanently. + + + When you delete a schedule: + + - The schedule is permanently removed and will no longer create deployments + + - Any deployments already created by this schedule are not affected + + - This action cannot be undone + + + If you want to temporarily stop a schedule from creating deployments, consider + + updating its status to "inactive" instead of deleting it.' + operationId: DeleteFleetSchedule + parameters: + - description: The unique identifier of the schedule to delete. + example: abc-def-ghi-123 + in: path + name: id + required: true + schema: + type: string + responses: + '204': + description: Schedule successfully deleted. + '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: Delete a schedule + tags: + - Fleet Automation + x-permission: + operator: AND + permissions: + - agent_upgrade_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/).' + get: + description: 'Retrieve detailed information about a specific schedule using + its unique identifier. + + + This endpoint returns comprehensive information about a schedule, including: + + - Schedule metadata (ID, name, creation/update timestamps) + + - Filter query for selecting target hosts + + - Recurrence rule defining when deployments are triggered + + - Version strategy for package upgrades + + - Current status (active or inactive)' + operationId: GetFleetSchedule + parameters: + - description: The unique identifier of the schedule to retrieve. + example: abc-def-ghi-123 + in: path + name: id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FleetScheduleResponse' + 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 schedule 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/).' + patch: + description: 'Partially update a schedule by providing only the fields you want + to change. + + + This endpoint allows you to modify specific attributes of a schedule without + + affecting other fields. Common use cases include: + + - Changing the schedule status between active and inactive + + - Updating the maintenance window times + + - Modifying the filter query to target different hosts + + - Adjusting the version strategy + + + Only include the fields you want to update in the request body. All fields + + are optional in a PATCH request.' + operationId: UpdateFleetSchedule + parameters: + - description: The unique identifier of the schedule to update. + example: abc-def-ghi-123 + in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + change_maintenance_window: + summary: Change maintenance window time + value: + data: + attributes: + rule: + days_of_week: + - Mon + - Wed + - Fri + maintenance_window_duration: 240 + start_maintenance_window: 03:00 + timezone: America/New_York + type: schedule + pause_schedule: + summary: Pause a schedule + value: + data: + attributes: + status: inactive + type: schedule + update_query: + summary: Update target hosts query + value: + data: + attributes: + query: env:prod AND service:api + type: schedule + schema: + $ref: '#/components/schemas/FleetSchedulePatchRequest' + description: Request payload containing the fields to update. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FleetScheduleResponse' + 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: Update a schedule + tags: + - Fleet Automation + x-permission: + operator: AND + permissions: + - agent_upgrade_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/schedules/{id}/trigger: + post: + description: 'Manually trigger a schedule to immediately create and start a + deployment. + + + This endpoint allows you to manually initiate a deployment using the schedule''s + + configuration, without waiting for the next scheduled maintenance window. + This is + + useful for: + + - Testing a schedule before it runs automatically + + - Performing an emergency update outside the regular maintenance window + + - Creating an ad-hoc deployment with the same settings as a schedule + + + The deployment is created immediately with: + + - The same filter query as the schedule + + - The package version determined by the schedule''s version strategy + + - All matching hosts as targets + + + The manually triggered deployment is independent of the schedule and does + not + + affect the schedule''s normal recurrence pattern.' + operationId: TriggerFleetSchedule + parameters: + - description: The unique identifier of the schedule to trigger. + example: abc-def-ghi-123 + in: path + name: id + required: true + schema: + type: string + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/FleetDeploymentResponse' + description: CREATED - Deployment successfully created and started. + '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: Trigger a schedule deployment + tags: + - Fleet Automation + x-permission: + operator: AND + permissions: + - agent_upgrade_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: @@ -81558,9 +82587,24 @@ tags: 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.' + 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' name: Fleet Automation - description: 'Configure your Datadog-Google Cloud Platform (GCP) integration directly diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 889f134a08..01cbbb5ce5 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -8551,6 +8551,27 @@ datadog\_api\_client.v2.model.flaky\_tests\_search\_sort module :members: :show-inheritance: +datadog\_api\_client.v2.model.fleet\_agent\_version\_attributes module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_agent_version_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_agent\_version\_resource\_type module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_agent_version_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_agent\_versions\_response module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_agent_versions_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.fleet\_deployment module ------------------------------------------------------ @@ -8593,6 +8614,27 @@ datadog\_api\_client.v2.model.fleet\_deployment\_file\_op module :members: :show-inheritance: +datadog\_api\_client.v2.model.fleet\_deployment\_host module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.fleet_deployment_host + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_deployment\_host\_package module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_deployment_host_package + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_deployment\_hosts\_page module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_deployment_hosts_page + :members: + :show-inheritance: + datadog\_api\_client.v2.model.fleet\_deployment\_operation module ----------------------------------------------------------------- @@ -8600,6 +8642,34 @@ datadog\_api\_client.v2.model.fleet\_deployment\_operation module :members: :show-inheritance: +datadog\_api\_client.v2.model.fleet\_deployment\_package module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_deployment_package + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_deployment\_package\_upgrade\_attributes module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.fleet_deployment_package_upgrade_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_deployment\_package\_upgrade\_create module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_deployment_package_upgrade_create + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_deployment\_package\_upgrade\_create\_request module +----------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_deployment_package_upgrade_create_request + :members: + :show-inheritance: + datadog\_api\_client.v2.model.fleet\_deployment\_resource\_type module ---------------------------------------------------------------------- @@ -8614,6 +8684,13 @@ datadog\_api\_client.v2.model.fleet\_deployment\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.fleet\_deployment\_response\_meta module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_deployment_response_meta + :members: + :show-inheritance: + datadog\_api\_client.v2.model.fleet\_deployments\_page module ------------------------------------------------------------- @@ -8635,6 +8712,97 @@ datadog\_api\_client.v2.model.fleet\_deployments\_response\_meta module :members: :show-inheritance: +datadog\_api\_client.v2.model.fleet\_schedule module +---------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_schedule + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_schedule\_attributes module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_schedule_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_schedule\_create module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.fleet_schedule_create + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_schedule\_create\_attributes module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.fleet_schedule_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_schedule\_create\_request module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_schedule_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_schedule\_patch module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_schedule_patch + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_schedule\_patch\_attributes module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_schedule_patch_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_schedule\_patch\_request module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_schedule_patch_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_schedule\_recurrence\_rule module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_schedule_recurrence_rule + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_schedule\_resource\_type module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_schedule_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_schedule\_response module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_schedule_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_schedule\_status module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.fleet_schedule_status + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.fleet\_schedules\_response module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.fleet_schedules_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.formula\_limit module --------------------------------------------------- diff --git a/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.py b/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.py index dbd734e2d3..9b7b96b5c0 100644 --- a/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.py +++ b/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.py @@ -1,5 +1,5 @@ """ -Create a deployment returns "CREATED" response +Create a configuration deployment returns "CREATED" response """ from datadog_api_client import ApiClient, Configuration diff --git a/examples/v2/fleet-automation/CreateFleetDeploymentUpgrade.py b/examples/v2/fleet-automation/CreateFleetDeploymentUpgrade.py new file mode 100644 index 0000000000..43c261dd06 --- /dev/null +++ b/examples/v2/fleet-automation/CreateFleetDeploymentUpgrade.py @@ -0,0 +1,38 @@ +""" +Upgrade hosts returns "CREATED" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.fleet_automation_api import FleetAutomationApi +from datadog_api_client.v2.model.fleet_deployment_package import FleetDeploymentPackage +from datadog_api_client.v2.model.fleet_deployment_package_upgrade_attributes import ( + FleetDeploymentPackageUpgradeAttributes, +) +from datadog_api_client.v2.model.fleet_deployment_package_upgrade_create import FleetDeploymentPackageUpgradeCreate +from datadog_api_client.v2.model.fleet_deployment_package_upgrade_create_request import ( + FleetDeploymentPackageUpgradeCreateRequest, +) +from datadog_api_client.v2.model.fleet_deployment_resource_type import FleetDeploymentResourceType + +body = FleetDeploymentPackageUpgradeCreateRequest( + data=FleetDeploymentPackageUpgradeCreate( + attributes=FleetDeploymentPackageUpgradeAttributes( + filter_query="env:prod AND service:web", + target_packages=[ + FleetDeploymentPackage( + name="datadog-agent", + version="7.52.0", + ), + ], + ), + type=FleetDeploymentResourceType.DEPLOYMENT, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_fleet_deployment_upgrade"] = True +with ApiClient(configuration) as api_client: + api_instance = FleetAutomationApi(api_client) + response = api_instance.create_fleet_deployment_upgrade(body=body) + + print(response) diff --git a/examples/v2/fleet-automation/CreateFleetSchedule.py b/examples/v2/fleet-automation/CreateFleetSchedule.py new file mode 100644 index 0000000000..5231d4d7b4 --- /dev/null +++ b/examples/v2/fleet-automation/CreateFleetSchedule.py @@ -0,0 +1,42 @@ +""" +Create a schedule returns "CREATED" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.fleet_automation_api import FleetAutomationApi +from datadog_api_client.v2.model.fleet_schedule_create import FleetScheduleCreate +from datadog_api_client.v2.model.fleet_schedule_create_attributes import FleetScheduleCreateAttributes +from datadog_api_client.v2.model.fleet_schedule_create_request import FleetScheduleCreateRequest +from datadog_api_client.v2.model.fleet_schedule_recurrence_rule import FleetScheduleRecurrenceRule +from datadog_api_client.v2.model.fleet_schedule_resource_type import FleetScheduleResourceType +from datadog_api_client.v2.model.fleet_schedule_status import FleetScheduleStatus + +body = FleetScheduleCreateRequest( + data=FleetScheduleCreate( + attributes=FleetScheduleCreateAttributes( + name="Weekly Production Agent Updates", + query="env:prod AND service:web", + rule=FleetScheduleRecurrenceRule( + days_of_week=[ + "Mon", + "Wed", + "Fri", + ], + maintenance_window_duration=1200, + start_maintenance_window="02:00", + timezone="America/New_York", + ), + status=FleetScheduleStatus.ACTIVE, + version_to_latest=0, + ), + type=FleetScheduleResourceType.SCHEDULE, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_fleet_schedule"] = True +with ApiClient(configuration) as api_client: + api_instance = FleetAutomationApi(api_client) + response = api_instance.create_fleet_schedule(body=body) + + print(response) diff --git a/examples/v2/fleet-automation/DeleteFleetSchedule.py b/examples/v2/fleet-automation/DeleteFleetSchedule.py new file mode 100644 index 0000000000..8497178a33 --- /dev/null +++ b/examples/v2/fleet-automation/DeleteFleetSchedule.py @@ -0,0 +1,14 @@ +""" +Delete a schedule returns "Schedule successfully deleted." response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.fleet_automation_api import FleetAutomationApi + +configuration = Configuration() +configuration.unstable_operations["delete_fleet_schedule"] = True +with ApiClient(configuration) as api_client: + api_instance = FleetAutomationApi(api_client) + api_instance.delete_fleet_schedule( + id="id", + ) diff --git a/examples/v2/fleet-automation/GetFleetDeployment.py b/examples/v2/fleet-automation/GetFleetDeployment.py index 769b313d3d..a511874008 100644 --- a/examples/v2/fleet-automation/GetFleetDeployment.py +++ b/examples/v2/fleet-automation/GetFleetDeployment.py @@ -1,20 +1,16 @@ """ -Get a deployment by ID returns "OK" response +Get a configuration deployment by ID returns "OK" response """ -from os import environ from datadog_api_client import ApiClient, Configuration from datadog_api_client.v2.api.fleet_automation_api import FleetAutomationApi -# there is a valid "deployment" in the system -DEPLOYMENT_ID = environ["DEPLOYMENT_ID"] - configuration = Configuration() configuration.unstable_operations["get_fleet_deployment"] = True with ApiClient(configuration) as api_client: api_instance = FleetAutomationApi(api_client) response = api_instance.get_fleet_deployment( - deployment_id=DEPLOYMENT_ID, + deployment_id="deployment_id", ) print(response) diff --git a/examples/v2/fleet-automation/GetFleetDeployment_1482493803.py b/examples/v2/fleet-automation/GetFleetDeployment_1482493803.py new file mode 100644 index 0000000000..769b313d3d --- /dev/null +++ b/examples/v2/fleet-automation/GetFleetDeployment_1482493803.py @@ -0,0 +1,20 @@ +""" +Get a deployment by ID returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.fleet_automation_api import FleetAutomationApi + +# there is a valid "deployment" in the system +DEPLOYMENT_ID = environ["DEPLOYMENT_ID"] + +configuration = Configuration() +configuration.unstable_operations["get_fleet_deployment"] = True +with ApiClient(configuration) as api_client: + api_instance = FleetAutomationApi(api_client) + response = api_instance.get_fleet_deployment( + deployment_id=DEPLOYMENT_ID, + ) + + print(response) diff --git a/examples/v2/fleet-automation/GetFleetSchedule.py b/examples/v2/fleet-automation/GetFleetSchedule.py new file mode 100644 index 0000000000..8e49887fe6 --- /dev/null +++ b/examples/v2/fleet-automation/GetFleetSchedule.py @@ -0,0 +1,16 @@ +""" +Get a schedule by ID returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.fleet_automation_api import FleetAutomationApi + +configuration = Configuration() +configuration.unstable_operations["get_fleet_schedule"] = True +with ApiClient(configuration) as api_client: + api_instance = FleetAutomationApi(api_client) + response = api_instance.get_fleet_schedule( + id="id", + ) + + print(response) diff --git a/examples/v2/fleet-automation/ListFleetAgentVersions.py b/examples/v2/fleet-automation/ListFleetAgentVersions.py new file mode 100644 index 0000000000..63b1438ebd --- /dev/null +++ b/examples/v2/fleet-automation/ListFleetAgentVersions.py @@ -0,0 +1,14 @@ +""" +List all available Agent versions returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.fleet_automation_api import FleetAutomationApi + +configuration = Configuration() +configuration.unstable_operations["list_fleet_agent_versions"] = True +with ApiClient(configuration) as api_client: + api_instance = FleetAutomationApi(api_client) + response = api_instance.list_fleet_agent_versions() + + print(response) diff --git a/examples/v2/fleet-automation/ListFleetSchedules.py b/examples/v2/fleet-automation/ListFleetSchedules.py new file mode 100644 index 0000000000..f6f4eebe9f --- /dev/null +++ b/examples/v2/fleet-automation/ListFleetSchedules.py @@ -0,0 +1,14 @@ +""" +List all schedules returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.fleet_automation_api import FleetAutomationApi + +configuration = Configuration() +configuration.unstable_operations["list_fleet_schedules"] = True +with ApiClient(configuration) as api_client: + api_instance = FleetAutomationApi(api_client) + response = api_instance.list_fleet_schedules() + + print(response) diff --git a/examples/v2/fleet-automation/TriggerFleetSchedule.py b/examples/v2/fleet-automation/TriggerFleetSchedule.py new file mode 100644 index 0000000000..f13daf66a1 --- /dev/null +++ b/examples/v2/fleet-automation/TriggerFleetSchedule.py @@ -0,0 +1,16 @@ +""" +Trigger a schedule deployment returns "CREATED - Deployment successfully created and started." response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.fleet_automation_api import FleetAutomationApi + +configuration = Configuration() +configuration.unstable_operations["trigger_fleet_schedule"] = True +with ApiClient(configuration) as api_client: + api_instance = FleetAutomationApi(api_client) + response = api_instance.trigger_fleet_schedule( + id="id", + ) + + print(response) diff --git a/examples/v2/fleet-automation/UpdateFleetSchedule.py b/examples/v2/fleet-automation/UpdateFleetSchedule.py new file mode 100644 index 0000000000..cf0981a675 --- /dev/null +++ b/examples/v2/fleet-automation/UpdateFleetSchedule.py @@ -0,0 +1,42 @@ +""" +Update a schedule returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.fleet_automation_api import FleetAutomationApi +from datadog_api_client.v2.model.fleet_schedule_patch import FleetSchedulePatch +from datadog_api_client.v2.model.fleet_schedule_patch_attributes import FleetSchedulePatchAttributes +from datadog_api_client.v2.model.fleet_schedule_patch_request import FleetSchedulePatchRequest +from datadog_api_client.v2.model.fleet_schedule_recurrence_rule import FleetScheduleRecurrenceRule +from datadog_api_client.v2.model.fleet_schedule_resource_type import FleetScheduleResourceType +from datadog_api_client.v2.model.fleet_schedule_status import FleetScheduleStatus + +body = FleetSchedulePatchRequest( + data=FleetSchedulePatch( + attributes=FleetSchedulePatchAttributes( + name="Weekly Production Agent Updates", + query="env:prod AND service:web", + rule=FleetScheduleRecurrenceRule( + days_of_week=[ + "Mon", + "Wed", + "Fri", + ], + maintenance_window_duration=1200, + start_maintenance_window="02:00", + timezone="America/New_York", + ), + status=FleetScheduleStatus.ACTIVE, + version_to_latest=0, + ), + type=FleetScheduleResourceType.SCHEDULE, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_fleet_schedule"] = True +with ApiClient(configuration) as api_client: + api_instance = FleetAutomationApi(api_client) + response = api_instance.update_fleet_schedule(id="id", body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index e603b19d57..68dd479ef3 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -244,8 +244,16 @@ def __init__( { "v2.cancel_fleet_deployment": False, "v2.create_fleet_deployment_configure": False, + "v2.create_fleet_deployment_upgrade": False, + "v2.create_fleet_schedule": False, + "v2.delete_fleet_schedule": False, "v2.get_fleet_deployment": False, + "v2.get_fleet_schedule": False, + "v2.list_fleet_agent_versions": False, "v2.list_fleet_deployments": False, + "v2.list_fleet_schedules": False, + "v2.trigger_fleet_schedule": False, + "v2.update_fleet_schedule": False, "v2.create_open_api": False, "v2.delete_open_api": False, "v2.get_open_api": False, diff --git a/src/datadog_api_client/v2/api/fleet_automation_api.py b/src/datadog_api_client/v2/api/fleet_automation_api.py index 9f89f0ff2c..379c77346f 100644 --- a/src/datadog_api_client/v2/api/fleet_automation_api.py +++ b/src/datadog_api_client/v2/api/fleet_automation_api.py @@ -11,16 +11,35 @@ UnsetType, unset, ) +from datadog_api_client.v2.model.fleet_agent_versions_response import FleetAgentVersionsResponse from datadog_api_client.v2.model.fleet_deployments_response import FleetDeploymentsResponse from datadog_api_client.v2.model.fleet_deployment_response import FleetDeploymentResponse from datadog_api_client.v2.model.fleet_deployment_configure_create_request import FleetDeploymentConfigureCreateRequest +from datadog_api_client.v2.model.fleet_deployment_package_upgrade_create_request import ( + FleetDeploymentPackageUpgradeCreateRequest, +) +from datadog_api_client.v2.model.fleet_schedules_response import FleetSchedulesResponse +from datadog_api_client.v2.model.fleet_schedule_response import FleetScheduleResponse +from datadog_api_client.v2.model.fleet_schedule_create_request import FleetScheduleCreateRequest +from datadog_api_client.v2.model.fleet_schedule_patch_request import FleetSchedulePatchRequest class FleetAutomationApi: """ 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. + + 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 """ def __init__(self, api_client=None): @@ -71,6 +90,69 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_fleet_deployment_upgrade_endpoint = _Endpoint( + settings={ + "response_type": (FleetDeploymentResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/unstable/fleet/deployments/upgrade", + "operation_id": "create_fleet_deployment_upgrade", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (FleetDeploymentPackageUpgradeCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_fleet_schedule_endpoint = _Endpoint( + settings={ + "response_type": (FleetScheduleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/unstable/fleet/schedules", + "operation_id": "create_fleet_schedule", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (FleetScheduleCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_fleet_schedule_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/unstable/fleet/schedules/{id}", + "operation_id": "delete_fleet_schedule", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (str,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._get_fleet_deployment_endpoint = _Endpoint( settings={ "response_type": (FleetDeploymentResponse,), @@ -87,6 +169,42 @@ def __init__(self, api_client=None): "attribute": "deployment_id", "location": "path", }, + "limit": { + "validation": { + "inclusive_maximum": 100, + }, + "openapi_types": (int,), + "attribute": "limit", + "location": "query", + }, + "page": { + "openapi_types": (int,), + "attribute": "page", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_fleet_schedule_endpoint = _Endpoint( + settings={ + "response_type": (FleetScheduleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/unstable/fleet/schedules/{id}", + "operation_id": "get_fleet_schedule", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (str,), + "attribute": "id", + "location": "path", + }, }, headers_map={ "accept": ["application/json"], @@ -94,6 +212,22 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_fleet_agent_versions_endpoint = _Endpoint( + settings={ + "response_type": (FleetAgentVersionsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/unstable/fleet/agents", + "operation_id": "list_fleet_agent_versions", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_fleet_deployments_endpoint = _Endpoint( settings={ "response_type": (FleetDeploymentsResponse,), @@ -124,15 +258,86 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_fleet_schedules_endpoint = _Endpoint( + settings={ + "response_type": (FleetSchedulesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/unstable/fleet/schedules", + "operation_id": "list_fleet_schedules", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._trigger_fleet_schedule_endpoint = _Endpoint( + settings={ + "response_type": (FleetDeploymentResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/unstable/fleet/schedules/{id}/trigger", + "operation_id": "trigger_fleet_schedule", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (str,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_fleet_schedule_endpoint = _Endpoint( + settings={ + "response_type": (FleetScheduleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/unstable/fleet/schedules/{id}", + "operation_id": "update_fleet_schedule", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (str,), + "attribute": "id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (FleetSchedulePatchRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + def cancel_fleet_deployment( self, deployment_id: str, ) -> None: """Cancel a deployment. - 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. + Cancel an active deployment and stop all pending operations. + When you cancel a deployment: + + * All pending operations on hosts that haven't started yet are stopped + * Operations currently in progress on hosts may complete or be interrupted, depending on their current state + * Configuration changes or package upgrades already applied to hosts are not rolled back + + After cancellation, you can view the final state of the deployment using the GET endpoint to see which hosts + were successfully updated before the cancellation. :param deployment_id: The unique identifier of the deployment to cancel. :type deployment_id: str @@ -147,11 +352,21 @@ def create_fleet_deployment_configure( self, body: FleetDeploymentConfigureCreateRequest, ) -> FleetDeploymentResponse: - """Create a deployment. + """Create a configuration deployment. Create a new deployment to apply configuration changes to a fleet of hosts matching the specified filter query. + This endpoint supports two types of configuration operations: + + * ``merge-patch`` : Merges the provided patch data with the existing configuration file, + creating the file if it doesn't exist + * ``delete`` : Removes the specified configuration file from the target hosts + + The deployment is created and started automatically. You can specify multiple configuration + operations that will be executed in order on each target host. Use the filter query to target + specific hosts using the Datadog query syntax. + :param body: Request payload containing the deployment details. :type body: FleetDeploymentConfigureCreateRequest :rtype: FleetDeploymentResponse @@ -161,23 +376,178 @@ def create_fleet_deployment_configure( return self._create_fleet_deployment_configure_endpoint.call_with_http_info(**kwargs) + def create_fleet_deployment_upgrade( + self, + body: FleetDeploymentPackageUpgradeCreateRequest, + ) -> FleetDeploymentResponse: + """Upgrade hosts. + + Create and immediately start a new package upgrade + on hosts matching the specified filter query. + + This endpoint allows you to upgrade the Datadog Agent to a specific version + on hosts matching the specified filter query. + + The deployment is created and started automatically. The system will: + + #. Identify all hosts matching the filter query + #. Validate that the specified version is available + #. Begin rolling out the package upgrade to the target hosts + + :param body: Request payload containing the package upgrade details. + :type body: FleetDeploymentPackageUpgradeCreateRequest + :rtype: FleetDeploymentResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_fleet_deployment_upgrade_endpoint.call_with_http_info(**kwargs) + + def create_fleet_schedule( + self, + body: FleetScheduleCreateRequest, + ) -> FleetScheduleResponse: + """Create a schedule. + + Create a new schedule for automated package upgrades. + + Schedules define when and how often to automatically deploy package upgrades to a fleet + of hosts. Each schedule includes: + + * A filter query to select target hosts + * A recurrence rule defining maintenance windows + * A version strategy (e.g., always latest, or N versions behind latest) + + When the schedule triggers during a maintenance window, it automatically creates a + deployment that upgrades the Datadog Agent to the specified version on all matching hosts. + + :param body: Request payload containing the schedule details. + :type body: FleetScheduleCreateRequest + :rtype: FleetScheduleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_fleet_schedule_endpoint.call_with_http_info(**kwargs) + + def delete_fleet_schedule( + self, + id: str, + ) -> None: + """Delete a schedule. + + Delete a schedule permanently. + + When you delete a schedule: + + * The schedule is permanently removed and will no longer create deployments + * Any deployments already created by this schedule are not affected + * This action cannot be undone + + If you want to temporarily stop a schedule from creating deployments, consider + updating its status to "inactive" instead of deleting it. + + :param id: The unique identifier of the schedule to delete. + :type id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._delete_fleet_schedule_endpoint.call_with_http_info(**kwargs) + def get_fleet_deployment( self, deployment_id: str, + *, + limit: Union[int, UnsetType] = unset, + page: Union[int, UnsetType] = unset, ) -> FleetDeploymentResponse: - """Get a deployment by ID. + """Get a configuration deployment by ID. + + Retrieve detailed information about a specific deployment using its unique identifier. + This endpoint returns comprehensive information about a deployment, including: - Retrieve the details of a specific deployment using its unique identifier. + * Deployment metadata (ID, type, filter query) + * Total number of target hosts + * Current high-level status (pending, running, succeeded, failed) + * Estimated completion time + * Configuration operations that were or are being applied + * Detailed host list: A paginated array of hosts included in this deployment with individual + host status, current package versions, and any errors + + The host list provides visibility into the per-host execution status, allowing you to: + + * Monitor which hosts have completed successfully + * Identify hosts that are still in progress + * Investigate failures on specific hosts + * View current package versions installed on each host (including initial, target, and current + versions for each package) + + Pagination: Use the ``limit`` and ``page`` query parameters to paginate through hosts. The response + includes pagination metadata in the ``meta.hosts`` field with information about the current page, + total pages, and total host count. The default page size is 50 hosts, with a maximum of 100. :param deployment_id: The unique identifier of the deployment to retrieve. :type deployment_id: str + :param limit: Maximum number of hosts to return per page. Default is 50, maximum is 100. + :type limit: int, optional + :param page: Page index for pagination (zero-based). Use this to retrieve subsequent pages of hosts. + :type page: int, optional :rtype: FleetDeploymentResponse """ kwargs: Dict[str, Any] = {} kwargs["deployment_id"] = deployment_id + if limit is not unset: + kwargs["limit"] = limit + + if page is not unset: + kwargs["page"] = page + return self._get_fleet_deployment_endpoint.call_with_http_info(**kwargs) + def get_fleet_schedule( + self, + id: str, + ) -> FleetScheduleResponse: + """Get a schedule by ID. + + Retrieve detailed information about a specific schedule using its unique identifier. + + This endpoint returns comprehensive information about a schedule, including: + + * Schedule metadata (ID, name, creation/update timestamps) + * Filter query for selecting target hosts + * Recurrence rule defining when deployments are triggered + * Version strategy for package upgrades + * Current status (active or inactive) + + :param id: The unique identifier of the schedule to retrieve. + :type id: str + :rtype: FleetScheduleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._get_fleet_schedule_endpoint.call_with_http_info(**kwargs) + + def list_fleet_agent_versions( + self, + ) -> FleetAgentVersionsResponse: + """List all available Agent versions. + + Retrieve a list of all available Datadog Agent versions. + + This endpoint returns the available Agent versions that can be deployed to your fleet. + These versions are used when creating deployments or configuring schedules for + automated Agent upgrades. + + :rtype: FleetAgentVersionsResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_fleet_agent_versions_endpoint.call_with_http_info(**kwargs) + def list_fleet_deployments( self, *, @@ -203,3 +573,86 @@ def list_fleet_deployments( kwargs["page_offset"] = page_offset return self._list_fleet_deployments_endpoint.call_with_http_info(**kwargs) + + def list_fleet_schedules( + self, + ) -> FleetSchedulesResponse: + """List all schedules. + + Retrieve a list of all schedules for automated fleet deployments. + + Schedules allow you to automate package upgrades by defining maintenance windows + and recurrence rules. Each schedule automatically creates deployments based on its + configuration. + + :rtype: FleetSchedulesResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_fleet_schedules_endpoint.call_with_http_info(**kwargs) + + def trigger_fleet_schedule( + self, + id: str, + ) -> FleetDeploymentResponse: + """Trigger a schedule deployment. + + Manually trigger a schedule to immediately create and start a deployment. + + This endpoint allows you to manually initiate a deployment using the schedule's + configuration, without waiting for the next scheduled maintenance window. This is + useful for: + + * Testing a schedule before it runs automatically + * Performing an emergency update outside the regular maintenance window + * Creating an ad-hoc deployment with the same settings as a schedule + + The deployment is created immediately with: + + * The same filter query as the schedule + * The package version determined by the schedule's version strategy + * All matching hosts as targets + + The manually triggered deployment is independent of the schedule and does not + affect the schedule's normal recurrence pattern. + + :param id: The unique identifier of the schedule to trigger. + :type id: str + :rtype: FleetDeploymentResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._trigger_fleet_schedule_endpoint.call_with_http_info(**kwargs) + + def update_fleet_schedule( + self, + id: str, + body: FleetSchedulePatchRequest, + ) -> FleetScheduleResponse: + """Update a schedule. + + Partially update a schedule by providing only the fields you want to change. + + This endpoint allows you to modify specific attributes of a schedule without + affecting other fields. Common use cases include: + + * Changing the schedule status between active and inactive + * Updating the maintenance window times + * Modifying the filter query to target different hosts + * Adjusting the version strategy + + Only include the fields you want to update in the request body. All fields + are optional in a PATCH request. + + :param id: The unique identifier of the schedule to update. + :type id: str + :param body: Request payload containing the fields to update. + :type body: FleetSchedulePatchRequest + :rtype: FleetScheduleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + kwargs["body"] = body + + return self._update_fleet_schedule_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/model/fleet_agent_version.py b/src/datadog_api_client/v2/model/fleet_agent_version.py new file mode 100644 index 0000000000..d2c6d85e62 --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_agent_version.py @@ -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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_agent_version_attributes import FleetAgentVersionAttributes + from datadog_api_client.v2.model.fleet_agent_version_resource_type import FleetAgentVersionResourceType + + +class FleetAgentVersion(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_agent_version_attributes import FleetAgentVersionAttributes + from datadog_api_client.v2.model.fleet_agent_version_resource_type import FleetAgentVersionResourceType + + return { + "attributes": (FleetAgentVersionAttributes,), + "id": (str,), + "type": (FleetAgentVersionResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + id: str, + type: FleetAgentVersionResourceType, + attributes: Union[FleetAgentVersionAttributes, UnsetType] = unset, + **kwargs, + ): + """ + Represents an available Datadog Agent version. + + :param attributes: + :type attributes: FleetAgentVersionAttributes, optional + + :param id: Unique identifier for the Agent version (same as version). + :type id: str + + :param type: The type of Agent version resource. + :type type: FleetAgentVersionResourceType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/fleet_agent_version_attributes.py b/src/datadog_api_client/v2/model/fleet_agent_version_attributes.py new file mode 100644 index 0000000000..1718673002 --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_agent_version_attributes.py @@ -0,0 +1,36 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class FleetAgentVersionAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "version": (str,), + } + + attribute_map = { + "version": "version", + } + + def __init__(self_, version: Union[str, UnsetType] = unset, **kwargs): + """ + + + :param version: The Agent version string. + :type version: str, optional + """ + if version is not unset: + kwargs["version"] = version + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/fleet_agent_version_resource_type.py b/src/datadog_api_client/v2/model/fleet_agent_version_resource_type.py new file mode 100644 index 0000000000..cd0b88c069 --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_agent_version_resource_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FleetAgentVersionResourceType(ModelSimple): + """ + The type of Agent version resource. + + :param value: If omitted defaults to "agent_version". Must be one of ["agent_version"]. + :type value: str + """ + + allowed_values = { + "agent_version", + } + AGENT_VERSION: ClassVar["FleetAgentVersionResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FleetAgentVersionResourceType.AGENT_VERSION = FleetAgentVersionResourceType("agent_version") diff --git a/src/datadog_api_client/v2/model/fleet_agent_versions_response.py b/src/datadog_api_client/v2/model/fleet_agent_versions_response.py new file mode 100644 index 0000000000..40013e2f2f --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_agent_versions_response.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_agent_version import FleetAgentVersion + + +class FleetAgentVersionsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_agent_version import FleetAgentVersion + + return { + "data": ([FleetAgentVersion],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[FleetAgentVersion], **kwargs): + """ + Response containing a list of available Agent versions. + + :param data: Array of available Agent versions. + :type data: [FleetAgentVersion] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/fleet_deployment_attributes.py b/src/datadog_api_client/v2/model/fleet_deployment_attributes.py index 9de69255d4..e0bf523e33 100644 --- a/src/datadog_api_client/v2/model/fleet_deployment_attributes.py +++ b/src/datadog_api_client/v2/model/fleet_deployment_attributes.py @@ -15,18 +15,24 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.fleet_deployment_operation import FleetDeploymentOperation + from datadog_api_client.v2.model.fleet_deployment_host import FleetDeploymentHost + from datadog_api_client.v2.model.fleet_deployment_package import FleetDeploymentPackage class FleetDeploymentAttributes(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.fleet_deployment_operation import FleetDeploymentOperation + from datadog_api_client.v2.model.fleet_deployment_host import FleetDeploymentHost + from datadog_api_client.v2.model.fleet_deployment_package import FleetDeploymentPackage return { "config_operations": ([FleetDeploymentOperation],), "estimated_end_time_unix": (int,), "filter_query": (str,), "high_level_status": (str,), + "hosts": ([FleetDeploymentHost],), + "packages": ([FleetDeploymentPackage],), "total_hosts": (int,), } @@ -35,6 +41,8 @@ def openapi_types(_): "estimated_end_time_unix": "estimated_end_time_unix", "filter_query": "filter_query", "high_level_status": "high_level_status", + "hosts": "hosts", + "packages": "packages", "total_hosts": "total_hosts", } @@ -44,6 +52,8 @@ def __init__( estimated_end_time_unix: Union[int, UnsetType] = unset, filter_query: Union[str, UnsetType] = unset, high_level_status: Union[str, UnsetType] = unset, + hosts: Union[List[FleetDeploymentHost], UnsetType] = unset, + packages: Union[List[FleetDeploymentPackage], UnsetType] = unset, total_hosts: Union[int, UnsetType] = unset, **kwargs, ): @@ -59,9 +69,18 @@ def __init__( :param filter_query: Query used to filter and select target hosts for the deployment. Uses the Datadog query syntax. :type filter_query: str, optional - :param high_level_status: Current high-level status of the deployment (for example, "pending", "running", "completed", "failed"). + :param high_level_status: Current high-level status of the deployment (for example, "pending", "running", + "completed", "failed"). :type high_level_status: str, optional + :param hosts: Paginated list of hosts in this deployment with their individual statuses. Only included + when fetching a single deployment by ID. Use the ``limit`` and ``page`` query parameters to + navigate through pages. Pagination metadata is included in the response ``meta.hosts`` field. + :type hosts: [FleetDeploymentHost], optional + + :param packages: List of packages to deploy to target hosts. Present only for package upgrade deployments. + :type packages: [FleetDeploymentPackage], optional + :param total_hosts: Total number of hosts targeted by this deployment. :type total_hosts: int, optional """ @@ -73,6 +92,10 @@ def __init__( kwargs["filter_query"] = filter_query if high_level_status is not unset: kwargs["high_level_status"] = high_level_status + if hosts is not unset: + kwargs["hosts"] = hosts + if packages is not unset: + kwargs["packages"] = packages if total_hosts is not unset: kwargs["total_hosts"] = total_hosts super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/fleet_deployment_configure_create.py b/src/datadog_api_client/v2/model/fleet_deployment_configure_create.py index 12d77a642b..f67b0c43f3 100644 --- a/src/datadog_api_client/v2/model/fleet_deployment_configure_create.py +++ b/src/datadog_api_client/v2/model/fleet_deployment_configure_create.py @@ -34,7 +34,7 @@ def openapi_types(_): def __init__(self_, attributes: FleetDeploymentConfigureAttributes, type: FleetDeploymentResourceType, **kwargs): """ - Data for creating a new deployment. + Data for creating a new configuration deployment. :param attributes: Attributes for creating a new configuration deployment. :type attributes: FleetDeploymentConfigureAttributes diff --git a/src/datadog_api_client/v2/model/fleet_deployment_configure_create_request.py b/src/datadog_api_client/v2/model/fleet_deployment_configure_create_request.py index c9e230e33c..38a65c0987 100644 --- a/src/datadog_api_client/v2/model/fleet_deployment_configure_create_request.py +++ b/src/datadog_api_client/v2/model/fleet_deployment_configure_create_request.py @@ -30,9 +30,9 @@ def openapi_types(_): def __init__(self_, data: FleetDeploymentConfigureCreate, **kwargs): """ - Request payload for creating a new deployment. + Request payload for creating a new configuration deployment. - :param data: Data for creating a new deployment. + :param data: Data for creating a new configuration deployment. :type data: FleetDeploymentConfigureCreate """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/fleet_deployment_host.py b/src/datadog_api_client/v2/model/fleet_deployment_host.py new file mode 100644 index 0000000000..0b09dd90f7 --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_deployment_host.py @@ -0,0 +1,70 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_deployment_host_package import FleetDeploymentHostPackage + + +class FleetDeploymentHost(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_deployment_host_package import FleetDeploymentHostPackage + + return { + "error": (str,), + "hostname": (str,), + "status": (str,), + "versions": ([FleetDeploymentHostPackage],), + } + + attribute_map = { + "error": "error", + "hostname": "hostname", + "status": "status", + "versions": "versions", + } + + def __init__( + self_, + error: Union[str, UnsetType] = unset, + hostname: Union[str, UnsetType] = unset, + status: Union[str, UnsetType] = unset, + versions: Union[List[FleetDeploymentHostPackage], UnsetType] = unset, + **kwargs, + ): + """ + A host that is part of a deployment with its current status. + + :param error: Error message if the deployment failed on this host. + :type error: str, optional + + :param hostname: The hostname of the agent. + :type hostname: str, optional + + :param status: Current deployment status for this specific host. + :type status: str, optional + + :param versions: List of packages and their versions currently installed on this host. + :type versions: [FleetDeploymentHostPackage], optional + """ + if error is not unset: + kwargs["error"] = error + if hostname is not unset: + kwargs["hostname"] = hostname + if status is not unset: + kwargs["status"] = status + if versions is not unset: + kwargs["versions"] = versions + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/fleet_deployment_host_package.py b/src/datadog_api_client/v2/model/fleet_deployment_host_package.py new file mode 100644 index 0000000000..ec413a4b1e --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_deployment_host_package.py @@ -0,0 +1,65 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class FleetDeploymentHostPackage(ModelNormal): + @cached_property + def openapi_types(_): + return { + "current_version": (str,), + "initial_version": (str,), + "package_name": (str,), + "target_version": (str,), + } + + attribute_map = { + "current_version": "current_version", + "initial_version": "initial_version", + "package_name": "package_name", + "target_version": "target_version", + } + + def __init__( + self_, + current_version: Union[str, UnsetType] = unset, + initial_version: Union[str, UnsetType] = unset, + package_name: Union[str, UnsetType] = unset, + target_version: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Package version information for a host, showing the initial version before deployment, + the target version to deploy, and the current version on the host. + + :param current_version: The current version of the package on the host. + :type current_version: str, optional + + :param initial_version: The initial version of the package on the host before the deployment started. + :type initial_version: str, optional + + :param package_name: The name of the package. + :type package_name: str, optional + + :param target_version: The target version that the deployment is attempting to install. + :type target_version: str, optional + """ + if current_version is not unset: + kwargs["current_version"] = current_version + if initial_version is not unset: + kwargs["initial_version"] = initial_version + if package_name is not unset: + kwargs["package_name"] = package_name + if target_version is not unset: + kwargs["target_version"] = target_version + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/fleet_deployment_hosts_page.py b/src/datadog_api_client/v2/model/fleet_deployment_hosts_page.py new file mode 100644 index 0000000000..d787cb9a3a --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_deployment_hosts_page.py @@ -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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class FleetDeploymentHostsPage(ModelNormal): + @cached_property + def openapi_types(_): + return { + "current_page": (int,), + "page_size": (int,), + "total_hosts": (int,), + "total_pages": (int,), + } + + attribute_map = { + "current_page": "current_page", + "page_size": "page_size", + "total_hosts": "total_hosts", + "total_pages": "total_pages", + } + + def __init__( + self_, + current_page: Union[int, UnsetType] = unset, + page_size: Union[int, UnsetType] = unset, + total_hosts: Union[int, UnsetType] = unset, + total_pages: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Pagination details for the list of hosts in a deployment. + + :param current_page: Current page index (zero-based). + :type current_page: int, optional + + :param page_size: Number of hosts returned per page. + :type page_size: int, optional + + :param total_hosts: Total number of hosts in this deployment. + :type total_hosts: int, optional + + :param total_pages: Total number of pages available. + :type total_pages: int, optional + """ + if current_page is not unset: + kwargs["current_page"] = current_page + if page_size is not unset: + kwargs["page_size"] = page_size + if total_hosts is not unset: + kwargs["total_hosts"] = total_hosts + if total_pages is not unset: + kwargs["total_pages"] = total_pages + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/fleet_deployment_operation.py b/src/datadog_api_client/v2/model/fleet_deployment_operation.py index 07e6203962..ae00c21851 100644 --- a/src/datadog_api_client/v2/model/fleet_deployment_operation.py +++ b/src/datadog_api_client/v2/model/fleet_deployment_operation.py @@ -72,8 +72,8 @@ def __init__( :param patch: 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. + The structure must match the target configuration file format (for example, YAML structure + for Datadog Agent config). Not applicable when using the ``delete`` operation. :type patch: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional """ if patch is not unset: diff --git a/src/datadog_api_client/v2/model/fleet_deployment_package.py b/src/datadog_api_client/v2/model/fleet_deployment_package.py new file mode 100644 index 0000000000..bc349114a2 --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_deployment_package.py @@ -0,0 +1,39 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class FleetDeploymentPackage(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + "version": (str,), + } + + attribute_map = { + "name": "name", + "version": "version", + } + + def __init__(self_, name: str, version: str, **kwargs): + """ + A package and its target version for deployment. + + :param name: The name of the package to deploy. + :type name: str + + :param version: The target version of the package to deploy. + :type version: str + """ + super().__init__(kwargs) + + self_.name = name + self_.version = version diff --git a/src/datadog_api_client/v2/model/fleet_deployment_package_upgrade_attributes.py b/src/datadog_api_client/v2/model/fleet_deployment_package_upgrade_attributes.py new file mode 100644 index 0000000000..038e298efc --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_deployment_package_upgrade_attributes.py @@ -0,0 +1,51 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_deployment_package import FleetDeploymentPackage + + +class FleetDeploymentPackageUpgradeAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_deployment_package import FleetDeploymentPackage + + return { + "filter_query": (str,), + "target_packages": ([FleetDeploymentPackage],), + } + + attribute_map = { + "filter_query": "filter_query", + "target_packages": "target_packages", + } + + def __init__( + self_, target_packages: List[FleetDeploymentPackage], filter_query: Union[str, UnsetType] = unset, **kwargs + ): + """ + Attributes for creating a new package upgrade deployment. + + :param filter_query: Query used to filter and select target hosts for the deployment. Uses the Datadog query syntax. + :type filter_query: str, optional + + :param target_packages: List of packages and their target versions to deploy to the selected hosts. + :type target_packages: [FleetDeploymentPackage] + """ + if filter_query is not unset: + kwargs["filter_query"] = filter_query + super().__init__(kwargs) + + self_.target_packages = target_packages diff --git a/src/datadog_api_client/v2/model/fleet_deployment_package_upgrade_create.py b/src/datadog_api_client/v2/model/fleet_deployment_package_upgrade_create.py new file mode 100644 index 0000000000..35425688af --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_deployment_package_upgrade_create.py @@ -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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_deployment_package_upgrade_attributes import ( + FleetDeploymentPackageUpgradeAttributes, + ) + from datadog_api_client.v2.model.fleet_deployment_resource_type import FleetDeploymentResourceType + + +class FleetDeploymentPackageUpgradeCreate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_deployment_package_upgrade_attributes import ( + FleetDeploymentPackageUpgradeAttributes, + ) + from datadog_api_client.v2.model.fleet_deployment_resource_type import FleetDeploymentResourceType + + return { + "attributes": (FleetDeploymentPackageUpgradeAttributes,), + "type": (FleetDeploymentResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, attributes: FleetDeploymentPackageUpgradeAttributes, type: FleetDeploymentResourceType, **kwargs + ): + """ + Data for creating a new package upgrade deployment. + + :param attributes: Attributes for creating a new package upgrade deployment. + :type attributes: FleetDeploymentPackageUpgradeAttributes + + :param type: The type of deployment resource. + :type type: FleetDeploymentResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/fleet_deployment_package_upgrade_create_request.py b/src/datadog_api_client/v2/model/fleet_deployment_package_upgrade_create_request.py new file mode 100644 index 0000000000..3d77206d20 --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_deployment_package_upgrade_create_request.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_deployment_package_upgrade_create import FleetDeploymentPackageUpgradeCreate + + +class FleetDeploymentPackageUpgradeCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_deployment_package_upgrade_create import ( + FleetDeploymentPackageUpgradeCreate, + ) + + return { + "data": (FleetDeploymentPackageUpgradeCreate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: FleetDeploymentPackageUpgradeCreate, **kwargs): + """ + Request payload for creating a new package upgrade deployment. + + :param data: Data for creating a new package upgrade deployment. + :type data: FleetDeploymentPackageUpgradeCreate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/fleet_deployment_response.py b/src/datadog_api_client/v2/model/fleet_deployment_response.py index 6639df4a16..98c411002f 100644 --- a/src/datadog_api_client/v2/model/fleet_deployment_response.py +++ b/src/datadog_api_client/v2/model/fleet_deployment_response.py @@ -15,28 +15,42 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.fleet_deployment import FleetDeployment + from datadog_api_client.v2.model.fleet_deployment_response_meta import FleetDeploymentResponseMeta class FleetDeploymentResponse(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.fleet_deployment import FleetDeployment + from datadog_api_client.v2.model.fleet_deployment_response_meta import FleetDeploymentResponseMeta return { "data": (FleetDeployment,), + "meta": (FleetDeploymentResponseMeta,), } attribute_map = { "data": "data", + "meta": "meta", } - def __init__(self_, data: Union[FleetDeployment, UnsetType] = unset, **kwargs): + def __init__( + self_, + data: Union[FleetDeployment, UnsetType] = unset, + meta: Union[FleetDeploymentResponseMeta, UnsetType] = unset, + **kwargs, + ): """ Response containing a single deployment. :param data: A deployment that defines automated configuration changes for a fleet of hosts. :type data: FleetDeployment, optional + + :param meta: Metadata for a single deployment response, including pagination information for hosts. + :type meta: FleetDeploymentResponseMeta, optional """ if data is not unset: kwargs["data"] = data + if meta is not unset: + kwargs["meta"] = meta super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/fleet_deployment_response_meta.py b/src/datadog_api_client/v2/model/fleet_deployment_response_meta.py new file mode 100644 index 0000000000..a3d390bba6 --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_deployment_response_meta.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_deployment_hosts_page import FleetDeploymentHostsPage + + +class FleetDeploymentResponseMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_deployment_hosts_page import FleetDeploymentHostsPage + + return { + "hosts": (FleetDeploymentHostsPage,), + } + + attribute_map = { + "hosts": "hosts", + } + + def __init__(self_, hosts: Union[FleetDeploymentHostsPage, UnsetType] = unset, **kwargs): + """ + Metadata for a single deployment response, including pagination information for hosts. + + :param hosts: Pagination details for the list of hosts in a deployment. + :type hosts: FleetDeploymentHostsPage, optional + """ + if hosts is not unset: + kwargs["hosts"] = hosts + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/fleet_schedule.py b/src/datadog_api_client/v2/model/fleet_schedule.py new file mode 100644 index 0000000000..e641993d5e --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_schedule.py @@ -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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_schedule_attributes import FleetScheduleAttributes + from datadog_api_client.v2.model.fleet_schedule_resource_type import FleetScheduleResourceType + + +class FleetSchedule(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_schedule_attributes import FleetScheduleAttributes + from datadog_api_client.v2.model.fleet_schedule_resource_type import FleetScheduleResourceType + + return { + "attributes": (FleetScheduleAttributes,), + "id": (str,), + "type": (FleetScheduleResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: FleetScheduleAttributes, id: str, type: FleetScheduleResourceType, **kwargs): + """ + A schedule that automatically creates deployments based on a recurrence rule. + + :param attributes: Attributes of a schedule in the response. + :type attributes: FleetScheduleAttributes + + :param id: Unique identifier for the schedule. + :type id: str + + :param type: The type of schedule resource. + :type type: FleetScheduleResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/fleet_schedule_attributes.py b/src/datadog_api_client/v2/model/fleet_schedule_attributes.py new file mode 100644 index 0000000000..db0415b51b --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_schedule_attributes.py @@ -0,0 +1,128 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_schedule_recurrence_rule import FleetScheduleRecurrenceRule + from datadog_api_client.v2.model.fleet_schedule_status import FleetScheduleStatus + + +class FleetScheduleAttributes(ModelNormal): + validations = { + "version_to_latest": { + "inclusive_maximum": 2, + "inclusive_minimum": 0, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_schedule_recurrence_rule import FleetScheduleRecurrenceRule + from datadog_api_client.v2.model.fleet_schedule_status import FleetScheduleStatus + + return { + "created_at_unix": (int,), + "created_by": (str,), + "name": (str,), + "query": (str,), + "rule": (FleetScheduleRecurrenceRule,), + "status": (FleetScheduleStatus,), + "updated_at_unix": (int,), + "updated_by": (str,), + "version_to_latest": (int,), + } + + attribute_map = { + "created_at_unix": "created_at_unix", + "created_by": "created_by", + "name": "name", + "query": "query", + "rule": "rule", + "status": "status", + "updated_at_unix": "updated_at_unix", + "updated_by": "updated_by", + "version_to_latest": "version_to_latest", + } + + def __init__( + self_, + created_at_unix: Union[int, UnsetType] = unset, + created_by: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + query: Union[str, UnsetType] = unset, + rule: Union[FleetScheduleRecurrenceRule, UnsetType] = unset, + status: Union[FleetScheduleStatus, UnsetType] = unset, + updated_at_unix: Union[int, UnsetType] = unset, + updated_by: Union[str, UnsetType] = unset, + version_to_latest: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of a schedule in the response. + + :param created_at_unix: Unix timestamp (seconds since epoch) when the schedule was created. + :type created_at_unix: int, optional + + :param created_by: User handle of the person who created the schedule. + :type created_by: str, optional + + :param name: Human-readable name for the schedule. + :type name: str, optional + + :param query: Query used to filter and select target hosts for scheduled deployments. Uses the Datadog query syntax. + :type query: str, optional + + :param rule: Defines the recurrence pattern for the schedule. Specifies when deployments should be + automatically triggered based on maintenance windows. + :type rule: FleetScheduleRecurrenceRule, optional + + :param status: The status of the schedule. + + * ``active`` : The schedule is active and will create deployments according to its recurrence rule. + * ``inactive`` : The schedule is inactive and will not create any deployments. + :type status: FleetScheduleStatus, optional + + :param updated_at_unix: Unix timestamp (seconds since epoch) when the schedule was last updated. + :type updated_at_unix: int, optional + + :param updated_by: User handle of the person who last updated the schedule. + :type updated_by: str, optional + + :param version_to_latest: Number of major versions behind the latest to target for upgrades. + + * 0: Always upgrade to the latest version + * 1: Upgrade to latest minus 1 major version + * 2: Upgrade to latest minus 2 major versions + Maximum value is 2. + :type version_to_latest: int, optional + """ + if created_at_unix is not unset: + kwargs["created_at_unix"] = created_at_unix + if created_by is not unset: + kwargs["created_by"] = created_by + if name is not unset: + kwargs["name"] = name + if query is not unset: + kwargs["query"] = query + if rule is not unset: + kwargs["rule"] = rule + if status is not unset: + kwargs["status"] = status + if updated_at_unix is not unset: + kwargs["updated_at_unix"] = updated_at_unix + if updated_by is not unset: + kwargs["updated_by"] = updated_by + if version_to_latest is not unset: + kwargs["version_to_latest"] = version_to_latest + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/fleet_schedule_create.py b/src/datadog_api_client/v2/model/fleet_schedule_create.py new file mode 100644 index 0000000000..072e373f7d --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_schedule_create.py @@ -0,0 +1,48 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_schedule_create_attributes import FleetScheduleCreateAttributes + from datadog_api_client.v2.model.fleet_schedule_resource_type import FleetScheduleResourceType + + +class FleetScheduleCreate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_schedule_create_attributes import FleetScheduleCreateAttributes + from datadog_api_client.v2.model.fleet_schedule_resource_type import FleetScheduleResourceType + + return { + "attributes": (FleetScheduleCreateAttributes,), + "type": (FleetScheduleResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: FleetScheduleCreateAttributes, type: FleetScheduleResourceType, **kwargs): + """ + Data for creating a new schedule. + + :param attributes: Attributes for creating a new schedule. + :type attributes: FleetScheduleCreateAttributes + + :param type: The type of schedule resource. + :type type: FleetScheduleResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/fleet_schedule_create_attributes.py b/src/datadog_api_client/v2/model/fleet_schedule_create_attributes.py new file mode 100644 index 0000000000..77db9a0060 --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_schedule_create_attributes.py @@ -0,0 +1,94 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_schedule_recurrence_rule import FleetScheduleRecurrenceRule + from datadog_api_client.v2.model.fleet_schedule_status import FleetScheduleStatus + + +class FleetScheduleCreateAttributes(ModelNormal): + validations = { + "version_to_latest": { + "inclusive_maximum": 2, + "inclusive_minimum": 0, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_schedule_recurrence_rule import FleetScheduleRecurrenceRule + from datadog_api_client.v2.model.fleet_schedule_status import FleetScheduleStatus + + return { + "name": (str,), + "query": (str,), + "rule": (FleetScheduleRecurrenceRule,), + "status": (FleetScheduleStatus,), + "version_to_latest": (int,), + } + + attribute_map = { + "name": "name", + "query": "query", + "rule": "rule", + "status": "status", + "version_to_latest": "version_to_latest", + } + + def __init__( + self_, + name: str, + query: str, + rule: FleetScheduleRecurrenceRule, + status: Union[FleetScheduleStatus, UnsetType] = unset, + version_to_latest: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for creating a new schedule. + + :param name: Human-readable name for the schedule. + :type name: str + + :param query: Query used to filter and select target hosts for scheduled deployments. Uses the Datadog query syntax. + :type query: str + + :param rule: Defines the recurrence pattern for the schedule. Specifies when deployments should be + automatically triggered based on maintenance windows. + :type rule: FleetScheduleRecurrenceRule + + :param status: The status of the schedule. + + * ``active`` : The schedule is active and will create deployments according to its recurrence rule. + * ``inactive`` : The schedule is inactive and will not create any deployments. + :type status: FleetScheduleStatus, optional + + :param version_to_latest: Number of major versions behind the latest to target for upgrades. + + * 0: Always upgrade to the latest version (default) + * 1: Upgrade to latest minus 1 major version + * 2: Upgrade to latest minus 2 major versions + Maximum value is 2. + :type version_to_latest: int, optional + """ + if status is not unset: + kwargs["status"] = status + if version_to_latest is not unset: + kwargs["version_to_latest"] = version_to_latest + super().__init__(kwargs) + + self_.name = name + self_.query = query + self_.rule = rule diff --git a/src/datadog_api_client/v2/model/fleet_schedule_create_request.py b/src/datadog_api_client/v2/model/fleet_schedule_create_request.py new file mode 100644 index 0000000000..b8c959dd71 --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_schedule_create_request.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_schedule_create import FleetScheduleCreate + + +class FleetScheduleCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_schedule_create import FleetScheduleCreate + + return { + "data": (FleetScheduleCreate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: FleetScheduleCreate, **kwargs): + """ + Request payload for creating a new schedule. + + :param data: Data for creating a new schedule. + :type data: FleetScheduleCreate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/fleet_schedule_patch.py b/src/datadog_api_client/v2/model/fleet_schedule_patch.py new file mode 100644 index 0000000000..212bbcbd4b --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_schedule_patch.py @@ -0,0 +1,56 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_schedule_patch_attributes import FleetSchedulePatchAttributes + from datadog_api_client.v2.model.fleet_schedule_resource_type import FleetScheduleResourceType + + +class FleetSchedulePatch(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_schedule_patch_attributes import FleetSchedulePatchAttributes + from datadog_api_client.v2.model.fleet_schedule_resource_type import FleetScheduleResourceType + + return { + "attributes": (FleetSchedulePatchAttributes,), + "type": (FleetScheduleResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + type: FleetScheduleResourceType, + attributes: Union[FleetSchedulePatchAttributes, UnsetType] = unset, + **kwargs, + ): + """ + Data for partially updating a schedule. + + :param attributes: Attributes for partially updating a schedule. All fields are optional. + :type attributes: FleetSchedulePatchAttributes, optional + + :param type: The type of schedule resource. + :type type: FleetScheduleResourceType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/fleet_schedule_patch_attributes.py b/src/datadog_api_client/v2/model/fleet_schedule_patch_attributes.py new file mode 100644 index 0000000000..43c8ae8ca1 --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_schedule_patch_attributes.py @@ -0,0 +1,96 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_schedule_recurrence_rule import FleetScheduleRecurrenceRule + from datadog_api_client.v2.model.fleet_schedule_status import FleetScheduleStatus + + +class FleetSchedulePatchAttributes(ModelNormal): + validations = { + "version_to_latest": { + "inclusive_maximum": 2, + "inclusive_minimum": 0, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_schedule_recurrence_rule import FleetScheduleRecurrenceRule + from datadog_api_client.v2.model.fleet_schedule_status import FleetScheduleStatus + + return { + "name": (str,), + "query": (str,), + "rule": (FleetScheduleRecurrenceRule,), + "status": (FleetScheduleStatus,), + "version_to_latest": (int,), + } + + attribute_map = { + "name": "name", + "query": "query", + "rule": "rule", + "status": "status", + "version_to_latest": "version_to_latest", + } + + def __init__( + self_, + name: Union[str, UnsetType] = unset, + query: Union[str, UnsetType] = unset, + rule: Union[FleetScheduleRecurrenceRule, UnsetType] = unset, + status: Union[FleetScheduleStatus, UnsetType] = unset, + version_to_latest: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for partially updating a schedule. All fields are optional. + + :param name: Human-readable name for the schedule. + :type name: str, optional + + :param query: Query used to filter and select target hosts for scheduled deployments. Uses the Datadog query syntax. + :type query: str, optional + + :param rule: Defines the recurrence pattern for the schedule. Specifies when deployments should be + automatically triggered based on maintenance windows. + :type rule: FleetScheduleRecurrenceRule, optional + + :param status: The status of the schedule. + + * ``active`` : The schedule is active and will create deployments according to its recurrence rule. + * ``inactive`` : The schedule is inactive and will not create any deployments. + :type status: FleetScheduleStatus, optional + + :param version_to_latest: Number of major versions behind the latest to target for upgrades. + + * 0: Always upgrade to the latest version + * 1: Upgrade to latest minus 1 major version + * 2: Upgrade to latest minus 2 major versions + Maximum value is 2. + :type version_to_latest: int, optional + """ + if name is not unset: + kwargs["name"] = name + if query is not unset: + kwargs["query"] = query + if rule is not unset: + kwargs["rule"] = rule + if status is not unset: + kwargs["status"] = status + if version_to_latest is not unset: + kwargs["version_to_latest"] = version_to_latest + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/fleet_schedule_patch_request.py b/src/datadog_api_client/v2/model/fleet_schedule_patch_request.py new file mode 100644 index 0000000000..9e37d61373 --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_schedule_patch_request.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_schedule_patch import FleetSchedulePatch + + +class FleetSchedulePatchRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_schedule_patch import FleetSchedulePatch + + return { + "data": (FleetSchedulePatch,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: FleetSchedulePatch, **kwargs): + """ + Request payload for partially updating a schedule. + + :param data: Data for partially updating a schedule. + :type data: FleetSchedulePatch + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/fleet_schedule_recurrence_rule.py b/src/datadog_api_client/v2/model/fleet_schedule_recurrence_rule.py new file mode 100644 index 0000000000..0d46fc79e0 --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_schedule_recurrence_rule.py @@ -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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class FleetScheduleRecurrenceRule(ModelNormal): + @cached_property + def openapi_types(_): + return { + "days_of_week": ([str],), + "maintenance_window_duration": (int,), + "start_maintenance_window": (str,), + "timezone": (str,), + } + + attribute_map = { + "days_of_week": "days_of_week", + "maintenance_window_duration": "maintenance_window_duration", + "start_maintenance_window": "start_maintenance_window", + "timezone": "timezone", + } + + def __init__( + self_, + days_of_week: List[str], + maintenance_window_duration: int, + start_maintenance_window: str, + timezone: str, + **kwargs, + ): + """ + Defines the recurrence pattern for the schedule. Specifies when deployments should be + automatically triggered based on maintenance windows. + + :param days_of_week: List of days of the week when the schedule should trigger. Valid values are: + "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun". + :type days_of_week: [str] + + :param maintenance_window_duration: Duration of the maintenance window in minutes. + :type maintenance_window_duration: int + + :param start_maintenance_window: Start time of the maintenance window in 24-hour clock format (HH:MM). + Deployments will be triggered at this time on the specified days. + :type start_maintenance_window: str + + :param timezone: Timezone for the schedule in IANA Time Zone Database format (e.g., "America/New_York", "UTC"). + :type timezone: str + """ + super().__init__(kwargs) + + self_.days_of_week = days_of_week + self_.maintenance_window_duration = maintenance_window_duration + self_.start_maintenance_window = start_maintenance_window + self_.timezone = timezone diff --git a/src/datadog_api_client/v2/model/fleet_schedule_resource_type.py b/src/datadog_api_client/v2/model/fleet_schedule_resource_type.py new file mode 100644 index 0000000000..0eeb4b2045 --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_schedule_resource_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FleetScheduleResourceType(ModelSimple): + """ + The type of schedule resource. + + :param value: If omitted defaults to "schedule". Must be one of ["schedule"]. + :type value: str + """ + + allowed_values = { + "schedule", + } + SCHEDULE: ClassVar["FleetScheduleResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FleetScheduleResourceType.SCHEDULE = FleetScheduleResourceType("schedule") diff --git a/src/datadog_api_client/v2/model/fleet_schedule_response.py b/src/datadog_api_client/v2/model/fleet_schedule_response.py new file mode 100644 index 0000000000..7d4aed9943 --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_schedule_response.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_schedule import FleetSchedule + + +class FleetScheduleResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_schedule import FleetSchedule + + return { + "data": (FleetSchedule,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[FleetSchedule, UnsetType] = unset, **kwargs): + """ + Response containing a single schedule. + + :param data: A schedule that automatically creates deployments based on a recurrence rule. + :type data: FleetSchedule, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/fleet_schedule_status.py b/src/datadog_api_client/v2/model/fleet_schedule_status.py new file mode 100644 index 0000000000..c85aa1f6b7 --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_schedule_status.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FleetScheduleStatus(ModelSimple): + """ + The status of the schedule. + - `active`: The schedule is active and will create deployments according to its recurrence rule. + - `inactive`: The schedule is inactive and will not create any deployments. + + :param value: Must be one of ["active", "inactive"]. + :type value: str + """ + + allowed_values = { + "active", + "inactive", + } + ACTIVE: ClassVar["FleetScheduleStatus"] + INACTIVE: ClassVar["FleetScheduleStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FleetScheduleStatus.ACTIVE = FleetScheduleStatus("active") +FleetScheduleStatus.INACTIVE = FleetScheduleStatus("inactive") diff --git a/src/datadog_api_client/v2/model/fleet_schedules_response.py b/src/datadog_api_client/v2/model/fleet_schedules_response.py new file mode 100644 index 0000000000..845b7d2a9e --- /dev/null +++ b/src/datadog_api_client/v2/model/fleet_schedules_response.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.fleet_schedule import FleetSchedule + + +class FleetSchedulesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.fleet_schedule import FleetSchedule + + return { + "data": ([FleetSchedule],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[FleetSchedule], **kwargs): + """ + Response containing a list of schedules. + + :param data: Array of schedules. + :type data: [FleetSchedule] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index c9785208a8..96bc75cab8 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1661,18 +1661,47 @@ from datadog_api_client.v2.model.flaky_tests_search_response import FlakyTestsSearchResponse from datadog_api_client.v2.model.flaky_tests_search_response_meta import FlakyTestsSearchResponseMeta from datadog_api_client.v2.model.flaky_tests_search_sort import FlakyTestsSearchSort +from datadog_api_client.v2.model.fleet_agent_version import FleetAgentVersion +from datadog_api_client.v2.model.fleet_agent_version_attributes import FleetAgentVersionAttributes +from datadog_api_client.v2.model.fleet_agent_version_resource_type import FleetAgentVersionResourceType +from datadog_api_client.v2.model.fleet_agent_versions_response import FleetAgentVersionsResponse from datadog_api_client.v2.model.fleet_deployment import FleetDeployment from datadog_api_client.v2.model.fleet_deployment_attributes import FleetDeploymentAttributes from datadog_api_client.v2.model.fleet_deployment_configure_attributes import FleetDeploymentConfigureAttributes from datadog_api_client.v2.model.fleet_deployment_configure_create import FleetDeploymentConfigureCreate from datadog_api_client.v2.model.fleet_deployment_configure_create_request import FleetDeploymentConfigureCreateRequest from datadog_api_client.v2.model.fleet_deployment_file_op import FleetDeploymentFileOp +from datadog_api_client.v2.model.fleet_deployment_host import FleetDeploymentHost +from datadog_api_client.v2.model.fleet_deployment_host_package import FleetDeploymentHostPackage +from datadog_api_client.v2.model.fleet_deployment_hosts_page import FleetDeploymentHostsPage from datadog_api_client.v2.model.fleet_deployment_operation import FleetDeploymentOperation +from datadog_api_client.v2.model.fleet_deployment_package import FleetDeploymentPackage +from datadog_api_client.v2.model.fleet_deployment_package_upgrade_attributes import ( + FleetDeploymentPackageUpgradeAttributes, +) +from datadog_api_client.v2.model.fleet_deployment_package_upgrade_create import FleetDeploymentPackageUpgradeCreate +from datadog_api_client.v2.model.fleet_deployment_package_upgrade_create_request import ( + FleetDeploymentPackageUpgradeCreateRequest, +) from datadog_api_client.v2.model.fleet_deployment_resource_type import FleetDeploymentResourceType from datadog_api_client.v2.model.fleet_deployment_response import FleetDeploymentResponse +from datadog_api_client.v2.model.fleet_deployment_response_meta import FleetDeploymentResponseMeta from datadog_api_client.v2.model.fleet_deployments_page import FleetDeploymentsPage from datadog_api_client.v2.model.fleet_deployments_response import FleetDeploymentsResponse from datadog_api_client.v2.model.fleet_deployments_response_meta import FleetDeploymentsResponseMeta +from datadog_api_client.v2.model.fleet_schedule import FleetSchedule +from datadog_api_client.v2.model.fleet_schedule_attributes import FleetScheduleAttributes +from datadog_api_client.v2.model.fleet_schedule_create import FleetScheduleCreate +from datadog_api_client.v2.model.fleet_schedule_create_attributes import FleetScheduleCreateAttributes +from datadog_api_client.v2.model.fleet_schedule_create_request import FleetScheduleCreateRequest +from datadog_api_client.v2.model.fleet_schedule_patch import FleetSchedulePatch +from datadog_api_client.v2.model.fleet_schedule_patch_attributes import FleetSchedulePatchAttributes +from datadog_api_client.v2.model.fleet_schedule_patch_request import FleetSchedulePatchRequest +from datadog_api_client.v2.model.fleet_schedule_recurrence_rule import FleetScheduleRecurrenceRule +from datadog_api_client.v2.model.fleet_schedule_resource_type import FleetScheduleResourceType +from datadog_api_client.v2.model.fleet_schedule_response import FleetScheduleResponse +from datadog_api_client.v2.model.fleet_schedule_status import FleetScheduleStatus +from datadog_api_client.v2.model.fleet_schedules_response import FleetSchedulesResponse from datadog_api_client.v2.model.formula_limit import FormulaLimit from datadog_api_client.v2.model.framework_handle_and_version_response_data import FrameworkHandleAndVersionResponseData from datadog_api_client.v2.model.freshservice_api_key import FreshserviceAPIKey @@ -6000,18 +6029,43 @@ "FlakyTestsSearchResponse", "FlakyTestsSearchResponseMeta", "FlakyTestsSearchSort", + "FleetAgentVersion", + "FleetAgentVersionAttributes", + "FleetAgentVersionResourceType", + "FleetAgentVersionsResponse", "FleetDeployment", "FleetDeploymentAttributes", "FleetDeploymentConfigureAttributes", "FleetDeploymentConfigureCreate", "FleetDeploymentConfigureCreateRequest", "FleetDeploymentFileOp", + "FleetDeploymentHost", + "FleetDeploymentHostPackage", + "FleetDeploymentHostsPage", "FleetDeploymentOperation", + "FleetDeploymentPackage", + "FleetDeploymentPackageUpgradeAttributes", + "FleetDeploymentPackageUpgradeCreate", + "FleetDeploymentPackageUpgradeCreateRequest", "FleetDeploymentResourceType", "FleetDeploymentResponse", + "FleetDeploymentResponseMeta", "FleetDeploymentsPage", "FleetDeploymentsResponse", "FleetDeploymentsResponseMeta", + "FleetSchedule", + "FleetScheduleAttributes", + "FleetScheduleCreate", + "FleetScheduleCreateAttributes", + "FleetScheduleCreateRequest", + "FleetSchedulePatch", + "FleetSchedulePatchAttributes", + "FleetSchedulePatchRequest", + "FleetScheduleRecurrenceRule", + "FleetScheduleResourceType", + "FleetScheduleResponse", + "FleetScheduleStatus", + "FleetSchedulesResponse", "FormulaLimit", "FrameworkHandleAndVersionResponseData", "FreshserviceAPIKey", diff --git a/tests/v2/features/fleet_automation.feature b/tests/v2/features/fleet_automation.feature index 2e91b6e0a8..0024399c74 100644 --- a/tests/v2/features/fleet_automation.feature +++ b/tests/v2/features/fleet_automation.feature @@ -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 @@ -34,7 +39,7 @@ 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"}} @@ -42,7 +47,7 @@ Feature: Fleet Automation 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"}} @@ -50,7 +55,47 @@ Feature: Fleet Automation 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" @@ -58,13 +103,21 @@ Feature: Fleet Automation 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 @@ -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 @@ -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 diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 7c9df160aa..12852be0f2 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -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": [ { diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 1865379ddb..07c8d42748 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1,4 +1,10 @@ { + "ListFleetAgentVersions": { + "tag": "Fleet Automation", + "undo": { + "type": "safe" + } + }, "ListFleetDeployments": { "tag": "Fleet Automation", "undo": { @@ -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": { @@ -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": {