diff --git a/config/_default/menus/api.en.yaml b/config/_default/menus/api.en.yaml
index a345a9b538869..977b188256450 100644
--- a/config/_default/menus/api.en.yaml
+++ b/config/_default/menus/api.en.yaml
@@ -7538,6 +7538,19 @@ menu:
unstable:
- v2
order: 5
+ - name: Get rules for a deployment gate
+ url: '#get-rules-for-a-deployment-gate'
+ identifier: deployment-gates-get-rules-for-a-deployment-gate
+ parent: deployment-gates
+ generated: true
+ params:
+ versions:
+ - v2
+ operationids:
+ - GetDeploymentGateRules
+ unstable:
+ - v2
+ order: 9
- name: Create deployment gate
url: '#create-deployment-gate'
identifier: deployment-gates-create-deployment-gate
diff --git a/content/en/api/v2/deployment-gates/examples.json b/content/en/api/v2/deployment-gates/examples.json
index 2b49f96c75abd..455fd68609a4a 100644
--- a/content/en/api/v2/deployment-gates/examples.json
+++ b/content/en/api/v2/deployment-gates/examples.json
@@ -101,6 +101,99 @@
"html": "
\n
\n
\n
\n
\n
Parameters for creating a deployment gate.
\n
\n
\n
\n
\n
\n
attributes [required]
\n
\n
\n
Parameters for creating a deployment gate.
\n
\n
\n
\n
\n
\n
\n
Whether this gate is run in dry-run mode.
\n
\n \n
\n
\n
\n
\n
\n
\n
The environment of the deployment gate.
\n
\n \n
\n
\n
\n
\n
\n
\n
The identifier of the deployment gate.
default: default
\n
\n \n
\n
\n
\n
\n
\n
\n
The service of the deployment gate.
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
Deployment gate resource type. \nAllowed enum values: deployment_gate
\n
\n \n
\n
\n
\n
"
}
},
+ "GetDeploymentGateRules": {
+ "responses": {
+ "200": {
+ "json": {
+ "data": [
+ {
+ "attributes": {
+ "created_at": "2021-01-01T00:00:00Z",
+ "created_by": {
+ "handle": "test-user",
+ "id": "1111-2222-3333-4444-555566667777",
+ "name": "Test User"
+ },
+ "dry_run": false,
+ "gate_id": "1111-2222-3333-4444-555566667777",
+ "name": "My deployment rule",
+ "options": {
+ "duration": 3600,
+ "excluded_resources": [
+ "resource1",
+ "resource2"
+ ]
+ },
+ "type": "faulty_deployment_detection",
+ "updated_at": "2019-09-19T10:00:00.000Z",
+ "updated_by": {
+ "handle": "test-user",
+ "id": "1111-2222-3333-4444-555566667777",
+ "name": "Test User"
+ }
+ },
+ "id": "1111-2222-3333-4444-555566667777",
+ "type": "deployment_rule"
+ }
+ ]
+ },
+ "html": "\n
\n
\n
\n
\n
\n
\n
attributes [required]
\n
\n
\n
Basic information about a deployment rule.
\n
\n
\n
\n
\n
\n
created_at [required]
\n
\n
\n
The timestamp when the deployment rule was created.
\n
\n \n
\n
\n
\n
\n
\n
created_by [required]
\n
\n
\n
Information about the user who created the deployment rule.
\n
\n
\n
\n
\n
\n
\n
The handle of the user who created the deployment rule.
\n
\n \n
\n
\n
\n
\n
\n
\n
The ID of the user who created the deployment rule.
\n
\n \n
\n
\n
\n
\n
\n
\n
The name of the user who created the deployment rule.
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
Whether this rule is run in dry-run mode.
\n
\n \n
\n
\n
\n
\n
\n
\n
The ID of the deployment gate.
\n
\n \n
\n
\n
\n
\n
\n
\n
The name of the deployment rule.
\n
\n \n
\n
\n
\n
\n
\n
\n
Options for deployment rule response representing either faulty deployment detection or monitor options.
\n
\n
\n
\n
\n
\n
\n
Faulty deployment detection options for deployment rules.
\n
\n
\n
\n
\n
\n
\n
The duration for faulty deployment detection.
\n
\n \n
\n
\n
\n
\n
\n
\n
Resources to exclude from faulty deployment detection.
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
Monitor options for deployment rules.
\n
\n
\n
\n
\n
\n
\n
Seconds the monitor needs to stay in OK status for the rule to pass.
\n
\n \n
\n
\n
\n
\n
\n
\n
Monitors that match this query are evaluated.
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
The type of the deployment rule. \nAllowed enum values: faulty_deployment_detection,monitor
\n
\n \n
\n
\n
\n
\n
\n
\n
The timestamp when the deployment rule was last updated.
\n
\n \n
\n
\n
\n
\n
\n
\n
Information about the user who updated the deployment rule.
\n
\n
\n
\n
\n
\n
\n
The handle of the user who updated the deployment rule.
\n
\n \n
\n
\n
\n
\n
\n
\n
The ID of the user who updated the deployment rule.
\n
\n \n
\n
\n
\n
\n
\n
\n
The name of the user who updated the deployment rule.
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Unique identifier of the deployment rule.
\n
\n \n
\n
\n
\n
\n
\n
\n
Deployment rule resource type. \nAllowed enum values: deployment_rule
\n
\n \n
\n
\n
\n
"
+ },
+ "400": {
+ "json": {
+ "errors": [
+ {
+ "detail": "Malformed payload",
+ "status": "400",
+ "title": "Bad Request"
+ }
+ ]
+ },
+ "html": ""
+ },
+ "401": {
+ "json": {
+ "errors": [
+ "Bad Request"
+ ]
+ },
+ "html": ""
+ },
+ "403": {
+ "json": {
+ "errors": [
+ "Bad Request"
+ ]
+ },
+ "html": ""
+ },
+ "429": {
+ "json": {
+ "errors": [
+ "Bad Request"
+ ]
+ },
+ "html": ""
+ },
+ "500": {
+ "json": {
+ "errors": [
+ {
+ "detail": "Malformed payload",
+ "status": "400",
+ "title": "Bad Request"
+ }
+ ]
+ },
+ "html": ""
+ }
+ },
+ "request": {
+ "json_curl": {},
+ "json": {},
+ "html": ""
+ }
+ },
"CreateDeploymentRule": {
"responses": {
"200": {
diff --git a/data/api/v2/full_spec.yaml b/data/api/v2/full_spec.yaml
index 86def950cf6bb..2667e18fc7a93 100644
--- a/data/api/v2/full_spec.yaml
+++ b/data/api/v2/full_spec.yaml
@@ -16436,6 +16436,14 @@ components:
required:
- id
type: object
+ DeploymentGateRulesResponse:
+ description: Response for a deployment gate rules.
+ properties:
+ data:
+ items:
+ $ref: '#/components/schemas/DeploymentRuleResponseData'
+ type: array
+ type: object
DeploymentMetadata:
description: Metadata object containing the publication creation information.
properties:
@@ -64838,6 +64846,51 @@ paths:
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/deployment_gates/{gate_id}/rules:
+ get:
+ description: Endpoint to get rules for a deployment gate.
+ operationId: GetDeploymentGateRules
+ parameters:
+ - description: The ID of the deployment gate.
+ in: path
+ name: gate_id
+ required: true
+ schema:
+ type: string
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DeploymentGateRulesResponse'
+ 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 rules for a deployment gate
+ tags:
+ - Deployment Gates
+ x-menu-order: 9
+ 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 rule. A gate for the rule must
already exist.
diff --git a/data/api/v2/translate_actions.json b/data/api/v2/translate_actions.json
index d009a396a564f..8149e55e081e0 100644
--- a/data/api/v2/translate_actions.json
+++ b/data/api/v2/translate_actions.json
@@ -912,6 +912,10 @@
"request_description": "",
"request_schema_description": "Parameters for creating a deployment gate."
},
+ "GetDeploymentGateRules": {
+ "description": "Endpoint to get rules for a deployment gate.",
+ "summary": "Get rules for a deployment gate"
+ },
"CreateDeploymentRule": {
"description": "Endpoint to create a deployment rule. A gate for the rule must already exist.",
"summary": "Create deployment rule",