forked from hyperledger-labs/fabric-operations-console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathibp_openapi_v3.yaml
11587 lines (11254 loc) · 452 KB
/
ibp_openapi_v3.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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
title: Fabric Operations console APIs
description: APIs to manage your Hyperledger Fabric Operations console
contact:
name: Fabric Operations console docs
url: https://github.com/hyperledger-labs/fabric-operations-console
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 3.0.0
x-alternate-name: blockchain
x-try-it-out-enabled:
enabled: false
servers:
- url: https://{REPLACE_HOSTNAME_AND_PORT}
variables:
REPLACE_HOSTNAME_AND_PORT:
description: The hostname and external port of your Fabric Operations console
default: example.com:443
security:
- BearerAuth: []
- BasicAuth: []
tags:
- name: Manage component
description: APIs to get, create, import, edit, or delete a component.
- name: Manage multiple components
description: APIs to get & delete multiple components.
- name: Administer the console
description: APIs to change or monitor the Fabric Operations console.
- name: Download examples
description: APIs to get postman collections and OpenAPI files.
#
#
#
#.
# -------------------------------------------------------------------------------------------------------------------------------------------------------------
# All the error messages from input validation
# -------------------------------------------------------------------------------------------------------------------------------------------------------------
x-validate_error_messages:
# when a required key is not sent
missing_required: "Expected parameter '$PROPERTY_NAME' to exist."
# when the sent value is of the wrong datatype
invalid_type: "Expected parameter '$PROPERTY_NAME' to be of type: '$PROPERTY_TYPE', but instead was: '$TYPE'."
# when the numeric value is too large or too small
too_large: "Parameter '$PROPERTY_NAME' is out of range. Must be <= $MAX."
too_small: "Parameter '$PROPERTY_NAME' is out of range. Must be >= $MIN."
# when the value is not one of the approved values
invalid_value: "Expected parameter '$PROPERTY_NAME' to be one of these values: $VALUES."
# when the value is one of the not-allowed values
illegal_value: "Parameter '$PROPERTY_NAME' cannot be any of these values: $VALUES."
# when the value for key cannot be set or edited
illegal_key: "Parameter '$PROPERTY_NAME' is automatically populated. It can not be set."
illegal_key_edit: "Parameter '$PROPERTY_NAME' is either never editable or not editable via this api."
# when the string length is too short or too long
str_too_small: "Expected parameter '$PROPERTY_NAME' is too short. Must be >= $MIN characters."
str_too_large: "Expected parameter '$PROPERTY_NAME' is too long. Must be <= $MAX characters."
# when the PEM cert is not parsable
invalid_certificate: "Expected parameter '$PROPERTY_NAME' to be a Base64 encoded PEM-string."
# when the resource units are bad, OR the value is crazy (too high or negative)
invalid_cpu_units: "Parameter '$PROPERTY_NAME' is malformed or outside the acceptable range. Must be less than 100CPU but greater than 0.01CPU. A typical value is '200m' or '0.2'."
invalid_memory_units: "Parameter '$PROPERTY_NAME' is malformed or outside the acceptable range. Must be less than 32GB but greater than 1B. A typical value is '0.39GiB' or '400MiB'."
invalid_storage_units: "Parameter '$PROPERTY_NAME' is malformed or outside the acceptable range. Must be less than 10TB but greater than 1B. A typical value is '20GiB' or '20480MiB'."
# when the deployment resource requests are less than the upper limits
invalid_requests_for_limits: "Parameter '$PROPERTY_NAME' is invalid. 'requests' must be <= 'limits'. requests: '$REQUESTS', limits: '$LIMITS'."
# when the duration string (like 1s) units are bad, or the value is crazy (too high or negative)
invalid_duration_units: "Parameter '$PROPERTY_NAME' must be a valid duration string. Try values similar to '1h' or '3600s'."
# regular expression failures on the value
regex_fail_full_url: The field '$PROPERTY_NAME' must be a url including the protocol, hostname/ip and port.
regex_invalid_msp_id: The field '$PROPERTY_NAME' can only contain alphanumerics characters, dashes, and dots.
regex_invalid_enroll_chars: The field '$PROPERTY_NAME' cannot contain white space or these characters :\<>#{}%`[]\^~|"
regex_fail_host_and_port: The field '$PROPERTY_NAME' must be a url including the hostname/ip and port. Do not include the protocol.
regex_fail_start_non_letter: The field '$PROPERTY_NAME' must start with a letter.
regex_fail_valid_id: The field '$PROPERTY_NAME' must start with a letter, be lowercase and only contain letters, numbers, dashes or underscores.
regex_invalid_email: The field '$PROPERTY_NAME' is not a valid email address.
# fall back regular expression failure (when the desired regex error message is not found, like I forgot to write one)
regex_generic_error: "Parameter '$PROPERTY_NAME' is malformed."
# when the object has an unknown key AND unknown keys are not allowed
no_extra_keys: "Parameter '$PROPERTY_NAME' is an unknown key for object."
# when the component type is not found anywhere, thus we don't know how to validate the request
missing_type: "Expected the component 'type' to be in the body or route."
# when the query parameter should have been a array of strings, but was not
invalid_query_param_arr_str: "Expected the query parameter '$PROPERTY_NAME' to be an array of strings. Try values similar to ?filter_orderers=['my-orderer.ibp.us-south.containers.appdomain.cloud']"
# when the array length is too short or too long
arr_too_small: "Expected parameter '$PROPERTY_NAME' is too small. Array must have >= $MIN element(s)."
arr_too_large: "Expected parameter '$PROPERTY_NAME' is too large. Array must have <= $MAX element(s)."
# query parameter is not supported by api
unsupported_query: "The query parameter '$PROPERTY_NAME' is not supported by this route."
# query parameter is not applicable to the component in the api
invalid_query_param_import: "The query parameter '$PROPERTY_NAME' with value '$VALUE' is not applicable on imported components."
# this api is not applicable to imported components
invalid_on_imported_comps: 'This api is not applicable on imported components.'
# this array is not the same length as the master array field
unmatched_lengths: "Expected array '$PROPERTY_NAME' to be the same length as '$MASTER_PROPERTY' ($LEN elements)."
# it is invalid to have this parameter and another parameter in the same body.
invalid_combo_not_exist: "Parameter '$PROPERTY_NAME' is incompatible with parameter '$CONFLICT_PROPERTY'. Only one of these fields can exist."
# it is invalid to have this parameter and NOT have another parameter in the same body.
invalid_combo_missing: "Parameter '$PROPERTY_NAME' is missing companion parameter '$COMPANION_PROPERTY'. Both fields must exist."
# it is invalid to set this field if using a free k8s plan - doesn't apply to IBP software
invalid_key_on_free_plan: "A *free* IBM Cloud Kubernetes cluster cannot use the parameter '$PROPERTY_NAME'."
# it is invalid to set more than 1 key in this body
too_many_keys: 'Too many fields in body. This API only supports 1 field in the body. Use multiple apis to update multiple fields.'
# this value must be a known hostname, typically from an imported or deployed CA
unknown_enroll_host: "The parameter '$PROPERTY_NAME' was not found in the list of known URLs. Import a CA using this host & port or change the host and port in this request to a known one"
# it is invalid to upgrade fabric from version x to y
invalid_fabric_upgrade: 'Invalid ''$PROPERTY_NAME'' value. Upgrading Fabric from ''$VALUE'' to ''$VALUE2'' is a potentially breaking update. Read the Fabric docs for details. You can override this by setting "ignore_warnings" to true.'
#
#
#
#.
# ------------------------------------------------------------------------------------------------------------------------------------------------------------
# Paths
# ------------------------------------------------------------------------------------------------------------------------------------------------------------
paths:
/ak/api/v3/components/{id}:
get:
tags:
- Manage component
summary: Get component data
description: Get the Fabric Operations console's data on a component (peer, CA, orderer, or MSP). The component might be imported or created.
operationId: get_component
parameters:
- $ref: '#/components/parameters/PathIdGet'
- $ref: '#/components/parameters/QueryDeploymentAttrs'
- $ref: '#/components/parameters/QueryParsedCerts'
- $ref: '#/components/parameters/QueryCache'
- $ref: '#/components/parameters/QueryCaAttrs'
x-sdk-operations:
request-examples:
curl:
- name: Example request
example:
- type: code
lang: curl
source:
- |-
curl -X GET "https://{REPLACE_HOSTNAME_AND_PORT}/ak/api/v3/components/{Component-ID}?cache=skip&deployment_attrs=included" \
-H "Authorization: Bearer {Access-Token}"
responses:
200:
description: Request was successful.
content:
application/json:
schema:
$ref: '#/components/schemas/GenericComponentResponse'
examples:
response:
value:
id: myca-2
type: fabric-ca
display_name: Example CA
grpcwp_url: >-
https://n3a3ec3-mypeer-proxy.ibp.us-south.containers.appdomain.cloud:8084
api_url: 'grpcs://n3a3ec3-mypeer.ibp.us-south.containers.appdomain.cloud:7051'
operations_url: 'https://n3a3ec3-mypeer.ibp.us-south.containers.appdomain.cloud:9443'
msp:
ca:
name: org1CA
root_certs:
- >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
tlsca:
name: org1tlsCA
root_certs:
- >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
component:
tls_cert: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
ecert: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
admin_certs:
- >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
msp_id: Org1
location: cloud
node_ou:
enabled: true
resources:
ca:
requests:
cpu: 100m
memory: 64M
limits:
cpu: 8000m
memory: 16384M
peer:
requests:
cpu: 100m
memory: 64M
limits:
cpu: 8000m
memory: 16384M
orderer:
requests:
cpu: 100m
memory: 64M
limits:
cpu: 8000m
memory: 16384M
proxy:
requests:
cpu: 100m
memory: 64M
limits:
cpu: 8000m
memory: 16384M
statedb:
requests:
cpu: 100m
memory: 64M
limits:
cpu: 8000m
memory: 16384M
scheme_version: v1
state_db: couchdb
storage:
ca:
size: 4GiB
class: default
peer:
size: 4GiB
class: default
orderer:
size: 4GiB
class: default
statedb:
size: 4GiB
class: default
timestamp: 1537262855753
tags:
- fabric-ca
version: 1.4.6-1
zone: '-'
401:
description: Request is unauthorized (invalid credentials).
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
403:
description: Request is forbidden (credentials lack permission).
content:
application/json:
schema:
$ref: '#/components/schemas/Forbidden'
404:
description: Component in request was not found.
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
delete:
tags:
- Manage component
summary: Remove imported component
description: |
Remove a single component from the Fabric Operations console.
- Using this api on an **imported** component removes it from the Fabric Operations console.
- Using this api on a **created** component removes it from the Fabric Operations console **but** it will **not** delete the component from the Kubernetes cluster where it resides. Thus it orphans the Kubernetes deployment (if it exists). Instead use the [Delete component](#delete-component) API to delete the Kubernetes deployment and the Fabric Operations console data at once.
operationId: remove_component
parameters:
- name: id
in: path
description: The `id` of the imported component to remove. Use the [Get all components](#list-components) API to determine the component id.
required: true
style: simple
explode: false
schema:
type: string
x-sdk-operations:
request-examples:
curl:
- name: Example request
example:
- type: code
lang: curl
source:
- |-
curl -X DELETE "https://{REPLACE_HOSTNAME_AND_PORT}/ak/api/v3/components/{Component-ID}" \
-H "Authorization: Bearer {Access-Token}"
responses:
200:
description: Request was successful.
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteComponentResponse'
examples:
response:
value:
message: deleted
type: fabric-peer
id: component-1
display_name: My Peer
401:
description: Request is unauthorized (invalid credentials).
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
403:
description: Request is forbidden (credentials lack permission).
content:
application/json:
schema:
$ref: '#/components/schemas/Forbidden'
/ak/api/v3/kubernetes/components/{id}:
delete:
tags:
- Manage component
summary: Delete component
description: |
Removes a single component from the Fabric Operations console **and** it deletes the Kubernetes deployment.
- Using this api on an **imported** component will *error out* since it does not have a Kubernetes deployment and thus it cannot be removed. Instead use the [Remove imported component](#remove-component) API to remove imported components.
- Using this api on a **created** component removes it from the Fabric Operations console **and** it will delete the component from the Kubernetes cluster where it resides. The Kubernetes delete must succeed before the component will be removed from the Fabric Operations console.
operationId: delete_component
parameters:
- name: id
in: path
description: The `id` of the component to delete. Use the [Get all components](#list-components) API to determine the id of the component to be deleted.
required: true
style: simple
explode: false
schema:
type: string
x-sdk-operations:
request-examples:
curl:
- name: Example request
example:
- type: code
lang: curl
source:
- |-
curl -X DELETE "https://{REPLACE_HOSTNAME_AND_PORT}/ak/api/v3/kubernetes/components/{Component-ID}" \
-H "Authorization: Bearer {Access-Token}"
responses:
200:
description: Request was successful.
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteComponentResponse'
examples:
response:
value:
message: deleted
type: fabric-peer
id: component-1
display_name: My Peer
401:
description: Request is unauthorized (invalid credentials).
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
403:
description: Request is forbidden (credentials lack permission).
content:
application/json:
schema:
$ref: '#/components/schemas/Forbidden'
404:
description: Component in request was not found.
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
/ak/api/v3/kubernetes/components/fabric-ca:
post:
tags:
- Manage component
summary: Create a CA
description: Create a Hyperledger Fabric Certificate Authority (CA) in your Kubernetes cluster.
operationId: create_ca
requestBody:
description: Create a CA in your Kubernetes cluster.
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCaBody'
required: true
x-sdk-operations:
request-examples:
curl:
- name: Example request
example:
- type: code
lang: curl
source:
- |-
curl -X POST "https://{REPLACE_HOSTNAME_AND_PORT}/ak/api/v3/kubernetes/components/fabric-ca" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {Access-Token}" \
-d "{
\"display_name\": \"My CA\",
\"config_override\":{
\"ca\":{
\"registry\":{
\"maxenrollments\": -1,
\"identities\": [{
\"name\": \"admin\",
\"pass\": \"password\",
\"type\": \"client\",
\"affiliation\": \"\",
\"attrs\":{
\"hf.Registrar.Roles\": \"*\",
\"hf.Registrar.DelegateRoles\": \"*\",
\"hf.Revoker\": true,
\"hf.IntermediateCA\": true,
\"hf.GenCRL\": true,
\"hf.Registrar.Attributes\": \"*\",
\"hf.AffiliationMgr\": true
}
}]
}
}
}
}"
responses:
200:
description: Request was successful.
content:
application/json:
schema:
$ref: '#/components/schemas/CaResponse'
examples:
response:
value:
id: component-1
dep_component_id: admin
display_name: My CA
api_url: 'grpcs://n3a3ec3-mypeer.ibp.us-south.containers.appdomain.cloud:7051'
operations_url: 'https://n3a3ec3-myca.ibp.us-south.containers.appdomain.cloud:9443'
config_override: {}
location: cloud
msp:
ca:
name: ca
root_certs:
- >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
tlsca:
name: tlsca
root_certs:
- >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
component:
tls_cert: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
ecert: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
admin_certs:
- >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
resources:
ca:
requests:
cpu: 100m
memory: 64M
limits:
cpu: 8000m
memory: 16384M
scheme_version: v1
storage:
ca:
size: 4GiB
class: default
tags:
- fabric-ca
timestamp: 1537262855753
version: 1.4.6-1
zone: '-'
400:
description: Request is bad (invalid syntax).
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequest'
401:
description: Request is unauthorized (invalid credentials).
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
403:
description: Request is forbidden (credentials lack permission).
content:
application/json:
schema:
$ref: '#/components/schemas/Forbidden'
/ak/api/v3/components/fabric-ca:
post:
tags:
- Manage component
summary: Import a CA
description: Import an existing Certificate Authority (CA) to your Fabric Operations console. It is recommended to only import components that were created by this or another Fabric Operations console.
operationId: import_ca
requestBody:
description: Import a CA.
content:
application/json:
schema:
$ref: '#/components/schemas/ImportCaBody'
required: true
x-sdk-operations:
request-examples:
curl:
- name: Example request
example:
- type: code
lang: curl
source:
- |-
curl -X POST "https://{REPLACE_HOSTNAME_AND_PORT}/ak/api/v3/components/fabric-ca" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {Access-Token}" \
-d "{
\"display_name\": \"My Imported CA\",
\"api_url\": \"https://n3a3ec3-myca.ibp.us-south.containers.appdomain.cloud:7054\",
\"operations_url\": \"https://n3a3ec3-myca.ibp.us-south.containers.appdomain.cloud:9443\",
\"location\": \"cloud\",
\"msp\": {
\"ca\": {
\"name\": \"ca\"
},
\"tlsca\": {
\"name\": \"tlsca\"
},
\"component\": {
\"tls_cert\": \"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo\"
}
}
}"
responses:
200:
description: Request was successful.
content:
application/json:
schema:
$ref: '#/components/schemas/CaResponse'
examples:
response:
value:
id: component-1
dep_component_id: admin
display_name: My CA
api_url: 'grpcs://n3a3ec3-mypeer.ibp.us-south.containers.appdomain.cloud:7051'
operations_url: 'https://n3a3ec3-myca.ibp.us-south.containers.appdomain.cloud:9443'
config_override: {}
location: cloud
msp:
ca:
name: ca
root_certs:
- >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
tlsca:
name: tlsca
root_certs:
- >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
component:
tls_cert: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
ecert: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
admin_certs:
- >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
resources:
ca:
requests:
cpu: 100m
memory: 64M
limits:
cpu: 8000m
memory: 16384M
scheme_version: v1
storage:
ca:
size: 4GiB
class: default
tags:
- fabric-ca
timestamp: 1537262855753
version: 1.4.6-1
zone: '-'
400:
description: Request is bad (invalid syntax).
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequest'
401:
description: Request is unauthorized (invalid credentials).
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
403:
description: Request is forbidden (credentials lack permission).
content:
application/json:
schema:
$ref: '#/components/schemas/Forbidden'
/ak/api/v3/kubernetes/components/fabric-ca/{id}:
put:
tags:
- Manage component
summary: Update a CA
description: Update Kubernetes deployment attributes of a Hyperledger Fabric Certificate Authority (CA) in your cluster.
operationId: update_ca
parameters:
- $ref: '#/components/parameters/PathIdEdit'
requestBody:
description: Update a CA in your Kubernetes cluster. **Only set 1 root body field.** Use multiple API requests to change multiple fields.
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateCaBody'
required: true
x-sdk-operations:
request-examples:
curl:
- name: Example request
example:
- type: code
lang: curl
source:
- |-
curl -X PUT "https://{REPLACE_HOSTNAME_AND_PORT}/ak/api/v3/kubernetes/components/fabric-ca/{Component-ID}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {Access-Token}" \
-d "{
\"resources\":{
\"ca\":{
\"requests\":{
\"cpu\": \"200m\",
\"memory\":\"256Mi\"
}
}
}
}"
responses:
200:
description: Request was successful.
content:
application/json:
schema:
$ref: '#/components/schemas/CaResponse'
examples:
response:
value:
id: component-1
dep_component_id: admin
display_name: My CA
api_url: 'grpcs://n3a3ec3-mypeer.ibp.us-south.containers.appdomain.cloud:7051'
operations_url: 'https://n3a3ec3-myca.ibp.us-south.containers.appdomain.cloud:9443'
config_override: {}
location: cloud
msp:
ca:
name: ca
root_certs:
- >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
tlsca:
name: tlsca
root_certs:
- >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
component:
tls_cert: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
ecert: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
admin_certs:
- >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
resources:
ca:
requests:
cpu: 100m
memory: 64M
limits:
cpu: 8000m
memory: 16384M
scheme_version: v1
storage:
ca:
size: 4GiB
class: default
tags:
- fabric-ca
timestamp: 1537262855753
version: 1.4.6-1
zone: '-'
400:
description: Request is bad (invalid syntax).
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequest'
401:
description: Request is unauthorized (invalid credentials).
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
403:
description: Request is forbidden (credentials lack permission).
content:
application/json:
schema:
$ref: '#/components/schemas/Forbidden'
404:
description: Component in request was not found.
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
/ak/api/v3/components/fabric-ca/{id}:
put:
tags:
- Manage component
summary: Edit data about a CA
description: Modify local metadata fields of a Certificate Authority (CA). For example, the "display_name" field. This API will **not** change any Kubernetes deployment attributes for the CA.
operationId: edit_ca
parameters:
- $ref: '#/components/parameters/PathIdEdit'
requestBody:
description: Edit local metadata about a CA. All body fields are optional (only send the fields that you want to change).
content:
application/json:
schema:
$ref: '#/components/schemas/EditCaDataBody'
required: true
x-sdk-operations:
request-examples:
curl:
- name: Example request
example:
- type: code
lang: curl
source:
- |-
curl -X PUT "https://{REPLACE_HOSTNAME_AND_PORT}/ak/api/v3/components/{Component-ID}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {Access-Token}" \
-d "{
\"display_name\": \"My Other CA\",
\"tags\": [\"fabric-ca\", \"blue_team\", \"dev\"]
}"
responses:
200:
description: Request was successful.
content:
application/json:
schema:
$ref: '#/components/schemas/CaResponse'
examples:
response:
value:
id: component-1
dep_component_id: admin
display_name: My CA
api_url: 'grpcs://n3a3ec3-mypeer.ibp.us-south.containers.appdomain.cloud:7051'
operations_url: 'https://n3a3ec3-myca.ibp.us-south.containers.appdomain.cloud:9443'
config_override: {}
location: cloud
msp:
ca:
name: ca
root_certs:
- >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
tlsca:
name: tlsca
root_certs:
- >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
component:
tls_cert: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
ecert: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
admin_certs:
- >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
resources:
ca:
requests:
cpu: 100m
memory: 64M
limits:
cpu: 8000m
memory: 16384M
scheme_version: v1
storage:
ca:
size: 4GiB
class: default
tags:
- fabric-ca
timestamp: 1537262855753
version: 1.4.6-1
zone: '-'
400:
description: Request is bad (invalid syntax).
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequest'
401:
description: Request is unauthorized (invalid credentials).
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
403:
description: Request is forbidden (credentials lack permission).
content:
application/json:
schema:
$ref: '#/components/schemas/Forbidden'
404:
description: Component in request was not found.
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
/ak/api/v3/kubernetes/components/fabric-ca/{id}/actions:
post:
tags:
- Manage component
summary: Submit action to a CA
description: Submit an action to a Fabric CA component. Actions such as restarting the component or certificate operations.
operationId: ca_action
parameters:
- $ref: '#/components/parameters/PathIdEdit'
requestBody:
description: The action(s) to perform.
content:
application/json:
schema:
$ref: '#/components/schemas/CaActionsBody'
required: true
x-sdk-operations:
request-examples:
curl:
- name: Example request
example:
- type: code
lang: curl
source:
- |-
curl -X POST "https://{REPLACE_HOSTNAME_AND_PORT}/ak/api/v3/kubernetes/components/fabric-ca/{Component-ID}/actions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {Access-Token}" \
-d "{
\"restart\": true
}"
responses:
202:
description: Request was received successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/ActionsResponse'
examples:
response:
value:
message: accepted
id: my-ca
actions:
- restart
401:
description: Request is unauthorized (invalid credentials).
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
403:
description: Request is forbidden (credentials lack permission).
content:
application/json:
schema:
$ref: '#/components/schemas/Forbidden'
/ak/api/v3/kubernetes/components/fabric-peer:
post:
tags:
- Manage component
summary: Create a peer
description: Create a Hyperledger Fabric peer in your Kubernetes cluster.
operationId: create_peer
requestBody:
description: Create a Hyperledger Fabric peer in your Kubernetes cluster.
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePeerBody'
required: true
x-sdk-operations:
request-examples:
curl:
- name: Example request
example:
- type: code
lang: curl
source:
- |-
curl -X POST "https://{REPLACE_HOSTNAME_AND_PORT}/ak/api/v3/kubernetes/components/fabric-peer" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {Access-Token}" \
-d "{
\"display_name\": \"My Peer\",
\"msp_id\": \"org2\",
\"crypto\": {
\"enrollment\": {
\"ca\": {
\"host\": \"n3a3ec3-myca.ibp.us-south.containers.appdomain.cloud\",
\"port\": \"7054\",
\"name\": \"ca\",
\"tls_cert\": \"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo\",
\"enroll_id\": \"admin\",
\"enroll_secret\": \"password\"
},
\"tlsca\": {
\"host\": \"n3a3ec3-myca.ibp.us-south.containers.appdomain.cloud\",
\"port\": \"7054\",
\"name\": \"tlsca\",
\"tls_cert\": \"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo\",
\"enroll_id\": \"admin\",
\"enroll_secret\": \"password\"
},
\"component\": {
\"admincerts\": [
\"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCkFkbWluIGNlcnQgZGF0YSB3b3VsZCBiZSBoZXJlIGlmIHRoaXMgd2FzIHJlYWwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=\"
]
}
}
},
\"config_override\": {
\"chaincode\": {
\"startuptimeout\": \"480s\",
\"executetimeout\": \"120s\"
}
}
}"
responses:
200:
description: Request was successful.
content:
application/json:
schema:
$ref: '#/components/schemas/PeerResponse'
examples:
response: