Skip to content

Commit d2c1145

Browse files
authored
CASMTRIAGE-6543: auth requirement in API docs (#4648)
* Format gen-api.sh as per shfmt requirements * CASMTRIAGE-6543: auth requirement in API docs * Fix Swagger 2.0 auth and normalize sample hostnames Fixes issues which were not addressed initially: * Support auth requirement for swagger 2.0 files * Normalize sample server URL's, so that auth requirement is always applicable
1 parent 6f477b8 commit d2c1145

17 files changed

+6200
-3374
lines changed

api/bos.md

+411-205
Large diffs are not rendered by default.

api/bss.md

+239-163
Large diffs are not rendered by default.

api/capmc.md

+125-81
Large diffs are not rendered by default.

api/cfs.md

+1,421-386
Large diffs are not rendered by default.

api/firmware-action.md

+359-251
Large diffs are not rendered by default.

api/hbtd.md

+121-83
Large diffs are not rendered by default.

api/hmnfd.md

+99-49
Large diffs are not rendered by default.

api/ims.md

+540-270
Large diffs are not rendered by default.

api/nls.md

+83-55
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
77
Base URLs:
88

9-
* <a href="/apis">/apis</a>
9+
* <a href="https://api-gw-service-nmn.local/apis">https://api-gw-service-nmn.local/apis</a>
10+
11+
# Authentication
12+
13+
- HTTP Authentication, scheme: bearer
1014

1115
<h1 id="ncn-lifecycle-service-ncn-lifecycle-events">NCN Lifecycle Events</h1>
1216

@@ -15,29 +19,31 @@ Base URLs:
1519
> Code samples
1620
1721
```http
18-
POST /apis/nls/v1/ncns/reboot HTTP/1.1
19-
22+
POST https://api-gw-service-nmn.local/apis/nls/v1/ncns/reboot HTTP/1.1
23+
Host: api-gw-service-nmn.local
2024
Content-Type: application/json
2125
Accept: application/json
2226
2327
```
2428

2529
```shell
2630
# You can also use wget
27-
curl -X POST /apis/nls/v1/ncns/reboot \
31+
curl -X POST https://api-gw-service-nmn.local/apis/nls/v1/ncns/reboot \
2832
-H 'Content-Type: application/json' \
29-
-H 'Accept: application/json'
33+
-H 'Accept: application/json' \
34+
-H 'Authorization: Bearer {access-token}'
3035

3136
```
3237

3338
```python
3439
import requests
3540
headers = {
3641
'Content-Type': 'application/json',
37-
'Accept': 'application/json'
42+
'Accept': 'application/json',
43+
'Authorization': 'Bearer {access-token}'
3844
}
3945

40-
r = requests.post('/apis/nls/v1/ncns/reboot', headers = headers)
46+
r = requests.post('https://api-gw-service-nmn.local/apis/nls/v1/ncns/reboot', headers = headers)
4147

4248
print(r.json())
4349

@@ -56,10 +62,11 @@ func main() {
5662
headers := map[string][]string{
5763
"Content-Type": []string{"application/json"},
5864
"Accept": []string{"application/json"},
65+
"Authorization": []string{"Bearer {access-token}"},
5966
}
6067

6168
data := bytes.NewBuffer([]byte{jsonReq})
62-
req, err := http.NewRequest("POST", "/apis/nls/v1/ncns/reboot", data)
69+
req, err := http.NewRequest("POST", "https://api-gw-service-nmn.local/apis/nls/v1/ncns/reboot", data)
6370
req.Header = headers
6471

6572
client := &http.Client{}
@@ -114,38 +121,41 @@ func main() {
114121
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found|[ResponseError](#schemaresponseerror)|
115122
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|[ResponseError](#schemaresponseerror)|
116123

117-
<aside class="success">
118-
This operation does not require authentication
124+
<aside class="warning">
125+
To perform this operation, you must be authenticated by means of one of the following methods:
126+
bearerAuth
119127
</aside>
120128

121129
## post__nls_v1_ncns_rebuild
122130

123131
> Code samples
124132
125133
```http
126-
POST /apis/nls/v1/ncns/rebuild HTTP/1.1
127-
134+
POST https://api-gw-service-nmn.local/apis/nls/v1/ncns/rebuild HTTP/1.1
135+
Host: api-gw-service-nmn.local
128136
Content-Type: application/json
129137
Accept: application/json
130138
131139
```
132140

133141
```shell
134142
# You can also use wget
135-
curl -X POST /apis/nls/v1/ncns/rebuild \
143+
curl -X POST https://api-gw-service-nmn.local/apis/nls/v1/ncns/rebuild \
136144
-H 'Content-Type: application/json' \
137-
-H 'Accept: application/json'
145+
-H 'Accept: application/json' \
146+
-H 'Authorization: Bearer {access-token}'
138147

139148
```
140149

141150
```python
142151
import requests
143152
headers = {
144153
'Content-Type': 'application/json',
145-
'Accept': 'application/json'
154+
'Accept': 'application/json',
155+
'Authorization': 'Bearer {access-token}'
146156
}
147157

148-
r = requests.post('/apis/nls/v1/ncns/rebuild', headers = headers)
158+
r = requests.post('https://api-gw-service-nmn.local/apis/nls/v1/ncns/rebuild', headers = headers)
149159

150160
print(r.json())
151161

@@ -164,10 +174,11 @@ func main() {
164174
headers := map[string][]string{
165175
"Content-Type": []string{"application/json"},
166176
"Accept": []string{"application/json"},
177+
"Authorization": []string{"Bearer {access-token}"},
167178
}
168179

169180
data := bytes.NewBuffer([]byte{jsonReq})
170-
req, err := http.NewRequest("POST", "/apis/nls/v1/ncns/rebuild", data)
181+
req, err := http.NewRequest("POST", "https://api-gw-service-nmn.local/apis/nls/v1/ncns/rebuild", data)
171182
req.Header = headers
172183

173184
client := &http.Client{}
@@ -229,8 +240,9 @@ func main() {
229240
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found|[ResponseError](#schemaresponseerror)|
230241
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|[ResponseError](#schemaresponseerror)|
231242

232-
<aside class="success">
233-
This operation does not require authentication
243+
<aside class="warning">
244+
To perform this operation, you must be authenticated by means of one of the following methods:
245+
bearerAuth
234246
</aside>
235247

236248
<h1 id="ncn-lifecycle-service-workflow-management">Workflow Management</h1>
@@ -240,26 +252,28 @@ This operation does not require authentication
240252
> Code samples
241253
242254
```http
243-
GET /apis/nls/v1/workflows HTTP/1.1
244-
255+
GET https://api-gw-service-nmn.local/apis/nls/v1/workflows HTTP/1.1
256+
Host: api-gw-service-nmn.local
245257
Accept: application/json
246258
247259
```
248260

249261
```shell
250262
# You can also use wget
251-
curl -X GET /apis/nls/v1/workflows \
252-
-H 'Accept: application/json'
263+
curl -X GET https://api-gw-service-nmn.local/apis/nls/v1/workflows \
264+
-H 'Accept: application/json' \
265+
-H 'Authorization: Bearer {access-token}'
253266

254267
```
255268

256269
```python
257270
import requests
258271
headers = {
259-
'Accept': 'application/json'
272+
'Accept': 'application/json',
273+
'Authorization': 'Bearer {access-token}'
260274
}
261275

262-
r = requests.get('/apis/nls/v1/workflows', headers = headers)
276+
r = requests.get('https://api-gw-service-nmn.local/apis/nls/v1/workflows', headers = headers)
263277

264278
print(r.json())
265279

@@ -277,10 +291,11 @@ func main() {
277291

278292
headers := map[string][]string{
279293
"Accept": []string{"application/json"},
294+
"Authorization": []string{"Bearer {access-token}"},
280295
}
281296

282297
data := bytes.NewBuffer([]byte{jsonReq})
283-
req, err := http.NewRequest("GET", "/apis/nls/v1/workflows", data)
298+
req, err := http.NewRequest("GET", "https://api-gw-service-nmn.local/apis/nls/v1/workflows", data)
284299
req.Header = headers
285300

286301
client := &http.Client{}
@@ -334,35 +349,38 @@ Status Code **200**
334349
|» name|string|false|none|none|
335350
|» status|object|false|none|none|
336351

337-
<aside class="success">
338-
This operation does not require authentication
352+
<aside class="warning">
353+
To perform this operation, you must be authenticated by means of one of the following methods:
354+
bearerAuth
339355
</aside>
340356

341357
## delete__nls_v1_workflows_{name}
342358

343359
> Code samples
344360
345361
```http
346-
DELETE /apis/nls/v1/workflows/{name} HTTP/1.1
347-
362+
DELETE https://api-gw-service-nmn.local/apis/nls/v1/workflows/{name} HTTP/1.1
363+
Host: api-gw-service-nmn.local
348364
Accept: application/json
349365
350366
```
351367

352368
```shell
353369
# You can also use wget
354-
curl -X DELETE /apis/nls/v1/workflows/{name} \
355-
-H 'Accept: application/json'
370+
curl -X DELETE https://api-gw-service-nmn.local/apis/nls/v1/workflows/{name} \
371+
-H 'Accept: application/json' \
372+
-H 'Authorization: Bearer {access-token}'
356373

357374
```
358375

359376
```python
360377
import requests
361378
headers = {
362-
'Accept': 'application/json'
379+
'Accept': 'application/json',
380+
'Authorization': 'Bearer {access-token}'
363381
}
364382

365-
r = requests.delete('/apis/nls/v1/workflows/{name}', headers = headers)
383+
r = requests.delete('https://api-gw-service-nmn.local/apis/nls/v1/workflows/{name}', headers = headers)
366384

367385
print(r.json())
368386

@@ -380,10 +398,11 @@ func main() {
380398

381399
headers := map[string][]string{
382400
"Accept": []string{"application/json"},
401+
"Authorization": []string{"Bearer {access-token}"},
383402
}
384403

385404
data := bytes.NewBuffer([]byte{jsonReq})
386-
req, err := http.NewRequest("DELETE", "/apis/nls/v1/workflows/{name}", data)
405+
req, err := http.NewRequest("DELETE", "https://api-gw-service-nmn.local/apis/nls/v1/workflows/{name}", data)
387406
req.Header = headers
388407

389408
client := &http.Client{}
@@ -422,35 +441,38 @@ func main() {
422441
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found|[ResponseError](#schemaresponseerror)|
423442
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|[ResponseError](#schemaresponseerror)|
424443

425-
<aside class="success">
426-
This operation does not require authentication
444+
<aside class="warning">
445+
To perform this operation, you must be authenticated by means of one of the following methods:
446+
bearerAuth
427447
</aside>
428448

429449
## put__nls_v1_workflows_{name}_rerun
430450

431451
> Code samples
432452
433453
```http
434-
PUT /apis/nls/v1/workflows/{name}/rerun HTTP/1.1
435-
454+
PUT https://api-gw-service-nmn.local/apis/nls/v1/workflows/{name}/rerun HTTP/1.1
455+
Host: api-gw-service-nmn.local
436456
Accept: application/json
437457
438458
```
439459

440460
```shell
441461
# You can also use wget
442-
curl -X PUT /apis/nls/v1/workflows/{name}/rerun \
443-
-H 'Accept: application/json'
462+
curl -X PUT https://api-gw-service-nmn.local/apis/nls/v1/workflows/{name}/rerun \
463+
-H 'Accept: application/json' \
464+
-H 'Authorization: Bearer {access-token}'
444465

445466
```
446467

447468
```python
448469
import requests
449470
headers = {
450-
'Accept': 'application/json'
471+
'Accept': 'application/json',
472+
'Authorization': 'Bearer {access-token}'
451473
}
452474

453-
r = requests.put('/apis/nls/v1/workflows/{name}/rerun', headers = headers)
475+
r = requests.put('https://api-gw-service-nmn.local/apis/nls/v1/workflows/{name}/rerun', headers = headers)
454476

455477
print(r.json())
456478

@@ -468,10 +490,11 @@ func main() {
468490

469491
headers := map[string][]string{
470492
"Accept": []string{"application/json"},
493+
"Authorization": []string{"Bearer {access-token}"},
471494
}
472495

473496
data := bytes.NewBuffer([]byte{jsonReq})
474-
req, err := http.NewRequest("PUT", "/apis/nls/v1/workflows/{name}/rerun", data)
497+
req, err := http.NewRequest("PUT", "https://api-gw-service-nmn.local/apis/nls/v1/workflows/{name}/rerun", data)
475498
req.Header = headers
476499

477500
client := &http.Client{}
@@ -510,38 +533,41 @@ func main() {
510533
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found|[ResponseError](#schemaresponseerror)|
511534
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|[ResponseError](#schemaresponseerror)|
512535

513-
<aside class="success">
514-
This operation does not require authentication
536+
<aside class="warning">
537+
To perform this operation, you must be authenticated by means of one of the following methods:
538+
bearerAuth
515539
</aside>
516540

517541
## put__nls_v1_workflows_{name}_retry
518542

519543
> Code samples
520544
521545
```http
522-
PUT /apis/nls/v1/workflows/{name}/retry HTTP/1.1
523-
546+
PUT https://api-gw-service-nmn.local/apis/nls/v1/workflows/{name}/retry HTTP/1.1
547+
Host: api-gw-service-nmn.local
524548
Content-Type: application/json
525549
Accept: application/json
526550
527551
```
528552

529553
```shell
530554
# You can also use wget
531-
curl -X PUT /apis/nls/v1/workflows/{name}/retry \
555+
curl -X PUT https://api-gw-service-nmn.local/apis/nls/v1/workflows/{name}/retry \
532556
-H 'Content-Type: application/json' \
533-
-H 'Accept: application/json'
557+
-H 'Accept: application/json' \
558+
-H 'Authorization: Bearer {access-token}'
534559

535560
```
536561

537562
```python
538563
import requests
539564
headers = {
540565
'Content-Type': 'application/json',
541-
'Accept': 'application/json'
566+
'Accept': 'application/json',
567+
'Authorization': 'Bearer {access-token}'
542568
}
543569

544-
r = requests.put('/apis/nls/v1/workflows/{name}/retry', headers = headers)
570+
r = requests.put('https://api-gw-service-nmn.local/apis/nls/v1/workflows/{name}/retry', headers = headers)
545571

546572
print(r.json())
547573

@@ -560,10 +586,11 @@ func main() {
560586
headers := map[string][]string{
561587
"Content-Type": []string{"application/json"},
562588
"Accept": []string{"application/json"},
589+
"Authorization": []string{"Bearer {access-token}"},
563590
}
564591

565592
data := bytes.NewBuffer([]byte{jsonReq})
566-
req, err := http.NewRequest("PUT", "/apis/nls/v1/workflows/{name}/retry", data)
593+
req, err := http.NewRequest("PUT", "https://api-gw-service-nmn.local/apis/nls/v1/workflows/{name}/retry", data)
567594
req.Header = headers
568595

569596
client := &http.Client{}
@@ -612,8 +639,9 @@ func main() {
612639
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found|[ResponseError](#schemaresponseerror)|
613640
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|[ResponseError](#schemaresponseerror)|
614641

615-
<aside class="success">
616-
This operation does not require authentication
642+
<aside class="warning">
643+
To perform this operation, you must be authenticated by means of one of the following methods:
644+
bearerAuth
617645
</aside>
618646

619647
# Schemas

0 commit comments

Comments
 (0)