From 526eb740783416cb0d36fb59e5654de21c820a49 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 4 Nov 2025 09:57:06 +0000 Subject: [PATCH] Regenerate client from commit 137b71e of spec repo --- .generator/schemas/v2/openapi.yaml | 1080 ++++++++++- .../CreateFleetDeploymentConfigure.java | 2 +- .../CreateFleetDeploymentUpgrade.java | 45 + .../fleet-automation/CreateFleetSchedule.java | 50 + .../fleet-automation/DeleteFleetSchedule.java | 23 + .../fleet-automation/GetFleetDeployment.java | 7 +- .../GetFleetDeployment_1482493803.java | 28 + .../v2/fleet-automation/GetFleetSchedule.java | 25 + .../ListFleetAgentVersions.java | 25 + .../fleet-automation/ListFleetSchedules.java | 25 + .../TriggerFleetSchedule.java | 26 + .../fleet-automation/UpdateFleetSchedule.java | 50 + .../com/datadog/api/client/ApiClient.java | 8 + .../api/client/v2/api/FleetAutomationApi.java | 1687 +++++++++++++++-- .../client/v2/model/FleetAgentVersion.java | 207 ++ .../v2/model/FleetAgentVersionAttributes.java | 136 ++ .../model/FleetAgentVersionResourceType.java | 57 + .../v2/model/FleetAgentVersionsResponse.java | 155 ++ .../v2/model/FleetDeploymentAttributes.java | 83 + .../model/FleetDeploymentConfigureCreate.java | 2 +- ...FleetDeploymentConfigureCreateRequest.java | 4 +- .../client/v2/model/FleetDeploymentHost.java | 232 +++ .../v2/model/FleetDeploymentHostPackage.java | 223 +++ .../v2/model/FleetDeploymentHostsPage.java | 218 +++ .../v2/model/FleetDeploymentPackage.java | 173 ++ ...eetDeploymentPackageUpgradeAttributes.java | 190 ++ .../FleetDeploymentPackageUpgradeCreate.java | 184 ++ ...DeploymentPackageUpgradeCreateRequest.java | 150 ++ .../v2/model/FleetDeploymentResponse.java | 34 +- .../v2/model/FleetDeploymentResponseMeta.java | 137 ++ .../api/client/v2/model/FleetSchedule.java | 209 ++ .../v2/model/FleetScheduleAttributes.java | 374 ++++ .../client/v2/model/FleetScheduleCreate.java | 181 ++ .../model/FleetScheduleCreateAttributes.java | 268 +++ .../v2/model/FleetScheduleCreateRequest.java | 146 ++ .../client/v2/model/FleetSchedulePatch.java | 178 ++ .../model/FleetSchedulePatchAttributes.java | 257 +++ .../v2/model/FleetSchedulePatchRequest.java | 146 ++ .../v2/model/FleetScheduleRecurrenceRule.java | 256 +++ .../v2/model/FleetScheduleResourceType.java | 56 + .../v2/model/FleetScheduleResponse.java | 136 ++ .../client/v2/model/FleetScheduleStatus.java | 60 + .../v2/model/FleetSchedulesResponse.java | 154 ++ .../client/v2/api/fleet_automation.feature | 202 +- .../com/datadog/api/client/v2/api/given.json | 26 + .../com/datadog/api/client/v2/api/undo.json | 69 + 46 files changed, 7788 insertions(+), 196 deletions(-) create mode 100644 examples/v2/fleet-automation/CreateFleetDeploymentUpgrade.java create mode 100644 examples/v2/fleet-automation/CreateFleetSchedule.java create mode 100644 examples/v2/fleet-automation/DeleteFleetSchedule.java create mode 100644 examples/v2/fleet-automation/GetFleetDeployment_1482493803.java create mode 100644 examples/v2/fleet-automation/GetFleetSchedule.java create mode 100644 examples/v2/fleet-automation/ListFleetAgentVersions.java create mode 100644 examples/v2/fleet-automation/ListFleetSchedules.java create mode 100644 examples/v2/fleet-automation/TriggerFleetSchedule.java create mode 100644 examples/v2/fleet-automation/UpdateFleetSchedule.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetAgentVersion.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetAgentVersionAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetAgentVersionResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetAgentVersionsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetDeploymentHost.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetDeploymentHostPackage.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetDeploymentHostsPage.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackage.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackageUpgradeAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackageUpgradeCreate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackageUpgradeCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetDeploymentResponseMeta.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetSchedule.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetScheduleAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetScheduleCreate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetScheduleCreateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetScheduleCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetSchedulePatch.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetSchedulePatchAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetSchedulePatchRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetScheduleRecurrenceRule.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetScheduleResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetScheduleResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetScheduleStatus.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FleetSchedulesResponse.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6bc9597abb6..65fad375253 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/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.java b/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.java index b47b0a0c030..53e4db2eed3 100644 --- a/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.java +++ b/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.java @@ -1,4 +1,4 @@ -// Create a deployment returns "CREATED" response +// Create a configuration deployment returns "CREATED" response import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; diff --git a/examples/v2/fleet-automation/CreateFleetDeploymentUpgrade.java b/examples/v2/fleet-automation/CreateFleetDeploymentUpgrade.java new file mode 100644 index 00000000000..d027611444d --- /dev/null +++ b/examples/v2/fleet-automation/CreateFleetDeploymentUpgrade.java @@ -0,0 +1,45 @@ +// Upgrade hosts returns "CREATED" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.FleetAutomationApi; +import com.datadog.api.client.v2.model.FleetDeploymentPackage; +import com.datadog.api.client.v2.model.FleetDeploymentPackageUpgradeAttributes; +import com.datadog.api.client.v2.model.FleetDeploymentPackageUpgradeCreate; +import com.datadog.api.client.v2.model.FleetDeploymentPackageUpgradeCreateRequest; +import com.datadog.api.client.v2.model.FleetDeploymentResourceType; +import com.datadog.api.client.v2.model.FleetDeploymentResponse; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createFleetDeploymentUpgrade", true); + FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient); + + FleetDeploymentPackageUpgradeCreateRequest body = + new FleetDeploymentPackageUpgradeCreateRequest() + .data( + new FleetDeploymentPackageUpgradeCreate() + .attributes( + new FleetDeploymentPackageUpgradeAttributes() + .filterQuery("env:prod AND service:web") + .targetPackages( + Collections.singletonList( + new FleetDeploymentPackage() + .name("datadog-agent") + .version("7.52.0")))) + .type(FleetDeploymentResourceType.DEPLOYMENT)); + + try { + FleetDeploymentResponse result = apiInstance.createFleetDeploymentUpgrade(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FleetAutomationApi#createFleetDeploymentUpgrade"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/fleet-automation/CreateFleetSchedule.java b/examples/v2/fleet-automation/CreateFleetSchedule.java new file mode 100644 index 00000000000..d31aa092696 --- /dev/null +++ b/examples/v2/fleet-automation/CreateFleetSchedule.java @@ -0,0 +1,50 @@ +// Create a schedule returns "CREATED" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.FleetAutomationApi; +import com.datadog.api.client.v2.model.FleetScheduleCreate; +import com.datadog.api.client.v2.model.FleetScheduleCreateAttributes; +import com.datadog.api.client.v2.model.FleetScheduleCreateRequest; +import com.datadog.api.client.v2.model.FleetScheduleRecurrenceRule; +import com.datadog.api.client.v2.model.FleetScheduleResourceType; +import com.datadog.api.client.v2.model.FleetScheduleResponse; +import com.datadog.api.client.v2.model.FleetScheduleStatus; +import java.util.Arrays; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createFleetSchedule", true); + FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient); + + FleetScheduleCreateRequest body = + new FleetScheduleCreateRequest() + .data( + new FleetScheduleCreate() + .attributes( + new FleetScheduleCreateAttributes() + .name("Weekly Production Agent Updates") + .query("env:prod AND service:web") + .rule( + new FleetScheduleRecurrenceRule() + .daysOfWeek(Arrays.asList("Mon", "Wed", "Fri")) + .maintenanceWindowDuration(1200L) + .startMaintenanceWindow("02:00") + .timezone("America/New_York")) + .status(FleetScheduleStatus.ACTIVE) + .versionToLatest(0L)) + .type(FleetScheduleResourceType.SCHEDULE)); + + try { + FleetScheduleResponse result = apiInstance.createFleetSchedule(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FleetAutomationApi#createFleetSchedule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/fleet-automation/DeleteFleetSchedule.java b/examples/v2/fleet-automation/DeleteFleetSchedule.java new file mode 100644 index 00000000000..3edd0fb2b6d --- /dev/null +++ b/examples/v2/fleet-automation/DeleteFleetSchedule.java @@ -0,0 +1,23 @@ +// Delete a schedule returns "Schedule successfully deleted." response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.FleetAutomationApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteFleetSchedule", true); + FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient); + + try { + apiInstance.deleteFleetSchedule("abc-def-ghi-123"); + } catch (ApiException e) { + System.err.println("Exception when calling FleetAutomationApi#deleteFleetSchedule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/fleet-automation/GetFleetDeployment.java b/examples/v2/fleet-automation/GetFleetDeployment.java index 1670a6eb6c7..1af01ef6ee3 100644 --- a/examples/v2/fleet-automation/GetFleetDeployment.java +++ b/examples/v2/fleet-automation/GetFleetDeployment.java @@ -1,4 +1,4 @@ -// Get a deployment by ID returns "OK" response +// Get a configuration deployment by ID returns "OK" response import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; @@ -11,11 +11,8 @@ public static void main(String[] args) { defaultClient.setUnstableOperationEnabled("v2.getFleetDeployment", true); FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient); - // there is a valid "deployment" in the system - String DEPLOYMENT_ID = System.getenv("DEPLOYMENT_ID"); - try { - FleetDeploymentResponse result = apiInstance.getFleetDeployment(DEPLOYMENT_ID); + FleetDeploymentResponse result = apiInstance.getFleetDeployment("abc-def-ghi"); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FleetAutomationApi#getFleetDeployment"); diff --git a/examples/v2/fleet-automation/GetFleetDeployment_1482493803.java b/examples/v2/fleet-automation/GetFleetDeployment_1482493803.java new file mode 100644 index 00000000000..1670a6eb6c7 --- /dev/null +++ b/examples/v2/fleet-automation/GetFleetDeployment_1482493803.java @@ -0,0 +1,28 @@ +// Get a deployment by ID returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.FleetAutomationApi; +import com.datadog.api.client.v2.model.FleetDeploymentResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getFleetDeployment", true); + FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient); + + // there is a valid "deployment" in the system + String DEPLOYMENT_ID = System.getenv("DEPLOYMENT_ID"); + + try { + FleetDeploymentResponse result = apiInstance.getFleetDeployment(DEPLOYMENT_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FleetAutomationApi#getFleetDeployment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/fleet-automation/GetFleetSchedule.java b/examples/v2/fleet-automation/GetFleetSchedule.java new file mode 100644 index 00000000000..f6ae06ab269 --- /dev/null +++ b/examples/v2/fleet-automation/GetFleetSchedule.java @@ -0,0 +1,25 @@ +// Get a schedule by ID returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.FleetAutomationApi; +import com.datadog.api.client.v2.model.FleetScheduleResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getFleetSchedule", true); + FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient); + + try { + FleetScheduleResponse result = apiInstance.getFleetSchedule("abc-def-ghi-123"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FleetAutomationApi#getFleetSchedule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/fleet-automation/ListFleetAgentVersions.java b/examples/v2/fleet-automation/ListFleetAgentVersions.java new file mode 100644 index 00000000000..24c4c4b23e1 --- /dev/null +++ b/examples/v2/fleet-automation/ListFleetAgentVersions.java @@ -0,0 +1,25 @@ +// List all available Agent versions returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.FleetAutomationApi; +import com.datadog.api.client.v2.model.FleetAgentVersionsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listFleetAgentVersions", true); + FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient); + + try { + FleetAgentVersionsResponse result = apiInstance.listFleetAgentVersions(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FleetAutomationApi#listFleetAgentVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/fleet-automation/ListFleetSchedules.java b/examples/v2/fleet-automation/ListFleetSchedules.java new file mode 100644 index 00000000000..6771be8d469 --- /dev/null +++ b/examples/v2/fleet-automation/ListFleetSchedules.java @@ -0,0 +1,25 @@ +// List all schedules returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.FleetAutomationApi; +import com.datadog.api.client.v2.model.FleetSchedulesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listFleetSchedules", true); + FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient); + + try { + FleetSchedulesResponse result = apiInstance.listFleetSchedules(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FleetAutomationApi#listFleetSchedules"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/fleet-automation/TriggerFleetSchedule.java b/examples/v2/fleet-automation/TriggerFleetSchedule.java new file mode 100644 index 00000000000..f8b7866a322 --- /dev/null +++ b/examples/v2/fleet-automation/TriggerFleetSchedule.java @@ -0,0 +1,26 @@ +// Trigger a schedule deployment returns "CREATED - Deployment successfully created and started." +// response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.FleetAutomationApi; +import com.datadog.api.client.v2.model.FleetDeploymentResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.triggerFleetSchedule", true); + FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient); + + try { + FleetDeploymentResponse result = apiInstance.triggerFleetSchedule("abc-def-ghi-123"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FleetAutomationApi#triggerFleetSchedule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/fleet-automation/UpdateFleetSchedule.java b/examples/v2/fleet-automation/UpdateFleetSchedule.java new file mode 100644 index 00000000000..8787f05daf3 --- /dev/null +++ b/examples/v2/fleet-automation/UpdateFleetSchedule.java @@ -0,0 +1,50 @@ +// Update a schedule returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.FleetAutomationApi; +import com.datadog.api.client.v2.model.FleetSchedulePatch; +import com.datadog.api.client.v2.model.FleetSchedulePatchAttributes; +import com.datadog.api.client.v2.model.FleetSchedulePatchRequest; +import com.datadog.api.client.v2.model.FleetScheduleRecurrenceRule; +import com.datadog.api.client.v2.model.FleetScheduleResourceType; +import com.datadog.api.client.v2.model.FleetScheduleResponse; +import com.datadog.api.client.v2.model.FleetScheduleStatus; +import java.util.Arrays; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateFleetSchedule", true); + FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient); + + FleetSchedulePatchRequest body = + new FleetSchedulePatchRequest() + .data( + new FleetSchedulePatch() + .attributes( + new FleetSchedulePatchAttributes() + .name("Weekly Production Agent Updates") + .query("env:prod AND service:web") + .rule( + new FleetScheduleRecurrenceRule() + .daysOfWeek(Arrays.asList("Mon", "Wed", "Fri")) + .maintenanceWindowDuration(1200L) + .startMaintenanceWindow("02:00") + .timezone("America/New_York")) + .status(FleetScheduleStatus.ACTIVE) + .versionToLatest(0L)) + .type(FleetScheduleResourceType.SCHEDULE)); + + try { + FleetScheduleResponse result = apiInstance.updateFleetSchedule("abc-def-ghi-123", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FleetAutomationApi#updateFleetSchedule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 790a403d960..510dbba5368 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -689,8 +689,16 @@ public class ApiClient { { put("v2.cancelFleetDeployment", false); put("v2.createFleetDeploymentConfigure", false); + put("v2.createFleetDeploymentUpgrade", false); + put("v2.createFleetSchedule", false); + put("v2.deleteFleetSchedule", false); put("v2.getFleetDeployment", false); + put("v2.getFleetSchedule", false); + put("v2.listFleetAgentVersions", false); put("v2.listFleetDeployments", false); + put("v2.listFleetSchedules", false); + put("v2.triggerFleetSchedule", false); + put("v2.updateFleetSchedule", false); put("v2.createOpenAPI", false); put("v2.deleteOpenAPI", false); put("v2.getOpenAPI", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/FleetAutomationApi.java b/src/main/java/com/datadog/api/client/v2/api/FleetAutomationApi.java index cbab3719124..5edd750cfb1 100644 --- a/src/main/java/com/datadog/api/client/v2/api/FleetAutomationApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/FleetAutomationApi.java @@ -4,9 +4,15 @@ import com.datadog.api.client.ApiException; import com.datadog.api.client.ApiResponse; import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.FleetAgentVersionsResponse; import com.datadog.api.client.v2.model.FleetDeploymentConfigureCreateRequest; +import com.datadog.api.client.v2.model.FleetDeploymentPackageUpgradeCreateRequest; import com.datadog.api.client.v2.model.FleetDeploymentResponse; import com.datadog.api.client.v2.model.FleetDeploymentsResponse; +import com.datadog.api.client.v2.model.FleetScheduleCreateRequest; +import com.datadog.api.client.v2.model.FleetSchedulePatchRequest; +import com.datadog.api.client.v2.model.FleetScheduleResponse; +import com.datadog.api.client.v2.model.FleetSchedulesResponse; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; @@ -75,9 +81,13 @@ public CompletableFuture cancelFleetDeploymentAsync(String deploymentId) { } /** - * 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 deploymentId The unique identifier of the deployment to cancel. (required) * @return ApiResponse<Void> @@ -205,7 +215,7 @@ public CompletableFuture> cancelFleetDeploymentWithHttpInfoAsy } /** - * Create a deployment. + * Create a configuration deployment. * *

