Skip to content

Commit 540ca01

Browse files
committed
corrected api specs
1 parent a455807 commit 540ca01

File tree

3 files changed

+132
-79
lines changed

3 files changed

+132
-79
lines changed

specs/api-spec.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,18 @@ components:
9090
type: string
9191
description: Values yaml
9292
example: "some values yaml"
93+
chartData:
94+
type: string
95+
format: byte
96+
description: Chart Data in case of base deployment template
9397
TemplateChartResponse:
9498
type: object
9599
properties:
96100
manifest:
97101
type: string
98102
description: helm generated manifest
99-
example: "some manifest"
103+
example: "some manifest"
104+
chartBytes:
105+
type: string
106+
format: byte
107+
description: Chart bytes data

specs/charts.yaml

Lines changed: 100 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@ paths:
77
get:
88
description: deployed chart listing, with search filters
99
parameters:
10-
- name: envs
10+
- name: envIds
1111
in: query
1212
description: environment ids
1313
required: false
1414
schema:
15-
type: array
16-
items:
17-
type: string
15+
type: string
16+
- name: clusterIds
17+
in: query
18+
description: cluster ids
19+
required: false
20+
schema:
21+
type: string
1822
- name: chartRepoId
1923
in: query
2024
description: chart repo ids
2125
required: false
2226
schema:
23-
type: array
24-
items:
25-
type: string
27+
type: string
2628
- name: appStoreName
2729
in: query
2830
description: chart name
@@ -53,6 +55,12 @@ paths:
5355
required: false
5456
schema:
5557
type: integer
58+
- name: appStatuses
59+
in: query
60+
description: app statuses filter
61+
required: false
62+
schema:
63+
type: string
5664
responses:
5765
'200':
5866
description: deployed chart listing, with search filters
@@ -67,40 +75,44 @@ paths:
6775
type: string
6876
description: status
6977
result:
70-
type: array
71-
description: deployed chart listing, with search filters
72-
items:
73-
$ref: '#/components/schemas/ChartInfo'
78+
$ref: '#/components/schemas/AppListDetail'
7479
default:
7580
description: unexpected error
7681
content:
7782
application/json:
7883
schema:
7984
$ref: '#/components/schemas/ErrorResponse'
80-
/orchestrator/app-store/installed-app/notes:
85+
/orchestrator/app-store/installed-app/notes/{installed-app-id}/{env-id}:
8186
get:
8287
description: Used to fetch notes.txt for helm charts deployed via gitOps
8388
parameters:
8489
- name: env-id
85-
in: query
90+
in: path
8691
description: it is an environment id of app
8792
required: true
88-
type: integer
93+
schema:
94+
type: integer
8995
- name: installed-app-id
90-
in: query
96+
in: path
9197
description: it is a installed application id
9298
required: true
93-
type: integer
99+
schema:
100+
type: integer
94101
responses:
95102
'200':
96103
description: if it is able to fetch the notes.txt then status will be ok
97104
content:
98105
application/json:
99106
schema:
100107
properties:
101-
notes:
108+
code:
109+
type: integer
110+
description: status code
111+
status:
102112
type: string
103-
description: it will provide notes
113+
description: status
114+
result:
115+
$ref: '#/components/schemas/Notes'
104116
'500':
105117
description: error while fetching notes.txt
106118

