Skip to content

Commit 5e96c95

Browse files
committed
spec
1 parent 7feb3a0 commit 5e96c95

File tree

4 files changed

+261
-61
lines changed

4 files changed

+261
-61
lines changed

specs/default-template-values.yaml

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,47 @@ paths:
2323
schema:
2424
type: integer
2525
description: The chart reference ID
26+
- name: token
27+
in: header
28+
required: true
29+
schema:
30+
type: string
31+
description: Authentication token
2632
responses:
2733
'200':
2834
description: Successfully retrieved default template values
2935
content:
3036
application/json:
3137
schema:
32-
$ref: '#/components/schemas/DefaultTemplateResponse'
38+
type: object
39+
properties:
40+
code:
41+
type: integer
42+
description: HTTP status code
43+
status:
44+
type: string
45+
description: Status message
46+
result:
47+
type: object
48+
properties:
49+
appOverride:
50+
type: array
51+
items:
52+
type: object
53+
properties:
54+
Key:
55+
type: string
56+
description: The configuration key
57+
Value:
58+
type: string
59+
description: The configuration value
60+
isAppMetricsEnabled:
61+
type: boolean
62+
description: Whether application metrics are enabled
63+
errors:
64+
type: array
65+
items:
66+
$ref: '#/components/schemas/ApiError'
3367
'400':
3468
description: Bad request
3569
content:
@@ -57,21 +91,21 @@ paths:
5791

5892
components:
5993
schemas:
60-
DefaultTemplateResponse:
94+
ApiError:
6195
type: object
6296
properties:
63-
appOverride:
64-
type: array
65-
items:
66-
type: object
67-
properties:
68-
Key:
69-
type: string
70-
description: The configuration key
71-
Value:
72-
type: string
73-
description: The configuration value
74-
description: Template configuration in key-value pairs
97+
code:
98+
type: string
99+
description: Error code
100+
message:
101+
type: string
102+
description: Error message
103+
internalMessage:
104+
type: string
105+
description: Internal error message for debugging
106+
userMessage:
107+
type: string
108+
description: User-friendly error message
75109

76110
Error:
77111
type: object

specs/deployment_app_type_change_api.yaml

Lines changed: 71 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ paths:
1010
description: A JSON object containing environment id and desired deployment app type
1111
required: true
1212
content:
13-
text/plain:
13+
application/json:
1414
schema:
1515
$ref: '#/components/schemas/DeploymentAppTypeChangeRequest'
1616
responses:
@@ -23,9 +23,9 @@ paths:
2323
'401':
2424
description: unauthorized user
2525
content:
26-
text/plain:
26+
application/json:
2727
schema:
28-
type: string
28+
$ref: '#/components/schemas/Error'
2929
'400':
3030
description: Bad Request. Validation error/wrong request body.
3131
content:
@@ -40,72 +40,106 @@ paths:
4040
$ref: '#/components/schemas/Error'
4141
'403':
4242
description: Forbidden
43+
content:
44+
application/json:
45+
schema:
46+
$ref: '#/components/schemas/Error'
4347

4448
# components mentioned below
4549
components:
4650
schemas:
4751
DeploymentAppTypeChangeRequest:
4852
type: object
53+
required:
54+
- envId
55+
- desiredDeploymentType
4956
properties:
5057
envId:
5158
type: integer
5259
description: Environment id
5360
desiredDeploymentType:
5461
type: string
5562
description: Desired deployment type. For eg argo_cd / helm
63+
enum: [argo_cd, helm]
5664
excludeApps:
5765
type: array
66+
items:
67+
type: integer
5868
description: List of app ids to be excluded
5969
includeApps:
6070
type: array
71+
items:
72+
type: integer
6173
description: List of app ids to be included (deployment will be changed only for these apps)
74+
autoTriggerDeployment:
75+
type: boolean
76+
description: Whether to automatically trigger deployment after type change
77+
userId:
78+
type: integer
79+
format: int32
80+
description: User ID who initiated the change
6281
DeploymentChangeStatus:
6382
type: object
6483
properties:
65-
id:
84+
pipelineId:
85+
type: integer
86+
description: CD pipeline id
87+
installedAppId:
6688
type: integer
67-
description: cd pipeline id
89+
description: Installed app id (for chart store apps)
90+
appId:
91+
type: integer
92+
description: App id
6893
appName:
6994
type: string
70-
description: app name
95+
description: App name
96+
envId:
97+
type: integer
98+
description: Environment id
7199
envName:
72100
type: string
73-
description: environment name
101+
description: Environment name
74102
error:
75103
type: string
76104
description: Error message if failed to change deployment app type
77105
status:
78106
type: string
79-
description: If deployment change was successful or failed for this pipeline
107+
description: Status of deployment change
108+
enum: [Success, Failed, INITIATED, NOT_YET_DELETED, permission denied]
80109
DeploymentAppTypeChangeResponse:
81110
type: object
82111
properties:
83112
envId:
84113
type: integer
85-
description: environment id
114+
description: Environment id
86115
desiredDeploymentType:
87116
type: string
88-
description: Desired deployment type. For eg argo_cd / helm
117+
description: Desired deployment type
118+
enum: [argo_cd, helm]
89119
successfulPipelines:
90120
type: array
91-
description: Pipelines which were successfully deleted from current deployment
121+
description: Pipelines which were successfully changed
92122
items:
93-
$ref: '#components/schemas/DeploymentChangeStatus'
123+
$ref: '#/components/schemas/DeploymentChangeStatus'
94124
failedPipelines:
95125
type: array
96-
description: Pipelines which failed to get deleted from current deployment
126+
description: Pipelines which failed to change deployment app type
97127
items:
98-
$ref: '#components/schemas/DeploymentChangeStatus'
99-
TriggeredPipelineDetails:
100-
type: object
101-
properties:
102-
ciArtifactId:
103-
type: integer
104-
description: Artifact id deployed
105-
pipelineId:
106-
type: integer
107-
description: Pipeline id for which deployment was triggered
128+
$ref: '#/components/schemas/DeploymentChangeStatus'
129+
triggeredPipelines:
130+
type: array
131+
description: Pipelines for which deployment was triggered
132+
items:
133+
type: object
134+
properties:
135+
ciArtifactId:
136+
type: integer
137+
description: CI artifact id
138+
pipelineId:
139+
type: integer
140+
description: Pipeline id
108141
OkResponse:
142+
type: object
109143
required:
110144
- code
111145
- status
@@ -114,26 +148,30 @@ components:
114148
code:
115149
type: integer
116150
format: int32
117-
description: Error code
151+
description: HTTP status code
118152
status:
119153
type: string
120-
description: Error message
154+
description: Status message
121155
result:
122-
type: object
123-
description: DeploymentAppTypeChangeResponse object
156+
$ref: '#/components/schemas/DeploymentAppTypeChangeResponse'
124157
Error:
158+
type: object
125159
required:
126160
- code
127-
- status
161+
- message
128162
properties:
129163
code:
130-
type: integer
131-
format: int32
132-
description: Error internal code
164+
type: string
165+
description: Error code
166+
example: E100
167+
message:
168+
type: string
169+
description: Error message
170+
example: User is not authenticated
133171
internalMessage:
134172
type: string
135-
description: Error internal message
173+
description: Internal error message for debugging
136174
userMessage:
137175
type: string
138-
description: Error user message
176+
description: User-friendly error message
139177