See {@link #createFleetDeploymentConfigureWithHttpInfo}. * @@ -219,7 +229,7 @@ public FleetDeploymentResponse createFleetDeploymentConfigure( } /** - * Create a deployment. + * Create a configuration deployment. * *

See {@link #createFleetDeploymentConfigureWithHttpInfoAsync}. * @@ -239,6 +249,15 @@ public CompletableFuture createFleetDeploymentConfigure * 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. (required) * @return ApiResponse<FleetDeploymentResponse> * @throws ApiException if fails to make API call @@ -295,7 +314,7 @@ public ApiResponse createFleetDeploymentConfigureWithHt } /** - * Create a deployment. + * Create a configuration deployment. * *

See {@link #createFleetDeploymentConfigureWithHttpInfo}. * @@ -358,28 +377,30 @@ public ApiResponse createFleetDeploymentConfigureWithHt } /** - * Get a deployment by ID. + * Upgrade hosts. * - *

See {@link #getFleetDeploymentWithHttpInfo}. + *

See {@link #createFleetDeploymentUpgradeWithHttpInfo}. * - * @param deploymentId The unique identifier of the deployment to retrieve. (required) + * @param body Request payload containing the package upgrade details. (required) * @return FleetDeploymentResponse * @throws ApiException if fails to make API call */ - public FleetDeploymentResponse getFleetDeployment(String deploymentId) throws ApiException { - return getFleetDeploymentWithHttpInfo(deploymentId).getData(); + public FleetDeploymentResponse createFleetDeploymentUpgrade( + FleetDeploymentPackageUpgradeCreateRequest body) throws ApiException { + return createFleetDeploymentUpgradeWithHttpInfo(body).getData(); } /** - * Get a deployment by ID. + * Upgrade hosts. * - *

See {@link #getFleetDeploymentWithHttpInfoAsync}. + *

See {@link #createFleetDeploymentUpgradeWithHttpInfoAsync}. * - * @param deploymentId The unique identifier of the deployment to retrieve. (required) + * @param body Request payload containing the package upgrade details. (required) * @return CompletableFuture<FleetDeploymentResponse> */ - public CompletableFuture getFleetDeploymentAsync(String deploymentId) { - return getFleetDeploymentWithHttpInfoAsync(deploymentId) + public CompletableFuture createFleetDeploymentUpgradeAsync( + FleetDeploymentPackageUpgradeCreateRequest body) { + return createFleetDeploymentUpgradeWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -387,16 +408,24 @@ public CompletableFuture getFleetDeploymentAsync(String } /** - * Retrieve the details of a specific deployment using its unique identifier. + * Create and immediately start a new package upgrade on hosts matching the specified filter + * query. * - * @param deploymentId The unique identifier of the deployment to retrieve. (required) + *

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 + * + * @param body Request payload containing the package upgrade details. (required) * @return ApiResponse<FleetDeploymentResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -404,33 +433,30 @@ public CompletableFuture getFleetDeploymentAsync(String * *
Response details
Status Code Description Response Headers
200 OK -
201 CREATED -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse getFleetDeploymentWithHttpInfo(String deploymentId) - throws ApiException { + public ApiResponse createFleetDeploymentUpgradeWithHttpInfo( + FleetDeploymentPackageUpgradeCreateRequest body) throws ApiException { // Check if unstable operation is enabled - String operationId = "getFleetDeployment"; + String operationId = "createFleetDeploymentUpgrade"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } - Object localVarPostBody = null; + Object localVarPostBody = body; - // verify the required parameter 'deploymentId' is set - if (deploymentId == null) { + // verify the required parameter 'body' is set + if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'deploymentId' when calling getFleetDeployment"); + 400, "Missing the required parameter 'body' when calling createFleetDeploymentUpgrade"); } // create path and map variables - String localVarPath = - "/api/unstable/fleet/deployments/{deployment_id}" - .replaceAll( - "\\{" + "deployment_id" + "\\}", apiClient.escapeString(deploymentId.toString())); + String localVarPath = "/api/unstable/fleet/deployments/upgrade"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.FleetAutomationApi.getFleetDeployment", + "v2.FleetAutomationApi.createFleetDeploymentUpgrade", localVarPath, new ArrayList(), localVarHeaderParams, @@ -438,10 +464,10 @@ public ApiResponse getFleetDeploymentWithHttpInfo(Strin new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, @@ -449,17 +475,18 @@ public ApiResponse getFleetDeploymentWithHttpInfo(Strin } /** - * Get a deployment by ID. + * Upgrade hosts. * - *

See {@link #getFleetDeploymentWithHttpInfo}. + *

See {@link #createFleetDeploymentUpgradeWithHttpInfo}. * - * @param deploymentId The unique identifier of the deployment to retrieve. (required) + * @param body Request payload containing the package upgrade details. (required) * @return CompletableFuture<ApiResponse<FleetDeploymentResponse>> */ public CompletableFuture> - getFleetDeploymentWithHttpInfoAsync(String deploymentId) { + createFleetDeploymentUpgradeWithHttpInfoAsync( + FleetDeploymentPackageUpgradeCreateRequest body) { // Check if unstable operation is enabled - String operationId = "getFleetDeployment"; + String operationId = "createFleetDeploymentUpgrade"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -468,22 +495,19 @@ public ApiResponse getFleetDeploymentWithHttpInfo(Strin new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } - Object localVarPostBody = null; + Object localVarPostBody = body; - // verify the required parameter 'deploymentId' is set - if (deploymentId == null) { + // verify the required parameter 'body' is set + if (body == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'deploymentId' when calling getFleetDeployment")); + "Missing the required parameter 'body' when calling createFleetDeploymentUpgrade")); return result; } // create path and map variables - String localVarPath = - "/api/unstable/fleet/deployments/{deployment_id}" - .replaceAll( - "\\{" + "deployment_id" + "\\}", apiClient.escapeString(deploymentId.toString())); + String localVarPath = "/api/unstable/fleet/deployments/upgrade"; Map localVarHeaderParams = new HashMap(); @@ -491,7 +515,7 @@ public ApiResponse getFleetDeploymentWithHttpInfo(Strin try { builder = apiClient.createBuilder( - "v2.FleetAutomationApi.getFleetDeployment", + "v2.FleetAutomationApi.createFleetDeploymentUpgrade", localVarPath, new ArrayList(), localVarHeaderParams, @@ -504,67 +528,41 @@ public ApiResponse getFleetDeploymentWithHttpInfo(Strin return result; } return apiClient.invokeAPIAsync( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, new GenericType() {}); } - /** Manage optional parameters to listFleetDeployments. */ - public static class ListFleetDeploymentsOptionalParameters { - private Long pageSize; - private Long pageOffset; - - /** - * Set pageSize. - * - * @param pageSize Number of deployments to return per page. Maximum value is 100. (optional, - * default to 10) - * @return ListFleetDeploymentsOptionalParameters - */ - public ListFleetDeploymentsOptionalParameters pageSize(Long pageSize) { - this.pageSize = pageSize; - return this; - } - - /** - * Set pageOffset. - * - * @param pageOffset Index of the first deployment to return. Use this with page_size - * to paginate through results. (optional, default to 0) - * @return ListFleetDeploymentsOptionalParameters - */ - public ListFleetDeploymentsOptionalParameters pageOffset(Long pageOffset) { - this.pageOffset = pageOffset; - return this; - } - } - /** - * List all deployments. + * Create a schedule. * - *

See {@link #listFleetDeploymentsWithHttpInfo}. + *

See {@link #createFleetScheduleWithHttpInfo}. * - * @return FleetDeploymentsResponse + * @param body Request payload containing the schedule details. (required) + * @return FleetScheduleResponse * @throws ApiException if fails to make API call */ - public FleetDeploymentsResponse listFleetDeployments() throws ApiException { - return listFleetDeploymentsWithHttpInfo(new ListFleetDeploymentsOptionalParameters()).getData(); + public FleetScheduleResponse createFleetSchedule(FleetScheduleCreateRequest body) + throws ApiException { + return createFleetScheduleWithHttpInfo(body).getData(); } /** - * List all deployments. + * Create a schedule. * - *

See {@link #listFleetDeploymentsWithHttpInfoAsync}. + *

See {@link #createFleetScheduleWithHttpInfoAsync}. * - * @return CompletableFuture<FleetDeploymentsResponse> + * @param body Request payload containing the schedule details. (required) + * @return CompletableFuture<FleetScheduleResponse> */ - public CompletableFuture listFleetDeploymentsAsync() { - return listFleetDeploymentsWithHttpInfoAsync(new ListFleetDeploymentsOptionalParameters()) + public CompletableFuture createFleetScheduleAsync( + FleetScheduleCreateRequest body) { + return createFleetScheduleWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -572,151 +570,1520 @@ public CompletableFuture listFleetDeploymentsAsync() { } /** - * List all deployments. - * - *

See {@link #listFleetDeploymentsWithHttpInfo}. - * - * @param parameters Optional parameters for the request. - * @return FleetDeploymentsResponse - * @throws ApiException if fails to make API call - */ - public FleetDeploymentsResponse listFleetDeployments( - ListFleetDeploymentsOptionalParameters parameters) throws ApiException { - return listFleetDeploymentsWithHttpInfo(parameters).getData(); - } - - /** - * List all deployments. + * Create a new schedule for automated package upgrades. * - *

See {@link #listFleetDeploymentsWithHttpInfoAsync}. + *

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) * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<FleetDeploymentsResponse> - */ - public CompletableFuture listFleetDeploymentsAsync( - ListFleetDeploymentsOptionalParameters parameters) { - return listFleetDeploymentsWithHttpInfoAsync(parameters) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Retrieve a list of all deployments for fleet automation. Use the page_size and - * page_offset parameters to paginate results. + *

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 parameters Optional parameters for the request. - * @return ApiResponse<FleetDeploymentsResponse> + * @param body Request payload containing the schedule details. (required) + * @return ApiResponse<FleetScheduleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * * *
Response details
Status Code Description Response Headers
200 OK -
201 CREATED -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse listFleetDeploymentsWithHttpInfo( - ListFleetDeploymentsOptionalParameters parameters) throws ApiException { + public ApiResponse createFleetScheduleWithHttpInfo( + FleetScheduleCreateRequest body) throws ApiException { // Check if unstable operation is enabled - String operationId = "listFleetDeployments"; + String operationId = "createFleetSchedule"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } - Object localVarPostBody = null; - Long pageSize = parameters.pageSize; - Long pageOffset = parameters.pageOffset; + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createFleetSchedule"); + } // create path and map variables - String localVarPath = "/api/unstable/fleet/deployments"; + String localVarPath = "/api/unstable/fleet/schedules"; - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_offset", pageOffset)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.FleetAutomationApi.listFleetDeployments", + "v2.FleetAutomationApi.createFleetSchedule", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List all deployments. + * Create a schedule. * - *

See {@link #listFleetDeploymentsWithHttpInfo}. + *

See {@link #createFleetScheduleWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<FleetDeploymentsResponse>> + * @param body Request payload containing the schedule details. (required) + * @return CompletableFuture<ApiResponse<FleetScheduleResponse>> */ - public CompletableFuture> - listFleetDeploymentsWithHttpInfoAsync(ListFleetDeploymentsOptionalParameters parameters) { + public CompletableFuture> createFleetScheduleWithHttpInfoAsync( + FleetScheduleCreateRequest body) { // Check if unstable operation is enabled - String operationId = "listFleetDeployments"; + String operationId = "createFleetSchedule"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } - Object localVarPostBody = null; - Long pageSize = parameters.pageSize; - Long pageOffset = parameters.pageOffset; + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createFleetSchedule")); + return result; + } // create path and map variables - String localVarPath = "/api/unstable/fleet/deployments"; + String localVarPath = "/api/unstable/fleet/schedules"; - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_offset", pageOffset)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.FleetAutomationApi.listFleetDeployments", + "v2.FleetAutomationApi.createFleetSchedule", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete a schedule. + * + *

See {@link #deleteFleetScheduleWithHttpInfo}. + * + * @param id The unique identifier of the schedule to delete. (required) + * @throws ApiException if fails to make API call + */ + public void deleteFleetSchedule(String id) throws ApiException { + deleteFleetScheduleWithHttpInfo(id); + } + + /** + * Delete a schedule. + * + *

See {@link #deleteFleetScheduleWithHttpInfoAsync}. + * + * @param id The unique identifier of the schedule to delete. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteFleetScheduleAsync(String id) { + return deleteFleetScheduleWithHttpInfoAsync(id) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 Schedule successfully deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteFleetScheduleWithHttpInfo(String id) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteFleetSchedule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling deleteFleetSchedule"); + } + // create path and map variables + String localVarPath = + "/api/unstable/fleet/schedules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.deleteFleetSchedule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", builder, localVarHeaderParams, new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); + } + + /** + * Delete a schedule. + * + *

See {@link #deleteFleetScheduleWithHttpInfo}. + * + * @param id The unique identifier of the schedule to delete. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteFleetScheduleWithHttpInfoAsync(String id) { + // Check if unstable operation is enabled + String operationId = "deleteFleetSchedule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling deleteFleetSchedule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/unstable/fleet/schedules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.deleteFleetSchedule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** Manage optional parameters to getFleetDeployment. */ + public static class GetFleetDeploymentOptionalParameters { + private Long limit; + private Long page; + + /** + * Set limit. + * + * @param limit Maximum number of hosts to return per page. Default is 50, maximum is 100. + * (optional, default to 50) + * @return GetFleetDeploymentOptionalParameters + */ + public GetFleetDeploymentOptionalParameters limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Set page. + * + * @param page Page index for pagination (zero-based). Use this to retrieve subsequent pages of + * hosts. (optional, default to 0) + * @return GetFleetDeploymentOptionalParameters + */ + public GetFleetDeploymentOptionalParameters page(Long page) { + this.page = page; + return this; + } + } + + /** + * Get a configuration deployment by ID. + * + *

See {@link #getFleetDeploymentWithHttpInfo}. + * + * @param deploymentId The unique identifier of the deployment to retrieve. (required) + * @return FleetDeploymentResponse + * @throws ApiException if fails to make API call + */ + public FleetDeploymentResponse getFleetDeployment(String deploymentId) throws ApiException { + return getFleetDeploymentWithHttpInfo(deploymentId, new GetFleetDeploymentOptionalParameters()) + .getData(); + } + + /** + * Get a configuration deployment by ID. + * + *

See {@link #getFleetDeploymentWithHttpInfoAsync}. + * + * @param deploymentId The unique identifier of the deployment to retrieve. (required) + * @return CompletableFuture<FleetDeploymentResponse> + */ + public CompletableFuture getFleetDeploymentAsync(String deploymentId) { + return getFleetDeploymentWithHttpInfoAsync( + deploymentId, new GetFleetDeploymentOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a configuration deployment by ID. + * + *

See {@link #getFleetDeploymentWithHttpInfo}. + * + * @param deploymentId The unique identifier of the deployment to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return FleetDeploymentResponse + * @throws ApiException if fails to make API call + */ + public FleetDeploymentResponse getFleetDeployment( + String deploymentId, GetFleetDeploymentOptionalParameters parameters) throws ApiException { + return getFleetDeploymentWithHttpInfo(deploymentId, parameters).getData(); + } + + /** + * Get a configuration deployment by ID. + * + *

See {@link #getFleetDeploymentWithHttpInfoAsync}. + * + * @param deploymentId The unique identifier of the deployment to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<FleetDeploymentResponse> + */ + public CompletableFuture getFleetDeploymentAsync( + String deploymentId, GetFleetDeploymentOptionalParameters parameters) { + return getFleetDeploymentWithHttpInfoAsync(deploymentId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve detailed information about a specific deployment using its unique identifier. This + * endpoint returns comprehensive information about a deployment, including: - 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 deploymentId The unique identifier of the deployment to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<FleetDeploymentResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getFleetDeploymentWithHttpInfo( + String deploymentId, GetFleetDeploymentOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getFleetDeployment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'deploymentId' is set + if (deploymentId == null) { + throw new ApiException( + 400, "Missing the required parameter 'deploymentId' when calling getFleetDeployment"); + } + Long limit = parameters.limit; + Long page = parameters.page; + // create path and map variables + String localVarPath = + "/api/unstable/fleet/deployments/{deployment_id}" + .replaceAll( + "\\{" + "deployment_id" + "\\}", apiClient.escapeString(deploymentId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.getFleetDeployment", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a configuration deployment by ID. + * + *

See {@link #getFleetDeploymentWithHttpInfo}. + * + * @param deploymentId The unique identifier of the deployment to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<FleetDeploymentResponse>> + */ + public CompletableFuture> + getFleetDeploymentWithHttpInfoAsync( + String deploymentId, GetFleetDeploymentOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getFleetDeployment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'deploymentId' is set + if (deploymentId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'deploymentId' when calling getFleetDeployment")); + return result; + } + Long limit = parameters.limit; + Long page = parameters.page; + // create path and map variables + String localVarPath = + "/api/unstable/fleet/deployments/{deployment_id}" + .replaceAll( + "\\{" + "deployment_id" + "\\}", apiClient.escapeString(deploymentId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.getFleetDeployment", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a schedule by ID. + * + *

See {@link #getFleetScheduleWithHttpInfo}. + * + * @param id The unique identifier of the schedule to retrieve. (required) + * @return FleetScheduleResponse + * @throws ApiException if fails to make API call + */ + public FleetScheduleResponse getFleetSchedule(String id) throws ApiException { + return getFleetScheduleWithHttpInfo(id).getData(); + } + + /** + * Get a schedule by ID. + * + *

See {@link #getFleetScheduleWithHttpInfoAsync}. + * + * @param id The unique identifier of the schedule to retrieve. (required) + * @return CompletableFuture<FleetScheduleResponse> + */ + public CompletableFuture getFleetScheduleAsync(String id) { + return getFleetScheduleWithHttpInfoAsync(id) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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. (required) + * @return ApiResponse<FleetScheduleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getFleetScheduleWithHttpInfo(String id) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getFleetSchedule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling getFleetSchedule"); + } + // create path and map variables + String localVarPath = + "/api/unstable/fleet/schedules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.getFleetSchedule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a schedule by ID. + * + *

See {@link #getFleetScheduleWithHttpInfo}. + * + * @param id The unique identifier of the schedule to retrieve. (required) + * @return CompletableFuture<ApiResponse<FleetScheduleResponse>> + */ + public CompletableFuture> getFleetScheduleWithHttpInfoAsync( + String id) { + // Check if unstable operation is enabled + String operationId = "getFleetSchedule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling getFleetSchedule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/unstable/fleet/schedules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.getFleetSchedule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List all available Agent versions. + * + *

See {@link #listFleetAgentVersionsWithHttpInfo}. + * + * @return FleetAgentVersionsResponse + * @throws ApiException if fails to make API call + */ + public FleetAgentVersionsResponse listFleetAgentVersions() throws ApiException { + return listFleetAgentVersionsWithHttpInfo().getData(); + } + + /** + * List all available Agent versions. + * + *

See {@link #listFleetAgentVersionsWithHttpInfoAsync}. + * + * @return CompletableFuture<FleetAgentVersionsResponse> + */ + public CompletableFuture listFleetAgentVersionsAsync() { + return listFleetAgentVersionsWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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. + * + * @return ApiResponse<FleetAgentVersionsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listFleetAgentVersionsWithHttpInfo() + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listFleetAgentVersions"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/unstable/fleet/agents"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.listFleetAgentVersions", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List all available Agent versions. + * + *

See {@link #listFleetAgentVersionsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<FleetAgentVersionsResponse>> + */ + public CompletableFuture> + listFleetAgentVersionsWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "listFleetAgentVersions"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/unstable/fleet/agents"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.listFleetAgentVersions", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listFleetDeployments. */ + public static class ListFleetDeploymentsOptionalParameters { + private Long pageSize; + private Long pageOffset; + + /** + * Set pageSize. + * + * @param pageSize Number of deployments to return per page. Maximum value is 100. (optional, + * default to 10) + * @return ListFleetDeploymentsOptionalParameters + */ + public ListFleetDeploymentsOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageOffset. + * + * @param pageOffset Index of the first deployment to return. Use this with page_size + * to paginate through results. (optional, default to 0) + * @return ListFleetDeploymentsOptionalParameters + */ + public ListFleetDeploymentsOptionalParameters pageOffset(Long pageOffset) { + this.pageOffset = pageOffset; + return this; + } + } + + /** + * List all deployments. + * + *

See {@link #listFleetDeploymentsWithHttpInfo}. + * + * @return FleetDeploymentsResponse + * @throws ApiException if fails to make API call + */ + public FleetDeploymentsResponse listFleetDeployments() throws ApiException { + return listFleetDeploymentsWithHttpInfo(new ListFleetDeploymentsOptionalParameters()).getData(); + } + + /** + * List all deployments. + * + *

See {@link #listFleetDeploymentsWithHttpInfoAsync}. + * + * @return CompletableFuture<FleetDeploymentsResponse> + */ + public CompletableFuture listFleetDeploymentsAsync() { + return listFleetDeploymentsWithHttpInfoAsync(new ListFleetDeploymentsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List all deployments. + * + *

See {@link #listFleetDeploymentsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return FleetDeploymentsResponse + * @throws ApiException if fails to make API call + */ + public FleetDeploymentsResponse listFleetDeployments( + ListFleetDeploymentsOptionalParameters parameters) throws ApiException { + return listFleetDeploymentsWithHttpInfo(parameters).getData(); + } + + /** + * List all deployments. + * + *

See {@link #listFleetDeploymentsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<FleetDeploymentsResponse> + */ + public CompletableFuture listFleetDeploymentsAsync( + ListFleetDeploymentsOptionalParameters parameters) { + return listFleetDeploymentsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve a list of all deployments for fleet automation. Use the page_size and + * page_offset parameters to paginate results. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<FleetDeploymentsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listFleetDeploymentsWithHttpInfo( + ListFleetDeploymentsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listFleetDeployments"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageOffset = parameters.pageOffset; + // create path and map variables + String localVarPath = "/api/unstable/fleet/deployments"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_offset", pageOffset)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.listFleetDeployments", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List all deployments. + * + *

See {@link #listFleetDeploymentsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<FleetDeploymentsResponse>> + */ + public CompletableFuture> + listFleetDeploymentsWithHttpInfoAsync(ListFleetDeploymentsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listFleetDeployments"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageOffset = parameters.pageOffset; + // create path and map variables + String localVarPath = "/api/unstable/fleet/deployments"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_offset", pageOffset)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.listFleetDeployments", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List all schedules. + * + *

See {@link #listFleetSchedulesWithHttpInfo}. + * + * @return FleetSchedulesResponse + * @throws ApiException if fails to make API call + */ + public FleetSchedulesResponse listFleetSchedules() throws ApiException { + return listFleetSchedulesWithHttpInfo().getData(); + } + + /** + * List all schedules. + * + *

See {@link #listFleetSchedulesWithHttpInfoAsync}. + * + * @return CompletableFuture<FleetSchedulesResponse> + */ + public CompletableFuture listFleetSchedulesAsync() { + return listFleetSchedulesWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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. + * + * @return ApiResponse<FleetSchedulesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listFleetSchedulesWithHttpInfo() throws ApiException { + // Check if unstable operation is enabled + String operationId = "listFleetSchedules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/unstable/fleet/schedules"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.listFleetSchedules", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List all schedules. + * + *

See {@link #listFleetSchedulesWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<FleetSchedulesResponse>> + */ + public CompletableFuture> + listFleetSchedulesWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "listFleetSchedules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/unstable/fleet/schedules"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.listFleetSchedules", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Trigger a schedule deployment. + * + *

See {@link #triggerFleetScheduleWithHttpInfo}. + * + * @param id The unique identifier of the schedule to trigger. (required) + * @return FleetDeploymentResponse + * @throws ApiException if fails to make API call + */ + public FleetDeploymentResponse triggerFleetSchedule(String id) throws ApiException { + return triggerFleetScheduleWithHttpInfo(id).getData(); + } + + /** + * Trigger a schedule deployment. + * + *

See {@link #triggerFleetScheduleWithHttpInfoAsync}. + * + * @param id The unique identifier of the schedule to trigger. (required) + * @return CompletableFuture<FleetDeploymentResponse> + */ + public CompletableFuture triggerFleetScheduleAsync(String id) { + return triggerFleetScheduleWithHttpInfoAsync(id) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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. (required) + * @return ApiResponse<FleetDeploymentResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 CREATED - Deployment successfully created and started. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse triggerFleetScheduleWithHttpInfo(String id) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "triggerFleetSchedule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling triggerFleetSchedule"); + } + // create path and map variables + String localVarPath = + "/api/unstable/fleet/schedules/{id}/trigger" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.triggerFleetSchedule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Trigger a schedule deployment. + * + *

See {@link #triggerFleetScheduleWithHttpInfo}. + * + * @param id The unique identifier of the schedule to trigger. (required) + * @return CompletableFuture<ApiResponse<FleetDeploymentResponse>> + */ + public CompletableFuture> + triggerFleetScheduleWithHttpInfoAsync(String id) { + // Check if unstable operation is enabled + String operationId = "triggerFleetSchedule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling triggerFleetSchedule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/unstable/fleet/schedules/{id}/trigger" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.triggerFleetSchedule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a schedule. + * + *

See {@link #updateFleetScheduleWithHttpInfo}. + * + * @param id The unique identifier of the schedule to update. (required) + * @param body Request payload containing the fields to update. (required) + * @return FleetScheduleResponse + * @throws ApiException if fails to make API call + */ + public FleetScheduleResponse updateFleetSchedule(String id, FleetSchedulePatchRequest body) + throws ApiException { + return updateFleetScheduleWithHttpInfo(id, body).getData(); + } + + /** + * Update a schedule. + * + *

See {@link #updateFleetScheduleWithHttpInfoAsync}. + * + * @param id The unique identifier of the schedule to update. (required) + * @param body Request payload containing the fields to update. (required) + * @return CompletableFuture<FleetScheduleResponse> + */ + public CompletableFuture updateFleetScheduleAsync( + String id, FleetSchedulePatchRequest body) { + return updateFleetScheduleWithHttpInfoAsync(id, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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. (required) + * @param body Request payload containing the fields to update. (required) + * @return ApiResponse<FleetScheduleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateFleetScheduleWithHttpInfo( + String id, FleetSchedulePatchRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateFleetSchedule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling updateFleetSchedule"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateFleetSchedule"); + } + // create path and map variables + String localVarPath = + "/api/unstable/fleet/schedules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.updateFleetSchedule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a schedule. + * + *

See {@link #updateFleetScheduleWithHttpInfo}. + * + * @param id The unique identifier of the schedule to update. (required) + * @param body Request payload containing the fields to update. (required) + * @return CompletableFuture<ApiResponse<FleetScheduleResponse>> + */ + public CompletableFuture> updateFleetScheduleWithHttpInfoAsync( + String id, FleetSchedulePatchRequest body) { + // Check if unstable operation is enabled + String operationId = "updateFleetSchedule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling updateFleetSchedule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateFleetSchedule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/unstable/fleet/schedules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.FleetAutomationApi.updateFleetSchedule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); } } diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetAgentVersion.java b/src/main/java/com/datadog/api/client/v2/model/FleetAgentVersion.java new file mode 100644 index 00000000000..9f339b26fd1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetAgentVersion.java @@ -0,0 +1,207 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Represents an available Datadog Agent version. */ +@JsonPropertyOrder({ + FleetAgentVersion.JSON_PROPERTY_ATTRIBUTES, + FleetAgentVersion.JSON_PROPERTY_ID, + FleetAgentVersion.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetAgentVersion { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private FleetAgentVersionAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private FleetAgentVersionResourceType type = FleetAgentVersionResourceType.AGENT_VERSION; + + public FleetAgentVersion() {} + + @JsonCreator + public FleetAgentVersion( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + FleetAgentVersionResourceType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public FleetAgentVersion attributes(FleetAgentVersionAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Getattributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FleetAgentVersionAttributes getAttributes() { + return attributes; + } + + public void setAttributes(FleetAgentVersionAttributes attributes) { + this.attributes = attributes; + } + + public FleetAgentVersion id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the Agent version (same as version). + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public FleetAgentVersion type(FleetAgentVersionResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of Agent version resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FleetAgentVersionResourceType getType() { + return type; + } + + public void setType(FleetAgentVersionResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetAgentVersion + */ + @JsonAnySetter + public FleetAgentVersion putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetAgentVersion object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetAgentVersion fleetAgentVersion = (FleetAgentVersion) o; + return Objects.equals(this.attributes, fleetAgentVersion.attributes) + && Objects.equals(this.id, fleetAgentVersion.id) + && Objects.equals(this.type, fleetAgentVersion.type) + && Objects.equals(this.additionalProperties, fleetAgentVersion.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetAgentVersion {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetAgentVersionAttributes.java b/src/main/java/com/datadog/api/client/v2/model/FleetAgentVersionAttributes.java new file mode 100644 index 00000000000..7151bc0064c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetAgentVersionAttributes.java @@ -0,0 +1,136 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({FleetAgentVersionAttributes.JSON_PROPERTY_VERSION}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetAgentVersionAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_VERSION = "version"; + private String version; + + public FleetAgentVersionAttributes version(String version) { + this.version = version; + return this; + } + + /** + * The Agent version string. + * + * @return version + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetAgentVersionAttributes + */ + @JsonAnySetter + public FleetAgentVersionAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetAgentVersionAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetAgentVersionAttributes fleetAgentVersionAttributes = (FleetAgentVersionAttributes) o; + return Objects.equals(this.version, fleetAgentVersionAttributes.version) + && Objects.equals( + this.additionalProperties, fleetAgentVersionAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetAgentVersionAttributes {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetAgentVersionResourceType.java b/src/main/java/com/datadog/api/client/v2/model/FleetAgentVersionResourceType.java new file mode 100644 index 00000000000..7bcca9faea2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetAgentVersionResourceType.java @@ -0,0 +1,57 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of Agent version resource. */ +@JsonSerialize(using = FleetAgentVersionResourceType.FleetAgentVersionResourceTypeSerializer.class) +public class FleetAgentVersionResourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("agent_version")); + + public static final FleetAgentVersionResourceType AGENT_VERSION = + new FleetAgentVersionResourceType("agent_version"); + + FleetAgentVersionResourceType(String value) { + super(value, allowedValues); + } + + public static class FleetAgentVersionResourceTypeSerializer + extends StdSerializer { + public FleetAgentVersionResourceTypeSerializer(Class t) { + super(t); + } + + public FleetAgentVersionResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + FleetAgentVersionResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static FleetAgentVersionResourceType fromValue(String value) { + return new FleetAgentVersionResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetAgentVersionsResponse.java b/src/main/java/com/datadog/api/client/v2/model/FleetAgentVersionsResponse.java new file mode 100644 index 00000000000..c83dceccc1b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetAgentVersionsResponse.java @@ -0,0 +1,155 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of available Agent versions. */ +@JsonPropertyOrder({FleetAgentVersionsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetAgentVersionsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public FleetAgentVersionsResponse() {} + + @JsonCreator + public FleetAgentVersionsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public FleetAgentVersionsResponse data(List data) { + this.data = data; + for (FleetAgentVersion item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public FleetAgentVersionsResponse addDataItem(FleetAgentVersion dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of available Agent versions. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetAgentVersionsResponse + */ + @JsonAnySetter + public FleetAgentVersionsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetAgentVersionsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetAgentVersionsResponse fleetAgentVersionsResponse = (FleetAgentVersionsResponse) o; + return Objects.equals(this.data, fleetAgentVersionsResponse.data) + && Objects.equals( + this.additionalProperties, fleetAgentVersionsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetAgentVersionsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentAttributes.java b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentAttributes.java index addbd323db3..4a06dfd955f 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentAttributes.java @@ -24,6 +24,8 @@ FleetDeploymentAttributes.JSON_PROPERTY_ESTIMATED_END_TIME_UNIX, FleetDeploymentAttributes.JSON_PROPERTY_FILTER_QUERY, FleetDeploymentAttributes.JSON_PROPERTY_HIGH_LEVEL_STATUS, + FleetDeploymentAttributes.JSON_PROPERTY_HOSTS, + FleetDeploymentAttributes.JSON_PROPERTY_PACKAGES, FleetDeploymentAttributes.JSON_PROPERTY_TOTAL_HOSTS }) @jakarta.annotation.Generated( @@ -42,6 +44,12 @@ public class FleetDeploymentAttributes { public static final String JSON_PROPERTY_HIGH_LEVEL_STATUS = "high_level_status"; private String highLevelStatus; + public static final String JSON_PROPERTY_HOSTS = "hosts"; + private List hosts = null; + + public static final String JSON_PROPERTY_PACKAGES = "packages"; + private List packages = null; + public static final String JSON_PROPERTY_TOTAL_HOSTS = "total_hosts"; private Long totalHosts; @@ -144,6 +152,75 @@ public void setHighLevelStatus(String highLevelStatus) { this.highLevelStatus = highLevelStatus; } + public FleetDeploymentAttributes hosts(List hosts) { + this.hosts = hosts; + for (FleetDeploymentHost item : hosts) { + this.unparsed |= item.unparsed; + } + return this; + } + + public FleetDeploymentAttributes addHostsItem(FleetDeploymentHost hostsItem) { + if (this.hosts == null) { + this.hosts = new ArrayList<>(); + } + this.hosts.add(hostsItem); + this.unparsed |= hostsItem.unparsed; + return this; + } + + /** + * 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. + * + * @return hosts + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HOSTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getHosts() { + return hosts; + } + + public void setHosts(List hosts) { + this.hosts = hosts; + } + + public FleetDeploymentAttributes packages(List packages) { + this.packages = packages; + for (FleetDeploymentPackage item : packages) { + this.unparsed |= item.unparsed; + } + return this; + } + + public FleetDeploymentAttributes addPackagesItem(FleetDeploymentPackage packagesItem) { + if (this.packages == null) { + this.packages = new ArrayList<>(); + } + this.packages.add(packagesItem); + this.unparsed |= packagesItem.unparsed; + return this; + } + + /** + * List of packages to deploy to target hosts. Present only for package upgrade deployments. + * + * @return packages + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PACKAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPackages() { + return packages; + } + + public void setPackages(List packages) { + this.packages = packages; + } + public FleetDeploymentAttributes totalHosts(Long totalHosts) { this.totalHosts = totalHosts; return this; @@ -225,6 +302,8 @@ public boolean equals(Object o) { && Objects.equals(this.estimatedEndTimeUnix, fleetDeploymentAttributes.estimatedEndTimeUnix) && Objects.equals(this.filterQuery, fleetDeploymentAttributes.filterQuery) && Objects.equals(this.highLevelStatus, fleetDeploymentAttributes.highLevelStatus) + && Objects.equals(this.hosts, fleetDeploymentAttributes.hosts) + && Objects.equals(this.packages, fleetDeploymentAttributes.packages) && Objects.equals(this.totalHosts, fleetDeploymentAttributes.totalHosts) && Objects.equals( this.additionalProperties, fleetDeploymentAttributes.additionalProperties); @@ -237,6 +316,8 @@ public int hashCode() { estimatedEndTimeUnix, filterQuery, highLevelStatus, + hosts, + packages, totalHosts, additionalProperties); } @@ -251,6 +332,8 @@ public String toString() { .append("\n"); sb.append(" filterQuery: ").append(toIndentedString(filterQuery)).append("\n"); sb.append(" highLevelStatus: ").append(toIndentedString(highLevelStatus)).append("\n"); + sb.append(" hosts: ").append(toIndentedString(hosts)).append("\n"); + sb.append(" packages: ").append(toIndentedString(packages)).append("\n"); sb.append(" totalHosts: ").append(toIndentedString(totalHosts)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentConfigureCreate.java b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentConfigureCreate.java index 3875d41df73..66b637dc90c 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentConfigureCreate.java +++ b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentConfigureCreate.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.Objects; -/** Data for creating a new deployment. */ +/** Data for creating a new configuration deployment. */ @JsonPropertyOrder({ FleetDeploymentConfigureCreate.JSON_PROPERTY_ATTRIBUTES, FleetDeploymentConfigureCreate.JSON_PROPERTY_TYPE diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentConfigureCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentConfigureCreateRequest.java index 84d6ca82947..a0d28df2704 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentConfigureCreateRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentConfigureCreateRequest.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.Objects; -/** Request payload for creating a new deployment. */ +/** Request payload for creating a new configuration deployment. */ @JsonPropertyOrder({FleetDeploymentConfigureCreateRequest.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -43,7 +43,7 @@ public FleetDeploymentConfigureCreateRequest data(FleetDeploymentConfigureCreate } /** - * Data for creating a new deployment. + * Data for creating a new configuration deployment. * * @return data */ diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentHost.java b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentHost.java new file mode 100644 index 00000000000..4d9cb4252ba --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentHost.java @@ -0,0 +1,232 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A host that is part of a deployment with its current status. */ +@JsonPropertyOrder({ + FleetDeploymentHost.JSON_PROPERTY_ERROR, + FleetDeploymentHost.JSON_PROPERTY_HOSTNAME, + FleetDeploymentHost.JSON_PROPERTY_STATUS, + FleetDeploymentHost.JSON_PROPERTY_VERSIONS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetDeploymentHost { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ERROR = "error"; + private String error; + + public static final String JSON_PROPERTY_HOSTNAME = "hostname"; + private String hostname; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_VERSIONS = "versions"; + private List versions = null; + + public FleetDeploymentHost error(String error) { + this.error = error; + return this; + } + + /** + * Error message if the deployment failed on this host. + * + * @return error + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getError() { + return error; + } + + public void setError(String error) { + this.error = error; + } + + public FleetDeploymentHost hostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * The hostname of the agent. + * + * @return hostname + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HOSTNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHostname() { + return hostname; + } + + public void setHostname(String hostname) { + this.hostname = hostname; + } + + public FleetDeploymentHost status(String status) { + this.status = status; + return this; + } + + /** + * Current deployment status for this specific host. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public FleetDeploymentHost versions(List versions) { + this.versions = versions; + for (FleetDeploymentHostPackage item : versions) { + this.unparsed |= item.unparsed; + } + return this; + } + + public FleetDeploymentHost addVersionsItem(FleetDeploymentHostPackage versionsItem) { + if (this.versions == null) { + this.versions = new ArrayList<>(); + } + this.versions.add(versionsItem); + this.unparsed |= versionsItem.unparsed; + return this; + } + + /** + * List of packages and their versions currently installed on this host. + * + * @return versions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getVersions() { + return versions; + } + + public void setVersions(List versions) { + this.versions = versions; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetDeploymentHost + */ + @JsonAnySetter + public FleetDeploymentHost putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetDeploymentHost object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetDeploymentHost fleetDeploymentHost = (FleetDeploymentHost) o; + return Objects.equals(this.error, fleetDeploymentHost.error) + && Objects.equals(this.hostname, fleetDeploymentHost.hostname) + && Objects.equals(this.status, fleetDeploymentHost.status) + && Objects.equals(this.versions, fleetDeploymentHost.versions) + && Objects.equals(this.additionalProperties, fleetDeploymentHost.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(error, hostname, status, versions, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetDeploymentHost {\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" hostname: ").append(toIndentedString(hostname)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" versions: ").append(toIndentedString(versions)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentHostPackage.java b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentHostPackage.java new file mode 100644 index 00000000000..db44847ce84 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentHostPackage.java @@ -0,0 +1,223 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Package version information for a host, showing the initial version before deployment, the target + * version to deploy, and the current version on the host. + */ +@JsonPropertyOrder({ + FleetDeploymentHostPackage.JSON_PROPERTY_CURRENT_VERSION, + FleetDeploymentHostPackage.JSON_PROPERTY_INITIAL_VERSION, + FleetDeploymentHostPackage.JSON_PROPERTY_PACKAGE_NAME, + FleetDeploymentHostPackage.JSON_PROPERTY_TARGET_VERSION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetDeploymentHostPackage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CURRENT_VERSION = "current_version"; + private String currentVersion; + + public static final String JSON_PROPERTY_INITIAL_VERSION = "initial_version"; + private String initialVersion; + + public static final String JSON_PROPERTY_PACKAGE_NAME = "package_name"; + private String packageName; + + public static final String JSON_PROPERTY_TARGET_VERSION = "target_version"; + private String targetVersion; + + public FleetDeploymentHostPackage currentVersion(String currentVersion) { + this.currentVersion = currentVersion; + return this; + } + + /** + * The current version of the package on the host. + * + * @return currentVersion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CURRENT_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrentVersion() { + return currentVersion; + } + + public void setCurrentVersion(String currentVersion) { + this.currentVersion = currentVersion; + } + + public FleetDeploymentHostPackage initialVersion(String initialVersion) { + this.initialVersion = initialVersion; + return this; + } + + /** + * The initial version of the package on the host before the deployment started. + * + * @return initialVersion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INITIAL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInitialVersion() { + return initialVersion; + } + + public void setInitialVersion(String initialVersion) { + this.initialVersion = initialVersion; + } + + public FleetDeploymentHostPackage packageName(String packageName) { + this.packageName = packageName; + return this; + } + + /** + * The name of the package. + * + * @return packageName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PACKAGE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPackageName() { + return packageName; + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + public FleetDeploymentHostPackage targetVersion(String targetVersion) { + this.targetVersion = targetVersion; + return this; + } + + /** + * The target version that the deployment is attempting to install. + * + * @return targetVersion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TARGET_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTargetVersion() { + return targetVersion; + } + + public void setTargetVersion(String targetVersion) { + this.targetVersion = targetVersion; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetDeploymentHostPackage + */ + @JsonAnySetter + public FleetDeploymentHostPackage putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetDeploymentHostPackage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetDeploymentHostPackage fleetDeploymentHostPackage = (FleetDeploymentHostPackage) o; + return Objects.equals(this.currentVersion, fleetDeploymentHostPackage.currentVersion) + && Objects.equals(this.initialVersion, fleetDeploymentHostPackage.initialVersion) + && Objects.equals(this.packageName, fleetDeploymentHostPackage.packageName) + && Objects.equals(this.targetVersion, fleetDeploymentHostPackage.targetVersion) + && Objects.equals( + this.additionalProperties, fleetDeploymentHostPackage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + currentVersion, initialVersion, packageName, targetVersion, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetDeploymentHostPackage {\n"); + sb.append(" currentVersion: ").append(toIndentedString(currentVersion)).append("\n"); + sb.append(" initialVersion: ").append(toIndentedString(initialVersion)).append("\n"); + sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); + sb.append(" targetVersion: ").append(toIndentedString(targetVersion)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentHostsPage.java b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentHostsPage.java new file mode 100644 index 00000000000..5332cf0071c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentHostsPage.java @@ -0,0 +1,218 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Pagination details for the list of hosts in a deployment. */ +@JsonPropertyOrder({ + FleetDeploymentHostsPage.JSON_PROPERTY_CURRENT_PAGE, + FleetDeploymentHostsPage.JSON_PROPERTY_PAGE_SIZE, + FleetDeploymentHostsPage.JSON_PROPERTY_TOTAL_HOSTS, + FleetDeploymentHostsPage.JSON_PROPERTY_TOTAL_PAGES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetDeploymentHostsPage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CURRENT_PAGE = "current_page"; + private Long currentPage; + + public static final String JSON_PROPERTY_PAGE_SIZE = "page_size"; + private Long pageSize; + + public static final String JSON_PROPERTY_TOTAL_HOSTS = "total_hosts"; + private Long totalHosts; + + public static final String JSON_PROPERTY_TOTAL_PAGES = "total_pages"; + private Long totalPages; + + public FleetDeploymentHostsPage currentPage(Long currentPage) { + this.currentPage = currentPage; + return this; + } + + /** + * Current page index (zero-based). + * + * @return currentPage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CURRENT_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCurrentPage() { + return currentPage; + } + + public void setCurrentPage(Long currentPage) { + this.currentPage = currentPage; + } + + public FleetDeploymentHostsPage pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Number of hosts returned per page. + * + * @return pageSize + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPageSize() { + return pageSize; + } + + public void setPageSize(Long pageSize) { + this.pageSize = pageSize; + } + + public FleetDeploymentHostsPage totalHosts(Long totalHosts) { + this.totalHosts = totalHosts; + return this; + } + + /** + * Total number of hosts in this deployment. + * + * @return totalHosts + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_HOSTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalHosts() { + return totalHosts; + } + + public void setTotalHosts(Long totalHosts) { + this.totalHosts = totalHosts; + } + + public FleetDeploymentHostsPage totalPages(Long totalPages) { + this.totalPages = totalPages; + return this; + } + + /** + * Total number of pages available. + * + * @return totalPages + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_PAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalPages() { + return totalPages; + } + + public void setTotalPages(Long totalPages) { + this.totalPages = totalPages; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetDeploymentHostsPage + */ + @JsonAnySetter + public FleetDeploymentHostsPage putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetDeploymentHostsPage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetDeploymentHostsPage fleetDeploymentHostsPage = (FleetDeploymentHostsPage) o; + return Objects.equals(this.currentPage, fleetDeploymentHostsPage.currentPage) + && Objects.equals(this.pageSize, fleetDeploymentHostsPage.pageSize) + && Objects.equals(this.totalHosts, fleetDeploymentHostsPage.totalHosts) + && Objects.equals(this.totalPages, fleetDeploymentHostsPage.totalPages) + && Objects.equals(this.additionalProperties, fleetDeploymentHostsPage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(currentPage, pageSize, totalHosts, totalPages, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetDeploymentHostsPage {\n"); + sb.append(" currentPage: ").append(toIndentedString(currentPage)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" totalHosts: ").append(toIndentedString(totalHosts)).append("\n"); + sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackage.java b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackage.java new file mode 100644 index 00000000000..f1ac9f35561 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackage.java @@ -0,0 +1,173 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A package and its target version for deployment. */ +@JsonPropertyOrder({ + FleetDeploymentPackage.JSON_PROPERTY_NAME, + FleetDeploymentPackage.JSON_PROPERTY_VERSION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetDeploymentPackage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_VERSION = "version"; + private String version; + + public FleetDeploymentPackage() {} + + @JsonCreator + public FleetDeploymentPackage( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_VERSION) String version) { + this.name = name; + this.version = version; + } + + public FleetDeploymentPackage name(String name) { + this.name = name; + return this; + } + + /** + * The name of the package to deploy. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public FleetDeploymentPackage version(String version) { + this.version = version; + return this; + } + + /** + * The target version of the package to deploy. + * + * @return version + */ + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetDeploymentPackage + */ + @JsonAnySetter + public FleetDeploymentPackage putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetDeploymentPackage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetDeploymentPackage fleetDeploymentPackage = (FleetDeploymentPackage) o; + return Objects.equals(this.name, fleetDeploymentPackage.name) + && Objects.equals(this.version, fleetDeploymentPackage.version) + && Objects.equals(this.additionalProperties, fleetDeploymentPackage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetDeploymentPackage {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackageUpgradeAttributes.java b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackageUpgradeAttributes.java new file mode 100644 index 00000000000..cbfbda49bdd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackageUpgradeAttributes.java @@ -0,0 +1,190 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes for creating a new package upgrade deployment. */ +@JsonPropertyOrder({ + FleetDeploymentPackageUpgradeAttributes.JSON_PROPERTY_FILTER_QUERY, + FleetDeploymentPackageUpgradeAttributes.JSON_PROPERTY_TARGET_PACKAGES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetDeploymentPackageUpgradeAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FILTER_QUERY = "filter_query"; + private String filterQuery; + + public static final String JSON_PROPERTY_TARGET_PACKAGES = "target_packages"; + private List targetPackages = new ArrayList<>(); + + public FleetDeploymentPackageUpgradeAttributes() {} + + @JsonCreator + public FleetDeploymentPackageUpgradeAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_TARGET_PACKAGES) + List targetPackages) { + this.targetPackages = targetPackages; + } + + public FleetDeploymentPackageUpgradeAttributes filterQuery(String filterQuery) { + this.filterQuery = filterQuery; + return this; + } + + /** + * Query used to filter and select target hosts for the deployment. Uses the Datadog query syntax. + * + * @return filterQuery + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILTER_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilterQuery() { + return filterQuery; + } + + public void setFilterQuery(String filterQuery) { + this.filterQuery = filterQuery; + } + + public FleetDeploymentPackageUpgradeAttributes targetPackages( + List targetPackages) { + this.targetPackages = targetPackages; + for (FleetDeploymentPackage item : targetPackages) { + this.unparsed |= item.unparsed; + } + return this; + } + + public FleetDeploymentPackageUpgradeAttributes addTargetPackagesItem( + FleetDeploymentPackage targetPackagesItem) { + this.targetPackages.add(targetPackagesItem); + this.unparsed |= targetPackagesItem.unparsed; + return this; + } + + /** + * List of packages and their target versions to deploy to the selected hosts. + * + * @return targetPackages + */ + @JsonProperty(JSON_PROPERTY_TARGET_PACKAGES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTargetPackages() { + return targetPackages; + } + + public void setTargetPackages(List targetPackages) { + this.targetPackages = targetPackages; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetDeploymentPackageUpgradeAttributes + */ + @JsonAnySetter + public FleetDeploymentPackageUpgradeAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetDeploymentPackageUpgradeAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetDeploymentPackageUpgradeAttributes fleetDeploymentPackageUpgradeAttributes = + (FleetDeploymentPackageUpgradeAttributes) o; + return Objects.equals(this.filterQuery, fleetDeploymentPackageUpgradeAttributes.filterQuery) + && Objects.equals( + this.targetPackages, fleetDeploymentPackageUpgradeAttributes.targetPackages) + && Objects.equals( + this.additionalProperties, + fleetDeploymentPackageUpgradeAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(filterQuery, targetPackages, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetDeploymentPackageUpgradeAttributes {\n"); + sb.append(" filterQuery: ").append(toIndentedString(filterQuery)).append("\n"); + sb.append(" targetPackages: ").append(toIndentedString(targetPackages)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackageUpgradeCreate.java b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackageUpgradeCreate.java new file mode 100644 index 00000000000..a107db3eb9b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackageUpgradeCreate.java @@ -0,0 +1,184 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for creating a new package upgrade deployment. */ +@JsonPropertyOrder({ + FleetDeploymentPackageUpgradeCreate.JSON_PROPERTY_ATTRIBUTES, + FleetDeploymentPackageUpgradeCreate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetDeploymentPackageUpgradeCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private FleetDeploymentPackageUpgradeAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private FleetDeploymentResourceType type = FleetDeploymentResourceType.DEPLOYMENT; + + public FleetDeploymentPackageUpgradeCreate() {} + + @JsonCreator + public FleetDeploymentPackageUpgradeCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + FleetDeploymentPackageUpgradeAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) FleetDeploymentResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public FleetDeploymentPackageUpgradeCreate attributes( + FleetDeploymentPackageUpgradeAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating a new package upgrade deployment. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FleetDeploymentPackageUpgradeAttributes getAttributes() { + return attributes; + } + + public void setAttributes(FleetDeploymentPackageUpgradeAttributes attributes) { + this.attributes = attributes; + } + + public FleetDeploymentPackageUpgradeCreate type(FleetDeploymentResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of deployment resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FleetDeploymentResourceType getType() { + return type; + } + + public void setType(FleetDeploymentResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetDeploymentPackageUpgradeCreate + */ + @JsonAnySetter + public FleetDeploymentPackageUpgradeCreate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetDeploymentPackageUpgradeCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetDeploymentPackageUpgradeCreate fleetDeploymentPackageUpgradeCreate = + (FleetDeploymentPackageUpgradeCreate) o; + return Objects.equals(this.attributes, fleetDeploymentPackageUpgradeCreate.attributes) + && Objects.equals(this.type, fleetDeploymentPackageUpgradeCreate.type) + && Objects.equals( + this.additionalProperties, fleetDeploymentPackageUpgradeCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetDeploymentPackageUpgradeCreate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackageUpgradeCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackageUpgradeCreateRequest.java new file mode 100644 index 00000000000..140a0a269d7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentPackageUpgradeCreateRequest.java @@ -0,0 +1,150 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for creating a new package upgrade deployment. */ +@JsonPropertyOrder({FleetDeploymentPackageUpgradeCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetDeploymentPackageUpgradeCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private FleetDeploymentPackageUpgradeCreate data; + + public FleetDeploymentPackageUpgradeCreateRequest() {} + + @JsonCreator + public FleetDeploymentPackageUpgradeCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + FleetDeploymentPackageUpgradeCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public FleetDeploymentPackageUpgradeCreateRequest data(FleetDeploymentPackageUpgradeCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for creating a new package upgrade deployment. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FleetDeploymentPackageUpgradeCreate getData() { + return data; + } + + public void setData(FleetDeploymentPackageUpgradeCreate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetDeploymentPackageUpgradeCreateRequest + */ + @JsonAnySetter + public FleetDeploymentPackageUpgradeCreateRequest putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetDeploymentPackageUpgradeCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetDeploymentPackageUpgradeCreateRequest fleetDeploymentPackageUpgradeCreateRequest = + (FleetDeploymentPackageUpgradeCreateRequest) o; + return Objects.equals(this.data, fleetDeploymentPackageUpgradeCreateRequest.data) + && Objects.equals( + this.additionalProperties, + fleetDeploymentPackageUpgradeCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetDeploymentPackageUpgradeCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentResponse.java b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentResponse.java index 455b56e68c5..1c2a3b14077 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentResponse.java @@ -17,7 +17,10 @@ import java.util.Objects; /** Response containing a single deployment. */ -@JsonPropertyOrder({FleetDeploymentResponse.JSON_PROPERTY_DATA}) +@JsonPropertyOrder({ + FleetDeploymentResponse.JSON_PROPERTY_DATA, + FleetDeploymentResponse.JSON_PROPERTY_META +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class FleetDeploymentResponse { @@ -25,6 +28,9 @@ public class FleetDeploymentResponse { public static final String JSON_PROPERTY_DATA = "data"; private FleetDeployment data; + public static final String JSON_PROPERTY_META = "meta"; + private FleetDeploymentResponseMeta meta; + public FleetDeploymentResponse data(FleetDeployment data) { this.data = data; this.unparsed |= data.unparsed; @@ -47,6 +53,28 @@ public void setData(FleetDeployment data) { this.data = data; } + public FleetDeploymentResponse meta(FleetDeploymentResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for a single deployment response, including pagination information for hosts. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FleetDeploymentResponseMeta getMeta() { + return meta; + } + + public void setMeta(FleetDeploymentResponseMeta meta) { + this.meta = meta; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -104,12 +132,13 @@ public boolean equals(Object o) { } FleetDeploymentResponse fleetDeploymentResponse = (FleetDeploymentResponse) o; return Objects.equals(this.data, fleetDeploymentResponse.data) + && Objects.equals(this.meta, fleetDeploymentResponse.meta) && Objects.equals(this.additionalProperties, fleetDeploymentResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(data, additionalProperties); + return Objects.hash(data, meta, additionalProperties); } @Override @@ -117,6 +146,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FleetDeploymentResponse {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentResponseMeta.java new file mode 100644 index 00000000000..ee927de757e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetDeploymentResponseMeta.java @@ -0,0 +1,137 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata for a single deployment response, including pagination information for hosts. */ +@JsonPropertyOrder({FleetDeploymentResponseMeta.JSON_PROPERTY_HOSTS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetDeploymentResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HOSTS = "hosts"; + private FleetDeploymentHostsPage hosts; + + public FleetDeploymentResponseMeta hosts(FleetDeploymentHostsPage hosts) { + this.hosts = hosts; + this.unparsed |= hosts.unparsed; + return this; + } + + /** + * Pagination details for the list of hosts in a deployment. + * + * @return hosts + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HOSTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FleetDeploymentHostsPage getHosts() { + return hosts; + } + + public void setHosts(FleetDeploymentHostsPage hosts) { + this.hosts = hosts; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetDeploymentResponseMeta + */ + @JsonAnySetter + public FleetDeploymentResponseMeta putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetDeploymentResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetDeploymentResponseMeta fleetDeploymentResponseMeta = (FleetDeploymentResponseMeta) o; + return Objects.equals(this.hosts, fleetDeploymentResponseMeta.hosts) + && Objects.equals( + this.additionalProperties, fleetDeploymentResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(hosts, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetDeploymentResponseMeta {\n"); + sb.append(" hosts: ").append(toIndentedString(hosts)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetSchedule.java b/src/main/java/com/datadog/api/client/v2/model/FleetSchedule.java new file mode 100644 index 00000000000..94b55087844 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetSchedule.java @@ -0,0 +1,209 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A schedule that automatically creates deployments based on a recurrence rule. */ +@JsonPropertyOrder({ + FleetSchedule.JSON_PROPERTY_ATTRIBUTES, + FleetSchedule.JSON_PROPERTY_ID, + FleetSchedule.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetSchedule { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private FleetScheduleAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private FleetScheduleResourceType type = FleetScheduleResourceType.SCHEDULE; + + public FleetSchedule() {} + + @JsonCreator + public FleetSchedule( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + FleetScheduleAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) FleetScheduleResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public FleetSchedule attributes(FleetScheduleAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a schedule in the response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FleetScheduleAttributes getAttributes() { + return attributes; + } + + public void setAttributes(FleetScheduleAttributes attributes) { + this.attributes = attributes; + } + + public FleetSchedule id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the schedule. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public FleetSchedule type(FleetScheduleResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of schedule resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FleetScheduleResourceType getType() { + return type; + } + + public void setType(FleetScheduleResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetSchedule + */ + @JsonAnySetter + public FleetSchedule putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetSchedule object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetSchedule fleetSchedule = (FleetSchedule) o; + return Objects.equals(this.attributes, fleetSchedule.attributes) + && Objects.equals(this.id, fleetSchedule.id) + && Objects.equals(this.type, fleetSchedule.type) + && Objects.equals(this.additionalProperties, fleetSchedule.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetSchedule {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetScheduleAttributes.java b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleAttributes.java new file mode 100644 index 00000000000..9da20c5506b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleAttributes.java @@ -0,0 +1,374 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a schedule in the response. */ +@JsonPropertyOrder({ + FleetScheduleAttributes.JSON_PROPERTY_CREATED_AT_UNIX, + FleetScheduleAttributes.JSON_PROPERTY_CREATED_BY, + FleetScheduleAttributes.JSON_PROPERTY_NAME, + FleetScheduleAttributes.JSON_PROPERTY_QUERY, + FleetScheduleAttributes.JSON_PROPERTY_RULE, + FleetScheduleAttributes.JSON_PROPERTY_STATUS, + FleetScheduleAttributes.JSON_PROPERTY_UPDATED_AT_UNIX, + FleetScheduleAttributes.JSON_PROPERTY_UPDATED_BY, + FleetScheduleAttributes.JSON_PROPERTY_VERSION_TO_LATEST +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetScheduleAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT_UNIX = "created_at_unix"; + private Long createdAtUnix; + + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private String createdBy; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_RULE = "rule"; + private FleetScheduleRecurrenceRule rule; + + public static final String JSON_PROPERTY_STATUS = "status"; + private FleetScheduleStatus status; + + public static final String JSON_PROPERTY_UPDATED_AT_UNIX = "updated_at_unix"; + private Long updatedAtUnix; + + public static final String JSON_PROPERTY_UPDATED_BY = "updated_by"; + private String updatedBy; + + public static final String JSON_PROPERTY_VERSION_TO_LATEST = "version_to_latest"; + private Long versionToLatest; + + public FleetScheduleAttributes createdAtUnix(Long createdAtUnix) { + this.createdAtUnix = createdAtUnix; + return this; + } + + /** + * Unix timestamp (seconds since epoch) when the schedule was created. + * + * @return createdAtUnix + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT_UNIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCreatedAtUnix() { + return createdAtUnix; + } + + public void setCreatedAtUnix(Long createdAtUnix) { + this.createdAtUnix = createdAtUnix; + } + + public FleetScheduleAttributes createdBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * User handle of the person who created the schedule. + * + * @return createdBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public FleetScheduleAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Human-readable name for the schedule. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public FleetScheduleAttributes query(String query) { + this.query = query; + return this; + } + + /** + * Query used to filter and select target hosts for scheduled deployments. Uses the Datadog query + * syntax. + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public FleetScheduleAttributes rule(FleetScheduleRecurrenceRule rule) { + this.rule = rule; + this.unparsed |= rule.unparsed; + return this; + } + + /** + * Defines the recurrence pattern for the schedule. Specifies when deployments should be + * automatically triggered based on maintenance windows. + * + * @return rule + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FleetScheduleRecurrenceRule getRule() { + return rule; + } + + public void setRule(FleetScheduleRecurrenceRule rule) { + this.rule = rule; + } + + public FleetScheduleAttributes status(FleetScheduleStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * 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. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FleetScheduleStatus getStatus() { + return status; + } + + public void setStatus(FleetScheduleStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public FleetScheduleAttributes updatedAtUnix(Long updatedAtUnix) { + this.updatedAtUnix = updatedAtUnix; + return this; + } + + /** + * Unix timestamp (seconds since epoch) when the schedule was last updated. + * + * @return updatedAtUnix + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT_UNIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getUpdatedAtUnix() { + return updatedAtUnix; + } + + public void setUpdatedAtUnix(Long updatedAtUnix) { + this.updatedAtUnix = updatedAtUnix; + } + + public FleetScheduleAttributes updatedBy(String updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + /** + * User handle of the person who last updated the schedule. + * + * @return updatedBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public FleetScheduleAttributes versionToLatest(Long versionToLatest) { + this.versionToLatest = versionToLatest; + return this; + } + + /** + * 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. minimum: 0 maximum: 2 + * + * @return versionToLatest + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION_TO_LATEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersionToLatest() { + return versionToLatest; + } + + public void setVersionToLatest(Long versionToLatest) { + this.versionToLatest = versionToLatest; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetScheduleAttributes + */ + @JsonAnySetter + public FleetScheduleAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetScheduleAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetScheduleAttributes fleetScheduleAttributes = (FleetScheduleAttributes) o; + return Objects.equals(this.createdAtUnix, fleetScheduleAttributes.createdAtUnix) + && Objects.equals(this.createdBy, fleetScheduleAttributes.createdBy) + && Objects.equals(this.name, fleetScheduleAttributes.name) + && Objects.equals(this.query, fleetScheduleAttributes.query) + && Objects.equals(this.rule, fleetScheduleAttributes.rule) + && Objects.equals(this.status, fleetScheduleAttributes.status) + && Objects.equals(this.updatedAtUnix, fleetScheduleAttributes.updatedAtUnix) + && Objects.equals(this.updatedBy, fleetScheduleAttributes.updatedBy) + && Objects.equals(this.versionToLatest, fleetScheduleAttributes.versionToLatest) + && Objects.equals(this.additionalProperties, fleetScheduleAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAtUnix, + createdBy, + name, + query, + rule, + status, + updatedAtUnix, + updatedBy, + versionToLatest, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetScheduleAttributes {\n"); + sb.append(" createdAtUnix: ").append(toIndentedString(createdAtUnix)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" updatedAtUnix: ").append(toIndentedString(updatedAtUnix)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" versionToLatest: ").append(toIndentedString(versionToLatest)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetScheduleCreate.java b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleCreate.java new file mode 100644 index 00000000000..8d10bd4cd2d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleCreate.java @@ -0,0 +1,181 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for creating a new schedule. */ +@JsonPropertyOrder({ + FleetScheduleCreate.JSON_PROPERTY_ATTRIBUTES, + FleetScheduleCreate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetScheduleCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private FleetScheduleCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private FleetScheduleResourceType type = FleetScheduleResourceType.SCHEDULE; + + public FleetScheduleCreate() {} + + @JsonCreator + public FleetScheduleCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + FleetScheduleCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) FleetScheduleResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public FleetScheduleCreate attributes(FleetScheduleCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating a new schedule. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FleetScheduleCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(FleetScheduleCreateAttributes attributes) { + this.attributes = attributes; + } + + public FleetScheduleCreate type(FleetScheduleResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of schedule resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FleetScheduleResourceType getType() { + return type; + } + + public void setType(FleetScheduleResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetScheduleCreate + */ + @JsonAnySetter + public FleetScheduleCreate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetScheduleCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetScheduleCreate fleetScheduleCreate = (FleetScheduleCreate) o; + return Objects.equals(this.attributes, fleetScheduleCreate.attributes) + && Objects.equals(this.type, fleetScheduleCreate.type) + && Objects.equals(this.additionalProperties, fleetScheduleCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetScheduleCreate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetScheduleCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleCreateAttributes.java new file mode 100644 index 00000000000..1ee1b4065dd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleCreateAttributes.java @@ -0,0 +1,268 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for creating a new schedule. */ +@JsonPropertyOrder({ + FleetScheduleCreateAttributes.JSON_PROPERTY_NAME, + FleetScheduleCreateAttributes.JSON_PROPERTY_QUERY, + FleetScheduleCreateAttributes.JSON_PROPERTY_RULE, + FleetScheduleCreateAttributes.JSON_PROPERTY_STATUS, + FleetScheduleCreateAttributes.JSON_PROPERTY_VERSION_TO_LATEST +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetScheduleCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_RULE = "rule"; + private FleetScheduleRecurrenceRule rule; + + public static final String JSON_PROPERTY_STATUS = "status"; + private FleetScheduleStatus status; + + public static final String JSON_PROPERTY_VERSION_TO_LATEST = "version_to_latest"; + private Long versionToLatest; + + public FleetScheduleCreateAttributes() {} + + @JsonCreator + public FleetScheduleCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE) FleetScheduleRecurrenceRule rule) { + this.name = name; + this.query = query; + this.rule = rule; + this.unparsed |= rule.unparsed; + } + + public FleetScheduleCreateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Human-readable name for the schedule. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public FleetScheduleCreateAttributes query(String query) { + this.query = query; + return this; + } + + /** + * Query used to filter and select target hosts for scheduled deployments. Uses the Datadog query + * syntax. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public FleetScheduleCreateAttributes rule(FleetScheduleRecurrenceRule rule) { + this.rule = rule; + this.unparsed |= rule.unparsed; + return this; + } + + /** + * Defines the recurrence pattern for the schedule. Specifies when deployments should be + * automatically triggered based on maintenance windows. + * + * @return rule + */ + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FleetScheduleRecurrenceRule getRule() { + return rule; + } + + public void setRule(FleetScheduleRecurrenceRule rule) { + this.rule = rule; + } + + public FleetScheduleCreateAttributes status(FleetScheduleStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * 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. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FleetScheduleStatus getStatus() { + return status; + } + + public void setStatus(FleetScheduleStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public FleetScheduleCreateAttributes versionToLatest(Long versionToLatest) { + this.versionToLatest = versionToLatest; + return this; + } + + /** + * 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. minimum: 0 maximum: 2 + * + * @return versionToLatest + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION_TO_LATEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersionToLatest() { + return versionToLatest; + } + + public void setVersionToLatest(Long versionToLatest) { + this.versionToLatest = versionToLatest; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetScheduleCreateAttributes + */ + @JsonAnySetter + public FleetScheduleCreateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetScheduleCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetScheduleCreateAttributes fleetScheduleCreateAttributes = (FleetScheduleCreateAttributes) o; + return Objects.equals(this.name, fleetScheduleCreateAttributes.name) + && Objects.equals(this.query, fleetScheduleCreateAttributes.query) + && Objects.equals(this.rule, fleetScheduleCreateAttributes.rule) + && Objects.equals(this.status, fleetScheduleCreateAttributes.status) + && Objects.equals(this.versionToLatest, fleetScheduleCreateAttributes.versionToLatest) + && Objects.equals( + this.additionalProperties, fleetScheduleCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, query, rule, status, versionToLatest, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetScheduleCreateAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" versionToLatest: ").append(toIndentedString(versionToLatest)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetScheduleCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleCreateRequest.java new file mode 100644 index 00000000000..0117e43368b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleCreateRequest.java @@ -0,0 +1,146 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for creating a new schedule. */ +@JsonPropertyOrder({FleetScheduleCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetScheduleCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private FleetScheduleCreate data; + + public FleetScheduleCreateRequest() {} + + @JsonCreator + public FleetScheduleCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) FleetScheduleCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public FleetScheduleCreateRequest data(FleetScheduleCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for creating a new schedule. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FleetScheduleCreate getData() { + return data; + } + + public void setData(FleetScheduleCreate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetScheduleCreateRequest + */ + @JsonAnySetter + public FleetScheduleCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetScheduleCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetScheduleCreateRequest fleetScheduleCreateRequest = (FleetScheduleCreateRequest) o; + return Objects.equals(this.data, fleetScheduleCreateRequest.data) + && Objects.equals( + this.additionalProperties, fleetScheduleCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetScheduleCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetSchedulePatch.java b/src/main/java/com/datadog/api/client/v2/model/FleetSchedulePatch.java new file mode 100644 index 00000000000..a9672bdf12b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetSchedulePatch.java @@ -0,0 +1,178 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for partially updating a schedule. */ +@JsonPropertyOrder({ + FleetSchedulePatch.JSON_PROPERTY_ATTRIBUTES, + FleetSchedulePatch.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetSchedulePatch { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private FleetSchedulePatchAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private FleetScheduleResourceType type = FleetScheduleResourceType.SCHEDULE; + + public FleetSchedulePatch() {} + + @JsonCreator + public FleetSchedulePatch( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) FleetScheduleResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public FleetSchedulePatch attributes(FleetSchedulePatchAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for partially updating a schedule. All fields are optional. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FleetSchedulePatchAttributes getAttributes() { + return attributes; + } + + public void setAttributes(FleetSchedulePatchAttributes attributes) { + this.attributes = attributes; + } + + public FleetSchedulePatch type(FleetScheduleResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of schedule resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FleetScheduleResourceType getType() { + return type; + } + + public void setType(FleetScheduleResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetSchedulePatch + */ + @JsonAnySetter + public FleetSchedulePatch putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetSchedulePatch object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetSchedulePatch fleetSchedulePatch = (FleetSchedulePatch) o; + return Objects.equals(this.attributes, fleetSchedulePatch.attributes) + && Objects.equals(this.type, fleetSchedulePatch.type) + && Objects.equals(this.additionalProperties, fleetSchedulePatch.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetSchedulePatch {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetSchedulePatchAttributes.java b/src/main/java/com/datadog/api/client/v2/model/FleetSchedulePatchAttributes.java new file mode 100644 index 00000000000..8b976a83a8c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetSchedulePatchAttributes.java @@ -0,0 +1,257 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for partially updating a schedule. All fields are optional. */ +@JsonPropertyOrder({ + FleetSchedulePatchAttributes.JSON_PROPERTY_NAME, + FleetSchedulePatchAttributes.JSON_PROPERTY_QUERY, + FleetSchedulePatchAttributes.JSON_PROPERTY_RULE, + FleetSchedulePatchAttributes.JSON_PROPERTY_STATUS, + FleetSchedulePatchAttributes.JSON_PROPERTY_VERSION_TO_LATEST +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetSchedulePatchAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_RULE = "rule"; + private FleetScheduleRecurrenceRule rule; + + public static final String JSON_PROPERTY_STATUS = "status"; + private FleetScheduleStatus status; + + public static final String JSON_PROPERTY_VERSION_TO_LATEST = "version_to_latest"; + private Long versionToLatest; + + public FleetSchedulePatchAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Human-readable name for the schedule. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public FleetSchedulePatchAttributes query(String query) { + this.query = query; + return this; + } + + /** + * Query used to filter and select target hosts for scheduled deployments. Uses the Datadog query + * syntax. + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public FleetSchedulePatchAttributes rule(FleetScheduleRecurrenceRule rule) { + this.rule = rule; + this.unparsed |= rule.unparsed; + return this; + } + + /** + * Defines the recurrence pattern for the schedule. Specifies when deployments should be + * automatically triggered based on maintenance windows. + * + * @return rule + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FleetScheduleRecurrenceRule getRule() { + return rule; + } + + public void setRule(FleetScheduleRecurrenceRule rule) { + this.rule = rule; + } + + public FleetSchedulePatchAttributes status(FleetScheduleStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * 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. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FleetScheduleStatus getStatus() { + return status; + } + + public void setStatus(FleetScheduleStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public FleetSchedulePatchAttributes versionToLatest(Long versionToLatest) { + this.versionToLatest = versionToLatest; + return this; + } + + /** + * 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. minimum: 0 maximum: 2 + * + * @return versionToLatest + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION_TO_LATEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersionToLatest() { + return versionToLatest; + } + + public void setVersionToLatest(Long versionToLatest) { + this.versionToLatest = versionToLatest; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetSchedulePatchAttributes + */ + @JsonAnySetter + public FleetSchedulePatchAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetSchedulePatchAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetSchedulePatchAttributes fleetSchedulePatchAttributes = (FleetSchedulePatchAttributes) o; + return Objects.equals(this.name, fleetSchedulePatchAttributes.name) + && Objects.equals(this.query, fleetSchedulePatchAttributes.query) + && Objects.equals(this.rule, fleetSchedulePatchAttributes.rule) + && Objects.equals(this.status, fleetSchedulePatchAttributes.status) + && Objects.equals(this.versionToLatest, fleetSchedulePatchAttributes.versionToLatest) + && Objects.equals( + this.additionalProperties, fleetSchedulePatchAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, query, rule, status, versionToLatest, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetSchedulePatchAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" versionToLatest: ").append(toIndentedString(versionToLatest)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetSchedulePatchRequest.java b/src/main/java/com/datadog/api/client/v2/model/FleetSchedulePatchRequest.java new file mode 100644 index 00000000000..fbaca6c5140 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetSchedulePatchRequest.java @@ -0,0 +1,146 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for partially updating a schedule. */ +@JsonPropertyOrder({FleetSchedulePatchRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetSchedulePatchRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private FleetSchedulePatch data; + + public FleetSchedulePatchRequest() {} + + @JsonCreator + public FleetSchedulePatchRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) FleetSchedulePatch data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public FleetSchedulePatchRequest data(FleetSchedulePatch data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for partially updating a schedule. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FleetSchedulePatch getData() { + return data; + } + + public void setData(FleetSchedulePatch data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetSchedulePatchRequest + */ + @JsonAnySetter + public FleetSchedulePatchRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetSchedulePatchRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetSchedulePatchRequest fleetSchedulePatchRequest = (FleetSchedulePatchRequest) o; + return Objects.equals(this.data, fleetSchedulePatchRequest.data) + && Objects.equals( + this.additionalProperties, fleetSchedulePatchRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetSchedulePatchRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetScheduleRecurrenceRule.java b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleRecurrenceRule.java new file mode 100644 index 00000000000..b583e88b1cd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleRecurrenceRule.java @@ -0,0 +1,256 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * Defines the recurrence pattern for the schedule. Specifies when deployments should be + * automatically triggered based on maintenance windows. + */ +@JsonPropertyOrder({ + FleetScheduleRecurrenceRule.JSON_PROPERTY_DAYS_OF_WEEK, + FleetScheduleRecurrenceRule.JSON_PROPERTY_MAINTENANCE_WINDOW_DURATION, + FleetScheduleRecurrenceRule.JSON_PROPERTY_START_MAINTENANCE_WINDOW, + FleetScheduleRecurrenceRule.JSON_PROPERTY_TIMEZONE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetScheduleRecurrenceRule { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DAYS_OF_WEEK = "days_of_week"; + private List daysOfWeek = new ArrayList<>(); + + public static final String JSON_PROPERTY_MAINTENANCE_WINDOW_DURATION = + "maintenance_window_duration"; + private Long maintenanceWindowDuration; + + public static final String JSON_PROPERTY_START_MAINTENANCE_WINDOW = "start_maintenance_window"; + private String startMaintenanceWindow; + + public static final String JSON_PROPERTY_TIMEZONE = "timezone"; + private String timezone; + + public FleetScheduleRecurrenceRule() {} + + @JsonCreator + public FleetScheduleRecurrenceRule( + @JsonProperty(required = true, value = JSON_PROPERTY_DAYS_OF_WEEK) List daysOfWeek, + @JsonProperty(required = true, value = JSON_PROPERTY_MAINTENANCE_WINDOW_DURATION) + Long maintenanceWindowDuration, + @JsonProperty(required = true, value = JSON_PROPERTY_START_MAINTENANCE_WINDOW) + String startMaintenanceWindow, + @JsonProperty(required = true, value = JSON_PROPERTY_TIMEZONE) String timezone) { + this.daysOfWeek = daysOfWeek; + this.maintenanceWindowDuration = maintenanceWindowDuration; + this.startMaintenanceWindow = startMaintenanceWindow; + this.timezone = timezone; + } + + public FleetScheduleRecurrenceRule daysOfWeek(List daysOfWeek) { + this.daysOfWeek = daysOfWeek; + return this; + } + + public FleetScheduleRecurrenceRule addDaysOfWeekItem(String daysOfWeekItem) { + this.daysOfWeek.add(daysOfWeekItem); + return this; + } + + /** + * List of days of the week when the schedule should trigger. Valid values are: "Mon", "Tue", + * "Wed", "Thu", "Fri", "Sat", "Sun". + * + * @return daysOfWeek + */ + @JsonProperty(JSON_PROPERTY_DAYS_OF_WEEK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getDaysOfWeek() { + return daysOfWeek; + } + + public void setDaysOfWeek(List daysOfWeek) { + this.daysOfWeek = daysOfWeek; + } + + public FleetScheduleRecurrenceRule maintenanceWindowDuration(Long maintenanceWindowDuration) { + this.maintenanceWindowDuration = maintenanceWindowDuration; + return this; + } + + /** + * Duration of the maintenance window in minutes. + * + * @return maintenanceWindowDuration + */ + @JsonProperty(JSON_PROPERTY_MAINTENANCE_WINDOW_DURATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getMaintenanceWindowDuration() { + return maintenanceWindowDuration; + } + + public void setMaintenanceWindowDuration(Long maintenanceWindowDuration) { + this.maintenanceWindowDuration = maintenanceWindowDuration; + } + + public FleetScheduleRecurrenceRule startMaintenanceWindow(String startMaintenanceWindow) { + this.startMaintenanceWindow = startMaintenanceWindow; + return this; + } + + /** + * Start time of the maintenance window in 24-hour clock format (HH:MM). Deployments will be + * triggered at this time on the specified days. + * + * @return startMaintenanceWindow + */ + @JsonProperty(JSON_PROPERTY_START_MAINTENANCE_WINDOW) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStartMaintenanceWindow() { + return startMaintenanceWindow; + } + + public void setStartMaintenanceWindow(String startMaintenanceWindow) { + this.startMaintenanceWindow = startMaintenanceWindow; + } + + public FleetScheduleRecurrenceRule timezone(String timezone) { + this.timezone = timezone; + return this; + } + + /** + * Timezone for the schedule in IANA Time Zone Database format (e.g., "America/New_York", "UTC"). + * + * @return timezone + */ + @JsonProperty(JSON_PROPERTY_TIMEZONE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTimezone() { + return timezone; + } + + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetScheduleRecurrenceRule + */ + @JsonAnySetter + public FleetScheduleRecurrenceRule putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetScheduleRecurrenceRule object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetScheduleRecurrenceRule fleetScheduleRecurrenceRule = (FleetScheduleRecurrenceRule) o; + return Objects.equals(this.daysOfWeek, fleetScheduleRecurrenceRule.daysOfWeek) + && Objects.equals( + this.maintenanceWindowDuration, fleetScheduleRecurrenceRule.maintenanceWindowDuration) + && Objects.equals( + this.startMaintenanceWindow, fleetScheduleRecurrenceRule.startMaintenanceWindow) + && Objects.equals(this.timezone, fleetScheduleRecurrenceRule.timezone) + && Objects.equals( + this.additionalProperties, fleetScheduleRecurrenceRule.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + daysOfWeek, + maintenanceWindowDuration, + startMaintenanceWindow, + timezone, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetScheduleRecurrenceRule {\n"); + sb.append(" daysOfWeek: ").append(toIndentedString(daysOfWeek)).append("\n"); + sb.append(" maintenanceWindowDuration: ") + .append(toIndentedString(maintenanceWindowDuration)) + .append("\n"); + sb.append(" startMaintenanceWindow: ") + .append(toIndentedString(startMaintenanceWindow)) + .append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetScheduleResourceType.java b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleResourceType.java new file mode 100644 index 00000000000..d77daa2bedc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleResourceType.java @@ -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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of schedule resource. */ +@JsonSerialize(using = FleetScheduleResourceType.FleetScheduleResourceTypeSerializer.class) +public class FleetScheduleResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("schedule")); + + public static final FleetScheduleResourceType SCHEDULE = + new FleetScheduleResourceType("schedule"); + + FleetScheduleResourceType(String value) { + super(value, allowedValues); + } + + public static class FleetScheduleResourceTypeSerializer + extends StdSerializer { + public FleetScheduleResourceTypeSerializer(Class t) { + super(t); + } + + public FleetScheduleResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + FleetScheduleResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static FleetScheduleResourceType fromValue(String value) { + return new FleetScheduleResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetScheduleResponse.java b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleResponse.java new file mode 100644 index 00000000000..5ad5961561e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleResponse.java @@ -0,0 +1,136 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a single schedule. */ +@JsonPropertyOrder({FleetScheduleResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetScheduleResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private FleetSchedule data; + + public FleetScheduleResponse data(FleetSchedule data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A schedule that automatically creates deployments based on a recurrence rule. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FleetSchedule getData() { + return data; + } + + public void setData(FleetSchedule data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetScheduleResponse + */ + @JsonAnySetter + public FleetScheduleResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetScheduleResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetScheduleResponse fleetScheduleResponse = (FleetScheduleResponse) o; + return Objects.equals(this.data, fleetScheduleResponse.data) + && Objects.equals(this.additionalProperties, fleetScheduleResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetScheduleResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetScheduleStatus.java b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleStatus.java new file mode 100644 index 00000000000..2b3e902e9fd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetScheduleStatus.java @@ -0,0 +1,60 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * 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. + */ +@JsonSerialize(using = FleetScheduleStatus.FleetScheduleStatusSerializer.class) +public class FleetScheduleStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("active", "inactive")); + + public static final FleetScheduleStatus ACTIVE = new FleetScheduleStatus("active"); + public static final FleetScheduleStatus INACTIVE = new FleetScheduleStatus("inactive"); + + FleetScheduleStatus(String value) { + super(value, allowedValues); + } + + public static class FleetScheduleStatusSerializer extends StdSerializer { + public FleetScheduleStatusSerializer(Class t) { + super(t); + } + + public FleetScheduleStatusSerializer() { + this(null); + } + + @Override + public void serialize( + FleetScheduleStatus value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static FleetScheduleStatus fromValue(String value) { + return new FleetScheduleStatus(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FleetSchedulesResponse.java b/src/main/java/com/datadog/api/client/v2/model/FleetSchedulesResponse.java new file mode 100644 index 00000000000..8271263d013 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FleetSchedulesResponse.java @@ -0,0 +1,154 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of schedules. */ +@JsonPropertyOrder({FleetSchedulesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FleetSchedulesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public FleetSchedulesResponse() {} + + @JsonCreator + public FleetSchedulesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public FleetSchedulesResponse data(List data) { + this.data = data; + for (FleetSchedule item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public FleetSchedulesResponse addDataItem(FleetSchedule dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of schedules. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FleetSchedulesResponse + */ + @JsonAnySetter + public FleetSchedulesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FleetSchedulesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FleetSchedulesResponse fleetSchedulesResponse = (FleetSchedulesResponse) o; + return Objects.equals(this.data, fleetSchedulesResponse.data) + && Objects.equals(this.additionalProperties, fleetSchedulesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FleetSchedulesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/fleet_automation.feature b/src/test/resources/com/datadog/api/client/v2/api/fleet_automation.feature index 2e91b6e0a85..0024399c745 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/fleet_automation.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 7c9df160aad..12852be0f21 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 1865379ddbe..07c8d427480 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/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": {