diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index db3332717d..a1a7d3fa1e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -4,6 +4,15 @@ components: headers: {} links: {} parameters: + AIWorkflowId: + description: The UUID of the AI workflow. + example: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + in: path + name: id + required: true + schema: + format: uuid + type: string APIKeyCategoryParameter: description: Filter API keys by category. in: query @@ -1485,6 +1494,15 @@ components: schema: example: "00000000-0000-9999-0000-000000000000" type: string + WorkflowExecutionId: + description: The UUID of the workflow execution. + example: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + in: path + name: id + required: true + schema: + format: uuid + type: string WorkflowId: description: The ID of the workflow. in: path @@ -1659,6 +1677,131 @@ components: $ref: "#/components/schemas/JSONAPIErrorResponse" description: The server cannot process the request because it contains invalid data. schemas: + AIWorkflowAttributes: + description: Attributes of an AI workflow. + properties: + completed_at: + description: Timestamp when the workflow completed. Null if not yet completed. + example: "2024-01-20T15:00:00Z" + format: date-time + nullable: true + type: string + created_at: + description: Timestamp when the workflow was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + entities: + description: A list of entity groups. Each group is processed in a separate workflow execution. + example: + - - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + items: + items: + $ref: "#/components/schemas/Entity" + type: array + type: array + filtering_logic: + $ref: "#/components/schemas/FilteringLogic" + grouping_logic: + description: The logic used to group entities into execution batches. + example: "by-service" + type: string + idp_campaign_id: + description: The IDP campaign ID associated with this workflow. + example: "campaign-abc123" + type: string + max_number_of_entities_per_session: + description: Maximum number of entities processed in a single execution session. + example: 5 + format: int64 + type: integer + prompt: + description: The AI prompt guiding the dependency upgrade automation. + example: "Upgrade the lodash dependency to version 4.17.21" + type: string + repository: + description: The target repository in owner/repo format. + example: "DataDog/datadog-agent" + type: string + updated_at: + description: Timestamp when the workflow was last updated. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + user: + description: The username of the user who created the workflow. + example: "john.doe@example.com" + type: string + workflow_id: + description: The UUID of the underlying Datadog Workflow Automation workflow. + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + format: uuid + type: string + workflow_name: + description: The human-readable name of the workflow. + example: "Upgrade lodash to 4.17.21" + type: string + required: + - workflow_id + - workflow_name + - idp_campaign_id + - user + - created_at + - updated_at + - prompt + - grouping_logic + - max_number_of_entities_per_session + - filtering_logic + - repository + - entities + type: object + AIWorkflowData: + description: A single AI workflow resource. + properties: + attributes: + $ref: "#/components/schemas/AIWorkflowAttributes" + id: + description: The unique identifier of the AI workflow. + example: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + format: uuid + type: string + type: + $ref: "#/components/schemas/AIWorkflowDataType" + required: + - id + - type + - attributes + type: object + AIWorkflowDataType: + description: The resource type for AI workflows. + enum: + - ai-workflows + example: "ai-workflows" + type: string + x-enum-varnames: + - AI_WORKFLOWS + AIWorkflowListMeta: + description: Metadata for the list AI workflows response. + properties: + total: + description: Total number of AI workflows matching the filter criteria. + example: 42 + format: int64 + type: integer + required: + - total + type: object + AIWorkflowResponse: + description: Response containing a single AI workflow. + properties: + data: + $ref: "#/components/schemas/AIWorkflowData" + required: + - data + type: object APIErrorResponse: description: API error response. properties: @@ -10604,6 +10747,25 @@ components: meta: $ref: "#/components/schemas/DataDeletionResponseMeta" type: object + CancelWorkflowExecutionsData: + description: Data returned after canceling workflow executions. + properties: + canceled_count: + description: The number of running instances that were successfully canceled. + example: 3 + format: int64 + type: integer + required: + - canceled_count + type: object + CancelWorkflowExecutionsResponse: + description: Response from canceling all running workflow execution instances. + properties: + data: + $ref: "#/components/schemas/CancelWorkflowExecutionsData" + required: + - data + type: object Case: description: A case properties: @@ -16030,6 +16192,63 @@ components: type: integer type: object x-model-simple-name: SpaCpu + CreateAIWorkflowRequest: + description: Request body for creating a new AI workflow. + properties: + entities: + description: A list of entity groups. Each group is processed in a separate workflow execution. + example: + - - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + items: + items: + $ref: "#/components/schemas/Entity" + type: array + type: array + filtering_logic: + $ref: "#/components/schemas/FilteringLogic" + grouping_logic: + description: The logic used to group entities into batches for execution. + example: "by-service" + type: string + idp_campaign_id: + description: The IDP campaign ID associated with this workflow. + example: "campaign-abc123" + type: string + max_number_of_entities_per_session: + description: Maximum number of entities allowed per execution session. + example: 5 + format: int64 + type: integer + prompt: + description: The AI prompt used to guide the dependency upgrade automation. + example: "Upgrade the lodash dependency to version 4.17.21" + type: string + repository: + description: The target repository in owner/repo format. + example: "DataDog/datadog-agent" + type: string + user: + description: The username of the user initiating the workflow. + example: "john.doe@example.com" + type: string + workflow_name: + description: A human-readable name for the workflow. + example: "Upgrade lodash to 4.17.21" + type: string + required: + - workflow_name + - idp_campaign_id + - user + - prompt + - grouping_logic + - max_number_of_entities_per_session + - filtering_logic + - repository + - entities + type: object CreateActionConnectionRequest: description: Request used to create an action connection. properties: @@ -18632,6 +18851,17 @@ components: - name - value type: object + CreateWorkflowExecutionsResponse: + description: Response containing a list of created workflow executions. + properties: + data: + description: List of created workflow execution resources. + items: + $ref: "#/components/schemas/WorkflowExecutionData" + type: array + required: + - data + type: object CreateWorkflowRequest: description: A request object for creating a new workflow. example: @@ -24258,6 +24488,28 @@ components: description: Field used to enable or disable the rule. example: true type: boolean + Entity: + description: An entity participating in the dependency upgrade workflow. + properties: + entity_kind: + description: The kind of the entity (for example, service or package). + example: "service" + type: string + entity_name: + description: The name of the entity. + example: "my-service" + type: string + entity_namespace: + description: The namespace of the entity. + example: "default" + type: string + entity_team: + description: The team that owns the entity. + example: "platform" + type: string + required: + - entity_name + type: object EntityAttributes: description: Entity attributes. properties: @@ -24305,6 +24557,16 @@ components: description: Entity. type: string type: object + EntityGroup: + description: A group of entities to be processed together in a single workflow execution. + items: + $ref: "#/components/schemas/Entity" + type: array + EntityGroups: + description: A list of entity groups. Each group is processed in a separate workflow execution. + items: + $ref: "#/components/schemas/EntityGroup" + type: array EntityMeta: description: Entity metadata. properties: @@ -26878,6 +27140,56 @@ components: example: "One or several indexes are missing or invalid. Results hold data from the other indexes." type: string type: object + ExecutionStep: + description: A single step in a workflow execution. + properties: + completed_at: + description: Timestamp when the step completed. Null if not yet completed. + example: "2024-01-15T10:37:00Z" + format: date-time + nullable: true + type: string + error: + description: Error message if the step failed. + example: "Failed to create pull request: branch already exists" + type: string + id: + description: The unique identifier of the execution step. + example: "step-abc123" + type: string + name: + description: The name of the step. + example: "Create Pull Request" + type: string + started_at: + description: Timestamp when the step started. Null if not yet started. + example: "2024-01-15T10:36:00Z" + format: date-time + nullable: true + type: string + status: + $ref: "#/components/schemas/ExecutionStepStatus" + required: + - id + - name + - status + type: object + ExecutionStepStatus: + description: The current status of the step. + enum: + - PENDING + - RUNNING + - COMPLETED + - FAILED + - CANCELED + example: "COMPLETED" + type: string + x-enum-varnames: + - PENDING + - RUNNING + - COMPLETED + - FAILED + - CANCELED ExposureRolloutStepRequest: description: Rollout step request payload. properties: @@ -27736,6 +28048,11 @@ components: format: int64 type: integer type: object + FilteringLogic: + description: Arbitrary filtering criteria used to select entities for the workflow. + example: + teams: ["platform"] + type: object FiltersPerProduct: description: Product-specific filters for the dataset. properties: @@ -41124,6 +41441,20 @@ components: - first - last type: object + ListAIWorkflowsResponse: + description: Response containing a list of AI workflows. + properties: + data: + description: List of AI workflow resources. + items: + $ref: "#/components/schemas/AIWorkflowData" + type: array + meta: + $ref: "#/components/schemas/AIWorkflowListMeta" + required: + - data + - meta + type: object ListAPIsResponse: description: Response for `ListAPIs`. properties: @@ -41587,6 +41918,56 @@ components: required: - data type: object + ListExecutionStepsAttributes: + description: Attributes of an execution steps response. + properties: + steps: + description: The list of steps for the workflow execution. + example: + - completed_at: "2024-01-15T10:37:00Z" + id: "step-abc123" + name: "Create Pull Request" + started_at: "2024-01-15T10:36:00Z" + status: "COMPLETED" + items: + $ref: "#/components/schemas/ExecutionStep" + type: array + required: + - steps + type: object + ListExecutionStepsData: + description: Data for execution steps response. + properties: + attributes: + $ref: "#/components/schemas/ListExecutionStepsAttributes" + id: + description: The unique identifier of the workflow execution. + example: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + format: uuid + type: string + type: + $ref: "#/components/schemas/ListExecutionStepsDataType" + required: + - id + - type + - attributes + type: object + ListExecutionStepsDataType: + description: The resource type for workflow execution steps. + enum: + - workflow-execution-steps + example: "workflow-execution-steps" + type: string + x-enum-varnames: + - WORKFLOW_EXECUTION_STEPS + ListExecutionStepsResponse: + description: Response containing the execution steps for a workflow execution. + properties: + data: + $ref: "#/components/schemas/ListExecutionStepsData" + required: + - data + type: object ListFeatureFlagsResponse: description: Response containing a list of feature flags. properties: @@ -41829,6 +42210,56 @@ components: $ref: "#/components/schemas/OnCallNotificationRulesIncluded" type: array type: object + ListPROutputsAttributes: + description: Attributes of a PR outputs response. + properties: + pr_outputs: + description: The list of pull requests created by the workflow execution. + example: + - ci_status: "SUCCESSFUL" + pr_number: 1234 + pr_url: "https://github.com/DataDog/datadog-agent/pull/1234" + repository: "DataDog/datadog-agent" + status: "READY" + items: + $ref: "#/components/schemas/PROutput" + type: array + required: + - pr_outputs + type: object + ListPROutputsData: + description: Data for PR outputs response. + properties: + attributes: + $ref: "#/components/schemas/ListPROutputsAttributes" + id: + description: The unique identifier of the workflow execution. + example: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + format: uuid + type: string + type: + $ref: "#/components/schemas/ListPROutputsDataType" + required: + - id + - type + - attributes + type: object + ListPROutputsDataType: + description: The resource type for workflow execution PR outputs. + enum: + - workflow-execution-pr-outputs + example: "workflow-execution-pr-outputs" + type: string + x-enum-varnames: + - WORKFLOW_EXECUTION_PR_OUTPUTS + ListPROutputsResponse: + description: Response containing the PR outputs for a workflow execution. + properties: + data: + $ref: "#/components/schemas/ListPROutputsData" + required: + - data + type: object ListPersonalAccessTokensResponse: description: Response for a list of personal access tokens. properties: @@ -42054,6 +42485,17 @@ components: required: - data type: object + ListWorkflowInstancesResponse: + description: Response containing a list of workflow instance summaries. + properties: + data: + description: List of workflow instance summaries. + items: + $ref: "#/components/schemas/WorkflowInstanceSummaryData" + type: array + required: + - data + type: object Log: description: Object description of a log after being processed and stored by Datadog. properties: @@ -54155,6 +54597,57 @@ components: required: - data type: object + PROutput: + description: A pull request created by the dependency upgrade automation. + properties: + ci_status: + $ref: "#/components/schemas/PROutputCiStatus" + pr_number: + description: The pull request number. + example: 1234 + format: int64 + type: integer + pr_url: + description: The URL of the pull request. + example: "https://github.com/DataDog/datadog-agent/pull/1234" + type: string + repository: + description: The repository name in owner/repo format. + example: "DataDog/datadog-agent" + type: string + status: + $ref: "#/components/schemas/PROutputStatus" + required: + - pr_url + type: object + PROutputCiStatus: + description: The aggregate CI check status for the pull request. + enum: + - PENDING + - FAILED + - SUCCESSFUL + example: "SUCCESSFUL" + type: string + x-enum-varnames: + - PENDING + - FAILED + - SUCCESSFUL + PROutputStatus: + description: The current status of the pull request. + enum: + - PENDING + - DRAFT + - READY + - MERGED + - CLOSED + example: "READY" + type: string + x-enum-varnames: + - PENDING + - DRAFT + - READY + - MERGED + - CLOSED PageUrgency: default: high description: On-Call Page urgency level. @@ -80674,6 +81167,40 @@ components: data: $ref: "#/components/schemas/Deployment" type: object + UpdateAIWorkflowRequest: + description: Request body for updating an existing AI workflow. All fields are optional. + properties: + completed_at: + description: Timestamp marking when the workflow completed. + example: "2024-06-01T12:00:00Z" + format: date-time + type: string + entities: + $ref: "#/components/schemas/EntityGroups" + filtering_logic: + $ref: "#/components/schemas/FilteringLogic" + grouping_logic: + description: Updated entity grouping logic. + example: "by-team" + type: string + max_number_of_entities_per_session: + description: Updated maximum number of entities per execution session. + example: 10 + format: int64 + type: integer + prompt: + description: Updated AI prompt for the workflow. + example: "Updated prompt for the dependency upgrade" + type: string + repository: + description: Updated target repository in owner/repo format. + example: "DataDog/datadog-agent" + type: string + workflow_name: + description: Updated name for the workflow. + example: "Updated workflow name" + type: string + type: object UpdateActionConnectionRequest: description: Request used to update an action connection. properties: @@ -84415,6 +84942,79 @@ components: type: string writeOnly: true type: object + WorkflowExecutionAttributes: + description: Attributes of a workflow execution. + properties: + ai_workflow_id: + description: The ID of the parent AI workflow. + example: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + format: uuid + type: string + created_at: + description: Timestamp when the execution was created. + example: "2024-01-15T10:35:00Z" + format: date-time + type: string + entities: + description: The list of entities processed by this execution. + example: + - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + items: + $ref: "#/components/schemas/Entity" + type: array + instance_id: + description: The Datadog Workflow Automation instance ID for this execution. + example: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + format: uuid + type: string + updated_at: + description: Timestamp when the execution was last updated. + example: "2024-01-15T10:35:00Z" + format: date-time + type: string + required: + - instance_id + - ai_workflow_id + - created_at + - updated_at + - entities + type: object + WorkflowExecutionData: + description: A single workflow execution resource. + properties: + attributes: + $ref: "#/components/schemas/WorkflowExecutionAttributes" + id: + description: The unique identifier of the workflow execution. + example: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + format: uuid + type: string + type: + $ref: "#/components/schemas/WorkflowExecutionDataType" + required: + - id + - type + - attributes + type: object + WorkflowExecutionDataType: + description: The resource type for workflow executions. + enum: + - workflow-executions + example: "workflow-executions" + type: string + x-enum-varnames: + - WORKFLOW_EXECUTIONS + WorkflowExecutionResponse: + description: Response containing a single workflow execution. + properties: + data: + $ref: "#/components/schemas/WorkflowExecutionData" + required: + - data + type: object WorkflowInstanceCreateMeta: description: Additional information for creating a workflow instance. properties: @@ -84452,6 +85052,64 @@ components: description: The ID of the workflow instance type: string type: object + WorkflowInstanceSummaryAttributes: + description: Attributes of a workflow instance summary. + properties: + created_at: + description: Timestamp when the workflow instance was created. + example: "2024-01-15T10:35:00Z" + format: date-time + type: string + entities: + description: The entities being processed by this workflow instance. + example: + - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + items: + $ref: "#/components/schemas/Entity" + type: array + status: + $ref: "#/components/schemas/WorkflowInstanceSummaryAttributesStatus" + status_display: + description: A human-readable display name for the current status. + example: "Running" + type: string + required: + - created_at + - status + - status_display + - entities + type: object + WorkflowInstanceSummaryAttributesStatus: + $ref: "#/components/schemas/ExecutionStepStatus" + example: "COMPLETED" + WorkflowInstanceSummaryData: + description: A summary of a single workflow instance. + properties: + attributes: + $ref: "#/components/schemas/WorkflowInstanceSummaryAttributes" + id: + description: The unique identifier of the workflow instance. + example: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + format: uuid + type: string + type: + $ref: "#/components/schemas/WorkflowInstanceSummaryDataType" + required: + - id + - type + - attributes + type: object + WorkflowInstanceSummaryDataType: + description: The resource type for workflow instances. + enum: + - workflow-instances + example: "workflow-instances" + type: string + x-enum-varnames: + - WORKFLOW_INSTANCES WorkflowListInstancesResponse: additionalProperties: {} description: Response returned when listing workflow instances. @@ -99449,6 +100107,623 @@ paths: x-unstable: |- **Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/dependency-management/ai-workflow: + post: + description: Create a new AI workflow for dependency management. This creates both the workflow definition and initializes its executions. + operationId: CreateAIWorkflow + requestBody: + content: + application/json: + examples: + default: + value: + entities: + - - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + filtering_logic: + teams: ["platform"] + grouping_logic: "by-service" + idp_campaign_id: "campaign-abc123" + max_number_of_entities_per_session: 5 + prompt: "Upgrade the lodash dependency to version 4.17.21" + repository: "DataDog/datadog-agent" + user: "john.doe@example.com" + workflow_name: "Upgrade lodash to 4.17.21" + schema: + $ref: "#/components/schemas/CreateAIWorkflowRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + completed_at: + created_at: "2024-01-15T10:30:00Z" + entities: + - - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + filtering_logic: + teams: ["platform"] + grouping_logic: "by-service" + idp_campaign_id: "campaign-abc123" + max_number_of_entities_per_session: 5 + prompt: "Upgrade the lodash dependency to version 4.17.21" + repository: "DataDog/datadog-agent" + updated_at: "2024-01-15T10:30:00Z" + user: "john.doe@example.com" + workflow_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + workflow_name: "Upgrade lodash to 4.17.21" + id: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + type: "ai-workflows" + schema: + $ref: "#/components/schemas/AIWorkflowResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create an AI workflow + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/ai-workflows: + get: + description: List AI workflows for the organization with optional filters. + operationId: ListAIWorkflows + parameters: + - description: Filter workflows by IDP campaign ID. + example: "campaign-abc123" + in: query + name: idp_campaign_id + required: false + schema: + type: string + - description: Filter workflows by repository name (owner/repo format). + example: "DataDog/datadog-agent" + in: query + name: repository + required: false + schema: + type: string + - description: Filter workflows by the username of the creator. + example: "john.doe@example.com" + in: query + name: user + required: false + schema: + type: string + - description: Filter workflows by completion status. Use `true` to return only completed workflows, `false` for incomplete. + example: false + in: query + name: completed + required: false + schema: + type: boolean + - description: Filter workflows created after this timestamp (RFC3339 format). + example: "2024-01-01T00:00:00Z" + in: query + name: created_after + required: false + schema: + format: date-time + type: string + - description: Filter workflows created before this timestamp (RFC3339 format). + example: "2024-12-31T23:59:59Z" + in: query + name: created_before + required: false + schema: + format: date-time + type: string + - description: Maximum number of workflows to return. Defaults to 50, maximum 100. + example: 50 + in: query + name: limit + required: false + schema: + default: 50 + maximum: 100 + minimum: 1 + type: integer + - description: Number of workflows to skip for pagination. + example: 0 + in: query + name: offset + required: false + schema: + default: 0 + minimum: 0 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + completed_at: + created_at: "2024-01-15T10:30:00Z" + entities: + - - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + filtering_logic: + teams: ["platform"] + grouping_logic: "by-service" + idp_campaign_id: "campaign-abc123" + max_number_of_entities_per_session: 5 + prompt: "Upgrade the lodash dependency to version 4.17.21" + repository: "DataDog/datadog-agent" + updated_at: "2024-01-15T10:30:00Z" + user: "john.doe@example.com" + workflow_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + workflow_name: "Upgrade lodash to 4.17.21" + id: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + type: "ai-workflows" + meta: + total: 1 + schema: + $ref: "#/components/schemas/ListAIWorkflowsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List AI workflows + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/ai-workflows/{id}: + delete: + description: Delete a specific AI workflow. This also removes the workflow from Datadog Workflow Automation. + operationId: DeleteAIWorkflow + parameters: + - $ref: "#/components/parameters/AIWorkflowId" + responses: + "204": + description: No Content + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete an AI workflow + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + get: + description: Get details of a specific AI workflow by its ID. + operationId: GetAIWorkflow + parameters: + - $ref: "#/components/parameters/AIWorkflowId" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + completed_at: + created_at: "2024-01-15T10:30:00Z" + entities: + - - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + filtering_logic: + teams: ["platform"] + grouping_logic: "by-service" + idp_campaign_id: "campaign-abc123" + max_number_of_entities_per_session: 5 + prompt: "Upgrade the lodash dependency to version 4.17.21" + repository: "DataDog/datadog-agent" + updated_at: "2024-01-15T10:30:00Z" + user: "john.doe@example.com" + workflow_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + workflow_name: "Upgrade lodash to 4.17.21" + id: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + type: "ai-workflows" + schema: + $ref: "#/components/schemas/AIWorkflowResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get an AI workflow + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + patch: + description: Update the configuration of an existing AI workflow. Only the provided fields are updated. + operationId: UpdateAIWorkflow + parameters: + - $ref: "#/components/parameters/AIWorkflowId" + requestBody: + content: + application/json: + examples: + default: + value: + prompt: "Updated prompt for the dependency upgrade" + workflow_name: "Updated workflow name" + schema: + $ref: "#/components/schemas/UpdateAIWorkflowRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + completed_at: + created_at: "2024-01-15T10:30:00Z" + entities: + - - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + filtering_logic: + teams: ["platform"] + grouping_logic: "by-service" + idp_campaign_id: "campaign-abc123" + max_number_of_entities_per_session: 5 + prompt: "Updated prompt for the dependency upgrade" + repository: "DataDog/datadog-agent" + updated_at: "2024-01-16T09:00:00Z" + user: "john.doe@example.com" + workflow_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + workflow_name: "Updated workflow name" + id: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + type: "ai-workflows" + schema: + $ref: "#/components/schemas/AIWorkflowResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update an AI workflow + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/ai-workflows/{id}/cancel: + post: + description: Cancel all running workflow execution instances for the given AI workflow. + operationId: CancelWorkflowExecutions + parameters: + - $ref: "#/components/parameters/AIWorkflowId" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + canceled_count: 3 + schema: + $ref: "#/components/schemas/CancelWorkflowExecutionsResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Cancel workflow executions + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/ai-workflows/{id}/executions: + delete: + description: Delete all workflow executions for a given AI workflow. Running instances are canceled before deletion. + operationId: DeleteWorkflowExecutions + parameters: + - $ref: "#/components/parameters/AIWorkflowId" + responses: + "204": + description: No Content + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete workflow executions + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + post: + description: Create workflow executions for an AI workflow. One execution is created per entity group defined in the workflow. + operationId: CreateWorkflowExecution + parameters: + - $ref: "#/components/parameters/AIWorkflowId" + - description: Maximum number of new workflow instances to start. Must be between 1 and 30. + example: 10 + in: query + name: max_instances + required: false + schema: + maximum: 30 + minimum: 1 + type: integer + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + - attributes: + ai_workflow_id: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + created_at: "2024-01-15T10:35:00Z" + entities: + - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + instance_id: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + updated_at: "2024-01-15T10:35:00Z" + id: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + type: "workflow-executions" + schema: + $ref: "#/components/schemas/CreateWorkflowExecutionsResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create workflow executions + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/ai-workflows/{id}/instances: + get: + description: List all workflow instances for a given AI workflow with their live status from Workflow Automation and entity information. + operationId: ListAIWorkflowInstances + parameters: + - $ref: "#/components/parameters/AIWorkflowId" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-15T10:35:00Z" + entities: + - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + status: "RUNNING" + status_display: "Running" + id: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + type: "workflow-instances" + schema: + $ref: "#/components/schemas/ListWorkflowInstancesResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List AI workflow instances + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/workflow-executions/{id}/cancel: + post: + description: Cancel a specific workflow execution instance. Returns 409 if the instance is not currently in a running state. + operationId: CancelWorkflowExecution + parameters: + - $ref: "#/components/parameters/WorkflowExecutionId" + responses: + "204": + description: No Content + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Cancel a workflow execution + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/workflow-executions/{id}/pr-outputs: + get: + description: Get the pull request outputs for a specific workflow execution. Includes PR URL, status, and CI status enriched from GitHub. + operationId: ListPROutputs + parameters: + - $ref: "#/components/parameters/WorkflowExecutionId" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + pr_outputs: + - ci_status: "SUCCESSFUL" + pr_number: 1234 + pr_url: "https://github.com/DataDog/datadog-agent/pull/1234" + repository: "DataDog/datadog-agent" + status: "READY" + id: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + type: "workflow-execution-pr-outputs" + schema: + $ref: "#/components/schemas/ListPROutputsResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List PR outputs + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/workflow-executions/{id}/rerun: + post: + description: Rerun a failed or canceled workflow execution. This replaces the existing execution with a new one using the same entities. + operationId: RerunWorkflowExecution + parameters: + - $ref: "#/components/parameters/WorkflowExecutionId" + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + ai_workflow_id: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + created_at: "2024-01-15T10:35:00Z" + entities: + - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + instance_id: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + updated_at: "2024-01-15T10:35:00Z" + id: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + type: "workflow-executions" + schema: + $ref: "#/components/schemas/WorkflowExecutionResponse" + description: Created + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Rerun a workflow execution + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/workflow-executions/{id}/steps: + get: + description: Get the real-time step status for a specific workflow execution instance from Datadog Workflow Automation. + operationId: ListExecutionSteps + parameters: + - $ref: "#/components/parameters/WorkflowExecutionId" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + steps: + - completed_at: "2024-01-15T10:37:00Z" + id: "step-abc123" + name: "Create Pull Request" + started_at: "2024-01-15T10:36:00Z" + status: "COMPLETED" + id: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + type: "workflow-execution-steps" + schema: + $ref: "#/components/schemas/ListExecutionStepsResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List execution steps + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." /api/v2/deployment_gates: get: description: |- @@ -147618,6 +148893,8 @@ tags: access to sensitive data. By defining Restricted Datasets, you can ensure that only specific teams or roles can view certain types of telemetry (for example, logs, traces, metrics, and RUM data). name: Datasets + - description: Manage AI-powered dependency upgrade workflows for your organization's repositories. + name: Dependency Management - description: |- Manage Deployment Gates using this API to reduce the likelihood and impact of incidents caused by deployments. See the [Deployment Gates documentation](https://docs.datadoghq.com/deployment_gates/) for more information. name: Deployment Gates diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 6863171396..7e9e74dd37 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -242,6 +242,13 @@ datadog\_api\_client.v2.api.datasets\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.dependency\_management\_api module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.dependency_management_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.deployment\_gates\_api module --------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index fb2f20c1c2..4d10253821 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -221,6 +221,41 @@ datadog\_api\_client.v2.model.advisory module :members: :show-inheritance: +datadog\_api\_client.v2.model.ai\_workflow\_attributes module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ai_workflow_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ai\_workflow\_data module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ai_workflow_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ai\_workflow\_data\_type module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ai_workflow_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ai\_workflow\_list\_meta module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ai_workflow_list_meta + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ai\_workflow\_response module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ai_workflow_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.alert\_event\_attributes module ------------------------------------------------------------- @@ -3434,6 +3469,20 @@ datadog\_api\_client.v2.model.cancel\_data\_deletion\_response\_body module :members: :show-inheritance: +datadog\_api\_client.v2.model.cancel\_workflow\_executions\_data module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.cancel_workflow_executions_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.cancel\_workflow\_executions\_response module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.cancel_workflow_executions_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.case module ----------------------------------------- @@ -6388,6 +6437,13 @@ datadog\_api\_client.v2.model.create\_action\_connection\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.create\_ai\_workflow\_request module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.create_ai_workflow_request + :members: + :show-inheritance: + datadog\_api\_client.v2.model.create\_allocations\_request module ----------------------------------------------------------------- @@ -7494,6 +7550,13 @@ datadog\_api\_client.v2.model.create\_variant module :members: :show-inheritance: +datadog\_api\_client.v2.model.create\_workflow\_executions\_response module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_workflow_executions_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.create\_workflow\_request module -------------------------------------------------------------- @@ -9944,6 +10007,13 @@ datadog\_api\_client.v2.model.downtime\_update\_request\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.entity module +------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.entity + :members: + :show-inheritance: + datadog\_api\_client.v2.model.entity\_attributes module ------------------------------------------------------- @@ -11162,6 +11232,20 @@ datadog\_api\_client.v2.model.events\_warning module :members: :show-inheritance: +datadog\_api\_client.v2.model.execution\_step module +---------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.execution_step + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.execution\_step\_status module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.execution_step_status + :members: + :show-inheritance: + datadog\_api\_client.v2.model.exposure\_rollout\_step\_request module --------------------------------------------------------------------- @@ -16517,6 +16601,13 @@ datadog\_api\_client.v2.model.links module :members: :show-inheritance: +datadog\_api\_client.v2.model.list\_ai\_workflows\_response module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.list_ai_workflows_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.list\_allocations\_response module ---------------------------------------------------------------- @@ -16755,6 +16846,34 @@ datadog\_api\_client.v2.model.list\_environments\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.list\_execution\_steps\_attributes module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_execution_steps_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_execution\_steps\_data module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_execution_steps_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_execution\_steps\_data\_type module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_execution_steps_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_execution\_steps\_response module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_execution_steps_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.list\_feature\_flags\_response module ------------------------------------------------------------------- @@ -16902,6 +17021,34 @@ datadog\_api\_client.v2.model.list\_powerpacks\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.list\_pr\_outputs\_attributes module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.list_pr_outputs_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_pr\_outputs\_data module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.list_pr_outputs_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_pr\_outputs\_data\_type module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.list_pr_outputs_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_pr\_outputs\_response module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_pr_outputs_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.list\_relation\_catalog\_response module ---------------------------------------------------------------------- @@ -17000,6 +17147,13 @@ datadog\_api\_client.v2.model.list\_vulnerable\_assets\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.list\_workflow\_instances\_response module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.list_workflow_instances_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.llm\_obs\_annotated\_interaction\_item module --------------------------------------------------------------------------- @@ -24455,6 +24609,27 @@ datadog\_api\_client.v2.model.powerpacks\_response\_meta\_pagination module :members: :show-inheritance: +datadog\_api\_client.v2.model.pr\_output module +----------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.pr_output + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.pr\_output\_ci\_status module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.pr_output_ci_status + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.pr\_output\_status module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.pr_output_status + :members: + :show-inheritance: + datadog\_api\_client.v2.model.preview\_entity\_response\_data module -------------------------------------------------------------------- @@ -35480,6 +35655,13 @@ datadog\_api\_client.v2.model.update\_action\_connection\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.update\_ai\_workflow\_request module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.update_ai_workflow_request + :members: + :show-inheritance: + datadog\_api\_client.v2.model.update\_app\_request module --------------------------------------------------------- @@ -37181,6 +37363,34 @@ datadog\_api\_client.v2.model.workflow\_data\_update\_attributes module :members: :show-inheritance: +datadog\_api\_client.v2.model.workflow\_execution\_attributes module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.workflow_execution_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.workflow\_execution\_data module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.workflow_execution_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.workflow\_execution\_data\_type module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.workflow_execution_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.workflow\_execution\_response module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.workflow_execution_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.workflow\_instance\_create\_meta module --------------------------------------------------------------------- @@ -37216,6 +37426,34 @@ datadog\_api\_client.v2.model.workflow\_instance\_list\_item module :members: :show-inheritance: +datadog\_api\_client.v2.model.workflow\_instance\_summary\_attributes module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.workflow_instance_summary_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.workflow\_instance\_summary\_attributes\_status module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.workflow_instance_summary_attributes_status + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.workflow\_instance\_summary\_data module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.workflow_instance_summary_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.workflow\_instance\_summary\_data\_type module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.workflow_instance_summary_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.workflow\_list\_instances\_response module ------------------------------------------------------------------------ diff --git a/examples/v2/dependency-management/CancelWorkflowExecution.py b/examples/v2/dependency-management/CancelWorkflowExecution.py new file mode 100644 index 0000000000..237d7f18e7 --- /dev/null +++ b/examples/v2/dependency-management/CancelWorkflowExecution.py @@ -0,0 +1,15 @@ +""" +Cancel a workflow execution returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.dependency_management_api import DependencyManagementApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["cancel_workflow_execution"] = True +with ApiClient(configuration) as api_client: + api_instance = DependencyManagementApi(api_client) + api_instance.cancel_workflow_execution( + id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) diff --git a/examples/v2/dependency-management/CancelWorkflowExecutions.py b/examples/v2/dependency-management/CancelWorkflowExecutions.py new file mode 100644 index 0000000000..1ecf7ec8d6 --- /dev/null +++ b/examples/v2/dependency-management/CancelWorkflowExecutions.py @@ -0,0 +1,17 @@ +""" +Cancel workflow executions returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.dependency_management_api import DependencyManagementApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["cancel_workflow_executions"] = True +with ApiClient(configuration) as api_client: + api_instance = DependencyManagementApi(api_client) + response = api_instance.cancel_workflow_executions( + id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) + + print(response) diff --git a/examples/v2/dependency-management/CreateAIWorkflow.py b/examples/v2/dependency-management/CreateAIWorkflow.py new file mode 100644 index 0000000000..aa0ceed501 --- /dev/null +++ b/examples/v2/dependency-management/CreateAIWorkflow.py @@ -0,0 +1,38 @@ +""" +Create an AI workflow returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.dependency_management_api import DependencyManagementApi +from datadog_api_client.v2.model.create_ai_workflow_request import CreateAIWorkflowRequest +from datadog_api_client.v2.model.entity import Entity +from datadog_api_client.v2.model.filtering_logic import FilteringLogic + +body = CreateAIWorkflowRequest( + entities=[ + [ + Entity( + entity_kind="service", + entity_name="my-service", + entity_namespace="default", + entity_team="platform", + ), + ], + ], + filtering_logic=FilteringLogic([("teams", "['platform']")]), + grouping_logic="by-service", + idp_campaign_id="campaign-abc123", + max_number_of_entities_per_session=5, + prompt="Upgrade the lodash dependency to version 4.17.21", + repository="DataDog/datadog-agent", + user="john.doe@example.com", + workflow_name="Upgrade lodash to 4.17.21", +) + +configuration = Configuration() +configuration.unstable_operations["create_ai_workflow"] = True +with ApiClient(configuration) as api_client: + api_instance = DependencyManagementApi(api_client) + response = api_instance.create_ai_workflow(body=body) + + print(response) diff --git a/examples/v2/dependency-management/CreateWorkflowExecution.py b/examples/v2/dependency-management/CreateWorkflowExecution.py new file mode 100644 index 0000000000..4b08441dd7 --- /dev/null +++ b/examples/v2/dependency-management/CreateWorkflowExecution.py @@ -0,0 +1,17 @@ +""" +Create workflow executions returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.dependency_management_api import DependencyManagementApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["create_workflow_execution"] = True +with ApiClient(configuration) as api_client: + api_instance = DependencyManagementApi(api_client) + response = api_instance.create_workflow_execution( + id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) + + print(response) diff --git a/examples/v2/dependency-management/DeleteAIWorkflow.py b/examples/v2/dependency-management/DeleteAIWorkflow.py new file mode 100644 index 0000000000..2007fdb9ec --- /dev/null +++ b/examples/v2/dependency-management/DeleteAIWorkflow.py @@ -0,0 +1,15 @@ +""" +Delete an AI workflow returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.dependency_management_api import DependencyManagementApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["delete_ai_workflow"] = True +with ApiClient(configuration) as api_client: + api_instance = DependencyManagementApi(api_client) + api_instance.delete_ai_workflow( + id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) diff --git a/examples/v2/dependency-management/DeleteWorkflowExecutions.py b/examples/v2/dependency-management/DeleteWorkflowExecutions.py new file mode 100644 index 0000000000..59c7e7a96a --- /dev/null +++ b/examples/v2/dependency-management/DeleteWorkflowExecutions.py @@ -0,0 +1,15 @@ +""" +Delete workflow executions returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.dependency_management_api import DependencyManagementApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["delete_workflow_executions"] = True +with ApiClient(configuration) as api_client: + api_instance = DependencyManagementApi(api_client) + api_instance.delete_workflow_executions( + id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) diff --git a/examples/v2/dependency-management/GetAIWorkflow.py b/examples/v2/dependency-management/GetAIWorkflow.py new file mode 100644 index 0000000000..590ea04608 --- /dev/null +++ b/examples/v2/dependency-management/GetAIWorkflow.py @@ -0,0 +1,17 @@ +""" +Get an AI workflow returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.dependency_management_api import DependencyManagementApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["get_ai_workflow"] = True +with ApiClient(configuration) as api_client: + api_instance = DependencyManagementApi(api_client) + response = api_instance.get_ai_workflow( + id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) + + print(response) diff --git a/examples/v2/dependency-management/ListAIWorkflowInstances.py b/examples/v2/dependency-management/ListAIWorkflowInstances.py new file mode 100644 index 0000000000..9d9ec098f8 --- /dev/null +++ b/examples/v2/dependency-management/ListAIWorkflowInstances.py @@ -0,0 +1,17 @@ +""" +List AI workflow instances returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.dependency_management_api import DependencyManagementApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["list_ai_workflow_instances"] = True +with ApiClient(configuration) as api_client: + api_instance = DependencyManagementApi(api_client) + response = api_instance.list_ai_workflow_instances( + id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) + + print(response) diff --git a/examples/v2/dependency-management/ListAIWorkflows.py b/examples/v2/dependency-management/ListAIWorkflows.py new file mode 100644 index 0000000000..9a32190b6d --- /dev/null +++ b/examples/v2/dependency-management/ListAIWorkflows.py @@ -0,0 +1,14 @@ +""" +List AI workflows returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.dependency_management_api import DependencyManagementApi + +configuration = Configuration() +configuration.unstable_operations["list_ai_workflows"] = True +with ApiClient(configuration) as api_client: + api_instance = DependencyManagementApi(api_client) + response = api_instance.list_ai_workflows() + + print(response) diff --git a/examples/v2/dependency-management/ListExecutionSteps.py b/examples/v2/dependency-management/ListExecutionSteps.py new file mode 100644 index 0000000000..f76e6ca84c --- /dev/null +++ b/examples/v2/dependency-management/ListExecutionSteps.py @@ -0,0 +1,17 @@ +""" +List execution steps returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.dependency_management_api import DependencyManagementApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["list_execution_steps"] = True +with ApiClient(configuration) as api_client: + api_instance = DependencyManagementApi(api_client) + response = api_instance.list_execution_steps( + id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) + + print(response) diff --git a/examples/v2/dependency-management/ListPROutputs.py b/examples/v2/dependency-management/ListPROutputs.py new file mode 100644 index 0000000000..2f63534db2 --- /dev/null +++ b/examples/v2/dependency-management/ListPROutputs.py @@ -0,0 +1,17 @@ +""" +List PR outputs returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.dependency_management_api import DependencyManagementApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["list_pr_outputs"] = True +with ApiClient(configuration) as api_client: + api_instance = DependencyManagementApi(api_client) + response = api_instance.list_pr_outputs( + id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) + + print(response) diff --git a/examples/v2/dependency-management/RerunWorkflowExecution.py b/examples/v2/dependency-management/RerunWorkflowExecution.py new file mode 100644 index 0000000000..6079b9b658 --- /dev/null +++ b/examples/v2/dependency-management/RerunWorkflowExecution.py @@ -0,0 +1,17 @@ +""" +Rerun a workflow execution returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.dependency_management_api import DependencyManagementApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["rerun_workflow_execution"] = True +with ApiClient(configuration) as api_client: + api_instance = DependencyManagementApi(api_client) + response = api_instance.rerun_workflow_execution( + id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) + + print(response) diff --git a/examples/v2/dependency-management/UpdateAIWorkflow.py b/examples/v2/dependency-management/UpdateAIWorkflow.py new file mode 100644 index 0000000000..0fc9723719 --- /dev/null +++ b/examples/v2/dependency-management/UpdateAIWorkflow.py @@ -0,0 +1,40 @@ +""" +Update an AI workflow returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.dependency_management_api import DependencyManagementApi +from datadog_api_client.v2.model.entity import Entity +from datadog_api_client.v2.model.filtering_logic import FilteringLogic +from datadog_api_client.v2.model.update_ai_workflow_request import UpdateAIWorkflowRequest +from datetime import datetime +from dateutil.tz import tzutc +from uuid import UUID + +body = UpdateAIWorkflowRequest( + completed_at=datetime(2024, 6, 1, 12, 0, tzinfo=tzutc()), + entities=[ + [ + Entity( + entity_kind="service", + entity_name="my-service", + entity_namespace="default", + entity_team="platform", + ), + ], + ], + filtering_logic=FilteringLogic([("teams", "['platform']")]), + grouping_logic="by-team", + max_number_of_entities_per_session=10, + prompt="Updated prompt for the dependency upgrade", + repository="DataDog/datadog-agent", + workflow_name="Updated workflow name", +) + +configuration = Configuration() +configuration.unstable_operations["update_ai_workflow"] = True +with ApiClient(configuration) as api_client: + api_instance = DependencyManagementApi(api_client) + response = api_instance.update_ai_workflow(id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 7a46309686..09293d2c32 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -365,6 +365,19 @@ def __init__( "v2.cancel_data_deletion_request": False, "v2.create_data_deletion_request": False, "v2.get_data_deletion_requests": False, + "v2.cancel_workflow_execution": False, + "v2.cancel_workflow_executions": False, + "v2.create_ai_workflow": False, + "v2.create_workflow_execution": False, + "v2.delete_ai_workflow": False, + "v2.delete_workflow_executions": False, + "v2.get_ai_workflow": False, + "v2.list_ai_workflow_instances": False, + "v2.list_ai_workflows": False, + "v2.list_execution_steps": False, + "v2.list_pr_outputs": False, + "v2.rerun_workflow_execution": False, + "v2.update_ai_workflow": False, "v2.create_deployment_gate": False, "v2.create_deployment_rule": False, "v2.delete_deployment_gate": False, diff --git a/src/datadog_api_client/v2/api/dependency_management_api.py b/src/datadog_api_client/v2/api/dependency_management_api.py new file mode 100644 index 0000000000..ffd535141f --- /dev/null +++ b/src/datadog_api_client/v2/api/dependency_management_api.py @@ -0,0 +1,660 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, Union + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + datetime, + UnsetType, + unset, + UUID, +) +from datadog_api_client.v2.model.ai_workflow_response import AIWorkflowResponse +from datadog_api_client.v2.model.create_ai_workflow_request import CreateAIWorkflowRequest +from datadog_api_client.v2.model.list_ai_workflows_response import ListAIWorkflowsResponse +from datadog_api_client.v2.model.update_ai_workflow_request import UpdateAIWorkflowRequest +from datadog_api_client.v2.model.cancel_workflow_executions_response import CancelWorkflowExecutionsResponse +from datadog_api_client.v2.model.create_workflow_executions_response import CreateWorkflowExecutionsResponse +from datadog_api_client.v2.model.list_workflow_instances_response import ListWorkflowInstancesResponse +from datadog_api_client.v2.model.list_pr_outputs_response import ListPROutputsResponse +from datadog_api_client.v2.model.workflow_execution_response import WorkflowExecutionResponse +from datadog_api_client.v2.model.list_execution_steps_response import ListExecutionStepsResponse + + +class DependencyManagementApi: + """ + Manage AI-powered dependency upgrade workflows for your organization's repositories. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._cancel_workflow_execution_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/dependency-management/workflow-executions/{id}/cancel", + "operation_id": "cancel_workflow_execution", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._cancel_workflow_executions_endpoint = _Endpoint( + settings={ + "response_type": (CancelWorkflowExecutionsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/dependency-management/ai-workflows/{id}/cancel", + "operation_id": "cancel_workflow_executions", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._create_ai_workflow_endpoint = _Endpoint( + settings={ + "response_type": (AIWorkflowResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/dependency-management/ai-workflow", + "operation_id": "create_ai_workflow", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (CreateAIWorkflowRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_workflow_execution_endpoint = _Endpoint( + settings={ + "response_type": (CreateWorkflowExecutionsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/dependency-management/ai-workflows/{id}/executions", + "operation_id": "create_workflow_execution", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "id", + "location": "path", + }, + "max_instances": { + "validation": { + "inclusive_maximum": 30, + "inclusive_minimum": 1, + }, + "openapi_types": (int,), + "attribute": "max_instances", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._delete_ai_workflow_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/dependency-management/ai-workflows/{id}", + "operation_id": "delete_ai_workflow", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._delete_workflow_executions_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/dependency-management/ai-workflows/{id}/executions", + "operation_id": "delete_workflow_executions", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_ai_workflow_endpoint = _Endpoint( + settings={ + "response_type": (AIWorkflowResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/dependency-management/ai-workflows/{id}", + "operation_id": "get_ai_workflow", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_ai_workflow_instances_endpoint = _Endpoint( + settings={ + "response_type": (ListWorkflowInstancesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/dependency-management/ai-workflows/{id}/instances", + "operation_id": "list_ai_workflow_instances", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_ai_workflows_endpoint = _Endpoint( + settings={ + "response_type": (ListAIWorkflowsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/dependency-management/ai-workflows", + "operation_id": "list_ai_workflows", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "idp_campaign_id": { + "openapi_types": (str,), + "attribute": "idp_campaign_id", + "location": "query", + }, + "repository": { + "openapi_types": (str,), + "attribute": "repository", + "location": "query", + }, + "user": { + "openapi_types": (str,), + "attribute": "user", + "location": "query", + }, + "completed": { + "openapi_types": (bool,), + "attribute": "completed", + "location": "query", + }, + "created_after": { + "openapi_types": (datetime,), + "attribute": "created_after", + "location": "query", + }, + "created_before": { + "openapi_types": (datetime,), + "attribute": "created_before", + "location": "query", + }, + "limit": { + "validation": { + "inclusive_maximum": 100, + "inclusive_minimum": 1, + }, + "openapi_types": (int,), + "attribute": "limit", + "location": "query", + }, + "offset": { + "validation": { + "inclusive_minimum": 0, + }, + "openapi_types": (int,), + "attribute": "offset", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_execution_steps_endpoint = _Endpoint( + settings={ + "response_type": (ListExecutionStepsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/dependency-management/workflow-executions/{id}/steps", + "operation_id": "list_execution_steps", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_pr_outputs_endpoint = _Endpoint( + settings={ + "response_type": (ListPROutputsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/dependency-management/workflow-executions/{id}/pr-outputs", + "operation_id": "list_pr_outputs", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._rerun_workflow_execution_endpoint = _Endpoint( + settings={ + "response_type": (WorkflowExecutionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/dependency-management/workflow-executions/{id}/rerun", + "operation_id": "rerun_workflow_execution", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_ai_workflow_endpoint = _Endpoint( + settings={ + "response_type": (AIWorkflowResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/dependency-management/ai-workflows/{id}", + "operation_id": "update_ai_workflow", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (UpdateAIWorkflowRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def cancel_workflow_execution( + self, + id: UUID, + ) -> None: + """Cancel a workflow execution. + + Cancel a specific workflow execution instance. Returns 409 if the instance is not currently in a running state. + + :param id: The UUID of the workflow execution. + :type id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._cancel_workflow_execution_endpoint.call_with_http_info(**kwargs) + + def cancel_workflow_executions( + self, + id: UUID, + ) -> CancelWorkflowExecutionsResponse: + """Cancel workflow executions. + + Cancel all running workflow execution instances for the given AI workflow. + + :param id: The UUID of the AI workflow. + :type id: UUID + :rtype: CancelWorkflowExecutionsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._cancel_workflow_executions_endpoint.call_with_http_info(**kwargs) + + def create_ai_workflow( + self, + body: CreateAIWorkflowRequest, + ) -> AIWorkflowResponse: + """Create an AI workflow. + + Create a new AI workflow for dependency management. This creates both the workflow definition and initializes its executions. + + :type body: CreateAIWorkflowRequest + :rtype: AIWorkflowResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_ai_workflow_endpoint.call_with_http_info(**kwargs) + + def create_workflow_execution( + self, + id: UUID, + *, + max_instances: Union[int, UnsetType] = unset, + ) -> CreateWorkflowExecutionsResponse: + """Create workflow executions. + + Create workflow executions for an AI workflow. One execution is created per entity group defined in the workflow. + + :param id: The UUID of the AI workflow. + :type id: UUID + :param max_instances: Maximum number of new workflow instances to start. Must be between 1 and 30. + :type max_instances: int, optional + :rtype: CreateWorkflowExecutionsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + if max_instances is not unset: + kwargs["max_instances"] = max_instances + + return self._create_workflow_execution_endpoint.call_with_http_info(**kwargs) + + def delete_ai_workflow( + self, + id: UUID, + ) -> None: + """Delete an AI workflow. + + Delete a specific AI workflow. This also removes the workflow from Datadog Workflow Automation. + + :param id: The UUID of the AI workflow. + :type id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._delete_ai_workflow_endpoint.call_with_http_info(**kwargs) + + def delete_workflow_executions( + self, + id: UUID, + ) -> None: + """Delete workflow executions. + + Delete all workflow executions for a given AI workflow. Running instances are canceled before deletion. + + :param id: The UUID of the AI workflow. + :type id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._delete_workflow_executions_endpoint.call_with_http_info(**kwargs) + + def get_ai_workflow( + self, + id: UUID, + ) -> AIWorkflowResponse: + """Get an AI workflow. + + Get details of a specific AI workflow by its ID. + + :param id: The UUID of the AI workflow. + :type id: UUID + :rtype: AIWorkflowResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._get_ai_workflow_endpoint.call_with_http_info(**kwargs) + + def list_ai_workflow_instances( + self, + id: UUID, + ) -> ListWorkflowInstancesResponse: + """List AI workflow instances. + + List all workflow instances for a given AI workflow with their live status from Workflow Automation and entity information. + + :param id: The UUID of the AI workflow. + :type id: UUID + :rtype: ListWorkflowInstancesResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._list_ai_workflow_instances_endpoint.call_with_http_info(**kwargs) + + def list_ai_workflows( + self, + *, + idp_campaign_id: Union[str, UnsetType] = unset, + repository: Union[str, UnsetType] = unset, + user: Union[str, UnsetType] = unset, + completed: Union[bool, UnsetType] = unset, + created_after: Union[datetime, UnsetType] = unset, + created_before: Union[datetime, UnsetType] = unset, + limit: Union[int, UnsetType] = unset, + offset: Union[int, UnsetType] = unset, + ) -> ListAIWorkflowsResponse: + """List AI workflows. + + List AI workflows for the organization with optional filters. + + :param idp_campaign_id: Filter workflows by IDP campaign ID. + :type idp_campaign_id: str, optional + :param repository: Filter workflows by repository name (owner/repo format). + :type repository: str, optional + :param user: Filter workflows by the username of the creator. + :type user: str, optional + :param completed: Filter workflows by completion status. Use ``true`` to return only completed workflows, ``false`` for incomplete. + :type completed: bool, optional + :param created_after: Filter workflows created after this timestamp (RFC3339 format). + :type created_after: datetime, optional + :param created_before: Filter workflows created before this timestamp (RFC3339 format). + :type created_before: datetime, optional + :param limit: Maximum number of workflows to return. Defaults to 50, maximum 100. + :type limit: int, optional + :param offset: Number of workflows to skip for pagination. + :type offset: int, optional + :rtype: ListAIWorkflowsResponse + """ + kwargs: Dict[str, Any] = {} + if idp_campaign_id is not unset: + kwargs["idp_campaign_id"] = idp_campaign_id + + if repository is not unset: + kwargs["repository"] = repository + + if user is not unset: + kwargs["user"] = user + + if completed is not unset: + kwargs["completed"] = completed + + if created_after is not unset: + kwargs["created_after"] = created_after + + if created_before is not unset: + kwargs["created_before"] = created_before + + if limit is not unset: + kwargs["limit"] = limit + + if offset is not unset: + kwargs["offset"] = offset + + return self._list_ai_workflows_endpoint.call_with_http_info(**kwargs) + + def list_execution_steps( + self, + id: UUID, + ) -> ListExecutionStepsResponse: + """List execution steps. + + Get the real-time step status for a specific workflow execution instance from Datadog Workflow Automation. + + :param id: The UUID of the workflow execution. + :type id: UUID + :rtype: ListExecutionStepsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._list_execution_steps_endpoint.call_with_http_info(**kwargs) + + def list_pr_outputs( + self, + id: UUID, + ) -> ListPROutputsResponse: + """List PR outputs. + + Get the pull request outputs for a specific workflow execution. Includes PR URL, status, and CI status enriched from GitHub. + + :param id: The UUID of the workflow execution. + :type id: UUID + :rtype: ListPROutputsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._list_pr_outputs_endpoint.call_with_http_info(**kwargs) + + def rerun_workflow_execution( + self, + id: UUID, + ) -> WorkflowExecutionResponse: + """Rerun a workflow execution. + + Rerun a failed or canceled workflow execution. This replaces the existing execution with a new one using the same entities. + + :param id: The UUID of the workflow execution. + :type id: UUID + :rtype: WorkflowExecutionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._rerun_workflow_execution_endpoint.call_with_http_info(**kwargs) + + def update_ai_workflow( + self, + id: UUID, + body: UpdateAIWorkflowRequest, + ) -> AIWorkflowResponse: + """Update an AI workflow. + + Update the configuration of an existing AI workflow. Only the provided fields are updated. + + :param id: The UUID of the AI workflow. + :type id: UUID + :type body: UpdateAIWorkflowRequest + :rtype: AIWorkflowResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + kwargs["body"] = body + + return self._update_ai_workflow_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index f8a5950df2..f9638f6f7d 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -33,6 +33,7 @@ from datadog_api_client.v2.api.dashboard_secure_embed_api import DashboardSecureEmbedApi from datadog_api_client.v2.api.data_deletion_api import DataDeletionApi from datadog_api_client.v2.api.datasets_api import DatasetsApi +from datadog_api_client.v2.api.dependency_management_api import DependencyManagementApi from datadog_api_client.v2.api.deployment_gates_api import DeploymentGatesApi from datadog_api_client.v2.api.domain_allowlist_api import DomainAllowlistApi from datadog_api_client.v2.api.downtimes_api import DowntimesApi @@ -146,6 +147,7 @@ "DashboardSecureEmbedApi", "DataDeletionApi", "DatasetsApi", + "DependencyManagementApi", "DeploymentGatesApi", "DomainAllowlistApi", "DowntimesApi", diff --git a/src/datadog_api_client/v2/model/ai_workflow_attributes.py b/src/datadog_api_client/v2/model/ai_workflow_attributes.py new file mode 100644 index 0000000000..e50842b8fc --- /dev/null +++ b/src/datadog_api_client/v2/model/ai_workflow_attributes.py @@ -0,0 +1,134 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.filtering_logic import FilteringLogic + + +class AIWorkflowAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.filtering_logic import FilteringLogic + + return { + "completed_at": (datetime, none_type), + "created_at": (datetime,), + "entities": ([[Entity]],), + "filtering_logic": (FilteringLogic,), + "grouping_logic": (str,), + "idp_campaign_id": (str,), + "max_number_of_entities_per_session": (int,), + "prompt": (str,), + "repository": (str,), + "updated_at": (datetime,), + "user": (str,), + "workflow_id": (UUID,), + "workflow_name": (str,), + } + + attribute_map = { + "completed_at": "completed_at", + "created_at": "created_at", + "entities": "entities", + "filtering_logic": "filtering_logic", + "grouping_logic": "grouping_logic", + "idp_campaign_id": "idp_campaign_id", + "max_number_of_entities_per_session": "max_number_of_entities_per_session", + "prompt": "prompt", + "repository": "repository", + "updated_at": "updated_at", + "user": "user", + "workflow_id": "workflow_id", + "workflow_name": "workflow_name", + } + + def __init__( + self_, + created_at: datetime, + entities: List[List[Entity]], + filtering_logic: FilteringLogic, + grouping_logic: str, + idp_campaign_id: str, + max_number_of_entities_per_session: int, + prompt: str, + repository: str, + updated_at: datetime, + user: str, + workflow_id: UUID, + workflow_name: str, + completed_at: Union[datetime, none_type, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of an AI workflow. + + :param completed_at: Timestamp when the workflow completed. Null if not yet completed. + :type completed_at: datetime, none_type, optional + + :param created_at: Timestamp when the workflow was created. + :type created_at: datetime + + :param entities: A list of entity groups. Each group is processed in a separate workflow execution. + :type entities: [[Entity]] + + :param filtering_logic: Arbitrary filtering criteria used to select entities for the workflow. + :type filtering_logic: FilteringLogic + + :param grouping_logic: The logic used to group entities into execution batches. + :type grouping_logic: str + + :param idp_campaign_id: The IDP campaign ID associated with this workflow. + :type idp_campaign_id: str + + :param max_number_of_entities_per_session: Maximum number of entities processed in a single execution session. + :type max_number_of_entities_per_session: int + + :param prompt: The AI prompt guiding the dependency upgrade automation. + :type prompt: str + + :param repository: The target repository in owner/repo format. + :type repository: str + + :param updated_at: Timestamp when the workflow was last updated. + :type updated_at: datetime + + :param user: The username of the user who created the workflow. + :type user: str + + :param workflow_id: The UUID of the underlying Datadog Workflow Automation workflow. + :type workflow_id: UUID + + :param workflow_name: The human-readable name of the workflow. + :type workflow_name: str + """ + if completed_at is not unset: + kwargs["completed_at"] = completed_at + super().__init__(kwargs) + + self_.created_at = created_at + self_.entities = entities + self_.filtering_logic = filtering_logic + self_.grouping_logic = grouping_logic + self_.idp_campaign_id = idp_campaign_id + self_.max_number_of_entities_per_session = max_number_of_entities_per_session + self_.prompt = prompt + self_.repository = repository + self_.updated_at = updated_at + self_.user = user + self_.workflow_id = workflow_id + self_.workflow_name = workflow_name diff --git a/src/datadog_api_client/v2/model/ai_workflow_data.py b/src/datadog_api_client/v2/model/ai_workflow_data.py new file mode 100644 index 0000000000..881fa80e75 --- /dev/null +++ b/src/datadog_api_client/v2/model/ai_workflow_data.py @@ -0,0 +1,55 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.ai_workflow_attributes import AIWorkflowAttributes + from datadog_api_client.v2.model.ai_workflow_data_type import AIWorkflowDataType + + +class AIWorkflowData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ai_workflow_attributes import AIWorkflowAttributes + from datadog_api_client.v2.model.ai_workflow_data_type import AIWorkflowDataType + + return { + "attributes": (AIWorkflowAttributes,), + "id": (UUID,), + "type": (AIWorkflowDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: AIWorkflowAttributes, id: UUID, type: AIWorkflowDataType, **kwargs): + """ + A single AI workflow resource. + + :param attributes: Attributes of an AI workflow. + :type attributes: AIWorkflowAttributes + + :param id: The unique identifier of the AI workflow. + :type id: UUID + + :param type: The resource type for AI workflows. + :type type: AIWorkflowDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/ai_workflow_data_type.py b/src/datadog_api_client/v2/model/ai_workflow_data_type.py new file mode 100644 index 0000000000..092389d38b --- /dev/null +++ b/src/datadog_api_client/v2/model/ai_workflow_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AIWorkflowDataType(ModelSimple): + """ + The resource type for AI workflows. + + :param value: If omitted defaults to "ai-workflows". Must be one of ["ai-workflows"]. + :type value: str + """ + + allowed_values = { + "ai-workflows", + } + AI_WORKFLOWS: ClassVar["AIWorkflowDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AIWorkflowDataType.AI_WORKFLOWS = AIWorkflowDataType("ai-workflows") diff --git a/src/datadog_api_client/v2/model/ai_workflow_list_meta.py b/src/datadog_api_client/v2/model/ai_workflow_list_meta.py new file mode 100644 index 0000000000..afdce79483 --- /dev/null +++ b/src/datadog_api_client/v2/model/ai_workflow_list_meta.py @@ -0,0 +1,33 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class AIWorkflowListMeta(ModelNormal): + @cached_property + def openapi_types(_): + return { + "total": (int,), + } + + attribute_map = { + "total": "total", + } + + def __init__(self_, total: int, **kwargs): + """ + Metadata for the list AI workflows response. + + :param total: Total number of AI workflows matching the filter criteria. + :type total: int + """ + super().__init__(kwargs) + + self_.total = total diff --git a/src/datadog_api_client/v2/model/ai_workflow_response.py b/src/datadog_api_client/v2/model/ai_workflow_response.py new file mode 100644 index 0000000000..52181bc96c --- /dev/null +++ b/src/datadog_api_client/v2/model/ai_workflow_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.ai_workflow_data import AIWorkflowData + + +class AIWorkflowResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ai_workflow_data import AIWorkflowData + + return { + "data": (AIWorkflowData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: AIWorkflowData, **kwargs): + """ + Response containing a single AI workflow. + + :param data: A single AI workflow resource. + :type data: AIWorkflowData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/cancel_workflow_executions_data.py b/src/datadog_api_client/v2/model/cancel_workflow_executions_data.py new file mode 100644 index 0000000000..7ce812620f --- /dev/null +++ b/src/datadog_api_client/v2/model/cancel_workflow_executions_data.py @@ -0,0 +1,33 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class CancelWorkflowExecutionsData(ModelNormal): + @cached_property + def openapi_types(_): + return { + "canceled_count": (int,), + } + + attribute_map = { + "canceled_count": "canceled_count", + } + + def __init__(self_, canceled_count: int, **kwargs): + """ + Data returned after canceling workflow executions. + + :param canceled_count: The number of running instances that were successfully canceled. + :type canceled_count: int + """ + super().__init__(kwargs) + + self_.canceled_count = canceled_count diff --git a/src/datadog_api_client/v2/model/cancel_workflow_executions_response.py b/src/datadog_api_client/v2/model/cancel_workflow_executions_response.py new file mode 100644 index 0000000000..240492a179 --- /dev/null +++ b/src/datadog_api_client/v2/model/cancel_workflow_executions_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.cancel_workflow_executions_data import CancelWorkflowExecutionsData + + +class CancelWorkflowExecutionsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.cancel_workflow_executions_data import CancelWorkflowExecutionsData + + return { + "data": (CancelWorkflowExecutionsData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CancelWorkflowExecutionsData, **kwargs): + """ + Response from canceling all running workflow execution instances. + + :param data: Data returned after canceling workflow executions. + :type data: CancelWorkflowExecutionsData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/create_ai_workflow_request.py b/src/datadog_api_client/v2/model/create_ai_workflow_request.py new file mode 100644 index 0000000000..1baac2887b --- /dev/null +++ b/src/datadog_api_client/v2/model/create_ai_workflow_request.py @@ -0,0 +1,100 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.filtering_logic import FilteringLogic + + +class CreateAIWorkflowRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.filtering_logic import FilteringLogic + + return { + "entities": ([[Entity]],), + "filtering_logic": (FilteringLogic,), + "grouping_logic": (str,), + "idp_campaign_id": (str,), + "max_number_of_entities_per_session": (int,), + "prompt": (str,), + "repository": (str,), + "user": (str,), + "workflow_name": (str,), + } + + attribute_map = { + "entities": "entities", + "filtering_logic": "filtering_logic", + "grouping_logic": "grouping_logic", + "idp_campaign_id": "idp_campaign_id", + "max_number_of_entities_per_session": "max_number_of_entities_per_session", + "prompt": "prompt", + "repository": "repository", + "user": "user", + "workflow_name": "workflow_name", + } + + def __init__( + self_, + entities: List[List[Entity]], + filtering_logic: FilteringLogic, + grouping_logic: str, + idp_campaign_id: str, + max_number_of_entities_per_session: int, + prompt: str, + repository: str, + user: str, + workflow_name: str, + **kwargs, + ): + """ + Request body for creating a new AI workflow. + + :param entities: A list of entity groups. Each group is processed in a separate workflow execution. + :type entities: [[Entity]] + + :param filtering_logic: Arbitrary filtering criteria used to select entities for the workflow. + :type filtering_logic: FilteringLogic + + :param grouping_logic: The logic used to group entities into batches for execution. + :type grouping_logic: str + + :param idp_campaign_id: The IDP campaign ID associated with this workflow. + :type idp_campaign_id: str + + :param max_number_of_entities_per_session: Maximum number of entities allowed per execution session. + :type max_number_of_entities_per_session: int + + :param prompt: The AI prompt used to guide the dependency upgrade automation. + :type prompt: str + + :param repository: The target repository in owner/repo format. + :type repository: str + + :param user: The username of the user initiating the workflow. + :type user: str + + :param workflow_name: A human-readable name for the workflow. + :type workflow_name: str + """ + super().__init__(kwargs) + + self_.entities = entities + self_.filtering_logic = filtering_logic + self_.grouping_logic = grouping_logic + self_.idp_campaign_id = idp_campaign_id + self_.max_number_of_entities_per_session = max_number_of_entities_per_session + self_.prompt = prompt + self_.repository = repository + self_.user = user + self_.workflow_name = workflow_name diff --git a/src/datadog_api_client/v2/model/create_workflow_executions_response.py b/src/datadog_api_client/v2/model/create_workflow_executions_response.py new file mode 100644 index 0000000000..3e2e389b2c --- /dev/null +++ b/src/datadog_api_client/v2/model/create_workflow_executions_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.workflow_execution_data import WorkflowExecutionData + + +class CreateWorkflowExecutionsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.workflow_execution_data import WorkflowExecutionData + + return { + "data": ([WorkflowExecutionData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[WorkflowExecutionData], **kwargs): + """ + Response containing a list of created workflow executions. + + :param data: List of created workflow execution resources. + :type data: [WorkflowExecutionData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/entity.py b/src/datadog_api_client/v2/model/entity.py new file mode 100644 index 0000000000..33a643a9d2 --- /dev/null +++ b/src/datadog_api_client/v2/model/entity.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class Entity(ModelNormal): + @cached_property + def openapi_types(_): + return { + "entity_kind": (str,), + "entity_name": (str,), + "entity_namespace": (str,), + "entity_team": (str,), + } + + attribute_map = { + "entity_kind": "entity_kind", + "entity_name": "entity_name", + "entity_namespace": "entity_namespace", + "entity_team": "entity_team", + } + + def __init__( + self_, + entity_name: str, + entity_kind: Union[str, UnsetType] = unset, + entity_namespace: Union[str, UnsetType] = unset, + entity_team: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + An entity participating in the dependency upgrade workflow. + + :param entity_kind: The kind of the entity (for example, service or package). + :type entity_kind: str, optional + + :param entity_name: The name of the entity. + :type entity_name: str + + :param entity_namespace: The namespace of the entity. + :type entity_namespace: str, optional + + :param entity_team: The team that owns the entity. + :type entity_team: str, optional + """ + if entity_kind is not unset: + kwargs["entity_kind"] = entity_kind + if entity_namespace is not unset: + kwargs["entity_namespace"] = entity_namespace + if entity_team is not unset: + kwargs["entity_team"] = entity_team + super().__init__(kwargs) + + self_.entity_name = entity_name diff --git a/src/datadog_api_client/v2/model/execution_step.py b/src/datadog_api_client/v2/model/execution_step.py new file mode 100644 index 0000000000..8c39c7b549 --- /dev/null +++ b/src/datadog_api_client/v2/model/execution_step.py @@ -0,0 +1,86 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.execution_step_status import ExecutionStepStatus + + +class ExecutionStep(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.execution_step_status import ExecutionStepStatus + + return { + "completed_at": (datetime, none_type), + "error": (str,), + "id": (str,), + "name": (str,), + "started_at": (datetime, none_type), + "status": (ExecutionStepStatus,), + } + + attribute_map = { + "completed_at": "completed_at", + "error": "error", + "id": "id", + "name": "name", + "started_at": "started_at", + "status": "status", + } + + def __init__( + self_, + id: str, + name: str, + status: ExecutionStepStatus, + completed_at: Union[datetime, none_type, UnsetType] = unset, + error: Union[str, UnsetType] = unset, + started_at: Union[datetime, none_type, UnsetType] = unset, + **kwargs, + ): + """ + A single step in a workflow execution. + + :param completed_at: Timestamp when the step completed. Null if not yet completed. + :type completed_at: datetime, none_type, optional + + :param error: Error message if the step failed. + :type error: str, optional + + :param id: The unique identifier of the execution step. + :type id: str + + :param name: The name of the step. + :type name: str + + :param started_at: Timestamp when the step started. Null if not yet started. + :type started_at: datetime, none_type, optional + + :param status: The current status of the step. + :type status: ExecutionStepStatus + """ + if completed_at is not unset: + kwargs["completed_at"] = completed_at + if error is not unset: + kwargs["error"] = error + if started_at is not unset: + kwargs["started_at"] = started_at + super().__init__(kwargs) + + self_.id = id + self_.name = name + self_.status = status diff --git a/src/datadog_api_client/v2/model/execution_step_status.py b/src/datadog_api_client/v2/model/execution_step_status.py new file mode 100644 index 0000000000..78aa69f088 --- /dev/null +++ b/src/datadog_api_client/v2/model/execution_step_status.py @@ -0,0 +1,47 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ExecutionStepStatus(ModelSimple): + """ + The current status of the step. + + :param value: Must be one of ["PENDING", "RUNNING", "COMPLETED", "FAILED", "CANCELED"]. + :type value: str + """ + + allowed_values = { + "PENDING", + "RUNNING", + "COMPLETED", + "FAILED", + "CANCELED", + } + PENDING: ClassVar["ExecutionStepStatus"] + RUNNING: ClassVar["ExecutionStepStatus"] + COMPLETED: ClassVar["ExecutionStepStatus"] + FAILED: ClassVar["ExecutionStepStatus"] + CANCELED: ClassVar["ExecutionStepStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ExecutionStepStatus.PENDING = ExecutionStepStatus("PENDING") +ExecutionStepStatus.RUNNING = ExecutionStepStatus("RUNNING") +ExecutionStepStatus.COMPLETED = ExecutionStepStatus("COMPLETED") +ExecutionStepStatus.FAILED = ExecutionStepStatus("FAILED") +ExecutionStepStatus.CANCELED = ExecutionStepStatus("CANCELED") diff --git a/src/datadog_api_client/v2/model/list_ai_workflows_response.py b/src/datadog_api_client/v2/model/list_ai_workflows_response.py new file mode 100644 index 0000000000..c2b5ef42da --- /dev/null +++ b/src/datadog_api_client/v2/model/list_ai_workflows_response.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.ai_workflow_data import AIWorkflowData + from datadog_api_client.v2.model.ai_workflow_list_meta import AIWorkflowListMeta + + +class ListAIWorkflowsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ai_workflow_data import AIWorkflowData + from datadog_api_client.v2.model.ai_workflow_list_meta import AIWorkflowListMeta + + return { + "data": ([AIWorkflowData],), + "meta": (AIWorkflowListMeta,), + } + + attribute_map = { + "data": "data", + "meta": "meta", + } + + def __init__(self_, data: List[AIWorkflowData], meta: AIWorkflowListMeta, **kwargs): + """ + Response containing a list of AI workflows. + + :param data: List of AI workflow resources. + :type data: [AIWorkflowData] + + :param meta: Metadata for the list AI workflows response. + :type meta: AIWorkflowListMeta + """ + super().__init__(kwargs) + + self_.data = data + self_.meta = meta diff --git a/src/datadog_api_client/v2/model/list_execution_steps_attributes.py b/src/datadog_api_client/v2/model/list_execution_steps_attributes.py new file mode 100644 index 0000000000..6594318f4d --- /dev/null +++ b/src/datadog_api_client/v2/model/list_execution_steps_attributes.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.execution_step import ExecutionStep + + +class ListExecutionStepsAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.execution_step import ExecutionStep + + return { + "steps": ([ExecutionStep],), + } + + attribute_map = { + "steps": "steps", + } + + def __init__(self_, steps: List[ExecutionStep], **kwargs): + """ + Attributes of an execution steps response. + + :param steps: The list of steps for the workflow execution. + :type steps: [ExecutionStep] + """ + super().__init__(kwargs) + + self_.steps = steps diff --git a/src/datadog_api_client/v2/model/list_execution_steps_data.py b/src/datadog_api_client/v2/model/list_execution_steps_data.py new file mode 100644 index 0000000000..75dc217a86 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_execution_steps_data.py @@ -0,0 +1,55 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.list_execution_steps_attributes import ListExecutionStepsAttributes + from datadog_api_client.v2.model.list_execution_steps_data_type import ListExecutionStepsDataType + + +class ListExecutionStepsData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.list_execution_steps_attributes import ListExecutionStepsAttributes + from datadog_api_client.v2.model.list_execution_steps_data_type import ListExecutionStepsDataType + + return { + "attributes": (ListExecutionStepsAttributes,), + "id": (UUID,), + "type": (ListExecutionStepsDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: ListExecutionStepsAttributes, id: UUID, type: ListExecutionStepsDataType, **kwargs): + """ + Data for execution steps response. + + :param attributes: Attributes of an execution steps response. + :type attributes: ListExecutionStepsAttributes + + :param id: The unique identifier of the workflow execution. + :type id: UUID + + :param type: The resource type for workflow execution steps. + :type type: ListExecutionStepsDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/list_execution_steps_data_type.py b/src/datadog_api_client/v2/model/list_execution_steps_data_type.py new file mode 100644 index 0000000000..c6fce5d211 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_execution_steps_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ListExecutionStepsDataType(ModelSimple): + """ + The resource type for workflow execution steps. + + :param value: If omitted defaults to "workflow-execution-steps". Must be one of ["workflow-execution-steps"]. + :type value: str + """ + + allowed_values = { + "workflow-execution-steps", + } + WORKFLOW_EXECUTION_STEPS: ClassVar["ListExecutionStepsDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ListExecutionStepsDataType.WORKFLOW_EXECUTION_STEPS = ListExecutionStepsDataType("workflow-execution-steps") diff --git a/src/datadog_api_client/v2/model/list_execution_steps_response.py b/src/datadog_api_client/v2/model/list_execution_steps_response.py new file mode 100644 index 0000000000..8c94187d78 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_execution_steps_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.list_execution_steps_data import ListExecutionStepsData + + +class ListExecutionStepsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.list_execution_steps_data import ListExecutionStepsData + + return { + "data": (ListExecutionStepsData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ListExecutionStepsData, **kwargs): + """ + Response containing the execution steps for a workflow execution. + + :param data: Data for execution steps response. + :type data: ListExecutionStepsData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/list_pr_outputs_attributes.py b/src/datadog_api_client/v2/model/list_pr_outputs_attributes.py new file mode 100644 index 0000000000..8301f62974 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_pr_outputs_attributes.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.pr_output import PROutput + + +class ListPROutputsAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.pr_output import PROutput + + return { + "pr_outputs": ([PROutput],), + } + + attribute_map = { + "pr_outputs": "pr_outputs", + } + + def __init__(self_, pr_outputs: List[PROutput], **kwargs): + """ + Attributes of a PR outputs response. + + :param pr_outputs: The list of pull requests created by the workflow execution. + :type pr_outputs: [PROutput] + """ + super().__init__(kwargs) + + self_.pr_outputs = pr_outputs diff --git a/src/datadog_api_client/v2/model/list_pr_outputs_data.py b/src/datadog_api_client/v2/model/list_pr_outputs_data.py new file mode 100644 index 0000000000..bb7c64b671 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_pr_outputs_data.py @@ -0,0 +1,55 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.list_pr_outputs_attributes import ListPROutputsAttributes + from datadog_api_client.v2.model.list_pr_outputs_data_type import ListPROutputsDataType + + +class ListPROutputsData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.list_pr_outputs_attributes import ListPROutputsAttributes + from datadog_api_client.v2.model.list_pr_outputs_data_type import ListPROutputsDataType + + return { + "attributes": (ListPROutputsAttributes,), + "id": (UUID,), + "type": (ListPROutputsDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: ListPROutputsAttributes, id: UUID, type: ListPROutputsDataType, **kwargs): + """ + Data for PR outputs response. + + :param attributes: Attributes of a PR outputs response. + :type attributes: ListPROutputsAttributes + + :param id: The unique identifier of the workflow execution. + :type id: UUID + + :param type: The resource type for workflow execution PR outputs. + :type type: ListPROutputsDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/list_pr_outputs_data_type.py b/src/datadog_api_client/v2/model/list_pr_outputs_data_type.py new file mode 100644 index 0000000000..cf8e53315e --- /dev/null +++ b/src/datadog_api_client/v2/model/list_pr_outputs_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ListPROutputsDataType(ModelSimple): + """ + The resource type for workflow execution PR outputs. + + :param value: If omitted defaults to "workflow-execution-pr-outputs". Must be one of ["workflow-execution-pr-outputs"]. + :type value: str + """ + + allowed_values = { + "workflow-execution-pr-outputs", + } + WORKFLOW_EXECUTION_PR_OUTPUTS: ClassVar["ListPROutputsDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ListPROutputsDataType.WORKFLOW_EXECUTION_PR_OUTPUTS = ListPROutputsDataType("workflow-execution-pr-outputs") diff --git a/src/datadog_api_client/v2/model/list_pr_outputs_response.py b/src/datadog_api_client/v2/model/list_pr_outputs_response.py new file mode 100644 index 0000000000..8f18eec27c --- /dev/null +++ b/src/datadog_api_client/v2/model/list_pr_outputs_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.list_pr_outputs_data import ListPROutputsData + + +class ListPROutputsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.list_pr_outputs_data import ListPROutputsData + + return { + "data": (ListPROutputsData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ListPROutputsData, **kwargs): + """ + Response containing the PR outputs for a workflow execution. + + :param data: Data for PR outputs response. + :type data: ListPROutputsData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/list_workflow_instances_response.py b/src/datadog_api_client/v2/model/list_workflow_instances_response.py new file mode 100644 index 0000000000..cd565348c0 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_workflow_instances_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.workflow_instance_summary_data import WorkflowInstanceSummaryData + + +class ListWorkflowInstancesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.workflow_instance_summary_data import WorkflowInstanceSummaryData + + return { + "data": ([WorkflowInstanceSummaryData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[WorkflowInstanceSummaryData], **kwargs): + """ + Response containing a list of workflow instance summaries. + + :param data: List of workflow instance summaries. + :type data: [WorkflowInstanceSummaryData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/pr_output.py b/src/datadog_api_client/v2/model/pr_output.py new file mode 100644 index 0000000000..22598e2823 --- /dev/null +++ b/src/datadog_api_client/v2/model/pr_output.py @@ -0,0 +1,80 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.pr_output_ci_status import PROutputCiStatus + from datadog_api_client.v2.model.pr_output_status import PROutputStatus + + +class PROutput(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.pr_output_ci_status import PROutputCiStatus + from datadog_api_client.v2.model.pr_output_status import PROutputStatus + + return { + "ci_status": (PROutputCiStatus,), + "pr_number": (int,), + "pr_url": (str,), + "repository": (str,), + "status": (PROutputStatus,), + } + + attribute_map = { + "ci_status": "ci_status", + "pr_number": "pr_number", + "pr_url": "pr_url", + "repository": "repository", + "status": "status", + } + + def __init__( + self_, + pr_url: str, + ci_status: Union[PROutputCiStatus, UnsetType] = unset, + pr_number: Union[int, UnsetType] = unset, + repository: Union[str, UnsetType] = unset, + status: Union[PROutputStatus, UnsetType] = unset, + **kwargs, + ): + """ + A pull request created by the dependency upgrade automation. + + :param ci_status: The aggregate CI check status for the pull request. + :type ci_status: PROutputCiStatus, optional + + :param pr_number: The pull request number. + :type pr_number: int, optional + + :param pr_url: The URL of the pull request. + :type pr_url: str + + :param repository: The repository name in owner/repo format. + :type repository: str, optional + + :param status: The current status of the pull request. + :type status: PROutputStatus, optional + """ + if ci_status is not unset: + kwargs["ci_status"] = ci_status + if pr_number is not unset: + kwargs["pr_number"] = pr_number + if repository is not unset: + kwargs["repository"] = repository + if status is not unset: + kwargs["status"] = status + super().__init__(kwargs) + + self_.pr_url = pr_url diff --git a/src/datadog_api_client/v2/model/pr_output_ci_status.py b/src/datadog_api_client/v2/model/pr_output_ci_status.py new file mode 100644 index 0000000000..2bcf29d401 --- /dev/null +++ b/src/datadog_api_client/v2/model/pr_output_ci_status.py @@ -0,0 +1,41 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class PROutputCiStatus(ModelSimple): + """ + The aggregate CI check status for the pull request. + + :param value: Must be one of ["PENDING", "FAILED", "SUCCESSFUL"]. + :type value: str + """ + + allowed_values = { + "PENDING", + "FAILED", + "SUCCESSFUL", + } + PENDING: ClassVar["PROutputCiStatus"] + FAILED: ClassVar["PROutputCiStatus"] + SUCCESSFUL: ClassVar["PROutputCiStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +PROutputCiStatus.PENDING = PROutputCiStatus("PENDING") +PROutputCiStatus.FAILED = PROutputCiStatus("FAILED") +PROutputCiStatus.SUCCESSFUL = PROutputCiStatus("SUCCESSFUL") diff --git a/src/datadog_api_client/v2/model/pr_output_status.py b/src/datadog_api_client/v2/model/pr_output_status.py new file mode 100644 index 0000000000..afb4f2a571 --- /dev/null +++ b/src/datadog_api_client/v2/model/pr_output_status.py @@ -0,0 +1,47 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class PROutputStatus(ModelSimple): + """ + The current status of the pull request. + + :param value: Must be one of ["PENDING", "DRAFT", "READY", "MERGED", "CLOSED"]. + :type value: str + """ + + allowed_values = { + "PENDING", + "DRAFT", + "READY", + "MERGED", + "CLOSED", + } + PENDING: ClassVar["PROutputStatus"] + DRAFT: ClassVar["PROutputStatus"] + READY: ClassVar["PROutputStatus"] + MERGED: ClassVar["PROutputStatus"] + CLOSED: ClassVar["PROutputStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +PROutputStatus.PENDING = PROutputStatus("PENDING") +PROutputStatus.DRAFT = PROutputStatus("DRAFT") +PROutputStatus.READY = PROutputStatus("READY") +PROutputStatus.MERGED = PROutputStatus("MERGED") +PROutputStatus.CLOSED = PROutputStatus("CLOSED") diff --git a/src/datadog_api_client/v2/model/update_ai_workflow_request.py b/src/datadog_api_client/v2/model/update_ai_workflow_request.py new file mode 100644 index 0000000000..03516ba703 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_ai_workflow_request.py @@ -0,0 +1,105 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.entity import Entity + from datadog_api_client.v2.model.filtering_logic import FilteringLogic + + +class UpdateAIWorkflowRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.entity import Entity + from datadog_api_client.v2.model.filtering_logic import FilteringLogic + + return { + "completed_at": (datetime,), + "entities": ([[Entity]],), + "filtering_logic": (FilteringLogic,), + "grouping_logic": (str,), + "max_number_of_entities_per_session": (int,), + "prompt": (str,), + "repository": (str,), + "workflow_name": (str,), + } + + attribute_map = { + "completed_at": "completed_at", + "entities": "entities", + "filtering_logic": "filtering_logic", + "grouping_logic": "grouping_logic", + "max_number_of_entities_per_session": "max_number_of_entities_per_session", + "prompt": "prompt", + "repository": "repository", + "workflow_name": "workflow_name", + } + + def __init__( + self_, + completed_at: Union[datetime, UnsetType] = unset, + entities: Union[List[List[Entity]], UnsetType] = unset, + filtering_logic: Union[FilteringLogic, UnsetType] = unset, + grouping_logic: Union[str, UnsetType] = unset, + max_number_of_entities_per_session: Union[int, UnsetType] = unset, + prompt: Union[str, UnsetType] = unset, + repository: Union[str, UnsetType] = unset, + workflow_name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Request body for updating an existing AI workflow. All fields are optional. + + :param completed_at: Timestamp marking when the workflow completed. + :type completed_at: datetime, optional + + :param entities: A list of entity groups. Each group is processed in a separate workflow execution. + :type entities: [[Entity]], optional + + :param filtering_logic: Arbitrary filtering criteria used to select entities for the workflow. + :type filtering_logic: FilteringLogic, optional + + :param grouping_logic: Updated entity grouping logic. + :type grouping_logic: str, optional + + :param max_number_of_entities_per_session: Updated maximum number of entities per execution session. + :type max_number_of_entities_per_session: int, optional + + :param prompt: Updated AI prompt for the workflow. + :type prompt: str, optional + + :param repository: Updated target repository in owner/repo format. + :type repository: str, optional + + :param workflow_name: Updated name for the workflow. + :type workflow_name: str, optional + """ + if completed_at is not unset: + kwargs["completed_at"] = completed_at + if entities is not unset: + kwargs["entities"] = entities + if filtering_logic is not unset: + kwargs["filtering_logic"] = filtering_logic + if grouping_logic is not unset: + kwargs["grouping_logic"] = grouping_logic + if max_number_of_entities_per_session is not unset: + kwargs["max_number_of_entities_per_session"] = max_number_of_entities_per_session + if prompt is not unset: + kwargs["prompt"] = prompt + if repository is not unset: + kwargs["repository"] = repository + if workflow_name is not unset: + kwargs["workflow_name"] = workflow_name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/workflow_execution_attributes.py b/src/datadog_api_client/v2/model/workflow_execution_attributes.py new file mode 100644 index 0000000000..18bc408287 --- /dev/null +++ b/src/datadog_api_client/v2/model/workflow_execution_attributes.py @@ -0,0 +1,74 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.entity import Entity + + +class WorkflowExecutionAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.entity import Entity + + return { + "ai_workflow_id": (UUID,), + "created_at": (datetime,), + "entities": ([Entity],), + "instance_id": (UUID,), + "updated_at": (datetime,), + } + + attribute_map = { + "ai_workflow_id": "ai_workflow_id", + "created_at": "created_at", + "entities": "entities", + "instance_id": "instance_id", + "updated_at": "updated_at", + } + + def __init__( + self_, + ai_workflow_id: UUID, + created_at: datetime, + entities: List[Entity], + instance_id: UUID, + updated_at: datetime, + **kwargs, + ): + """ + Attributes of a workflow execution. + + :param ai_workflow_id: The ID of the parent AI workflow. + :type ai_workflow_id: UUID + + :param created_at: Timestamp when the execution was created. + :type created_at: datetime + + :param entities: The list of entities processed by this execution. + :type entities: [Entity] + + :param instance_id: The Datadog Workflow Automation instance ID for this execution. + :type instance_id: UUID + + :param updated_at: Timestamp when the execution was last updated. + :type updated_at: datetime + """ + super().__init__(kwargs) + + self_.ai_workflow_id = ai_workflow_id + self_.created_at = created_at + self_.entities = entities + self_.instance_id = instance_id + self_.updated_at = updated_at diff --git a/src/datadog_api_client/v2/model/workflow_execution_data.py b/src/datadog_api_client/v2/model/workflow_execution_data.py new file mode 100644 index 0000000000..791ab00895 --- /dev/null +++ b/src/datadog_api_client/v2/model/workflow_execution_data.py @@ -0,0 +1,55 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.workflow_execution_attributes import WorkflowExecutionAttributes + from datadog_api_client.v2.model.workflow_execution_data_type import WorkflowExecutionDataType + + +class WorkflowExecutionData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.workflow_execution_attributes import WorkflowExecutionAttributes + from datadog_api_client.v2.model.workflow_execution_data_type import WorkflowExecutionDataType + + return { + "attributes": (WorkflowExecutionAttributes,), + "id": (UUID,), + "type": (WorkflowExecutionDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: WorkflowExecutionAttributes, id: UUID, type: WorkflowExecutionDataType, **kwargs): + """ + A single workflow execution resource. + + :param attributes: Attributes of a workflow execution. + :type attributes: WorkflowExecutionAttributes + + :param id: The unique identifier of the workflow execution. + :type id: UUID + + :param type: The resource type for workflow executions. + :type type: WorkflowExecutionDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/workflow_execution_data_type.py b/src/datadog_api_client/v2/model/workflow_execution_data_type.py new file mode 100644 index 0000000000..6a49e41ebb --- /dev/null +++ b/src/datadog_api_client/v2/model/workflow_execution_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class WorkflowExecutionDataType(ModelSimple): + """ + The resource type for workflow executions. + + :param value: If omitted defaults to "workflow-executions". Must be one of ["workflow-executions"]. + :type value: str + """ + + allowed_values = { + "workflow-executions", + } + WORKFLOW_EXECUTIONS: ClassVar["WorkflowExecutionDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +WorkflowExecutionDataType.WORKFLOW_EXECUTIONS = WorkflowExecutionDataType("workflow-executions") diff --git a/src/datadog_api_client/v2/model/workflow_execution_response.py b/src/datadog_api_client/v2/model/workflow_execution_response.py new file mode 100644 index 0000000000..c67860e1ff --- /dev/null +++ b/src/datadog_api_client/v2/model/workflow_execution_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.workflow_execution_data import WorkflowExecutionData + + +class WorkflowExecutionResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.workflow_execution_data import WorkflowExecutionData + + return { + "data": (WorkflowExecutionData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: WorkflowExecutionData, **kwargs): + """ + Response containing a single workflow execution. + + :param data: A single workflow execution resource. + :type data: WorkflowExecutionData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/workflow_instance_summary_attributes.py b/src/datadog_api_client/v2/model/workflow_instance_summary_attributes.py new file mode 100644 index 0000000000..0d2bb3a47e --- /dev/null +++ b/src/datadog_api_client/v2/model/workflow_instance_summary_attributes.py @@ -0,0 +1,72 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.entity import Entity + from datadog_api_client.v2.model.workflow_instance_summary_attributes_status import ( + WorkflowInstanceSummaryAttributesStatus, + ) + + +class WorkflowInstanceSummaryAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.entity import Entity + from datadog_api_client.v2.model.workflow_instance_summary_attributes_status import ( + WorkflowInstanceSummaryAttributesStatus, + ) + + return { + "created_at": (datetime,), + "entities": ([Entity],), + "status": (WorkflowInstanceSummaryAttributesStatus,), + "status_display": (str,), + } + + attribute_map = { + "created_at": "created_at", + "entities": "entities", + "status": "status", + "status_display": "status_display", + } + + def __init__( + self_, + created_at: datetime, + entities: List[Entity], + status: WorkflowInstanceSummaryAttributesStatus, + status_display: str, + **kwargs, + ): + """ + Attributes of a workflow instance summary. + + :param created_at: Timestamp when the workflow instance was created. + :type created_at: datetime + + :param entities: The entities being processed by this workflow instance. + :type entities: [Entity] + + :param status: The current status of the step. + :type status: WorkflowInstanceSummaryAttributesStatus + + :param status_display: A human-readable display name for the current status. + :type status_display: str + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.entities = entities + self_.status = status + self_.status_display = status_display diff --git a/src/datadog_api_client/v2/model/workflow_instance_summary_attributes_status.py b/src/datadog_api_client/v2/model/workflow_instance_summary_attributes_status.py new file mode 100644 index 0000000000..b91284f539 --- /dev/null +++ b/src/datadog_api_client/v2/model/workflow_instance_summary_attributes_status.py @@ -0,0 +1,47 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class WorkflowInstanceSummaryAttributesStatus(ModelSimple): + """ + The current status of the step. + + :param value: Must be one of ["PENDING", "RUNNING", "COMPLETED", "FAILED", "CANCELED"]. + :type value: str + """ + + allowed_values = { + "PENDING", + "RUNNING", + "COMPLETED", + "FAILED", + "CANCELED", + } + PENDING: ClassVar["WorkflowInstanceSummaryAttributesStatus"] + RUNNING: ClassVar["WorkflowInstanceSummaryAttributesStatus"] + COMPLETED: ClassVar["WorkflowInstanceSummaryAttributesStatus"] + FAILED: ClassVar["WorkflowInstanceSummaryAttributesStatus"] + CANCELED: ClassVar["WorkflowInstanceSummaryAttributesStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +WorkflowInstanceSummaryAttributesStatus.PENDING = WorkflowInstanceSummaryAttributesStatus("PENDING") +WorkflowInstanceSummaryAttributesStatus.RUNNING = WorkflowInstanceSummaryAttributesStatus("RUNNING") +WorkflowInstanceSummaryAttributesStatus.COMPLETED = WorkflowInstanceSummaryAttributesStatus("COMPLETED") +WorkflowInstanceSummaryAttributesStatus.FAILED = WorkflowInstanceSummaryAttributesStatus("FAILED") +WorkflowInstanceSummaryAttributesStatus.CANCELED = WorkflowInstanceSummaryAttributesStatus("CANCELED") diff --git a/src/datadog_api_client/v2/model/workflow_instance_summary_data.py b/src/datadog_api_client/v2/model/workflow_instance_summary_data.py new file mode 100644 index 0000000000..32eb5f08fa --- /dev/null +++ b/src/datadog_api_client/v2/model/workflow_instance_summary_data.py @@ -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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.workflow_instance_summary_attributes import WorkflowInstanceSummaryAttributes + from datadog_api_client.v2.model.workflow_instance_summary_data_type import WorkflowInstanceSummaryDataType + + +class WorkflowInstanceSummaryData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.workflow_instance_summary_attributes import WorkflowInstanceSummaryAttributes + from datadog_api_client.v2.model.workflow_instance_summary_data_type import WorkflowInstanceSummaryDataType + + return { + "attributes": (WorkflowInstanceSummaryAttributes,), + "id": (UUID,), + "type": (WorkflowInstanceSummaryDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: WorkflowInstanceSummaryAttributes, id: UUID, type: WorkflowInstanceSummaryDataType, **kwargs + ): + """ + A summary of a single workflow instance. + + :param attributes: Attributes of a workflow instance summary. + :type attributes: WorkflowInstanceSummaryAttributes + + :param id: The unique identifier of the workflow instance. + :type id: UUID + + :param type: The resource type for workflow instances. + :type type: WorkflowInstanceSummaryDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/workflow_instance_summary_data_type.py b/src/datadog_api_client/v2/model/workflow_instance_summary_data_type.py new file mode 100644 index 0000000000..796d47e1b7 --- /dev/null +++ b/src/datadog_api_client/v2/model/workflow_instance_summary_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class WorkflowInstanceSummaryDataType(ModelSimple): + """ + The resource type for workflow instances. + + :param value: If omitted defaults to "workflow-instances". Must be one of ["workflow-instances"]. + :type value: str + """ + + allowed_values = { + "workflow-instances", + } + WORKFLOW_INSTANCES: ClassVar["WorkflowInstanceSummaryDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +WorkflowInstanceSummaryDataType.WORKFLOW_INSTANCES = WorkflowInstanceSummaryDataType("workflow-instances") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index e1a77cef72..d26e938bfd 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1,3 +1,8 @@ +from datadog_api_client.v2.model.ai_workflow_attributes import AIWorkflowAttributes +from datadog_api_client.v2.model.ai_workflow_data import AIWorkflowData +from datadog_api_client.v2.model.ai_workflow_data_type import AIWorkflowDataType +from datadog_api_client.v2.model.ai_workflow_list_meta import AIWorkflowListMeta +from datadog_api_client.v2.model.ai_workflow_response import AIWorkflowResponse from datadog_api_client.v2.model.api_error_response import APIErrorResponse from datadog_api_client.v2.model.api_key_create_attributes import APIKeyCreateAttributes from datadog_api_client.v2.model.api_key_create_data import APIKeyCreateData @@ -746,6 +751,8 @@ from datadog_api_client.v2.model.campaign_status import CampaignStatus from datadog_api_client.v2.model.campaign_type import CampaignType from datadog_api_client.v2.model.cancel_data_deletion_response_body import CancelDataDeletionResponseBody +from datadog_api_client.v2.model.cancel_workflow_executions_data import CancelWorkflowExecutionsData +from datadog_api_client.v2.model.cancel_workflow_executions_response import CancelWorkflowExecutionsResponse from datadog_api_client.v2.model.case import Case from datadog_api_client.v2.model.case3rd_party_ticket_status import Case3rdPartyTicketStatus from datadog_api_client.v2.model.case_assign import CaseAssign @@ -1193,6 +1200,7 @@ from datadog_api_client.v2.model.coverage_summary_service_stats import CoverageSummaryServiceStats from datadog_api_client.v2.model.coverage_summary_type import CoverageSummaryType from datadog_api_client.v2.model.cpu import Cpu +from datadog_api_client.v2.model.create_ai_workflow_request import CreateAIWorkflowRequest from datadog_api_client.v2.model.create_action_connection_request import CreateActionConnectionRequest from datadog_api_client.v2.model.create_action_connection_response import CreateActionConnectionResponse from datadog_api_client.v2.model.create_allocations_request import CreateAllocationsRequest @@ -1463,6 +1471,7 @@ from datadog_api_client.v2.model.create_upload_response_data_type import CreateUploadResponseDataType from datadog_api_client.v2.model.create_user_notification_channel_request import CreateUserNotificationChannelRequest from datadog_api_client.v2.model.create_variant import CreateVariant +from datadog_api_client.v2.model.create_workflow_executions_response import CreateWorkflowExecutionsResponse from datadog_api_client.v2.model.create_workflow_request import CreateWorkflowRequest from datadog_api_client.v2.model.create_workflow_response import CreateWorkflowResponse from datadog_api_client.v2.model.creator import Creator @@ -1954,6 +1963,7 @@ from datadog_api_client.v2.model.downtime_update_request_attributes import DowntimeUpdateRequestAttributes from datadog_api_client.v2.model.downtime_update_request_data import DowntimeUpdateRequestData from datadog_api_client.v2.model.epss import EPSS +from datadog_api_client.v2.model.entity import Entity from datadog_api_client.v2.model.entity_attributes import EntityAttributes from datadog_api_client.v2.model.entity_data import EntityData from datadog_api_client.v2.model.entity_meta import EntityMeta @@ -2202,6 +2212,8 @@ from datadog_api_client.v2.model.events_sort_type import EventsSortType from datadog_api_client.v2.model.events_timeseries_query import EventsTimeseriesQuery from datadog_api_client.v2.model.events_warning import EventsWarning +from datadog_api_client.v2.model.execution_step import ExecutionStep +from datadog_api_client.v2.model.execution_step_status import ExecutionStepStatus from datadog_api_client.v2.model.exposure_rollout_step_request import ExposureRolloutStepRequest from datadog_api_client.v2.model.exposure_schedule_request import ExposureScheduleRequest from datadog_api_client.v2.model.facet_info_request import FacetInfoRequest @@ -3339,6 +3351,7 @@ from datadog_api_client.v2.model.leaked_key_type import LeakedKeyType from datadog_api_client.v2.model.library import Library from datadog_api_client.v2.model.links import Links +from datadog_api_client.v2.model.list_ai_workflows_response import ListAIWorkflowsResponse from datadog_api_client.v2.model.list_apis_response import ListAPIsResponse from datadog_api_client.v2.model.list_apis_response_data import ListAPIsResponseData from datadog_api_client.v2.model.list_apis_response_data_attributes import ListAPIsResponseDataAttributes @@ -3381,6 +3394,10 @@ from datadog_api_client.v2.model.list_entity_catalog_response_included_item import ListEntityCatalogResponseIncludedItem from datadog_api_client.v2.model.list_entity_catalog_response_links import ListEntityCatalogResponseLinks from datadog_api_client.v2.model.list_environments_response import ListEnvironmentsResponse +from datadog_api_client.v2.model.list_execution_steps_attributes import ListExecutionStepsAttributes +from datadog_api_client.v2.model.list_execution_steps_data import ListExecutionStepsData +from datadog_api_client.v2.model.list_execution_steps_data_type import ListExecutionStepsDataType +from datadog_api_client.v2.model.list_execution_steps_response import ListExecutionStepsResponse from datadog_api_client.v2.model.list_feature_flags_response import ListFeatureFlagsResponse from datadog_api_client.v2.model.list_findings_meta import ListFindingsMeta from datadog_api_client.v2.model.list_findings_page import ListFindingsPage @@ -3400,6 +3417,10 @@ from datadog_api_client.v2.model.list_kind_catalog_response import ListKindCatalogResponse from datadog_api_client.v2.model.list_notification_channels_response import ListNotificationChannelsResponse from datadog_api_client.v2.model.list_on_call_notification_rules_response import ListOnCallNotificationRulesResponse +from datadog_api_client.v2.model.list_pr_outputs_attributes import ListPROutputsAttributes +from datadog_api_client.v2.model.list_pr_outputs_data import ListPROutputsData +from datadog_api_client.v2.model.list_pr_outputs_data_type import ListPROutputsDataType +from datadog_api_client.v2.model.list_pr_outputs_response import ListPROutputsResponse from datadog_api_client.v2.model.list_personal_access_tokens_response import ListPersonalAccessTokensResponse from datadog_api_client.v2.model.list_pipelines_response import ListPipelinesResponse from datadog_api_client.v2.model.list_pipelines_response_meta import ListPipelinesResponseMeta @@ -3418,6 +3439,7 @@ from datadog_api_client.v2.model.list_teams_sort import ListTeamsSort from datadog_api_client.v2.model.list_vulnerabilities_response import ListVulnerabilitiesResponse from datadog_api_client.v2.model.list_vulnerable_assets_response import ListVulnerableAssetsResponse +from datadog_api_client.v2.model.list_workflow_instances_response import ListWorkflowInstancesResponse from datadog_api_client.v2.model.log import Log from datadog_api_client.v2.model.log_attributes import LogAttributes from datadog_api_client.v2.model.log_type import LogType @@ -4874,6 +4896,9 @@ from datadog_api_client.v2.model.output_schema_parameters import OutputSchemaParameters from datadog_api_client.v2.model.output_schema_parameters_type import OutputSchemaParametersType from datadog_api_client.v2.model.overwrite_allocations_request import OverwriteAllocationsRequest +from datadog_api_client.v2.model.pr_output import PROutput +from datadog_api_client.v2.model.pr_output_ci_status import PROutputCiStatus +from datadog_api_client.v2.model.pr_output_status import PROutputStatus from datadog_api_client.v2.model.page_urgency import PageUrgency from datadog_api_client.v2.model.paginated_response_meta import PaginatedResponseMeta from datadog_api_client.v2.model.pagination import Pagination @@ -7251,6 +7276,7 @@ ) from datadog_api_client.v2.model.unit import Unit from datadog_api_client.v2.model.unpublish_app_response import UnpublishAppResponse +from datadog_api_client.v2.model.update_ai_workflow_request import UpdateAIWorkflowRequest from datadog_api_client.v2.model.update_action_connection_request import UpdateActionConnectionRequest from datadog_api_client.v2.model.update_action_connection_response import UpdateActionConnectionResponse from datadog_api_client.v2.model.update_app_request import UpdateAppRequest @@ -7560,11 +7586,21 @@ from datadog_api_client.v2.model.workflow_data_type import WorkflowDataType from datadog_api_client.v2.model.workflow_data_update import WorkflowDataUpdate from datadog_api_client.v2.model.workflow_data_update_attributes import WorkflowDataUpdateAttributes +from datadog_api_client.v2.model.workflow_execution_attributes import WorkflowExecutionAttributes +from datadog_api_client.v2.model.workflow_execution_data import WorkflowExecutionData +from datadog_api_client.v2.model.workflow_execution_data_type import WorkflowExecutionDataType +from datadog_api_client.v2.model.workflow_execution_response import WorkflowExecutionResponse from datadog_api_client.v2.model.workflow_instance_create_meta import WorkflowInstanceCreateMeta from datadog_api_client.v2.model.workflow_instance_create_request import WorkflowInstanceCreateRequest from datadog_api_client.v2.model.workflow_instance_create_response import WorkflowInstanceCreateResponse from datadog_api_client.v2.model.workflow_instance_create_response_data import WorkflowInstanceCreateResponseData from datadog_api_client.v2.model.workflow_instance_list_item import WorkflowInstanceListItem +from datadog_api_client.v2.model.workflow_instance_summary_attributes import WorkflowInstanceSummaryAttributes +from datadog_api_client.v2.model.workflow_instance_summary_attributes_status import ( + WorkflowInstanceSummaryAttributesStatus, +) +from datadog_api_client.v2.model.workflow_instance_summary_data import WorkflowInstanceSummaryData +from datadog_api_client.v2.model.workflow_instance_summary_data_type import WorkflowInstanceSummaryDataType from datadog_api_client.v2.model.workflow_list_instances_response import WorkflowListInstancesResponse from datadog_api_client.v2.model.workflow_list_instances_response_meta import WorkflowListInstancesResponseMeta from datadog_api_client.v2.model.workflow_list_instances_response_meta_page import WorkflowListInstancesResponseMetaPage @@ -7586,6 +7622,11 @@ from datadog_api_client.v2.model.zoom_configuration_reference_data import ZoomConfigurationReferenceData __all__ = [ + "AIWorkflowAttributes", + "AIWorkflowData", + "AIWorkflowDataType", + "AIWorkflowListMeta", + "AIWorkflowResponse", "APIErrorResponse", "APIKeyCreateAttributes", "APIKeyCreateData", @@ -8154,6 +8195,8 @@ "CampaignStatus", "CampaignType", "CancelDataDeletionResponseBody", + "CancelWorkflowExecutionsData", + "CancelWorkflowExecutionsResponse", "Case", "Case3rdPartyTicketStatus", "CaseAssign", @@ -8501,6 +8544,7 @@ "CoverageSummaryServiceStats", "CoverageSummaryType", "Cpu", + "CreateAIWorkflowRequest", "CreateActionConnectionRequest", "CreateActionConnectionResponse", "CreateAllocationsRequest", @@ -8661,6 +8705,7 @@ "CreateUploadResponseDataType", "CreateUserNotificationChannelRequest", "CreateVariant", + "CreateWorkflowExecutionsResponse", "CreateWorkflowRequest", "CreateWorkflowResponse", "Creator", @@ -9010,6 +9055,7 @@ "DowntimeUpdateRequestAttributes", "DowntimeUpdateRequestData", "EPSS", + "Entity", "EntityAttributes", "EntityData", "EntityMeta", @@ -9184,6 +9230,8 @@ "EventsSortType", "EventsTimeseriesQuery", "EventsWarning", + "ExecutionStep", + "ExecutionStepStatus", "ExposureRolloutStepRequest", "ExposureScheduleRequest", "FacetInfoRequest", @@ -10083,6 +10131,7 @@ "LeakedKeyType", "Library", "Links", + "ListAIWorkflowsResponse", "ListAPIsResponse", "ListAPIsResponseData", "ListAPIsResponseDataAttributes", @@ -10117,6 +10166,10 @@ "ListEntityCatalogResponseIncludedItem", "ListEntityCatalogResponseLinks", "ListEnvironmentsResponse", + "ListExecutionStepsAttributes", + "ListExecutionStepsData", + "ListExecutionStepsDataType", + "ListExecutionStepsResponse", "ListFeatureFlagsResponse", "ListFindingsMeta", "ListFindingsPage", @@ -10134,6 +10187,10 @@ "ListKindCatalogResponse", "ListNotificationChannelsResponse", "ListOnCallNotificationRulesResponse", + "ListPROutputsAttributes", + "ListPROutputsData", + "ListPROutputsDataType", + "ListPROutputsResponse", "ListPersonalAccessTokensResponse", "ListPipelinesResponse", "ListPipelinesResponseMeta", @@ -10152,6 +10209,7 @@ "ListTeamsSort", "ListVulnerabilitiesResponse", "ListVulnerableAssetsResponse", + "ListWorkflowInstancesResponse", "Log", "LogAttributes", "LogType", @@ -10976,6 +11034,9 @@ "OutputSchemaParameters", "OutputSchemaParametersType", "OverwriteAllocationsRequest", + "PROutput", + "PROutputCiStatus", + "PROutputStatus", "PageUrgency", "PaginatedResponseMeta", "Pagination", @@ -12663,6 +12724,7 @@ "UnassignSeatsUserRequestDataAttributes", "Unit", "UnpublishAppResponse", + "UpdateAIWorkflowRequest", "UpdateActionConnectionRequest", "UpdateActionConnectionResponse", "UpdateAppRequest", @@ -12908,11 +12970,19 @@ "WorkflowDataType", "WorkflowDataUpdate", "WorkflowDataUpdateAttributes", + "WorkflowExecutionAttributes", + "WorkflowExecutionData", + "WorkflowExecutionDataType", + "WorkflowExecutionResponse", "WorkflowInstanceCreateMeta", "WorkflowInstanceCreateRequest", "WorkflowInstanceCreateResponse", "WorkflowInstanceCreateResponseData", "WorkflowInstanceListItem", + "WorkflowInstanceSummaryAttributes", + "WorkflowInstanceSummaryAttributesStatus", + "WorkflowInstanceSummaryData", + "WorkflowInstanceSummaryDataType", "WorkflowListInstancesResponse", "WorkflowListInstancesResponseMeta", "WorkflowListInstancesResponseMetaPage", diff --git a/tests/v2/features/dependency_management.feature b/tests/v2/features/dependency_management.feature new file mode 100644 index 0000000000..916b13bb5f --- /dev/null +++ b/tests/v2/features/dependency_management.feature @@ -0,0 +1,250 @@ +@endpoint(dependency-management) @endpoint(dependency-management-v2) +Feature: Dependency Management + Manage AI-powered dependency upgrade workflows for your organization's + repositories. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "DependencyManagement" API + + @generated @skip @team:DataDog/dependency-management + Scenario: Cancel a workflow execution returns "Conflict" response + Given operation "CancelWorkflowExecution" enabled + And new "CancelWorkflowExecution" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/dependency-management + Scenario: Cancel a workflow execution returns "No Content" response + Given operation "CancelWorkflowExecution" enabled + And new "CancelWorkflowExecution" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/dependency-management + Scenario: Cancel a workflow execution returns "Not Found" response + Given operation "CancelWorkflowExecution" enabled + And new "CancelWorkflowExecution" 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/dependency-management + Scenario: Cancel workflow executions returns "Not Found" response + Given operation "CancelWorkflowExecutions" enabled + And new "CancelWorkflowExecutions" 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/dependency-management + Scenario: Cancel workflow executions returns "OK" response + Given operation "CancelWorkflowExecutions" enabled + And new "CancelWorkflowExecutions" 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/dependency-management + Scenario: Create an AI workflow returns "Bad Request" response + Given operation "CreateAIWorkflow" enabled + And new "CreateAIWorkflow" request + And body with value {"entities": [[{"entity_kind": "service", "entity_name": "my-service", "entity_namespace": "default", "entity_team": "platform"}]], "filtering_logic": {"teams": ["platform"]}, "grouping_logic": "by-service", "idp_campaign_id": "campaign-abc123", "max_number_of_entities_per_session": 5, "prompt": "Upgrade the lodash dependency to version 4.17.21", "repository": "DataDog/datadog-agent", "user": "john.doe@example.com", "workflow_name": "Upgrade lodash to 4.17.21"} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/dependency-management + Scenario: Create an AI workflow returns "Created" response + Given operation "CreateAIWorkflow" enabled + And new "CreateAIWorkflow" request + And body with value {"entities": [[{"entity_kind": "service", "entity_name": "my-service", "entity_namespace": "default", "entity_team": "platform"}]], "filtering_logic": {"teams": ["platform"]}, "grouping_logic": "by-service", "idp_campaign_id": "campaign-abc123", "max_number_of_entities_per_session": 5, "prompt": "Upgrade the lodash dependency to version 4.17.21", "repository": "DataDog/datadog-agent", "user": "john.doe@example.com", "workflow_name": "Upgrade lodash to 4.17.21"} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/dependency-management + Scenario: Create workflow executions returns "Bad Request" response + Given operation "CreateWorkflowExecution" enabled + And new "CreateWorkflowExecution" 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/dependency-management + Scenario: Create workflow executions returns "Created" response + Given operation "CreateWorkflowExecution" enabled + And new "CreateWorkflowExecution" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/dependency-management + Scenario: Create workflow executions returns "Not Found" response + Given operation "CreateWorkflowExecution" enabled + And new "CreateWorkflowExecution" 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/dependency-management + Scenario: Delete an AI workflow returns "No Content" response + Given operation "DeleteAIWorkflow" enabled + And new "DeleteAIWorkflow" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/dependency-management + Scenario: Delete an AI workflow returns "Not Found" response + Given operation "DeleteAIWorkflow" enabled + And new "DeleteAIWorkflow" 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/dependency-management + Scenario: Delete workflow executions returns "No Content" response + Given operation "DeleteWorkflowExecutions" enabled + And new "DeleteWorkflowExecutions" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/dependency-management + Scenario: Delete workflow executions returns "Not Found" response + Given operation "DeleteWorkflowExecutions" enabled + And new "DeleteWorkflowExecutions" 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/dependency-management + Scenario: Get an AI workflow returns "Not Found" response + Given operation "GetAIWorkflow" enabled + And new "GetAIWorkflow" 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/dependency-management + Scenario: Get an AI workflow returns "OK" response + Given operation "GetAIWorkflow" enabled + And new "GetAIWorkflow" 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/dependency-management + Scenario: List AI workflow instances returns "Not Found" response + Given operation "ListAIWorkflowInstances" enabled + And new "ListAIWorkflowInstances" 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/dependency-management + Scenario: List AI workflow instances returns "OK" response + Given operation "ListAIWorkflowInstances" enabled + And new "ListAIWorkflowInstances" 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/dependency-management + Scenario: List AI workflows returns "Bad Request" response + Given operation "ListAIWorkflows" enabled + And new "ListAIWorkflows" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/dependency-management + Scenario: List AI workflows returns "OK" response + Given operation "ListAIWorkflows" enabled + And new "ListAIWorkflows" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/dependency-management + Scenario: List PR outputs returns "Not Found" response + Given operation "ListPROutputs" enabled + And new "ListPROutputs" 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/dependency-management + Scenario: List PR outputs returns "OK" response + Given operation "ListPROutputs" enabled + And new "ListPROutputs" 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/dependency-management + Scenario: List execution steps returns "Not Found" response + Given operation "ListExecutionSteps" enabled + And new "ListExecutionSteps" 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/dependency-management + Scenario: List execution steps returns "OK" response + Given operation "ListExecutionSteps" enabled + And new "ListExecutionSteps" 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/dependency-management + Scenario: Rerun a workflow execution returns "Conflict" response + Given operation "RerunWorkflowExecution" enabled + And new "RerunWorkflowExecution" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/dependency-management + Scenario: Rerun a workflow execution returns "Created" response + Given operation "RerunWorkflowExecution" enabled + And new "RerunWorkflowExecution" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/dependency-management + Scenario: Rerun a workflow execution returns "Not Found" response + Given operation "RerunWorkflowExecution" enabled + And new "RerunWorkflowExecution" 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/dependency-management + Scenario: Update an AI workflow returns "Bad Request" response + Given operation "UpdateAIWorkflow" enabled + And new "UpdateAIWorkflow" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"completed_at": "2024-06-01T12:00:00Z", "entities": [[{"entity_kind": "service", "entity_name": "my-service", "entity_namespace": "default", "entity_team": "platform"}]], "filtering_logic": {"teams": ["platform"]}, "grouping_logic": "by-team", "max_number_of_entities_per_session": 10, "prompt": "Updated prompt for the dependency upgrade", "repository": "DataDog/datadog-agent", "workflow_name": "Updated workflow name"} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/dependency-management + Scenario: Update an AI workflow returns "Not Found" response + Given operation "UpdateAIWorkflow" enabled + And new "UpdateAIWorkflow" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"completed_at": "2024-06-01T12:00:00Z", "entities": [[{"entity_kind": "service", "entity_name": "my-service", "entity_namespace": "default", "entity_team": "platform"}]], "filtering_logic": {"teams": ["platform"]}, "grouping_logic": "by-team", "max_number_of_entities_per_session": 10, "prompt": "Updated prompt for the dependency upgrade", "repository": "DataDog/datadog-agent", "workflow_name": "Updated workflow name"} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/dependency-management + Scenario: Update an AI workflow returns "OK" response + Given operation "UpdateAIWorkflow" enabled + And new "UpdateAIWorkflow" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"completed_at": "2024-06-01T12:00:00Z", "entities": [[{"entity_kind": "service", "entity_name": "my-service", "entity_namespace": "default", "entity_team": "platform"}]], "filtering_logic": {"teams": ["platform"]}, "grouping_logic": "by-team", "max_number_of_entities_per_session": 10, "prompt": "Updated prompt for the dependency upgrade", "repository": "DataDog/datadog-agent", "workflow_name": "Updated workflow name"} + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index b9805518e9..fe9bdd3515 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1701,6 +1701,92 @@ "type": "idempotent" } }, + "CreateAIWorkflow": { + "tag": "Dependency Management", + "undo": { + "operationId": "DeleteAIWorkflow", + "parameters": [ + { + "name": "id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ListAIWorkflows": { + "tag": "Dependency Management", + "undo": { + "type": "safe" + } + }, + "DeleteAIWorkflow": { + "tag": "Dependency Management", + "undo": { + "type": "idempotent" + } + }, + "GetAIWorkflow": { + "tag": "Dependency Management", + "undo": { + "type": "safe" + } + }, + "UpdateAIWorkflow": { + "tag": "Dependency Management", + "undo": { + "type": "idempotent" + } + }, + "CancelWorkflowExecutions": { + "tag": "Dependency Management", + "undo": { + "type": "unsafe" + } + }, + "DeleteWorkflowExecutions": { + "tag": "Dependency Management", + "undo": { + "type": "idempotent" + } + }, + "CreateWorkflowExecution": { + "tag": "Dependency Management", + "undo": { + "operationId": "DeleteWorkflowExecutions", + "type": "unsafe" + } + }, + "ListAIWorkflowInstances": { + "tag": "Dependency Management", + "undo": { + "type": "safe" + } + }, + "CancelWorkflowExecution": { + "tag": "Dependency Management", + "undo": { + "type": "unsafe" + } + }, + "ListPROutputs": { + "tag": "Dependency Management", + "undo": { + "type": "safe" + } + }, + "RerunWorkflowExecution": { + "tag": "Dependency Management", + "undo": { + "type": "unsafe" + } + }, + "ListExecutionSteps": { + "tag": "Dependency Management", + "undo": { + "type": "safe" + } + }, "ListDeploymentGates": { "tag": "Deployment Gates", "undo": {