|
1 | 1 | openapi: "3.0.0"
|
2 | 2 | info:
|
3 | 3 | version: 1.0.0
|
4 |
| - title: Cluster access policy |
| 4 | + title: Cluster Access Policy Management |
| 5 | + description: API for managing cluster access policies and roles |
| 6 | + |
5 | 7 | paths:
|
6 |
| - /orchestrator/user: |
| 8 | + /orchestrator/cluster/access: |
7 | 9 | post:
|
8 |
| - summary: Creates a new User |
9 |
| - operationId: addUser |
| 10 | + summary: Create a new cluster access policy |
| 11 | + operationId: CreateClusterAccessPolicy |
10 | 12 | requestBody:
|
11 |
| - description: json as request body |
12 | 13 | required: true
|
13 | 14 | content:
|
14 | 15 | application/json:
|
15 | 16 | schema:
|
16 |
| - $ref: '#/components/schemas/User' |
| 17 | + $ref: '#/components/schemas/ClusterAccessPolicy' |
17 | 18 | responses:
|
18 | 19 | '200':
|
19 |
| - description: create user response |
| 20 | + description: Successfully created cluster access policy |
| 21 | + content: |
| 22 | + application/json: |
| 23 | + schema: |
| 24 | + $ref: '#/components/schemas/ClusterAccessPolicy' |
| 25 | + '400': |
| 26 | + description: Bad request |
| 27 | + content: |
| 28 | + application/json: |
| 29 | + schema: |
| 30 | + $ref: '#/components/schemas/Error' |
| 31 | + '401': |
| 32 | + description: Unauthorized user |
20 | 33 | content:
|
21 | 34 | application/json:
|
22 | 35 | schema:
|
23 |
| - $ref: '#/components/schemas/User' |
24 |
| - default: |
25 |
| - description: unexpected error |
| 36 | + $ref: '#/components/schemas/Error' |
| 37 | + '403': |
| 38 | + description: Forbidden, user is not authorized |
26 | 39 | content:
|
27 | 40 | application/json:
|
28 | 41 | schema:
|
29 | 42 | $ref: '#/components/schemas/Error'
|
| 43 | + '500': |
| 44 | + description: Internal server error |
| 45 | + content: |
| 46 | + application/json: |
| 47 | + schema: |
| 48 | + $ref: '#/components/schemas/Error' |
| 49 | + |
30 | 50 | put:
|
31 |
| - summary: update user |
32 |
| - operationId: updateUser |
| 51 | + summary: Update an existing cluster access policy |
| 52 | + operationId: UpdateClusterAccessPolicy |
33 | 53 | requestBody:
|
34 |
| - description: json as request body |
35 | 54 | required: true
|
36 | 55 | content:
|
37 | 56 | application/json:
|
38 | 57 | schema:
|
39 |
| - $ref: '#/components/schemas/User' |
| 58 | + $ref: '#/components/schemas/ClusterAccessPolicy' |
40 | 59 | responses:
|
41 | 60 | '200':
|
42 |
| - description: user response |
| 61 | + description: Successfully updated cluster access policy |
43 | 62 | content:
|
44 | 63 | application/json:
|
45 | 64 | schema:
|
46 |
| - $ref: '#/components/schemas/User' |
47 |
| - default: |
48 |
| - description: unexpected error |
| 65 | + $ref: '#/components/schemas/ClusterAccessPolicy' |
| 66 | + '400': |
| 67 | + description: Bad request |
| 68 | + content: |
| 69 | + application/json: |
| 70 | + schema: |
| 71 | + $ref: '#/components/schemas/Error' |
| 72 | + '401': |
| 73 | + description: Unauthorized user |
| 74 | + content: |
| 75 | + application/json: |
| 76 | + schema: |
| 77 | + $ref: '#/components/schemas/Error' |
| 78 | + '403': |
| 79 | + description: Forbidden, user is not authorized |
| 80 | + content: |
| 81 | + application/json: |
| 82 | + schema: |
| 83 | + $ref: '#/components/schemas/Error' |
| 84 | + '500': |
| 85 | + description: Internal server error |
49 | 86 | content:
|
50 | 87 | application/json:
|
51 | 88 | schema:
|
52 | 89 | $ref: '#/components/schemas/Error'
|
53 | 90 |
|
54 |
| - /orchestrator/role/group: |
55 |
| - post: |
56 |
| - summary: Creates a new role group |
57 |
| - operationId: addUser |
58 |
| - requestBody: |
59 |
| - description: json as request body |
60 |
| - required: true |
61 |
| - content: |
62 |
| - application/json: |
63 |
| - schema: |
64 |
| - $ref: '#/components/schemas/RoleGroup' |
| 91 | + /orchestrator/cluster/access/{id}: |
| 92 | + get: |
| 93 | + summary: Get a cluster access policy by ID |
| 94 | + operationId: GetClusterAccessPolicy |
| 95 | + parameters: |
| 96 | + - name: id |
| 97 | + in: path |
| 98 | + required: true |
| 99 | + schema: |
| 100 | + type: integer |
65 | 101 | responses:
|
66 | 102 | '200':
|
67 |
| - description: create user response |
| 103 | + description: Successfully retrieved cluster access policy |
68 | 104 | content:
|
69 | 105 | application/json:
|
70 | 106 | schema:
|
71 |
| - $ref: '#/components/schemas/RoleGroup' |
72 |
| - default: |
73 |
| - description: unexpected error |
| 107 | + $ref: '#/components/schemas/ClusterAccessPolicy' |
| 108 | + '400': |
| 109 | + description: Bad request |
74 | 110 | content:
|
75 | 111 | application/json:
|
76 | 112 | schema:
|
77 | 113 | $ref: '#/components/schemas/Error'
|
78 |
| - put: |
79 |
| - summary: update user |
80 |
| - operationId: updateUser |
81 |
| - requestBody: |
82 |
| - description: json as request body |
83 |
| - required: true |
84 |
| - content: |
85 |
| - application/json: |
86 |
| - schema: |
87 |
| - $ref: '#/components/schemas/RoleGroup' |
| 114 | + '401': |
| 115 | + description: Unauthorized user |
| 116 | + content: |
| 117 | + application/json: |
| 118 | + schema: |
| 119 | + $ref: '#/components/schemas/Error' |
| 120 | + '403': |
| 121 | + description: Forbidden, user is not authorized |
| 122 | + content: |
| 123 | + application/json: |
| 124 | + schema: |
| 125 | + $ref: '#/components/schemas/Error' |
| 126 | + '404': |
| 127 | + description: Cluster access policy not found |
| 128 | + content: |
| 129 | + application/json: |
| 130 | + schema: |
| 131 | + $ref: '#/components/schemas/Error' |
| 132 | + '500': |
| 133 | + description: Internal server error |
| 134 | + content: |
| 135 | + application/json: |
| 136 | + schema: |
| 137 | + $ref: '#/components/schemas/Error' |
| 138 | + |
| 139 | + delete: |
| 140 | + summary: Delete a cluster access policy |
| 141 | + operationId: DeleteClusterAccessPolicy |
| 142 | + parameters: |
| 143 | + - name: id |
| 144 | + in: path |
| 145 | + required: true |
| 146 | + schema: |
| 147 | + type: integer |
88 | 148 | responses:
|
89 | 149 | '200':
|
90 |
| - description: user response |
| 150 | + description: Successfully deleted cluster access policy |
91 | 151 | content:
|
92 | 152 | application/json:
|
93 | 153 | schema:
|
94 |
| - $ref: '#/components/schemas/RoleGroup' |
95 |
| - default: |
96 |
| - description: unexpected error |
| 154 | + type: boolean |
| 155 | + '400': |
| 156 | + description: Bad request |
| 157 | + content: |
| 158 | + application/json: |
| 159 | + schema: |
| 160 | + $ref: '#/components/schemas/Error' |
| 161 | + '401': |
| 162 | + description: Unauthorized user |
| 163 | + content: |
| 164 | + application/json: |
| 165 | + schema: |
| 166 | + $ref: '#/components/schemas/Error' |
| 167 | + '403': |
| 168 | + description: Forbidden, user is not authorized |
| 169 | + content: |
| 170 | + application/json: |
| 171 | + schema: |
| 172 | + $ref: '#/components/schemas/Error' |
| 173 | + '404': |
| 174 | + description: Cluster access policy not found |
| 175 | + content: |
| 176 | + application/json: |
| 177 | + schema: |
| 178 | + $ref: '#/components/schemas/Error' |
| 179 | + '500': |
| 180 | + description: Internal server error |
| 181 | + content: |
| 182 | + application/json: |
| 183 | + schema: |
| 184 | + $ref: '#/components/schemas/Error' |
| 185 | + |
| 186 | + /orchestrator/cluster/access/list: |
| 187 | + get: |
| 188 | + summary: List all cluster access policies |
| 189 | + operationId: ListClusterAccessPolicies |
| 190 | + parameters: |
| 191 | + - name: clusterId |
| 192 | + in: query |
| 193 | + required: false |
| 194 | + schema: |
| 195 | + type: integer |
| 196 | + - name: namespace |
| 197 | + in: query |
| 198 | + required: false |
| 199 | + schema: |
| 200 | + type: string |
| 201 | + responses: |
| 202 | + '200': |
| 203 | + description: Successfully retrieved cluster access policies |
| 204 | + content: |
| 205 | + application/json: |
| 206 | + schema: |
| 207 | + type: array |
| 208 | + items: |
| 209 | + $ref: '#/components/schemas/ClusterAccessPolicy' |
| 210 | + '400': |
| 211 | + description: Bad request |
| 212 | + content: |
| 213 | + application/json: |
| 214 | + schema: |
| 215 | + $ref: '#/components/schemas/Error' |
| 216 | + '401': |
| 217 | + description: Unauthorized user |
| 218 | + content: |
| 219 | + application/json: |
| 220 | + schema: |
| 221 | + $ref: '#/components/schemas/Error' |
| 222 | + '403': |
| 223 | + description: Forbidden, user is not authorized |
| 224 | + content: |
| 225 | + application/json: |
| 226 | + schema: |
| 227 | + $ref: '#/components/schemas/Error' |
| 228 | + '500': |
| 229 | + description: Internal server error |
97 | 230 | content:
|
98 | 231 | application/json:
|
99 | 232 | schema:
|
100 | 233 | $ref: '#/components/schemas/Error'
|
101 | 234 |
|
102 | 235 | components:
|
103 | 236 | schemas:
|
104 |
| - User: |
| 237 | + ClusterAccessPolicy: |
105 | 238 | type: object
|
106 | 239 | required:
|
107 |
| - - email_id |
108 |
| - properties: |
109 |
| - id: |
110 |
| - type: integer |
111 |
| - description: Unique id of user |
112 |
| - email_id: |
113 |
| - type: string |
114 |
| - description: Unique valid email-id of user, comma separated emails ids for multiple users |
115 |
| - groups: |
116 |
| - type: array |
117 |
| - items: |
118 |
| - type: string |
119 |
| - roleFilters: |
120 |
| - type: array |
121 |
| - items: |
122 |
| - $ref: '#/components/schemas/roleFilter' |
123 |
| - description: role filters objects |
124 |
| - RoleGroup: |
125 |
| - type: object |
| 240 | + - cluster |
| 241 | + - action |
126 | 242 | properties:
|
127 | 243 | id:
|
128 | 244 | type: integer
|
129 |
| - name: |
130 |
| - type: string |
131 |
| - roleFilters: |
132 |
| - type: array |
133 |
| - items: |
134 |
| - $ref: '#/components/schemas/roleFilter' |
135 |
| - description: role filters objects |
136 |
| - roleFilter: |
137 |
| - type: object |
138 |
| - required: |
139 |
| - - action |
140 |
| - properties: |
| 245 | + description: Unique identifier for the policy |
141 | 246 | cluster:
|
142 | 247 | type: string
|
143 |
| - description: cluster name |
| 248 | + description: Name of the cluster |
144 | 249 | namespace:
|
145 | 250 | type: string
|
146 |
| - description: namespace names. for multiple selection comma separated values, for all selection an empty string. |
| 251 | + description: Namespace name. For multiple namespaces, use comma-separated values. Empty string for all namespaces. |
147 | 252 | group:
|
148 | 253 | type: string
|
149 |
| - description: group names. for multiple selection comma separated values, for all selection an empty string. |
| 254 | + description: Group name. For multiple groups, use comma-separated values. Empty string for all groups. |
150 | 255 | kind:
|
151 | 256 | type: string
|
152 |
| - description: kind names. for multiple selection comma separated values, for all selection an empty string. |
| 257 | + description: Resource kind. For multiple kinds, use comma-separated values. Empty string for all kinds. |
153 | 258 | resource:
|
154 | 259 | type: string
|
155 |
| - description: resource names. for multiple selection comma separated values, for all selection an empty string. |
| 260 | + description: Resource name. For multiple resources, use comma-separated values. Empty string for all resources. |
156 | 261 | action:
|
157 | 262 | type: string
|
158 |
| - description: action is type of role, i.e, admin, trigger, view, etc. |
159 |
| - enum: ["view","edit","admin"] |
| 263 | + description: Type of access role |
| 264 | + enum: ["view", "edit", "admin"] |
| 265 | + userId: |
| 266 | + type: integer |
| 267 | + description: ID of the user who created/updated the policy |
| 268 | + createdOn: |
| 269 | + type: string |
| 270 | + format: date-time |
| 271 | + description: Timestamp when the policy was created |
| 272 | + updatedOn: |
| 273 | + type: string |
| 274 | + format: date-time |
| 275 | + description: Timestamp when the policy was last updated |
| 276 | + |
160 | 277 | Error:
|
| 278 | + type: object |
161 | 279 | required:
|
162 | 280 | - code
|
163 | 281 | - message
|
164 | 282 | properties:
|
165 | 283 | code:
|
166 | 284 | type: integer
|
167 |
| - format: int32 |
168 | 285 | description: Error code
|
169 | 286 | message:
|
170 | 287 | type: string
|
|
0 commit comments