-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathinternal-organizations-sync-api-spec.yaml
351 lines (351 loc) · 10.5 KB
/
internal-organizations-sync-api-spec.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
openapi: "3.0.2"
info:
title: "internal-organizations-sync-api"
description: "REST interface for the internal-organization-sync service. Please note any deprecated APIs. Our current deprecation policy is to keep deprecated APIs around for at least 6 months."
version: 1.0.0
servers:
- url: /{PATH_PREFIX}/{APP_NAME}/v1
variables:
PATH_PREFIX:
default: api
APP_NAME:
default: rhsm-subscriptions
- url: https://{HOSTNAME}/{PATH_PREFIX}/{APP_NAME}/v1
variables:
HOSTNAME:
enum:
- ci.cloud.redhat.com
- qa.cloud.redhat.com
- stage.cloud.redhat.com
- cloud.redhat.com
default: ci.cloud.redhat.com
PATH_PREFIX:
default: api
APP_NAME:
default: rhsm-subscriptions
paths:
/internal/rpc/syncOrg:
description: "Trigger a sync for a given Org ID"
post:
summary: "Sync organization for given org_id."
parameters:
- name: x-rh-swatch-synchronous-request
in: header
required: false
schema:
type: boolean
default: "false"
description: "When present, a synchronous request is made."
requestBody:
$ref: "#/components/requestBodies/OrgSyncRequestBody"
operationId: syncOrg
tags:
- internalOrganizations
responses:
'200':
description: "The request for syncing organization has completed successfully."
content:
application/vnd.api+json:
schema:
$ref: "#/components/schemas/DefaultResponse"
'400':
$ref: "../../../../spec/error-responses.yaml#/$defs/BadRequest"
'403':
$ref: "../../../../spec/error-responses.yaml#/$defs/Forbidden"
'404':
$ref: "../../../../spec/error-responses.yaml#/$defs/ResourceNotFound"
'500':
$ref: "../../../../spec/error-responses.yaml#/$defs/InternalServerError"
/internal/rpc/syncAllOrgs:
description: "Trigger a sync for all Organizations"
post:
summary: "Sync all organizations."
operationId: syncFullOrgList
tags:
- internalOrganizations
responses:
'202':
description: "The request for syncing all organizations is successfully running."
content:
application/vnd.api+json:
schema:
$ref: "#/components/schemas/DefaultResponse"
'403':
$ref: "../../../../spec/error-responses.yaml#/$defs/Forbidden"
'500':
$ref: "../../../../spec/error-responses.yaml#/$defs/InternalServerError"
/internal/organizations-sync-list:
description: "Initiate altering database sync list by either adding or removing a given list of Org IDs"
parameters:
- name: org_ids
in: query
required: true
schema:
type: array
items:
type: string
description: "List of org IDs to add (Ex. ?org_ids=123&org_ids=456&org_ids=789)"
post:
summary: "Add a given list of organizations to the database sync list."
operationId: addOrgsToSyncList
tags:
- internalOrganizations
responses:
'200':
description: "The request for adding organizations to the sync list has completed successfully."
content:
application/vnd.api+json:
schema:
$ref: "#/components/schemas/DefaultResponse"
'400':
$ref: "../../../../spec/error-responses.yaml#/$defs/BadRequest"
'403':
$ref: "../../../../spec/error-responses.yaml#/$defs/Forbidden"
'500':
$ref: "../../../../spec/error-responses.yaml#/$defs/InternalServerError"
delete:
summary: "Remove a given list of organizations from the database sync list."
operationId: removeOrgsFromSyncList
tags:
- internalOrganizations
responses:
'200':
description: "The request for removing organizations from the sync list has completed successfully."
content:
application/vnd.api+json:
schema:
$ref: "#/components/schemas/DefaultResponse"
'400':
$ref: "../../../../spec/error-responses.yaml#/$defs/BadRequest"
'403':
$ref: "../../../../spec/error-responses.yaml#/$defs/Forbidden"
'404':
$ref: "../../../../spec/error-responses.yaml#/$defs/ResourceNotFound"
'500':
$ref: "../../../../spec/error-responses.yaml#/$defs/InternalServerError"
/internal/organizations-sync-list/{org_id}:
description: "Initiate a search to check if given Org ID is in sync list"
parameters:
- name: org_id
in: path
required: true
schema:
type: string
get:
summary: "Check if given Org ID is in the database sync list."
operationId: hasOrgInSyncList
tags:
- internalOrganizations
responses:
'200':
description: "The request to check the sync list for given org ID has successfully completed."
content:
application/vnd.api+json:
schema:
$ref: "#/components/schemas/OrgExistsResponse"
'400':
$ref: "../../../../spec/error-responses.yaml#/$defs/BadRequest"
'403':
$ref: "../../../../spec/error-responses.yaml#/$defs/Forbidden"
'404':
$ref: "../../../../spec/error-responses.yaml#/$defs/ResourceNotFound"
'500':
$ref: "../../../../spec/error-responses.yaml#/$defs/InternalServerError"
/internal/organizations/{org_id}/inventory:
description: "Initiate viewing conduit representation of an org's systems from RHSM"
parameters:
- name: org_id
in: path
required: true
schema:
type: string
- name: offset
in: query
schema:
type: integer
description: "The number of items to skip before starting to collect the result set"
- name: limit
in: query
required: true
schema:
type: integer
minimum: 1
maximum: 1000
description: "The numbers of items to return"
get:
summary: "See conduit representation of an org's systems from RHSM."
operationId: getInventoryForOrg
tags:
- internalOrganizations
responses:
'200':
description: ""
content:
application/vnd.api+json:
schema:
$ref: "#/components/schemas/OrgInventory"
'400':
$ref: "../../../../spec/error-responses.yaml#/$defs/BadRequest"
'403':
$ref: "../../../../spec/error-responses.yaml#/$defs/Forbidden"
'404':
$ref: "../../../../spec/error-responses.yaml#/$defs/ResourceNotFound"
'500':
$ref: "../../../../spec/error-responses.yaml#/$defs/InternalServerError"
/internal-organizations-sync-openapi.json:
$ref: "../../../../spec/openapi-paths.yaml#/openapi-json"
/internal-organizations-sync-openapi.yaml:
$ref: "../../../../spec/openapi-paths.yaml#/openapi-yaml"
components:
requestBodies:
OrgSyncRequestBody:
description: "ID of Organization to sync"
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/OrgSyncRequest"
schemas:
ConsumerInventory:
# Container for fields we capture from the IT endpoint for upload to inventory service.
required:
- subscription_manager_id
- org_id
properties:
subscription_manager_id:
type: string
insights_id:
type: string
org_id:
type: string
os_name:
type: string
os_version:
type: string
os_kernel_version:
type: string
bios_vendor:
type: string
bios_version:
type: string
bios_uuid:
type: string
ip_addresses:
type: array
items:
type: string
fqdn:
type: string
display_name:
type: string
mac_addresses:
type: array
items:
type: string
cpu_sockets:
type: integer
cpu_cores:
type: integer
cores_per_socket:
type: integer
number_of_cpus:
type: integer
threads_per_core:
type: integer
last_checkin:
type: string
format: date-time
memory:
type: integer
format: int64
system_memory_bytes:
type: integer
format: int64
architecture:
type: string
cloud_provider:
type: string
is_virtual:
type: boolean
vm_host:
type: string
virtual_host_uuid:
type: string
guest_id:
type: string
rh_prod:
type: array
items:
type: string
sys_purpose_role:
type: string
sys_purpose_sla:
type: string
sys_purpose_usage:
type: string
release_ver:
type: string
sys_purpose_addons:
type: array
items:
type: string
sys_purpose_units:
type: string
billing_model:
type: string
is_marketplace:
type: boolean
provider_id:
type: string
provider_type:
type: string
enum: [ aws, azure, gcp ]
conversions_activity:
type: boolean
DefaultResponse:
properties:
status:
type: string
OrgExistsResponse:
properties:
exists_in_list:
type: boolean
OrgSyncRequest:
type: object
properties:
org_id:
type: string
OrgInventory:
properties:
links:
$ref: "#/components/schemas/PageLinks"
consumer_inventories:
type: array
items:
$ref: "#/components/schemas/ConsumerInventory"
PageLinks:
properties:
first:
type: string
last:
type: string
previous:
type: string
next:
type: string
required:
- first
- last
securitySchemes:
PskIdentity:
type: apiKey
in: header
name: x-rh-swatch-psk
description: |
Psk header containing Pre Shared Key. Contains an
UUID string:
```
c9a98753-2092-4617-b226-5c2653330b3d
```
security:
- PskIdentity: []