specs/dynamic-handling-of-charts.yaml

Lines changed: 56 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@ paths:
1212
operationId: ChartRefAutocompleteForApp
1313
parameters:
1414
- name: appId
15-
in: query
15+
in: path
1616
required: true
1717
schema:
18-
type: string
18+
type: integer
19+
description: Application ID
1920
responses:
2021
'200':
2122
description: Successfully return all charts
2223
content:
2324
application/json:
2425
schema:
26+
type: object
2527
properties:
2628
code:
2729
type: integer
28-
description: status code
30+
description: HTTP status code
2931
status:
3032
type: string
31-
description: status
33+
description: Status message
3234
result:
33-
type: array
34-
items:
35-
$ref: '#/components/schemas/ChartRefResponse'
35+
$ref: '#/components/schemas/ChartRefAutocompleteResponse'
3636
'400':
3737
description: Bad Request. Input Validation error/wrong request body.
3838
content:
@@ -54,35 +54,79 @@ paths:
5454

5555
components:
5656
schemas:
57-
ChartRefResponse:
57+
ChartRefAutocompleteResponse:
5858
type: object
5959
properties:
6060
chartRefs:
6161
type: array
6262
items:
63-
$ref: '#/components/schemas/ChartRef'
63+
$ref: '#/components/schemas/ChartRefAutocompleteDto'
6464
latestChartRef:
6565
type: integer
66+
description: ID of the latest chart reference
6667
latestAppChartRef:
6768
type: integer
69+
description: ID of the latest chart reference for the application
6870
latestEnvChartRef:
6971
type: integer
72+
description: ID of the latest chart reference for the environment
7073
chartMetadata:
74+
type: object
75+
additionalProperties:
76+
$ref: '#/components/schemas/ChartRefMetaData'
77+
description: Map of chart name to metadata
78+
compatibleChartTypes:
7179
type: array
7280
items:
73-
type: string
74-
ChartRef:
81+
type: string
82+
description: List of compatible chart types
83+
84+
ChartRefAutocompleteDto:
7585
type: object
7686
properties:
7787
id:
7888
type: integer
89+
description: Chart reference ID
7990
version:
8091
type: string
92+
description: Chart version
8193
name:
8294
type: string
95+
description: Chart name
8396
description:
8497
type: string
98+
description: Chart description
8599
userUploaded:
86100
type: boolean
101+
description: Whether the chart was uploaded by a user
87102
isAppMetricsSupported:
88-
type: boolean
103+
type: boolean
104+
description: Whether the chart supports application metrics
105+
106+
ChartRefMetaData:
107+
type: object
108+
properties:
109+
chartDescription:
110+
type: string
111+
description: Description of the chart
112+
113+
Error:
114+
type: object
115+
required:
116+
- code
117+
- message
118+
properties:
119+
code:
120+
type: string
121+
description: Error code
122+
example: E100
123+
message:
124+
type: string
125+
description: Error message
126+
example: User is not authenticated
127+
internalMessage:
128+
type: string
129+
description: Internal error message for debugging
130+
userMessage:
131+
type: string
132+
description: User-friendly error message

0 commit comments

Comments
 (0)