From 62ca83df421406d0d04fe48ad6c97f5d77f123cb Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 20 Mar 2026 13:33:49 +0000 Subject: [PATCH] Regenerate client from commit e764d8c of spec repo --- .generator/schemas/v2/openapi.yaml | 387 ++++++++++++++++++ docs/datadog_api_client.v2.model.rst | 119 ++++++ .../GetDeploymentGatesEvaluationResult.py | 17 + ...loymentGatesEvaluationResult_3594131214.py | 20 + .../deployment-gates/ListDeploymentGates.py | 14 + .../TriggerDeploymentGatesEvaluation.py | 35 ++ ...ggerDeploymentGatesEvaluation_691804290.py | 37 ++ src/datadog_api_client/configuration.py | 3 + .../v2/api/deployment_gates_api.py | 152 ++++++- .../deployment_gates_evaluation_request.py | 44 ++ ...ent_gates_evaluation_request_attributes.py | 71 ++++ ...eployment_gates_evaluation_request_data.py | 61 +++ ...ment_gates_evaluation_request_data_type.py | 37 ++ .../deployment_gates_evaluation_response.py | 46 +++ ...nt_gates_evaluation_response_attributes.py | 33 ++ ...ployment_gates_evaluation_response_data.py | 69 ++++ ...ent_gates_evaluation_response_data_type.py | 37 ++ ...oyment_gates_evaluation_result_response.py | 46 +++ ...s_evaluation_result_response_attributes.py | 90 ++++ ..._result_response_attributes_gate_status.py | 50 +++ ...t_gates_evaluation_result_response_data.py | 68 +++ ...es_evaluation_result_response_data_type.py | 37 ++ .../model/deployment_gates_list_response.py | 56 +++ .../deployment_gates_list_response_meta.py | 44 ++ ...eployment_gates_list_response_meta_page.py | 63 +++ .../model/deployment_gates_rule_response.py | 78 ++++ src/datadog_api_client/v2/models/__init__.py | 52 +++ ...eturns_bad_request_invalid_response.frozen | 1 + ..._returns_bad_request_invalid_response.yaml | 55 +++ ...eturns_bad_request_invalid_response.frozen | 1 + ..._returns_bad_request_invalid_response.yaml | 21 + ...eturns_bad_request_invalid_response.frozen | 1 + ..._returns_bad_request_invalid_response.yaml | 19 + ..._deployment_gate_not_found_response.frozen | 1 + ...ns_deployment_gate_not_found_response.yaml | 19 + ...eturns_bad_request_invalid_response.frozen | 1 + ..._returns_bad_request_invalid_response.yaml | 19 + ..._deployment_gate_not_found_response.frozen | 1 + ...ns_deployment_gate_not_found_response.yaml | 19 + ...result_returns_bad_request_response.frozen | 1 + ...n_result_returns_bad_request_response.yaml | 19 + ..._deployment_gate_not_found_response.frozen | 1 + ...ns_deployment_gate_not_found_response.yaml | 19 + ...aluation_result_returns_ok_response.frozen | 1 + ...evaluation_result_returns_ok_response.yaml | 106 +++++ ...eturns_bad_request_invalid_response.frozen | 1 + ..._returns_bad_request_invalid_response.yaml | 19 + ..._deployment_gate_not_found_response.frozen | 1 + ...ns_deployment_gate_not_found_response.yaml | 19 + ...eturns_bad_request_invalid_response.frozen | 1 + ..._returns_bad_request_invalid_response.yaml | 19 + ..._deployment_rule_not_found_response.frozen | 1 + ...ns_deployment_rule_not_found_response.yaml | 19 + ...t_gate_returns_bad_request_response.frozen | 1 + ...ent_gate_returns_bad_request_response.yaml | 19 + ...valuation_returns_accepted_response.frozen | 1 + ..._evaluation_returns_accepted_response.yaml | 89 ++++ ...uation_returns_bad_request_response.frozen | 1 + ...aluation_returns_bad_request_response.yaml | 21 + ..._deployment_gate_not_found_response.frozen | 1 + ...ns_deployment_gate_not_found_response.yaml | 21 + ...eturns_bad_request_invalid_response.frozen | 1 + ..._returns_bad_request_invalid_response.yaml | 21 + ..._deployment_gate_not_found_response.frozen | 1 + ...ns_deployment_gate_not_found_response.yaml | 21 + ...eturns_bad_request_invalid_response.frozen | 1 + ..._returns_bad_request_invalid_response.yaml | 21 + ..._deployment_rule_not_found_response.frozen | 1 + ...ns_deployment_rule_not_found_response.yaml | 21 + tests/v2/features/deployment_gates.feature | 143 ++++++- tests/v2/features/given.json | 12 + tests/v2/features/undo.json | 18 + 72 files changed, 2548 insertions(+), 18 deletions(-) create mode 100644 examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult.py create mode 100644 examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult_3594131214.py create mode 100644 examples/v2/deployment-gates/ListDeploymentGates.py create mode 100644 examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.py create mode 100644 examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation_691804290.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_evaluation_request.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_evaluation_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_evaluation_request_data.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_evaluation_request_data_type.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_evaluation_response.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_evaluation_response_attributes.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_evaluation_response_data.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_evaluation_response_data_type.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_attributes.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_attributes_gate_status.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_data.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_data_type.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_list_response.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_list_response_meta.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_list_response_meta_page.py create mode 100644 src/datadog_api_client/v2/model/deployment_gates_rule_response.py create mode 100644 tests/v2/cassettes/test_scenarios/test_create_deployment_gate_returns_bad_request_invalid_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_deployment_gate_returns_bad_request_invalid_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_bad_request_invalid_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_bad_request_invalid_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_bad_request_invalid_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_bad_request_invalid_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_deployment_gate_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_deployment_gate_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_bad_request_invalid_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_bad_request_invalid_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_deployment_gate_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_deployment_gate_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_deployment_gate_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_deployment_gate_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_bad_request_invalid_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_bad_request_invalid_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_deployment_gate_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_deployment_gate_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_bad_request_invalid_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_bad_request_invalid_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_deployment_rule_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_deployment_rule_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_rules_for_a_deployment_gate_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_rules_for_a_deployment_gate_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_accepted_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_accepted_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_deployment_gate_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_deployment_gate_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_bad_request_invalid_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_bad_request_invalid_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_deployment_gate_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_deployment_gate_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_bad_request_invalid_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_bad_request_invalid_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_deployment_rule_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_deployment_rule_not_found_response.yaml diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ccc3331457..ac890a965f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -20382,6 +20382,238 @@ components: data: $ref: "#/components/schemas/ListDeploymentRuleResponseData" type: object + DeploymentGatesEvaluationRequest: + description: Request body for triggering a deployment gate evaluation. + properties: + data: + $ref: "#/components/schemas/DeploymentGatesEvaluationRequestData" + required: + - data + type: object + DeploymentGatesEvaluationRequestAttributes: + description: Attributes for a deployment gate evaluation request. + properties: + env: + description: The environment of the deployment. + example: "staging" + type: string + identifier: + default: default + description: The identifier of the deployment gate. Defaults to "default". + example: "pre-deploy" + type: string + primary_tag: + description: A primary tag to scope APM Faulty Deployment Detection rules. + example: "region:us-east-1" + type: string + service: + description: The service being deployed. + example: "transaction-backend" + type: string + version: + description: The version of the deployment. Required for APM Faulty Deployment Detection rules. + example: "v1.2.3" + type: string + required: + - env + - service + type: object + DeploymentGatesEvaluationRequestData: + description: Data for a deployment gate evaluation request. + properties: + attributes: + $ref: "#/components/schemas/DeploymentGatesEvaluationRequestAttributes" + type: + $ref: "#/components/schemas/DeploymentGatesEvaluationRequestDataType" + required: + - type + - attributes + type: object + DeploymentGatesEvaluationRequestDataType: + default: deployment_gates_evaluation_request + description: JSON:API type for a deployment gate evaluation request. + enum: + - deployment_gates_evaluation_request + example: deployment_gates_evaluation_request + type: string + x-enum-varnames: + - DEPLOYMENT_GATES_EVALUATION_REQUEST + DeploymentGatesEvaluationResponse: + description: Response for a deployment gate evaluation request. + properties: + data: + $ref: "#/components/schemas/DeploymentGatesEvaluationResponseData" + type: object + DeploymentGatesEvaluationResponseAttributes: + description: Attributes for a deployment gate evaluation response. + properties: + evaluation_id: + description: The unique identifier of the gate evaluation. + example: "e9d2f04f-4f4b-494b-86e5-52f03e10c8e9" + type: string + required: + - evaluation_id + type: object + DeploymentGatesEvaluationResponseData: + description: Data for a deployment gate evaluation response. + properties: + attributes: + $ref: "#/components/schemas/DeploymentGatesEvaluationResponseAttributes" + id: + description: The unique identifier of the evaluation response. + example: "e9d2f04f-4f4b-494b-86e5-52f03e10c8e9" + format: uuid + type: string + type: + $ref: "#/components/schemas/DeploymentGatesEvaluationResponseDataType" + required: + - type + - attributes + - id + type: object + DeploymentGatesEvaluationResponseDataType: + default: deployment_gates_evaluation_response + description: JSON:API type for a deployment gate evaluation response. + enum: + - deployment_gates_evaluation_response + example: deployment_gates_evaluation_response + type: string + x-enum-varnames: + - DEPLOYMENT_GATES_EVALUATION_RESPONSE + DeploymentGatesEvaluationResultResponse: + description: Response containing the result of a deployment gate evaluation. + properties: + data: + $ref: "#/components/schemas/DeploymentGatesEvaluationResultResponseData" + type: object + DeploymentGatesEvaluationResultResponseAttributes: + description: Attributes for a deployment gate evaluation result response. + properties: + dry_run: + description: Whether the gate was evaluated in dry-run mode. + example: false + type: boolean + evaluation_id: + description: The unique identifier of the gate evaluation. + example: "e9d2f04f-4f4b-494b-86e5-52f03e10c8e9" + type: string + evaluation_url: + description: A URL to view the evaluation details in the Datadog UI. + example: "https://app.datadoghq.com/ci/deployment-gates/evaluations?index=cdgates&query=level%3Agate+%40evaluation_id%3Ae9d2f04f-4f4b-494b-86e5-52f03e10c8e9" + type: string + gate_id: + description: The unique identifier of the deployment gate. + example: "e140302e-0cba-40d2-978c-6780647f8f1c" + format: uuid + type: string + gate_status: + $ref: "#/components/schemas/DeploymentGatesEvaluationResultResponseAttributesGateStatus" + rules: + description: The results of individual rule evaluations. + items: + $ref: "#/components/schemas/DeploymentGatesRuleResponse" + type: array + required: + - dry_run + - evaluation_id + - evaluation_url + - gate_id + - gate_status + - rules + type: object + DeploymentGatesEvaluationResultResponseAttributesGateStatus: + description: |- + The overall status of the gate evaluation. + - `in_progress`: The evaluation is still running. + - `pass`: All rules passed successfully and the deployment is allowed to proceed. + - `fail`: One or more rules did not pass; the deployment should not proceed. + enum: + - in_progress + - pass + - fail + example: "pass" + type: string + x-enum-varnames: + - IN_PROGRESS + - PASS + - FAIL + DeploymentGatesEvaluationResultResponseData: + description: Data for a deployment gate evaluation result response. + properties: + attributes: + $ref: "#/components/schemas/DeploymentGatesEvaluationResultResponseAttributes" + id: + description: The unique identifier of the evaluation. + example: "e9d2f04f-4f4b-494b-86e5-52f03e10c8e9" + type: string + type: + $ref: "#/components/schemas/DeploymentGatesEvaluationResultResponseDataType" + required: + - type + - attributes + - id + type: object + DeploymentGatesEvaluationResultResponseDataType: + default: deployment_gates_evaluation_result_response + description: JSON:API type for a deployment gate evaluation result response. + enum: + - deployment_gates_evaluation_result_response + example: deployment_gates_evaluation_result_response + type: string + x-enum-varnames: + - DEPLOYMENT_GATES_EVALUATION_RESULT_RESPONSE + DeploymentGatesListResponse: + description: Response containing a paginated list of deployment gates. + properties: + data: + description: Array of deployment gates. + items: + $ref: "#/components/schemas/DeploymentGateResponseData" + type: array + meta: + $ref: "#/components/schemas/DeploymentGatesListResponseMeta" + type: object + DeploymentGatesListResponseMeta: + description: Metadata for a list of deployment gates response. + properties: + page: + $ref: "#/components/schemas/DeploymentGatesListResponseMetaPage" + type: object + DeploymentGatesListResponseMetaPage: + description: Pagination information for a list of deployment gates. + properties: + cursor: + description: The cursor used for the current page. + type: string + next_cursor: + description: The cursor to use to fetch the next page. This is absent when there are no more pages. + type: string + size: + default: 50 + description: The number of results per page. + format: int64 + maximum: 1000 + minimum: 1 + type: integer + type: object + DeploymentGatesRuleResponse: + description: The result of a single rule evaluation. + properties: + dry_run: + description: Whether this rule was evaluated in dry-run mode. + example: false + type: boolean + name: + description: The name of the rule. + example: "Check service monitors" + type: string + reason: + description: The reason for the rule result, if applicable. + example: "One or more monitors in ALERT state" + type: string + status: + $ref: "#/components/schemas/DeploymentGatesEvaluationResultResponseAttributesGateStatus" + type: object DeploymentMetadata: description: Metadata object containing the publication creation information. properties: @@ -79322,6 +79554,61 @@ paths: **Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/deployment_gates: + get: + description: |- + Returns a paginated list of all deployment gates for the organization. + Use `page[cursor]` and `page[size]` query parameters to paginate through results. + operationId: ListDeploymentGates + parameters: + - description: Cursor for pagination. Use the `meta.page.next_cursor` value from the previous response. + in: query + name: page[cursor] + required: false + schema: + type: string + - description: Number of results per page. Defaults to 50. Must be between 1 and 1000. + in: query + name: page[size] + required: false + schema: + default: 50 + format: int64 + maximum: 1000 + minimum: 1 + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DeploymentGatesListResponse" + description: OK + "400": + $ref: "#/components/responses/HTTPCDGatesBadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/HTTPCIAppErrors" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get all deployment gates + tags: ["Deployment Gates"] + x-permission: + operator: OR + permissions: + - deployment_gates_read + x-unstable: |- + **Note**: This endpoint is in preview and may be subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). post: description: |- Endpoint to create a deployment gate. @@ -79760,6 +80047,106 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and may be subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/deployments/gates/evaluation: + post: + description: |- + Triggers an asynchronous deployment gate evaluation for the given service and environment. + Returns an evaluation ID that can be used to poll for the result via the + `GET /api/v2/deployments/gates/evaluation/{id}` endpoint. + operationId: TriggerDeploymentGatesEvaluation + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/DeploymentGatesEvaluationRequest" + required: true + responses: + "202": + content: + application/json: + schema: + $ref: "#/components/schemas/DeploymentGatesEvaluationResponse" + description: Accepted + "400": + $ref: "#/components/responses/HTTPCDGatesBadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/HTTPCDGatesNotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/HTTPCIAppErrors" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Trigger a deployment gate evaluation + tags: ["Deployment Gates"] + x-permission: + operator: OR + permissions: + - deployment_gates_evaluate + x-unstable: |- + **Note**: This endpoint is in preview and may be subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/deployments/gates/evaluation/{id}: + get: + description: |- + Retrieves the result of a deployment gate evaluation by its evaluation ID. + If the evaluation is still in progress, `data.attributes.gate_status` will be `in_progress`; + continue polling until it returns `pass` or `fail`. + Polling every 10-20 seconds is recommended. + The endpoint may return a 404 if called too soon after triggering; retry after a few seconds. + operationId: GetDeploymentGatesEvaluationResult + parameters: + - description: The evaluation ID returned by the trigger endpoint. + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DeploymentGatesEvaluationResultResponse" + description: OK + "400": + $ref: "#/components/responses/HTTPCDGatesBadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/HTTPCDGatesNotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/HTTPCIAppErrors" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a deployment gate evaluation result + tags: ["Deployment Gates"] + x-permission: + operator: OR + permissions: + - deployment_gates_evaluate + x-unstable: |- + **Note**: This endpoint is in preview and may be subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/domain_allowlist: get: description: Get the domain allowlist for an organization. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index e7e8184063..8dbf4eef3a 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -8453,6 +8453,125 @@ datadog\_api\_client.v2.model.deployment\_gate\_rules\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_request module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_request\_attributes module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_request\_data module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_request\_data\_type module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_request_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_response module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_response\_attributes module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_response\_data module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_response\_data\_type module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_response_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_result\_response module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_result_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_result\_response\_attributes module +------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_result_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_result\_response\_attributes\_gate\_status module +-------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_result_response_attributes_gate_status + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_result\_response\_data module +------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_result_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_evaluation\_result\_response\_data\_type module +------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.deployment_gates_evaluation_result_response_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_list\_response module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deployment_gates_list_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_list\_response\_meta module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deployment_gates_list_response_meta + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_list\_response\_meta\_page module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deployment_gates_list_response_meta_page + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deployment\_gates\_rule\_response module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deployment_gates_rule_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.deployment\_metadata module --------------------------------------------------------- diff --git a/examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult.py b/examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult.py new file mode 100644 index 0000000000..82972b2e5c --- /dev/null +++ b/examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult.py @@ -0,0 +1,17 @@ +""" +Get a deployment gate evaluation result returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.deployment_gates_api import DeploymentGatesApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["get_deployment_gates_evaluation_result"] = True +with ApiClient(configuration) as api_client: + api_instance = DeploymentGatesApi(api_client) + response = api_instance.get_deployment_gates_evaluation_result( + id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) + + print(response) diff --git a/examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult_3594131214.py b/examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult_3594131214.py new file mode 100644 index 0000000000..ed8565e06c --- /dev/null +++ b/examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult_3594131214.py @@ -0,0 +1,20 @@ +""" +Get a deployment gates evaluation result returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.deployment_gates_api import DeploymentGatesApi + +# there is a valid "deployment_gates_evaluation" in the system +DEPLOYMENT_GATES_EVALUATION_DATA_ID = environ["DEPLOYMENT_GATES_EVALUATION_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["get_deployment_gates_evaluation_result"] = True +with ApiClient(configuration) as api_client: + api_instance = DeploymentGatesApi(api_client) + response = api_instance.get_deployment_gates_evaluation_result( + id=DEPLOYMENT_GATES_EVALUATION_DATA_ID, + ) + + print(response) diff --git a/examples/v2/deployment-gates/ListDeploymentGates.py b/examples/v2/deployment-gates/ListDeploymentGates.py new file mode 100644 index 0000000000..3baeaf67d8 --- /dev/null +++ b/examples/v2/deployment-gates/ListDeploymentGates.py @@ -0,0 +1,14 @@ +""" +Get all deployment gates returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.deployment_gates_api import DeploymentGatesApi + +configuration = Configuration() +configuration.unstable_operations["list_deployment_gates"] = True +with ApiClient(configuration) as api_client: + api_instance = DeploymentGatesApi(api_client) + response = api_instance.list_deployment_gates() + + print(response) diff --git a/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.py b/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.py new file mode 100644 index 0000000000..a287064929 --- /dev/null +++ b/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.py @@ -0,0 +1,35 @@ +""" +Trigger a deployment gate evaluation returns "Accepted" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.deployment_gates_api import DeploymentGatesApi +from datadog_api_client.v2.model.deployment_gates_evaluation_request import DeploymentGatesEvaluationRequest +from datadog_api_client.v2.model.deployment_gates_evaluation_request_attributes import ( + DeploymentGatesEvaluationRequestAttributes, +) +from datadog_api_client.v2.model.deployment_gates_evaluation_request_data import DeploymentGatesEvaluationRequestData +from datadog_api_client.v2.model.deployment_gates_evaluation_request_data_type import ( + DeploymentGatesEvaluationRequestDataType, +) + +body = DeploymentGatesEvaluationRequest( + data=DeploymentGatesEvaluationRequestData( + attributes=DeploymentGatesEvaluationRequestAttributes( + env="staging", + identifier="pre-deploy", + primary_tag="region:us-east-1", + service="transaction-backend", + version="v1.2.3", + ), + type=DeploymentGatesEvaluationRequestDataType.DEPLOYMENT_GATES_EVALUATION_REQUEST, + ), +) + +configuration = Configuration() +configuration.unstable_operations["trigger_deployment_gates_evaluation"] = True +with ApiClient(configuration) as api_client: + api_instance = DeploymentGatesApi(api_client) + response = api_instance.trigger_deployment_gates_evaluation(body=body) + + print(response) diff --git a/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation_691804290.py b/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation_691804290.py new file mode 100644 index 0000000000..4edb265076 --- /dev/null +++ b/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation_691804290.py @@ -0,0 +1,37 @@ +""" +Trigger a deployment gates evaluation returns "Accepted" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.deployment_gates_api import DeploymentGatesApi +from datadog_api_client.v2.model.deployment_gates_evaluation_request import DeploymentGatesEvaluationRequest +from datadog_api_client.v2.model.deployment_gates_evaluation_request_attributes import ( + DeploymentGatesEvaluationRequestAttributes, +) +from datadog_api_client.v2.model.deployment_gates_evaluation_request_data import DeploymentGatesEvaluationRequestData +from datadog_api_client.v2.model.deployment_gates_evaluation_request_data_type import ( + DeploymentGatesEvaluationRequestDataType, +) + +# there is a valid "deployment_gate" in the system +DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER = environ["DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER"] + +body = DeploymentGatesEvaluationRequest( + data=DeploymentGatesEvaluationRequestData( + attributes=DeploymentGatesEvaluationRequestAttributes( + env="production", + identifier=DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER, + service="my-service", + ), + type=DeploymentGatesEvaluationRequestDataType.DEPLOYMENT_GATES_EVALUATION_REQUEST, + ), +) + +configuration = Configuration() +configuration.unstable_operations["trigger_deployment_gates_evaluation"] = True +with ApiClient(configuration) as api_client: + api_instance = DeploymentGatesApi(api_client) + response = api_instance.trigger_deployment_gates_evaluation(body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 5cedd11cae..6880bba4d2 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -321,7 +321,10 @@ def __init__( "v2.delete_deployment_rule": False, "v2.get_deployment_gate": False, "v2.get_deployment_gate_rules": False, + "v2.get_deployment_gates_evaluation_result": False, "v2.get_deployment_rule": False, + "v2.list_deployment_gates": False, + "v2.trigger_deployment_gates_evaluation": False, "v2.update_deployment_gate": False, "v2.update_deployment_rule": False, "v2.create_hamr_org_connection": False, diff --git a/src/datadog_api_client/v2/api/deployment_gates_api.py b/src/datadog_api_client/v2/api/deployment_gates_api.py index cec0823a93..9b0efbc06d 100644 --- a/src/datadog_api_client/v2/api/deployment_gates_api.py +++ b/src/datadog_api_client/v2/api/deployment_gates_api.py @@ -3,10 +3,16 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Any, Dict +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 ( + UnsetType, + unset, + UUID, +) +from datadog_api_client.v2.model.deployment_gates_list_response import DeploymentGatesListResponse from datadog_api_client.v2.model.deployment_gate_response import DeploymentGateResponse from datadog_api_client.v2.model.create_deployment_gate_params import CreateDeploymentGateParams from datadog_api_client.v2.model.deployment_gate_rules_response import DeploymentGateRulesResponse @@ -14,6 +20,11 @@ from datadog_api_client.v2.model.create_deployment_rule_params import CreateDeploymentRuleParams from datadog_api_client.v2.model.update_deployment_rule_params import UpdateDeploymentRuleParams from datadog_api_client.v2.model.update_deployment_gate_params import UpdateDeploymentGateParams +from datadog_api_client.v2.model.deployment_gates_evaluation_response import DeploymentGatesEvaluationResponse +from datadog_api_client.v2.model.deployment_gates_evaluation_request import DeploymentGatesEvaluationRequest +from datadog_api_client.v2.model.deployment_gates_evaluation_result_response import ( + DeploymentGatesEvaluationResultResponse, +) class DeploymentGatesApi: @@ -170,6 +181,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_deployment_gates_evaluation_result_endpoint = _Endpoint( + settings={ + "response_type": (DeploymentGatesEvaluationResultResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/deployments/gates/evaluation/{id}", + "operation_id": "get_deployment_gates_evaluation_result", + "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._get_deployment_rule_endpoint = _Endpoint( settings={ "response_type": (DeploymentRuleResponse,), @@ -199,6 +233,57 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_deployment_gates_endpoint = _Endpoint( + settings={ + "response_type": (DeploymentGatesListResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/deployment_gates", + "operation_id": "list_deployment_gates", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_cursor": { + "openapi_types": (str,), + "attribute": "page[cursor]", + "location": "query", + }, + "page_size": { + "validation": { + "inclusive_maximum": 1000, + "inclusive_minimum": 1, + }, + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._trigger_deployment_gates_evaluation_endpoint = _Endpoint( + settings={ + "response_type": (DeploymentGatesEvaluationResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/deployments/gates/evaluation", + "operation_id": "trigger_deployment_gates_evaluation", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (DeploymentGatesEvaluationRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._update_deployment_gate_endpoint = _Endpoint( settings={ "response_type": (DeploymentGateResponse,), @@ -367,6 +452,27 @@ def get_deployment_gate_rules( return self._get_deployment_gate_rules_endpoint.call_with_http_info(**kwargs) + def get_deployment_gates_evaluation_result( + self, + id: UUID, + ) -> DeploymentGatesEvaluationResultResponse: + """Get a deployment gate evaluation result. + + Retrieves the result of a deployment gate evaluation by its evaluation ID. + If the evaluation is still in progress, ``data.attributes.gate_status`` will be ``in_progress`` ; + continue polling until it returns ``pass`` or ``fail``. + Polling every 10-20 seconds is recommended. + The endpoint may return a 404 if called too soon after triggering; retry after a few seconds. + + :param id: The evaluation ID returned by the trigger endpoint. + :type id: UUID + :rtype: DeploymentGatesEvaluationResultResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._get_deployment_gates_evaluation_result_endpoint.call_with_http_info(**kwargs) + def get_deployment_rule( self, gate_id: str, @@ -389,6 +495,50 @@ def get_deployment_rule( return self._get_deployment_rule_endpoint.call_with_http_info(**kwargs) + def list_deployment_gates( + self, + *, + page_cursor: Union[str, UnsetType] = unset, + page_size: Union[int, UnsetType] = unset, + ) -> DeploymentGatesListResponse: + """Get all deployment gates. + + Returns a paginated list of all deployment gates for the organization. + Use ``page[cursor]`` and ``page[size]`` query parameters to paginate through results. + + :param page_cursor: Cursor for pagination. Use the ``meta.page.next_cursor`` value from the previous response. + :type page_cursor: str, optional + :param page_size: Number of results per page. Defaults to 50. Must be between 1 and 1000. + :type page_size: int, optional + :rtype: DeploymentGatesListResponse + """ + kwargs: Dict[str, Any] = {} + if page_cursor is not unset: + kwargs["page_cursor"] = page_cursor + + if page_size is not unset: + kwargs["page_size"] = page_size + + return self._list_deployment_gates_endpoint.call_with_http_info(**kwargs) + + def trigger_deployment_gates_evaluation( + self, + body: DeploymentGatesEvaluationRequest, + ) -> DeploymentGatesEvaluationResponse: + """Trigger a deployment gate evaluation. + + Triggers an asynchronous deployment gate evaluation for the given service and environment. + Returns an evaluation ID that can be used to poll for the result via the + ``GET /api/v2/deployments/gates/evaluation/{id}`` endpoint. + + :type body: DeploymentGatesEvaluationRequest + :rtype: DeploymentGatesEvaluationResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._trigger_deployment_gates_evaluation_endpoint.call_with_http_info(**kwargs) + def update_deployment_gate( self, id: str, diff --git a/src/datadog_api_client/v2/model/deployment_gates_evaluation_request.py b/src/datadog_api_client/v2/model/deployment_gates_evaluation_request.py new file mode 100644 index 0000000000..ff154fcf34 --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_evaluation_request.py @@ -0,0 +1,44 @@ +# 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.deployment_gates_evaluation_request_data import ( + DeploymentGatesEvaluationRequestData, + ) + + +class DeploymentGatesEvaluationRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.deployment_gates_evaluation_request_data import ( + DeploymentGatesEvaluationRequestData, + ) + + return { + "data": (DeploymentGatesEvaluationRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: DeploymentGatesEvaluationRequestData, **kwargs): + """ + Request body for triggering a deployment gate evaluation. + + :param data: Data for a deployment gate evaluation request. + :type data: DeploymentGatesEvaluationRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/deployment_gates_evaluation_request_attributes.py b/src/datadog_api_client/v2/model/deployment_gates_evaluation_request_attributes.py new file mode 100644 index 0000000000..784a60c64a --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_evaluation_request_attributes.py @@ -0,0 +1,71 @@ +# 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 DeploymentGatesEvaluationRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "env": (str,), + "identifier": (str,), + "primary_tag": (str,), + "service": (str,), + "version": (str,), + } + + attribute_map = { + "env": "env", + "identifier": "identifier", + "primary_tag": "primary_tag", + "service": "service", + "version": "version", + } + + def __init__( + self_, + env: str, + service: str, + identifier: Union[str, UnsetType] = unset, + primary_tag: Union[str, UnsetType] = unset, + version: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for a deployment gate evaluation request. + + :param env: The environment of the deployment. + :type env: str + + :param identifier: The identifier of the deployment gate. Defaults to "default". + :type identifier: str, optional + + :param primary_tag: A primary tag to scope APM Faulty Deployment Detection rules. + :type primary_tag: str, optional + + :param service: The service being deployed. + :type service: str + + :param version: The version of the deployment. Required for APM Faulty Deployment Detection rules. + :type version: str, optional + """ + if identifier is not unset: + kwargs["identifier"] = identifier + if primary_tag is not unset: + kwargs["primary_tag"] = primary_tag + if version is not unset: + kwargs["version"] = version + super().__init__(kwargs) + + self_.env = env + self_.service = service diff --git a/src/datadog_api_client/v2/model/deployment_gates_evaluation_request_data.py b/src/datadog_api_client/v2/model/deployment_gates_evaluation_request_data.py new file mode 100644 index 0000000000..9b141844b0 --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_evaluation_request_data.py @@ -0,0 +1,61 @@ +# 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.deployment_gates_evaluation_request_attributes import ( + DeploymentGatesEvaluationRequestAttributes, + ) + from datadog_api_client.v2.model.deployment_gates_evaluation_request_data_type import ( + DeploymentGatesEvaluationRequestDataType, + ) + + +class DeploymentGatesEvaluationRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.deployment_gates_evaluation_request_attributes import ( + DeploymentGatesEvaluationRequestAttributes, + ) + from datadog_api_client.v2.model.deployment_gates_evaluation_request_data_type import ( + DeploymentGatesEvaluationRequestDataType, + ) + + return { + "attributes": (DeploymentGatesEvaluationRequestAttributes,), + "type": (DeploymentGatesEvaluationRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + attributes: DeploymentGatesEvaluationRequestAttributes, + type: DeploymentGatesEvaluationRequestDataType, + **kwargs, + ): + """ + Data for a deployment gate evaluation request. + + :param attributes: Attributes for a deployment gate evaluation request. + :type attributes: DeploymentGatesEvaluationRequestAttributes + + :param type: JSON:API type for a deployment gate evaluation request. + :type type: DeploymentGatesEvaluationRequestDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/deployment_gates_evaluation_request_data_type.py b/src/datadog_api_client/v2/model/deployment_gates_evaluation_request_data_type.py new file mode 100644 index 0000000000..83b1274d0b --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_evaluation_request_data_type.py @@ -0,0 +1,37 @@ +# 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 DeploymentGatesEvaluationRequestDataType(ModelSimple): + """ + JSON:API type for a deployment gate evaluation request. + + :param value: If omitted defaults to "deployment_gates_evaluation_request". Must be one of ["deployment_gates_evaluation_request"]. + :type value: str + """ + + allowed_values = { + "deployment_gates_evaluation_request", + } + DEPLOYMENT_GATES_EVALUATION_REQUEST: ClassVar["DeploymentGatesEvaluationRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DeploymentGatesEvaluationRequestDataType.DEPLOYMENT_GATES_EVALUATION_REQUEST = DeploymentGatesEvaluationRequestDataType( + "deployment_gates_evaluation_request" +) diff --git a/src/datadog_api_client/v2/model/deployment_gates_evaluation_response.py b/src/datadog_api_client/v2/model/deployment_gates_evaluation_response.py new file mode 100644 index 0000000000..2a66e12943 --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_evaluation_response.py @@ -0,0 +1,46 @@ +# 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.deployment_gates_evaluation_response_data import ( + DeploymentGatesEvaluationResponseData, + ) + + +class DeploymentGatesEvaluationResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.deployment_gates_evaluation_response_data import ( + DeploymentGatesEvaluationResponseData, + ) + + return { + "data": (DeploymentGatesEvaluationResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[DeploymentGatesEvaluationResponseData, UnsetType] = unset, **kwargs): + """ + Response for a deployment gate evaluation request. + + :param data: Data for a deployment gate evaluation response. + :type data: DeploymentGatesEvaluationResponseData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/deployment_gates_evaluation_response_attributes.py b/src/datadog_api_client/v2/model/deployment_gates_evaluation_response_attributes.py new file mode 100644 index 0000000000..7f032871b3 --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_evaluation_response_attributes.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 DeploymentGatesEvaluationResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "evaluation_id": (str,), + } + + attribute_map = { + "evaluation_id": "evaluation_id", + } + + def __init__(self_, evaluation_id: str, **kwargs): + """ + Attributes for a deployment gate evaluation response. + + :param evaluation_id: The unique identifier of the gate evaluation. + :type evaluation_id: str + """ + super().__init__(kwargs) + + self_.evaluation_id = evaluation_id diff --git a/src/datadog_api_client/v2/model/deployment_gates_evaluation_response_data.py b/src/datadog_api_client/v2/model/deployment_gates_evaluation_response_data.py new file mode 100644 index 0000000000..40137e22e4 --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_evaluation_response_data.py @@ -0,0 +1,69 @@ +# 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.deployment_gates_evaluation_response_attributes import ( + DeploymentGatesEvaluationResponseAttributes, + ) + from datadog_api_client.v2.model.deployment_gates_evaluation_response_data_type import ( + DeploymentGatesEvaluationResponseDataType, + ) + + +class DeploymentGatesEvaluationResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.deployment_gates_evaluation_response_attributes import ( + DeploymentGatesEvaluationResponseAttributes, + ) + from datadog_api_client.v2.model.deployment_gates_evaluation_response_data_type import ( + DeploymentGatesEvaluationResponseDataType, + ) + + return { + "attributes": (DeploymentGatesEvaluationResponseAttributes,), + "id": (UUID,), + "type": (DeploymentGatesEvaluationResponseDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: DeploymentGatesEvaluationResponseAttributes, + id: UUID, + type: DeploymentGatesEvaluationResponseDataType, + **kwargs, + ): + """ + Data for a deployment gate evaluation response. + + :param attributes: Attributes for a deployment gate evaluation response. + :type attributes: DeploymentGatesEvaluationResponseAttributes + + :param id: The unique identifier of the evaluation response. + :type id: UUID + + :param type: JSON:API type for a deployment gate evaluation response. + :type type: DeploymentGatesEvaluationResponseDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/deployment_gates_evaluation_response_data_type.py b/src/datadog_api_client/v2/model/deployment_gates_evaluation_response_data_type.py new file mode 100644 index 0000000000..96ac1917d9 --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_evaluation_response_data_type.py @@ -0,0 +1,37 @@ +# 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 DeploymentGatesEvaluationResponseDataType(ModelSimple): + """ + JSON:API type for a deployment gate evaluation response. + + :param value: If omitted defaults to "deployment_gates_evaluation_response". Must be one of ["deployment_gates_evaluation_response"]. + :type value: str + """ + + allowed_values = { + "deployment_gates_evaluation_response", + } + DEPLOYMENT_GATES_EVALUATION_RESPONSE: ClassVar["DeploymentGatesEvaluationResponseDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DeploymentGatesEvaluationResponseDataType.DEPLOYMENT_GATES_EVALUATION_RESPONSE = ( + DeploymentGatesEvaluationResponseDataType("deployment_gates_evaluation_response") +) diff --git a/src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response.py b/src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response.py new file mode 100644 index 0000000000..ea43a03ab3 --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response.py @@ -0,0 +1,46 @@ +# 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.deployment_gates_evaluation_result_response_data import ( + DeploymentGatesEvaluationResultResponseData, + ) + + +class DeploymentGatesEvaluationResultResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.deployment_gates_evaluation_result_response_data import ( + DeploymentGatesEvaluationResultResponseData, + ) + + return { + "data": (DeploymentGatesEvaluationResultResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[DeploymentGatesEvaluationResultResponseData, UnsetType] = unset, **kwargs): + """ + Response containing the result of a deployment gate evaluation. + + :param data: Data for a deployment gate evaluation result response. + :type data: DeploymentGatesEvaluationResultResponseData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_attributes.py b/src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_attributes.py new file mode 100644 index 0000000000..488d6b9689 --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_attributes.py @@ -0,0 +1,90 @@ +# 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, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.deployment_gates_evaluation_result_response_attributes_gate_status import ( + DeploymentGatesEvaluationResultResponseAttributesGateStatus, + ) + from datadog_api_client.v2.model.deployment_gates_rule_response import DeploymentGatesRuleResponse + + +class DeploymentGatesEvaluationResultResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.deployment_gates_evaluation_result_response_attributes_gate_status import ( + DeploymentGatesEvaluationResultResponseAttributesGateStatus, + ) + from datadog_api_client.v2.model.deployment_gates_rule_response import DeploymentGatesRuleResponse + + return { + "dry_run": (bool,), + "evaluation_id": (str,), + "evaluation_url": (str,), + "gate_id": (UUID,), + "gate_status": (DeploymentGatesEvaluationResultResponseAttributesGateStatus,), + "rules": ([DeploymentGatesRuleResponse],), + } + + attribute_map = { + "dry_run": "dry_run", + "evaluation_id": "evaluation_id", + "evaluation_url": "evaluation_url", + "gate_id": "gate_id", + "gate_status": "gate_status", + "rules": "rules", + } + + def __init__( + self_, + dry_run: bool, + evaluation_id: str, + evaluation_url: str, + gate_id: UUID, + gate_status: DeploymentGatesEvaluationResultResponseAttributesGateStatus, + rules: List[DeploymentGatesRuleResponse], + **kwargs, + ): + """ + Attributes for a deployment gate evaluation result response. + + :param dry_run: Whether the gate was evaluated in dry-run mode. + :type dry_run: bool + + :param evaluation_id: The unique identifier of the gate evaluation. + :type evaluation_id: str + + :param evaluation_url: A URL to view the evaluation details in the Datadog UI. + :type evaluation_url: str + + :param gate_id: The unique identifier of the deployment gate. + :type gate_id: UUID + + :param gate_status: The overall status of the gate evaluation. + + * ``in_progress`` : The evaluation is still running. + * ``pass`` : All rules passed successfully and the deployment is allowed to proceed. + * ``fail`` : One or more rules did not pass; the deployment should not proceed. + :type gate_status: DeploymentGatesEvaluationResultResponseAttributesGateStatus + + :param rules: The results of individual rule evaluations. + :type rules: [DeploymentGatesRuleResponse] + """ + super().__init__(kwargs) + + self_.dry_run = dry_run + self_.evaluation_id = evaluation_id + self_.evaluation_url = evaluation_url + self_.gate_id = gate_id + self_.gate_status = gate_status + self_.rules = rules diff --git a/src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_attributes_gate_status.py b/src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_attributes_gate_status.py new file mode 100644 index 0000000000..535a130afd --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_attributes_gate_status.py @@ -0,0 +1,50 @@ +# 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 DeploymentGatesEvaluationResultResponseAttributesGateStatus(ModelSimple): + """ + The overall status of the gate evaluation. + - `in_progress`: The evaluation is still running. + - `pass`: All rules passed successfully and the deployment is allowed to proceed. + - `fail`: One or more rules did not pass; the deployment should not proceed. + + :param value: Must be one of ["in_progress", "pass", "fail"]. + :type value: str + """ + + allowed_values = { + "in_progress", + "pass", + "fail", + } + IN_PROGRESS: ClassVar["DeploymentGatesEvaluationResultResponseAttributesGateStatus"] + PASS: ClassVar["DeploymentGatesEvaluationResultResponseAttributesGateStatus"] + FAIL: ClassVar["DeploymentGatesEvaluationResultResponseAttributesGateStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DeploymentGatesEvaluationResultResponseAttributesGateStatus.IN_PROGRESS = ( + DeploymentGatesEvaluationResultResponseAttributesGateStatus("in_progress") +) +DeploymentGatesEvaluationResultResponseAttributesGateStatus.PASS = ( + DeploymentGatesEvaluationResultResponseAttributesGateStatus("pass") +) +DeploymentGatesEvaluationResultResponseAttributesGateStatus.FAIL = ( + DeploymentGatesEvaluationResultResponseAttributesGateStatus("fail") +) diff --git a/src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_data.py b/src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_data.py new file mode 100644 index 0000000000..bf423ad712 --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_data.py @@ -0,0 +1,68 @@ +# 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.deployment_gates_evaluation_result_response_attributes import ( + DeploymentGatesEvaluationResultResponseAttributes, + ) + from datadog_api_client.v2.model.deployment_gates_evaluation_result_response_data_type import ( + DeploymentGatesEvaluationResultResponseDataType, + ) + + +class DeploymentGatesEvaluationResultResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.deployment_gates_evaluation_result_response_attributes import ( + DeploymentGatesEvaluationResultResponseAttributes, + ) + from datadog_api_client.v2.model.deployment_gates_evaluation_result_response_data_type import ( + DeploymentGatesEvaluationResultResponseDataType, + ) + + return { + "attributes": (DeploymentGatesEvaluationResultResponseAttributes,), + "id": (str,), + "type": (DeploymentGatesEvaluationResultResponseDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: DeploymentGatesEvaluationResultResponseAttributes, + id: str, + type: DeploymentGatesEvaluationResultResponseDataType, + **kwargs, + ): + """ + Data for a deployment gate evaluation result response. + + :param attributes: Attributes for a deployment gate evaluation result response. + :type attributes: DeploymentGatesEvaluationResultResponseAttributes + + :param id: The unique identifier of the evaluation. + :type id: str + + :param type: JSON:API type for a deployment gate evaluation result response. + :type type: DeploymentGatesEvaluationResultResponseDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_data_type.py b/src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_data_type.py new file mode 100644 index 0000000000..27024afea0 --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_evaluation_result_response_data_type.py @@ -0,0 +1,37 @@ +# 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 DeploymentGatesEvaluationResultResponseDataType(ModelSimple): + """ + JSON:API type for a deployment gate evaluation result response. + + :param value: If omitted defaults to "deployment_gates_evaluation_result_response". Must be one of ["deployment_gates_evaluation_result_response"]. + :type value: str + """ + + allowed_values = { + "deployment_gates_evaluation_result_response", + } + DEPLOYMENT_GATES_EVALUATION_RESULT_RESPONSE: ClassVar["DeploymentGatesEvaluationResultResponseDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DeploymentGatesEvaluationResultResponseDataType.DEPLOYMENT_GATES_EVALUATION_RESULT_RESPONSE = ( + DeploymentGatesEvaluationResultResponseDataType("deployment_gates_evaluation_result_response") +) diff --git a/src/datadog_api_client/v2/model/deployment_gates_list_response.py b/src/datadog_api_client/v2/model/deployment_gates_list_response.py new file mode 100644 index 0000000000..1daf3e4d7e --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_list_response.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.deployment_gate_response_data import DeploymentGateResponseData + from datadog_api_client.v2.model.deployment_gates_list_response_meta import DeploymentGatesListResponseMeta + + +class DeploymentGatesListResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.deployment_gate_response_data import DeploymentGateResponseData + from datadog_api_client.v2.model.deployment_gates_list_response_meta import DeploymentGatesListResponseMeta + + return { + "data": ([DeploymentGateResponseData],), + "meta": (DeploymentGatesListResponseMeta,), + } + + attribute_map = { + "data": "data", + "meta": "meta", + } + + def __init__( + self_, + data: Union[List[DeploymentGateResponseData], UnsetType] = unset, + meta: Union[DeploymentGatesListResponseMeta, UnsetType] = unset, + **kwargs, + ): + """ + Response containing a paginated list of deployment gates. + + :param data: Array of deployment gates. + :type data: [DeploymentGateResponseData], optional + + :param meta: Metadata for a list of deployment gates response. + :type meta: DeploymentGatesListResponseMeta, optional + """ + if data is not unset: + kwargs["data"] = data + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/deployment_gates_list_response_meta.py b/src/datadog_api_client/v2/model/deployment_gates_list_response_meta.py new file mode 100644 index 0000000000..f08e5b99d7 --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_list_response_meta.py @@ -0,0 +1,44 @@ +# 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.deployment_gates_list_response_meta_page import DeploymentGatesListResponseMetaPage + + +class DeploymentGatesListResponseMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.deployment_gates_list_response_meta_page import ( + DeploymentGatesListResponseMetaPage, + ) + + return { + "page": (DeploymentGatesListResponseMetaPage,), + } + + attribute_map = { + "page": "page", + } + + def __init__(self_, page: Union[DeploymentGatesListResponseMetaPage, UnsetType] = unset, **kwargs): + """ + Metadata for a list of deployment gates response. + + :param page: Pagination information for a list of deployment gates. + :type page: DeploymentGatesListResponseMetaPage, optional + """ + if page is not unset: + kwargs["page"] = page + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/deployment_gates_list_response_meta_page.py b/src/datadog_api_client/v2/model/deployment_gates_list_response_meta_page.py new file mode 100644 index 0000000000..1d16e6357e --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_list_response_meta_page.py @@ -0,0 +1,63 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class DeploymentGatesListResponseMetaPage(ModelNormal): + validations = { + "size": { + "inclusive_maximum": 1000, + "inclusive_minimum": 1, + }, + } + + @cached_property + def openapi_types(_): + return { + "cursor": (str,), + "next_cursor": (str,), + "size": (int,), + } + + attribute_map = { + "cursor": "cursor", + "next_cursor": "next_cursor", + "size": "size", + } + + def __init__( + self_, + cursor: Union[str, UnsetType] = unset, + next_cursor: Union[str, UnsetType] = unset, + size: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Pagination information for a list of deployment gates. + + :param cursor: The cursor used for the current page. + :type cursor: str, optional + + :param next_cursor: The cursor to use to fetch the next page. This is absent when there are no more pages. + :type next_cursor: str, optional + + :param size: The number of results per page. + :type size: int, optional + """ + if cursor is not unset: + kwargs["cursor"] = cursor + if next_cursor is not unset: + kwargs["next_cursor"] = next_cursor + if size is not unset: + kwargs["size"] = size + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/deployment_gates_rule_response.py b/src/datadog_api_client/v2/model/deployment_gates_rule_response.py new file mode 100644 index 0000000000..323f67a291 --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_gates_rule_response.py @@ -0,0 +1,78 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 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.deployment_gates_evaluation_result_response_attributes_gate_status import ( + DeploymentGatesEvaluationResultResponseAttributesGateStatus, + ) + + +class DeploymentGatesRuleResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.deployment_gates_evaluation_result_response_attributes_gate_status import ( + DeploymentGatesEvaluationResultResponseAttributesGateStatus, + ) + + return { + "dry_run": (bool,), + "name": (str,), + "reason": (str,), + "status": (DeploymentGatesEvaluationResultResponseAttributesGateStatus,), + } + + attribute_map = { + "dry_run": "dry_run", + "name": "name", + "reason": "reason", + "status": "status", + } + + def __init__( + self_, + dry_run: Union[bool, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + reason: Union[str, UnsetType] = unset, + status: Union[DeploymentGatesEvaluationResultResponseAttributesGateStatus, UnsetType] = unset, + **kwargs, + ): + """ + The result of a single rule evaluation. + + :param dry_run: Whether this rule was evaluated in dry-run mode. + :type dry_run: bool, optional + + :param name: The name of the rule. + :type name: str, optional + + :param reason: The reason for the rule result, if applicable. + :type reason: str, optional + + :param status: The overall status of the gate evaluation. + + * ``in_progress`` : The evaluation is still running. + * ``pass`` : All rules passed successfully and the deployment is allowed to proceed. + * ``fail`` : One or more rules did not pass; the deployment should not proceed. + :type status: DeploymentGatesEvaluationResultResponseAttributesGateStatus, optional + """ + if dry_run is not unset: + kwargs["dry_run"] = dry_run + if name is not unset: + kwargs["name"] = name + if reason is not unset: + kwargs["reason"] = reason + if status is not unset: + kwargs["status"] = status + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 26db56bc33..1fca8f4351 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1706,6 +1706,41 @@ DeploymentGateResponseDataAttributesUpdatedBy, ) from datadog_api_client.v2.model.deployment_gate_rules_response import DeploymentGateRulesResponse +from datadog_api_client.v2.model.deployment_gates_evaluation_request import DeploymentGatesEvaluationRequest +from datadog_api_client.v2.model.deployment_gates_evaluation_request_attributes import ( + DeploymentGatesEvaluationRequestAttributes, +) +from datadog_api_client.v2.model.deployment_gates_evaluation_request_data import DeploymentGatesEvaluationRequestData +from datadog_api_client.v2.model.deployment_gates_evaluation_request_data_type import ( + DeploymentGatesEvaluationRequestDataType, +) +from datadog_api_client.v2.model.deployment_gates_evaluation_response import DeploymentGatesEvaluationResponse +from datadog_api_client.v2.model.deployment_gates_evaluation_response_attributes import ( + DeploymentGatesEvaluationResponseAttributes, +) +from datadog_api_client.v2.model.deployment_gates_evaluation_response_data import DeploymentGatesEvaluationResponseData +from datadog_api_client.v2.model.deployment_gates_evaluation_response_data_type import ( + DeploymentGatesEvaluationResponseDataType, +) +from datadog_api_client.v2.model.deployment_gates_evaluation_result_response import ( + DeploymentGatesEvaluationResultResponse, +) +from datadog_api_client.v2.model.deployment_gates_evaluation_result_response_attributes import ( + DeploymentGatesEvaluationResultResponseAttributes, +) +from datadog_api_client.v2.model.deployment_gates_evaluation_result_response_attributes_gate_status import ( + DeploymentGatesEvaluationResultResponseAttributesGateStatus, +) +from datadog_api_client.v2.model.deployment_gates_evaluation_result_response_data import ( + DeploymentGatesEvaluationResultResponseData, +) +from datadog_api_client.v2.model.deployment_gates_evaluation_result_response_data_type import ( + DeploymentGatesEvaluationResultResponseDataType, +) +from datadog_api_client.v2.model.deployment_gates_list_response import DeploymentGatesListResponse +from datadog_api_client.v2.model.deployment_gates_list_response_meta import DeploymentGatesListResponseMeta +from datadog_api_client.v2.model.deployment_gates_list_response_meta_page import DeploymentGatesListResponseMetaPage +from datadog_api_client.v2.model.deployment_gates_rule_response import DeploymentGatesRuleResponse from datadog_api_client.v2.model.deployment_metadata import DeploymentMetadata from datadog_api_client.v2.model.deployment_relationship import DeploymentRelationship from datadog_api_client.v2.model.deployment_relationship_data import DeploymentRelationshipData @@ -7786,6 +7821,23 @@ "DeploymentGateResponseDataAttributesCreatedBy", "DeploymentGateResponseDataAttributesUpdatedBy", "DeploymentGateRulesResponse", + "DeploymentGatesEvaluationRequest", + "DeploymentGatesEvaluationRequestAttributes", + "DeploymentGatesEvaluationRequestData", + "DeploymentGatesEvaluationRequestDataType", + "DeploymentGatesEvaluationResponse", + "DeploymentGatesEvaluationResponseAttributes", + "DeploymentGatesEvaluationResponseData", + "DeploymentGatesEvaluationResponseDataType", + "DeploymentGatesEvaluationResultResponse", + "DeploymentGatesEvaluationResultResponseAttributes", + "DeploymentGatesEvaluationResultResponseAttributesGateStatus", + "DeploymentGatesEvaluationResultResponseData", + "DeploymentGatesEvaluationResultResponseDataType", + "DeploymentGatesListResponse", + "DeploymentGatesListResponseMeta", + "DeploymentGatesListResponseMetaPage", + "DeploymentGatesRuleResponse", "DeploymentMetadata", "DeploymentRelationship", "DeploymentRelationshipData", diff --git a/tests/v2/cassettes/test_scenarios/test_create_deployment_gate_returns_bad_request_invalid_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_deployment_gate_returns_bad_request_invalid_response.frozen new file mode 100644 index 0000000000..d82c14f94d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_deployment_gate_returns_bad_request_invalid_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:13.804Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_deployment_gate_returns_bad_request_invalid_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_deployment_gate_returns_bad_request_invalid_response.yaml new file mode 100644 index 0000000000..7890fbade0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_deployment_gate_returns_bad_request_invalid_response.yaml @@ -0,0 +1,55 @@ +interactions: +- request: + body: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testcreatedeploymentgatereturnsbadrequestresponse1773742993","service":"my-service"},"type":"deployment_gate"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployment_gates + response: + body: + string: '{"data":{"id":"2ddfb377-44de-47fe-b53c-58cf800cca1b","type":"deployment_gate","attributes":{"created_at":"2026-03-17T10:23:14.339908Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"env":"production","identifier":"my-gate-testcreatedeploymentgatereturnsbadrequestresponse1773742993","service":"my-service","updated_at":"2026-03-17T10:23:14.339908Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testcreatedeploymentgatereturnsbadrequestresponse1773742993","service":"my-service"},"type":"deployment_gate"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployment_gates + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"Gate already + exists with the given env, service and identifier"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/2ddfb377-44de-47fe-b53c-58cf800cca1b + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_bad_request_invalid_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_bad_request_invalid_response.frozen new file mode 100644 index 0000000000..51145fd231 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_bad_request_invalid_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:14.811Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_bad_request_invalid_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_bad_request_invalid_response.yaml new file mode 100644 index 0000000000..06931b5eb6 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_bad_request_invalid_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"dry_run":false,"name":"My deployment rule","options":{"duration":3600,"excluded_resources":["resource1","resource2"]},"type":"faulty_deployment_detection"},"type":"deployment_rule"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id/rules + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"gate_id\" Invalid id"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_bad_request_invalid_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_bad_request_invalid_response.frozen new file mode 100644 index 0000000000..dd4ee3cef6 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_bad_request_invalid_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:14.936Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_bad_request_invalid_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_bad_request_invalid_response.yaml new file mode 100644 index 0000000000..4ca39cc61b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_bad_request_invalid_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"id\" Invalid id"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_deployment_gate_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_deployment_gate_not_found_response.frozen new file mode 100644 index 0000000000..a448414316 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_deployment_gate_not_found_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:15.078Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_deployment_gate_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_deployment_gate_not_found_response.yaml new file mode 100644 index 0000000000..f078f1e536 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_deployment_gate_returns_deployment_gate_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Gate does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_bad_request_invalid_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_bad_request_invalid_response.frozen new file mode 100644 index 0000000000..166e7ef115 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_bad_request_invalid_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:15.199Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_bad_request_invalid_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_bad_request_invalid_response.yaml new file mode 100644 index 0000000000..ef349f67cc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_bad_request_invalid_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id/rules/not-a-valid-id + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"gate_id\" Invalid id"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_deployment_gate_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_deployment_gate_not_found_response.frozen new file mode 100644 index 0000000000..d7a7461d03 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_deployment_gate_not_found_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:15.316Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_deployment_gate_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_deployment_gate_not_found_response.yaml new file mode 100644 index 0000000000..cd78e3274b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_deployment_rule_returns_deployment_gate_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000/rules/00000000-0000-0000-0000-000000000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_bad_request_response.frozen new file mode 100644 index 0000000000..3bd75e8166 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:15.458Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_bad_request_response.yaml new file mode 100644 index 0000000000..e1983525d7 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_bad_request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployments/gates/evaluation/not-a-valid-id + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"id\" Invalid id"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_deployment_gate_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_deployment_gate_not_found_response.frozen new file mode 100644 index 0000000000..44058d5f1d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_deployment_gate_not_found_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:15.592Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_deployment_gate_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_deployment_gate_not_found_response.yaml new file mode 100644 index 0000000000..a76618a11f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_deployment_gate_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployments/gates/evaluation/00000000-0000-0000-0000-000000000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"gate evaluation + with id 00000000-0000-0000-0000-000000000000 not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_ok_response.frozen new file mode 100644 index 0000000000..b929d919bf --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:15.715Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_ok_response.yaml new file mode 100644 index 0000000000..cda8e34b5c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_deployment_gates_evaluation_result_returns_ok_response.yaml @@ -0,0 +1,106 @@ +interactions: +- request: + body: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testgetadeploymentgatesevaluationresultreturnsokresponse1773742995","service":"my-service"},"type":"deployment_gate"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployment_gates + response: + body: + string: '{"data":{"id":"7b930550-63b0-4002-8b74-4c827bd070d3","type":"deployment_gate","attributes":{"created_at":"2026-03-17T10:23:15.799742Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"env":"production","identifier":"my-gate-testgetadeploymentgatesevaluationresultreturnsokresponse1773742995","service":"my-service","updated_at":"2026-03-17T10:23:15.799742Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"dry_run":false,"name":"My deployment rule","options":{"excluded_resources":[]},"type":"faulty_deployment_detection"},"type":"deployment_rule"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployment_gates/7b930550-63b0-4002-8b74-4c827bd070d3/rules + response: + body: + string: '{"data":{"id":"c2058cfd-aa63-4efc-a8fe-a37d622e7cc3","type":"deployment_rule","attributes":{"created_at":"2026-03-17T10:23:15.934037Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"gate_id":"7b930550-63b0-4002-8b74-4c827bd070d3","name":"My + deployment rule","options":{"excluded_resources":[]},"type":"faulty_deployment_detection","updated_at":"2026-03-17T10:23:15.934037Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"env":"production","identifier":"my-gate-testgetadeploymentgatesevaluationresultreturnsokresponse1773742995","service":"my-service"},"type":"deployment_gates_evaluation_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployments/gates/evaluation + response: + body: + string: '{"data":{"id":"fb1d7aef-236f-433d-ab3e-11648edb64c0","type":"deployment_gates_evaluation_response","attributes":{"evaluation_id":"fb1d7aef-236f-433d-ab3e-11648edb64c0"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 202 + message: Accepted +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployments/gates/evaluation/fb1d7aef-236f-433d-ab3e-11648edb64c0 + response: + body: + string: '{"data":{"id":"fb1d7aef-236f-433d-ab3e-11648edb64c0","type":"deployment_gates_evaluation_result_response","attributes":{"dry_run":false,"evaluation_id":"fb1d7aef-236f-433d-ab3e-11648edb64c0","evaluation_url":"https://frog.datadoghq.com/ci/deployment-gates/evaluations?deployment_gates_source=evaluation_result_url\u0026end=1773743896343\u0026index=cdgates\u0026paused=true\u0026query=level%3Agate+%40evaluation_id%3Afb1d7aef-236f-433d-ab3e-11648edb64c0\u0026recent_gate_id=fb1d7aef-236f-433d-ab3e-11648edb64c0\u0026start=1773742096343","gate_id":"7b930550-63b0-4002-8b74-4c827bd070d3","gate_status":"in_progress","rules":[{"name":"My + deployment rule","status":"in_progress","dry_run":false}]}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/7b930550-63b0-4002-8b74-4c827bd070d3/rules/c2058cfd-aa63-4efc-a8fe-a37d622e7cc3 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/7b930550-63b0-4002-8b74-4c827bd070d3 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_bad_request_invalid_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_bad_request_invalid_response.frozen new file mode 100644 index 0000000000..fd19f0667f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_bad_request_invalid_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:16.714Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_bad_request_invalid_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_bad_request_invalid_response.yaml new file mode 100644 index 0000000000..1d3a1f5306 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_bad_request_invalid_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"id\" Invalid id"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_deployment_gate_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_deployment_gate_not_found_response.frozen new file mode 100644 index 0000000000..9e48a99314 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_deployment_gate_not_found_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:16.827Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_deployment_gate_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_deployment_gate_not_found_response.yaml new file mode 100644 index 0000000000..652bc0b299 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_deployment_gate_returns_deployment_gate_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Gate does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_bad_request_invalid_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_bad_request_invalid_response.frozen new file mode 100644 index 0000000000..b549853588 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_bad_request_invalid_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:16.977Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_bad_request_invalid_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_bad_request_invalid_response.yaml new file mode 100644 index 0000000000..820e3d8562 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_bad_request_invalid_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id/rules/not-a-valid-id + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"gate_id\" Invalid id"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_deployment_rule_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_deployment_rule_not_found_response.frozen new file mode 100644 index 0000000000..015ddfda33 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_deployment_rule_not_found_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:17.101Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_deployment_rule_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_deployment_rule_not_found_response.yaml new file mode 100644 index 0000000000..5e7aaa7e93 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_deployment_rule_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000/rules/00000000-0000-0000-0000-000000000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_rules_for_a_deployment_gate_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_rules_for_a_deployment_gate_returns_bad_request_response.frozen new file mode 100644 index 0000000000..bec78d5b82 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_rules_for_a_deployment_gate_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:17.224Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_rules_for_a_deployment_gate_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_rules_for_a_deployment_gate_returns_bad_request_response.yaml new file mode 100644 index 0000000000..078e67b778 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_rules_for_a_deployment_gate_returns_bad_request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id/rules + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"gate_id\" Invalid id"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_accepted_response.frozen b/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_accepted_response.frozen new file mode 100644 index 0000000000..de92181ae3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_accepted_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:17.356Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_accepted_response.yaml b/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_accepted_response.yaml new file mode 100644 index 0000000000..36f6bed749 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_accepted_response.yaml @@ -0,0 +1,89 @@ +interactions: +- request: + body: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testtriggeradeploymentgatesevaluationreturnsacceptedresponse1773742997","service":"my-service"},"type":"deployment_gate"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployment_gates + response: + body: + string: '{"data":{"id":"9d4fad94-29e3-452d-817d-5bc3f0ddbcb4","type":"deployment_gate","attributes":{"created_at":"2026-03-17T10:23:17.458814Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"env":"production","identifier":"my-gate-testtriggeradeploymentgatesevaluationreturnsacceptedresponse1773742997","service":"my-service","updated_at":"2026-03-17T10:23:17.458814Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"dry_run":false,"name":"My deployment rule","options":{"excluded_resources":[]},"type":"faulty_deployment_detection"},"type":"deployment_rule"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployment_gates/9d4fad94-29e3-452d-817d-5bc3f0ddbcb4/rules + response: + body: + string: '{"data":{"id":"891bdcc9-ae8f-4fbc-87ad-5dfb83fc447f","type":"deployment_rule","attributes":{"created_at":"2026-03-17T10:23:17.620863Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"gate_id":"9d4fad94-29e3-452d-817d-5bc3f0ddbcb4","name":"My + deployment rule","options":{"excluded_resources":[]},"type":"faulty_deployment_detection","updated_at":"2026-03-17T10:23:17.620863Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"env":"production","identifier":"my-gate-testtriggeradeploymentgatesevaluationreturnsacceptedresponse1773742997","service":"my-service"},"type":"deployment_gates_evaluation_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployments/gates/evaluation + response: + body: + string: '{"data":{"id":"a3d2923c-ee20-490c-bd12-7139a805c949","type":"deployment_gates_evaluation_response","attributes":{"evaluation_id":"a3d2923c-ee20-490c-bd12-7139a805c949"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 202 + message: Accepted +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/9d4fad94-29e3-452d-817d-5bc3f0ddbcb4/rules/891bdcc9-ae8f-4fbc-87ad-5dfb83fc447f + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/9d4fad94-29e3-452d-817d-5bc3f0ddbcb4 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_bad_request_response.frozen new file mode 100644 index 0000000000..882a0382f0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2026-03-20T09:57:05.683Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_bad_request_response.yaml new file mode 100644 index 0000000000..e23f7b2de6 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"env":"","service":"my-service"},"type":"deployment_gates_evaluation_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployments/gates/evaluation + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"required + env field is missing"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_deployment_gate_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_deployment_gate_not_found_response.frozen new file mode 100644 index 0000000000..273be7a078 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_deployment_gate_not_found_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:18.627Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_deployment_gate_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_deployment_gate_not_found_response.yaml new file mode 100644 index 0000000000..aa59422ffc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_trigger_a_deployment_gates_evaluation_returns_deployment_gate_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"env":"staging","service":"non-existent-service-xyz"},"type":"deployment_gates_evaluation_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployments/gates/evaluation + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"no gate found + for service non-existent-service-xyz, env staging, and identifier default"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_bad_request_invalid_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_bad_request_invalid_response.frozen new file mode 100644 index 0000000000..1b2c93460c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_bad_request_invalid_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:18.738Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_bad_request_invalid_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_bad_request_invalid_response.yaml new file mode 100644 index 0000000000..65b333b08e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_bad_request_invalid_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"dry_run":false},"id":"12345678-1234-1234-1234-123456789012","type":"deployment_gate"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"id\" Invalid id"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_deployment_gate_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_deployment_gate_not_found_response.frozen new file mode 100644 index 0000000000..b5a2443187 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_deployment_gate_not_found_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:18.854Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_deployment_gate_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_deployment_gate_not_found_response.yaml new file mode 100644 index 0000000000..36c9e1cd57 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_deployment_gate_returns_deployment_gate_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"dry_run":false},"id":"12345678-1234-1234-1234-123456789012","type":"deployment_gate"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Gate does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_bad_request_invalid_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_bad_request_invalid_response.frozen new file mode 100644 index 0000000000..a30a58dadc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_bad_request_invalid_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:18.972Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_bad_request_invalid_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_bad_request_invalid_response.yaml new file mode 100644 index 0000000000..83dd834462 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_bad_request_invalid_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"dry_run":false,"name":"Updated deployment rule","options":{"duration":3600,"excluded_resources":["resource1","resource2"]}},"type":"deployment_rule"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id/rules/not-a-valid-id + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"gate_id\" Invalid id"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_deployment_rule_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_deployment_rule_not_found_response.frozen new file mode 100644 index 0000000000..cd87ba2394 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_deployment_rule_not_found_response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:19.084Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_deployment_rule_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_deployment_rule_not_found_response.yaml new file mode 100644 index 0000000000..af03989210 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_deployment_rule_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"dry_run":false,"name":"Updated deployment rule","options":{"duration":3600,"excluded_resources":["resource1","resource2"]}},"type":"deployment_rule"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000/rules/00000000-0000-0000-0000-000000000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/features/deployment_gates.feature b/tests/v2/features/deployment_gates.feature index cb0c5a1262..df9494d2ae 100644 --- a/tests/v2/features/deployment_gates.feature +++ b/tests/v2/features/deployment_gates.feature @@ -79,11 +79,11 @@ Feature: Deployment Gates When the request is sent Then the response status is 400 Bad request. - @generated @skip @team:DataDog/ci-app-backend + @team:DataDog/ci-app-backend Scenario: Delete deployment gate returns "Deployment gate not found." response Given operation "DeleteDeploymentGate" enabled And new "DeleteDeploymentGate" request - And request contains "id" parameter from "REPLACE.ME" + And request contains "id" parameter with value "00000000-0000-0000-0000-000000000000" When the request is sent Then the response status is 404 Deployment gate not found. @@ -114,12 +114,12 @@ Feature: Deployment Gates When the request is sent Then the response status is 400 Bad request. - @generated @skip @team:DataDog/ci-app-backend + @team:DataDog/ci-app-backend Scenario: Delete deployment rule returns "Deployment gate not found." response Given operation "DeleteDeploymentRule" enabled And new "DeleteDeploymentRule" request - And request contains "gate_id" parameter from "REPLACE.ME" - And request contains "id" parameter from "REPLACE.ME" + And request contains "gate_id" parameter with value "00000000-0000-0000-0000-000000000000" + And request contains "id" parameter with value "00000000-0000-0000-0000-000000000000" When the request is sent Then the response status is 404 Deployment gate not found. @@ -134,6 +134,64 @@ Feature: Deployment Gates When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get a deployment gate evaluation result returns "Bad request." response + Given operation "GetDeploymentGatesEvaluationResult" enabled + And new "GetDeploymentGatesEvaluationResult" 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/ci-app-backend + Scenario: Get a deployment gate evaluation result returns "Deployment gate not found." response + Given operation "GetDeploymentGatesEvaluationResult" enabled + And new "GetDeploymentGatesEvaluationResult" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Deployment gate not found. + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get a deployment gate evaluation result returns "OK" response + Given operation "GetDeploymentGatesEvaluationResult" enabled + And new "GetDeploymentGatesEvaluationResult" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/ci-app-backend + Scenario: Get a deployment gates evaluation result returns "Deployment gate not found." response + Given operation "GetDeploymentGatesEvaluationResult" enabled + And new "GetDeploymentGatesEvaluationResult" request + And request contains "id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Deployment gate not found. + + @team:DataDog/ci-app-backend + Scenario: Get a deployment gates evaluation result returns "OK" response + Given operation "GetDeploymentGatesEvaluationResult" enabled + And there is a valid "deployment_gate" in the system + And there is a valid "deployment_rule" in the system + And there is a valid "deployment_gates_evaluation" in the system + And new "GetDeploymentGatesEvaluationResult" request + And request contains "id" parameter from "deployment_gates_evaluation.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "deployment_gates_evaluation_result_response" + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get all deployment gates returns "Bad request." response + Given operation "ListDeploymentGates" enabled + And new "ListDeploymentGates" request + When the request is sent + Then the response status is 400 Bad request. + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get all deployment gates returns "OK" response + Given operation "ListDeploymentGates" enabled + And new "ListDeploymentGates" request + When the request is sent + Then the response status is 200 OK + @team:DataDog/ci-app-backend Scenario: Get deployment gate returns "Bad Request" response Given operation "GetDeploymentGate" enabled @@ -150,11 +208,11 @@ Feature: Deployment Gates When the request is sent Then the response status is 400 Bad request. - @generated @skip @team:DataDog/ci-app-backend + @team:DataDog/ci-app-backend Scenario: Get deployment gate returns "Deployment gate not found." response Given operation "GetDeploymentGate" enabled And new "GetDeploymentGate" request - And request contains "id" parameter from "REPLACE.ME" + And request contains "id" parameter with value "00000000-0000-0000-0000-000000000000" When the request is sent Then the response status is 404 Deployment gate not found. @@ -187,12 +245,12 @@ Feature: Deployment Gates When the request is sent Then the response status is 400 Bad request. - @generated @skip @team:DataDog/ci-app-backend + @team:DataDog/ci-app-backend Scenario: Get deployment rule returns "Deployment rule not found." response Given operation "GetDeploymentRule" enabled And new "GetDeploymentRule" request - And request contains "gate_id" parameter from "REPLACE.ME" - And request contains "id" parameter from "REPLACE.ME" + And request contains "gate_id" parameter with value "00000000-0000-0000-0000-000000000000" + And request contains "id" parameter with value "00000000-0000-0000-0000-000000000000" When the request is sent Then the response status is 404 Deployment rule not found. @@ -207,11 +265,11 @@ Feature: Deployment Gates When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/ci-app-backend + @team:DataDog/ci-app-backend Scenario: Get rules for a deployment gate returns "Bad request." response Given operation "GetDeploymentGateRules" enabled And new "GetDeploymentGateRules" request - And request contains "gate_id" parameter from "REPLACE.ME" + And request contains "gate_id" parameter with value "not-a-valid-id" When the request is sent Then the response status is 400 Bad request. @@ -224,6 +282,57 @@ Feature: Deployment Gates When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ci-app-backend + Scenario: Trigger a deployment gate evaluation returns "Accepted" response + Given operation "TriggerDeploymentGatesEvaluation" enabled + And new "TriggerDeploymentGatesEvaluation" request + And body with value {"data": {"attributes": {"env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Trigger a deployment gate evaluation returns "Bad request." response + Given operation "TriggerDeploymentGatesEvaluation" enabled + And new "TriggerDeploymentGatesEvaluation" request + And body with value {"data": {"attributes": {"env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}} + When the request is sent + Then the response status is 400 Bad request. + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Trigger a deployment gate evaluation returns "Deployment gate not found." response + Given operation "TriggerDeploymentGatesEvaluation" enabled + And new "TriggerDeploymentGatesEvaluation" request + And body with value {"data": {"attributes": {"env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}} + When the request is sent + Then the response status is 404 Deployment gate not found. + + @team:DataDog/ci-app-backend + Scenario: Trigger a deployment gates evaluation returns "Accepted" response + Given operation "TriggerDeploymentGatesEvaluation" enabled + And there is a valid "deployment_gate" in the system + And there is a valid "deployment_rule" in the system + And new "TriggerDeploymentGatesEvaluation" request + And body with value {"data": {"attributes": {"env": "production", "identifier": "{{ deployment_gate.data.attributes.identifier }}", "service": "my-service"}, "type": "deployment_gates_evaluation_request"}} + When the request is sent + Then the response status is 202 Accepted + And the response "data.type" is equal to "deployment_gates_evaluation_response" + + @team:DataDog/ci-app-backend + Scenario: Trigger a deployment gates evaluation returns "Bad request." response + Given operation "TriggerDeploymentGatesEvaluation" enabled + And new "TriggerDeploymentGatesEvaluation" request + And body with value {"data": {"attributes": {"env": "", "service": "my-service"}, "type": "deployment_gates_evaluation_request"}} + When the request is sent + Then the response status is 400 Bad request. + + @team:DataDog/ci-app-backend + Scenario: Trigger a deployment gates evaluation returns "Deployment gate not found." response + Given operation "TriggerDeploymentGatesEvaluation" enabled + And new "TriggerDeploymentGatesEvaluation" request + And body with value {"data": {"attributes": {"env": "staging", "service": "non-existent-service-xyz"}, "type": "deployment_gates_evaluation_request"}} + When the request is sent + Then the response status is 404 Deployment gate not found. + @team:DataDog/ci-app-backend Scenario: Update deployment gate returns "Bad Request" response Given operation "UpdateDeploymentGate" enabled @@ -242,11 +351,11 @@ Feature: Deployment Gates When the request is sent Then the response status is 400 Bad request. - @generated @skip @team:DataDog/ci-app-backend + @team:DataDog/ci-app-backend Scenario: Update deployment gate returns "Deployment gate not found." response Given operation "UpdateDeploymentGate" enabled And new "UpdateDeploymentGate" request - And request contains "id" parameter from "REPLACE.ME" + And request contains "id" parameter with value "00000000-0000-0000-0000-000000000000" And body with value {"data": {"attributes": {"dry_run": false}, "id": "12345678-1234-1234-1234-123456789012", "type": "deployment_gate"}} When the request is sent Then the response status is 404 Deployment gate not found. @@ -283,12 +392,12 @@ Feature: Deployment Gates When the request is sent Then the response status is 400 Bad request. - @generated @skip @team:DataDog/ci-app-backend + @team:DataDog/ci-app-backend Scenario: Update deployment rule returns "Deployment rule not found." response Given operation "UpdateDeploymentRule" enabled And new "UpdateDeploymentRule" request - And request contains "gate_id" parameter from "REPLACE.ME" - And request contains "id" parameter from "REPLACE.ME" + And request contains "gate_id" parameter with value "00000000-0000-0000-0000-000000000000" + And request contains "id" parameter with value "00000000-0000-0000-0000-000000000000" And body with value {"data": {"attributes": {"dry_run": false, "name": "Updated deployment rule", "options": {"duration": 3600, "excluded_resources": ["resource1", "resource2"]}}, "type": "deployment_rule"}} When the request is sent Then the response status is 404 Deployment rule not found. diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 61c0b7da74..2fee80e2ff 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -404,6 +404,18 @@ "tag": "Deployment Gates", "operationId": "CreateDeploymentRule" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"deployment_gates_evaluation_request\",\n \"attributes\": {\n \"service\": \"my-service\",\n \"env\": \"production\",\n \"identifier\": \"{{ deployment_gate.data.attributes.identifier }}\"\n }\n }\n}" + } + ], + "step": "there is a valid \"deployment_gates_evaluation\" in the system", + "key": "deployment_gates_evaluation", + "tag": "Deployment Gates", + "operationId": "TriggerDeploymentGatesEvaluation" + }, { "parameters": [ { diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 28ebe49741..405cf8c8f2 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1514,6 +1514,12 @@ "type": "idempotent" } }, + "ListDeploymentGates": { + "tag": "Deployment Gates", + "undo": { + "type": "safe" + } + }, "CreateDeploymentGate": { "tag": "Deployment Gates", "undo": { @@ -1586,6 +1592,18 @@ "type": "idempotent" } }, + "TriggerDeploymentGatesEvaluation": { + "tag": "Deployment Gates", + "undo": { + "type": "safe" + } + }, + "GetDeploymentGatesEvaluationResult": { + "tag": "Deployment Gates", + "undo": { + "type": "safe" + } + }, "GetDomainAllowlist": { "tag": "Domain Allowlist", "undo": {