@@ -109,64 +121,88 @@ paths:
109121
# components mentioned below
110122
components:
111123
schemas:
112-
ChartInfo:
124+
AppListDetail:
113125
type: object
114-
required:
115-
- installedAppId
116-
- environmentId
117-
- installedAppVersionId
118-
- appStoreApplicationVersionId
119-
- appStoreApplicationName
120-
- status
121-
- appName
122-
- environmentName
123-
- deployedAt
124-
- deployedBy
125-
- readme
126-
- deprecated
127126
properties:
128-
installedAppId:
129-
type: integer
130-
description: installed chart id
131-
environmentId:
132-
type: integer
133-
description: environment id
134-
installedAppVersionId:
135-
type: integer
136-
description: installed chart version id
137-
appStoreApplicationVersionId:
138-
type: integer
139-
description: team/project id
140-
appStoreApplicationName:
141-
type: string
142-
description: chart name externally
143-
chartName:
127+
clusterIds:
128+
type: array
129+
description: clusters to which result corresponds
130+
items:
131+
type: integer
132+
applicationType:
144133
type: string
145-
description: chart repo name
146-
icon:
134+
description: application type inside the array
135+
enum: [DEVTRON-CHART-STORE, DEVTRON-APP, HELM-APP]
136+
errored:
137+
type: boolean
138+
description: if data fetch for that cluster produced error
139+
errorMsg:
147140
type: string
148-
description: image
149-
status:
141+
description: error msg if client failed to fetch
142+
helmApps:
143+
type: array
144+
description: all helm app list
145+
items:
146+
$ref: '#/components/schemas/HelmAppDetails'
147+
devtronApps:
148+
type: array
149+
description: all devtron app list
150+
items:
151+
type: object
152+
153+
HelmAppDetails:
154+
type: object
155+
properties:
156+
lastDeployedAt:
150157
type: string
151-
description: status of deployed chart
158+
format: date-time
159+
description: time when this application was last deployed/updated
152160
appName:
153161
type: string
154-
description: chart name is app name for devtron
155-
environmentName:
162+
description: name of the helm application/helm release name
163+
appId:
164+
type: string
165+
description: unique identifier for app
166+
chartName:
156167
type: string
157-
description: env name
158-
deployedAt:
168+
description: name of the chart
169+
chartAvatar:
159170
type: string
160-
description: deployement time
161-
deployedBy:
171+
description: url/location of the chart icon
172+
projectId:
173+
type: integer
174+
description: unique identifier for the project, APP with no project will have id 0
175+
chartVersion:
176+
type: string
177+
description: chart version
178+
environmentDetail:
179+
$ref: '#/components/schemas/EnvironmentDetails'
180+
appStatus:
181+
type: string
182+
description: application status
183+
184+
EnvironmentDetails:
185+
type: object
186+
properties:
187+
clusterName:
162188
type: string
163-
description: user
164-
readme:
189+
description: cluster corresponding to the environment where application is deployed
190+
clusterId:
191+
type: integer
192+
description: clusterId corresponding to the environment where application is deployed
193+
namespace:
165194
type: string
166-
description: readme
167-
deprecated:
195+
description: namespace where application is deployed
196+
isVirtualEnvironment:
168197
type: boolean
169-
description: is deprecated or not
198+
description: whether environment is virtual or not
199+
200+
Notes:
201+
type: object
202+
properties:
203+
gitOpsNotes:
204+
type: string
205+
description: notes content
170206

171207
ErrorResponse:
172208
required:

specs/environment.yaml

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ paths:
1111
name: ids
1212
example: "1,2"
1313
description: cluster ids
14-
required: true
15-
allowEmptyValue: false
14+
required: false
15+
allowEmptyValue: true
1616
schema:
17-
type: integer
17+
type: string
1818
responses:
1919
'200':
2020
description: list response
@@ -32,7 +32,7 @@ paths:
3232
type: array
3333
description: namespace list group by cluster
3434
items:
35-
$ref: '#/components/schemas/Cluster'
35+
$ref: '#/components/schemas/ClusterEnvDto'
3636
default:
3737
description: unexpected error
3838
content:
@@ -43,11 +43,8 @@ paths:
4343
# components mentioned below
4444
components:
4545
schemas:
46-
Cluster:
46+
ClusterEnvDto:
4747
type: object
48-
required:
49-
- key
50-
- value
5148
properties:
5249
clusterId:
5350
type: integer
@@ -58,22 +55,34 @@ components:
5855
environments:
5956
type: array
6057
items:
61-
$ref: '#/components/schemas/Environment'
62-
Environment:
58+
$ref: '#/components/schemas/EnvDto'
59+
isVirtualCluster:
60+
type: boolean
61+
description: whether cluster is virtual or not
62+
EnvDto:
6363
type: object
6464
properties:
6565
environmentId:
6666
type: integer
67-
description: cluster id
67+
description: environment id
6868
environmentName:
6969
type: string
70-
description: cluster name
70+
description: environment name
71+
namespace:
72+
type: string
73+
description: namespace
7174
environmentIdentifier:
7275
type: string
7376
description: environment identifier
74-
namespace:
77+
description:
7578
type: string
76-
description: namespace
79+
description: environment description
80+
isVirtualEnvironment:
81+
type: boolean
82+
description: whether environment is virtual or not
83+
default:
84+
type: boolean
85+
description: whether environment is default or not
7786

7887
ErrorResponse:
7988
required:

0 commit comments

Comments
 (0)