Skip to content

Commit f3038cf

Browse files
gitops validation spec added (#6755)
1 parent 4324e77 commit f3038cf

File tree

2 files changed

+196
-3
lines changed

2 files changed

+196
-3
lines changed

specs/gitops-validation.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ info:
33
version: 1.0.0
44
title: GitOps Validation
55
servers:
6-
- url: http://localhost:3000/orchestrator/gitops
6+
- url: https://api.yourdomain.com
77
paths:
88
/validate:
99
post:
1010
description: Validate gitops configuration by dry run
11+
summary: Validate gitops configuration by dry run
12+
security:
13+
- ApiKeyAuth: []
1114
operationId: GitOpsValidateDryRun
1215
requestBody:
1316
description: A JSON object containing the gitops configuration
@@ -44,6 +47,9 @@ paths:
4447
/config:
4548
post:
4649
description: create/save new configuration and validate them before saving
50+
summary: create/save new configuration and validate them before saving
51+
security:
52+
- ApiKeyAuth: []
4753
operationId: CreateGitOpsConfig
4854
requestBody:
4955
description: A JSON object containing the gitops configuration
@@ -79,7 +85,10 @@ paths:
7985
$ref: '#/components/schemas/Error'
8086
put:
8187
description: update configuration and validate them before saving(if last validation is within 30 seconds then do not validate)
88+
summary: update configuration and validate them before saving(if last validation is within 30 seconds then do not validate)
8289
operationId: UpdateGitOpsConfig
90+
security:
91+
- ApiKeyAuth: []
8392
requestBody:
8493
description: A JSON object containing the gitops configuration
8594
required: true
@@ -114,6 +123,11 @@ paths:
114123
$ref: '#/components/schemas/Error'
115124

116125
components:
126+
securitySchemes:
127+
ApiKeyAuth:
128+
type: apiKey
129+
in: header
130+
name: Authorization
117131
schemas:
118132
GitOpsConfigDto:
119133
type: object

specs/swagger/openapi.yaml

Lines changed: 181 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ tags:
7070
x-displayName: CloneWorkflow (ENT)
7171
- name: Deployment History
7272
x-displayName: Get Deployment History (ENT)
73-
description: Retrieves the deployment history for a specific CD pipeline based on various filter criteria.
73+
description: >-
74+
Retrieves the deployment history for a specific CD pipeline based on
75+
various filter criteria.
7476
- name: K8s Resource
7577
description: >-
7678
APIs for managing Kubernetes resources (get, create, update, delete,
@@ -80,6 +82,8 @@ tags:
8082
x-displayName: Workflow Management
8183
- name: Devtron Server version
8284
x-displayName: Devtron Server version
85+
- name: GitOps Validation
86+
x-displayName: GitOps Validation
8387
paths:
8488
/resource/history/deployment/cd-pipeline/v1:
8589
get:
@@ -3567,6 +3571,136 @@ paths:
35673571
- EA_ONLY
35683572
tags:
35693573
- Devtron Server version
3574+
/validate:
3575+
post:
3576+
description: Validate gitops configuration by dry run
3577+
summary: Validate gitops configuration by dry run
3578+
security:
3579+
- ApiKeyAuth: []
3580+
operationId: GitOpsValidateDryRun
3581+
requestBody:
3582+
description: A JSON object containing the gitops configuration
3583+
required: true
3584+
content:
3585+
application/json:
3586+
schema:
3587+
$ref: '#/components/schemas/GitOpsConfigDto'
3588+
responses:
3589+
'200':
3590+
description: Successfully return all validation stages results
3591+
content:
3592+
application/json:
3593+
schema:
3594+
$ref: '#/components/schemas/DetailedError'
3595+
'400':
3596+
description: Bad Request. Input Validation error/wrong request body.
3597+
content:
3598+
application/json:
3599+
schema:
3600+
$ref: '#/components/schemas/Error'
3601+
'403':
3602+
description: Unauthorized User
3603+
content:
3604+
application/json:
3605+
schema:
3606+
$ref: '#/components/schemas/Error'
3607+
'500':
3608+
description: Internal Server Error
3609+
content:
3610+
application/json:
3611+
schema:
3612+
$ref: '#/components/schemas/Error'
3613+
tags:
3614+
- GitOps Validation
3615+
/config:
3616+
post:
3617+
description: create/save new configuration and validate them before saving
3618+
summary: create/save new configuration and validate them before saving
3619+
security:
3620+
- ApiKeyAuth: []
3621+
operationId: CreateGitOpsConfig
3622+
requestBody:
3623+
description: A JSON object containing the gitops configuration
3624+
required: true
3625+
content:
3626+
application/json:
3627+
schema:
3628+
$ref: '#/components/schemas/GitOpsConfigDto'
3629+
responses:
3630+
'200':
3631+
description: >-
3632+
Successfully return all validation stages results and if validation
3633+
is correct then saves the configuration in the backend
3634+
content:
3635+
application/json:
3636+
schema:
3637+
$ref: '#/components/schemas/DetailedError'
3638+
'400':
3639+
description: Bad Request. Input Validation error/wrong request body.
3640+
content:
3641+
application/json:
3642+
schema:
3643+
$ref: '#/components/schemas/Error'
3644+
'403':
3645+
description: Unauthorized User
3646+
content:
3647+
application/json:
3648+
schema:
3649+
$ref: '#/components/schemas/Error'
3650+
'500':
3651+
description: Internal Server Error
3652+
content:
3653+
application/json:
3654+
schema:
3655+
$ref: '#/components/schemas/Error'
3656+
tags:
3657+
- GitOps Validation
3658+
put:
3659+
description: >-
3660+
update configuration and validate them before saving(if last validation
3661+
is within 30 seconds then do not validate)
3662+
summary: >-
3663+
update configuration and validate them before saving(if last validation
3664+
is within 30 seconds then do not validate)
3665+
operationId: UpdateGitOpsConfig
3666+
security:
3667+
- ApiKeyAuth: []
3668+
requestBody:
3669+
description: A JSON object containing the gitops configuration
3670+
required: true
3671+
content:
3672+
application/json:
3673+
schema:
3674+
$ref: '#/components/schemas/GitOpsConfigDto'
3675+
responses:
3676+
'200':
3677+
description: >-
3678+
Successfully return all validation stages results and if validation
3679+
is correct then updates the configuration in the backend
3680+
content:
3681+
application/json:
3682+
schema:
3683+
$ref: '#/components/schemas/DetailedError'
3684+
'400':
3685+
description: Bad Request. Input Validation error/wrong request body.
3686+
content:
3687+
application/json:
3688+
schema:
3689+
$ref: '#/components/schemas/Error'
3690+
'403':
3691+
description: Unauthorized User
3692+
content:
3693+
application/json:
3694+
schema:
3695+
$ref: '#/components/schemas/Error'
3696+
'500':
3697+
description: Internal Server Error
3698+
content:
3699+
application/json:
3700+
schema:
3701+
$ref: '#/components/schemas/Error'
3702+
tags:
3703+
- GitOps Validation
35703704
components:
35713705
securitySchemes:
35723706
ApiKeyAuth:
@@ -5493,6 +5627,50 @@ components:
54935627
isLast:
54945628
type: boolean
54955629
description: Indicates if this is the last node in its branch of the tree.
5630+
GitOpsConfigDto:
5631+
type: object
5632+
properties:
5633+
id:
5634+
type: integer
5635+
provider:
5636+
type: string
5637+
username:
5638+
type: string
5639+
token:
5640+
type: string
5641+
gitLabGroupId:
5642+
type: string
5643+
gitHubOrgId:
5644+
type: string
5645+
host:
5646+
type: string
5647+
active:
5648+
type: boolean
5649+
azureProjectName:
5650+
type: string
5651+
userId:
5652+
type: integer
5653+
DetailedError:
5654+
type: object
5655+
properties:
5656+
successfulStages:
5657+
type: array
5658+
items:
5659+
type: string
5660+
description: All successful stages
5661+
validatedOn:
5662+
type: string
5663+
description: Timestamp of validation
5664+
stageErrorMap:
5665+
type: array
5666+
items:
5667+
type: object
5668+
properties:
5669+
stage:
5670+
type: string
5671+
error:
5672+
type: string
5673+
description: map of stage and their respective errors
54965674
requestBodies:
54975675
SSOLoginDto:
54985676
description: SSO Login Configuration object
@@ -5696,7 +5874,8 @@ x-tagGroups:
56965874
- Environment Management
56975875
- Change Chart
56985876
- Clone Workflow
5877+
- Deployment History
56995878
- K8s Resource
57005879
- Workflow Management
57015880
- Devtron Server version
5702-
- Deployment History
5881+
- GitOps Validation

0 commit comments

Comments
 (0)