-
Notifications
You must be signed in to change notification settings - Fork 0
/
casapi.yaml
1101 lines (1100 loc) · 30.3 KB
/
casapi.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.1
info:
title: ServiceStage application deployment and operation management API
description: This is an Open API descriptor for Huawei ServiceStage application deployment.
The operations cover the provsining life-cycle management broker APIs that allow
users to create, update and delete an application instance on the Huawei cloud.
version: "2.13"
externalDocs:
description: Find out more about CAS service broker
url: http://office-service.huawei.com/DocView.aspx?did=bd722989-3955-46f7-b79f-19f4833807c6
servers:
- url: https://servicestage.{region}.myhuaweicloud.com/v1
paths:
/cas/{project_id}/apps/service_instances/{instance_id}:
get:
tags:
- Application
summary: get application instance information
description: Get application instance detail information for a given project
ID and its service instance ID
operationId: getApplicationInfo
parameters:
- name: project_id
in: path
description: ID of the tenant's project on the cloud
required: true
schema:
type: string
- name: instance_id
in: path
description: ID of an application instance. A UUID string
required: true
schema:
type: string
- name: X-Auth-Token
in: header
description: Authentication Token
required: true
schema:
type: string
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/appinfo'
401:
description: Invalid username/password supplied
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
500:
description: Internal error
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
put:
tags:
- Application
summary: update an application instance
description: This API is used to update service plan, cpu/mem/disk, scale rules,
source code, war file, etc. The update may or may not require reprovisioning.
operationId: updateServiceInstance
parameters:
- name: project_id
in: path
description: ID of the tenant's project on the cloud
required: true
schema:
type: string
- name: instance_id
in: path
description: ID of an application instance. e.g. app3gdocdeg18gkg013d
required: true
schema:
type: string
- name: accepts_incomplete
in: query
description: Running provisioning asynchronizely, support true only
required: true
schema:
type: string
default: "true"
- name: X-Auth-Token
in: header
description: Authentication Token
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/updateParameters'
application/xml:
schema:
$ref: '#/components/schemas/updateParameters'
required: false
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/appresponse'
401:
description: Invalid username/password supplied
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
500:
description: Internal error
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
post:
tags:
- Application
summary: create an application instance
description: This is to provision a cloud application instance
operationId: provisionInstance
parameters:
- name: project_id
in: path
description: ID of the tenant's project on the cloud
required: true
schema:
type: string
- name: instance_id
in: path
description: ID of the service instance. A generated UUID
required: true
schema:
type: string
- name: accepts_incomplete
in: query
description: Running provisioning asynchronizely, either true or false
required: true
schema:
type: string
default: "true"
- name: X-Auth-Token
in: header
description: Authentication Token
required: true
schema:
type: string
requestBody:
description: Provisioning parmeters that need to be added to the application
instance
content:
application/json:
schema:
$ref: '#/components/schemas/provisionInstance'
required: true
responses:
200:
description: successful operation
content:
text/plain:
schema:
$ref: '#/components/schemas/appresponse'
application/json:
schema:
$ref: '#/components/schemas/appresponse'
401:
description: Unauthorized error
content:
text/plain:
schema:
$ref: '#/components/schemas/errorResponse'
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
405:
description: Validation exception
content:
text/plain:
schema:
$ref: '#/components/schemas/errorResponse'
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
412:
description: Incorrect broker version
content:
text/plain:
schema:
$ref: '#/components/schemas/errorResponse'
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
500:
description: Internal error
content:
text/plain:
schema:
$ref: '#/components/schemas/errorResponse'
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
delete:
tags:
- Application
summary: Delete an application instance
description: This is to deprovision a cloud application instance
operationId: deprovisionInstance
parameters:
- name: project_id
in: path
description: ID of the tenant's project on the cloud
required: true
schema:
type: string
- name: instance_id
in: path
description: ID of the service instance
required: true
schema:
type: string
- name: accepts_incomplete
in: query
description: Running provisioning asynchronizely, either true or false
required: true
schema:
type: string
default: "true"
- name: X-Auth-Token
in: header
description: Authentication Token
required: true
schema:
type: string
responses:
200:
description: successful operation
content:
text/plain:
schema:
$ref: '#/components/schemas/appresponse'
application/json:
schema:
$ref: '#/components/schemas/appresponse'
401:
description: Unauthorized error
content:
text/plain:
schema:
$ref: '#/components/schemas/errorResponse'
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
405:
description: Validation exception
content:
text/plain:
schema:
$ref: '#/components/schemas/errorResponse'
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
412:
description: Incorrect broker version
content:
text/plain:
schema:
$ref: '#/components/schemas/errorResponse'
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
500:
description: Internal error
content:
text/plain:
schema:
$ref: '#/components/schemas/errorResponse'
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
/cas/{project_id}/apps:
get:
tags:
- Application
summary: Get all application instances
description: Get all application instances for a given project ID
operationId: getApplications
parameters:
- name: project_id
in: path
description: ID of the tenant's project on the cloud
required: true
schema:
type: string
- name: X-Auth-Token
in: header
description: Authentication Token
required: true
schema:
type: string
- name: platform_type
in: query
description: Filter by platform type e.g. cce
schema:
type: string
- name: app_type
in: query
description: Filter by application type e.g. Tomcat8
schema:
type: string
responses:
200:
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/apps'
401:
description: Invalid username/password supplied
content: {}
500:
description: Internal error
content: {}
/cas/{project_id}/apps/service_instances/{instance_id}/logs:
get:
tags:
- Application
summary: Get application job and task details
description: Task logs can optionally be filtered by job-id and/or job-type.
Also, it's backed by offset pagination in case there are many records.
operationId: getAppTaskLogs
parameters:
- name: project_id
in: path
description: ID of the tenant's project on the cloud
required: true
schema:
type: string
- name: instance_id
in: path
description: ID of a service instance ID. e.g. app3gdocdeg18gkg013d
required: true
schema:
type: string
- name: X-Auth-Token
in: header
description: Authentication Token
required: true
schema:
type: string
- name: job_id
in: query
description: 'JobID is stored in both taskmgr_job and taskmgr_task tables:
e.g., JOB602d157d-e98d-49bd-bdcb-15f49f9df323'
schema:
type: string
- name: task_id
in: query
description: TaskID is the primary key of the taskmgr_task table, as, e.g.,
Task-5701507c-c9b8-44a5-9f3f-8751f92f5b7c
schema:
type: string
- name: job_type
in: query
description: 'Job types: PROVISION, UNPROVISION, DAILY_OPERATION, UNKNOWN'
style: form
explode: false
schema:
type: array
items:
type: string
default: unavailable
enum:
- PROVISION
- UNPROVISION
- DAILY_OPERATION
- UNKNOWN
- name: limit
in: query
description: An integer to limit the number of records returned
schema:
type: integer
default: 20
- name: offset
in: query
description: Retrieves records starting from offset
schema:
type: integer
default: 0
- name: orderby
in: query
description: order by data fields
schema:
type: string
default: lastCheck
- name: desc
in: query
description: order by decending or acending order
schema:
type: string
default: "true"
responses:
200:
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/taskLog'
401:
description: Invalid username/password supplied
content: {}
500:
description: Internal error
content: {}
/cas/{project_id}/apps/service_instances/{instance_id}/revisions:
get:
tags:
- Application
summary: Get application revisions
description: Application revisions.
operationId: appRevisions
parameters:
- name: project_id
in: path
description: ID of the tenant's project on the cloud
required: true
schema:
type: string
- name: instance_id
in: path
description: ID of a service instance ID. e.g. app3gdocdeg18gkg013d
required: true
schema:
type: string
- name: X-Auth-Token
in: header
description: Authentication Token
required: true
schema:
type: string
responses:
200:
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/apprevisions'
401:
description: Invalid username/password supplied
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
500:
description: Internal error
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
/cas/{project_id}/apps/metadata/types:
get:
tags:
- Application Metadata
summary: Get supported application types
description: All available application types that can be used
operationId: appTypes
parameters:
- name: project_id
in: path
description: ID of the tenant's project on the cloud
required: true
schema:
type: string
- name: X-Auth-Token
in: header
description: Authentication Token
required: true
schema:
type: string
responses:
200:
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/apptypes'
401:
description: Invalid username/password supplied
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
500:
description: Internal error
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
/cas/{project_id}/apps/metadata/sizes:
get:
tags:
- Application Metadata
summary: Get supported application sizes
description: All available application sizes. e.g. micro, small, large, xlarge
operationId: appSizes
parameters:
- name: project_id
in: path
description: ID of the tenant's project on the cloud
required: true
schema:
type: string
- name: X-Auth-Token
in: header
description: Authentication Token
required: true
schema:
type: string
responses:
200:
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/appsizes'
401:
description: Invalid username/password supplied
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
500:
description: Internal error
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
components:
schemas:
taskLog:
type: object
properties:
job_id:
type: string
job_name:
type: string
job_type:
type: string
service_instance_id:
type: string
project_id:
type: string
order_id:
type: string
job_desc:
type: string
execution_status:
type: string
created_at:
type: string
format: date-time
created_by:
type: string
task_id:
type: string
task_type:
type: string
task_index:
type: string
task_name:
type: string
task_status:
type: string
last_health_check:
type: string
format: date-time
owner_id:
type: string
appsizes:
type: object
properties:
flavor_id:
type: string
example: MICRO-5G:0.5C:1G
storage_size:
type: string
example: 5G
num_cpu:
type: string
example: 500m
memory_size:
type: string
example: 1G
label:
type: string
example: 'Micro: 5G Storage, 0.5 CPU, 1G Memory'
appresponse:
type: object
properties:
instance_id:
type: string
job_id:
type: string
message:
type: string
errorResponse:
required:
- error_code
- error_msg
type: object
properties:
error_code:
type: string
error_msg:
type: string
error_detail:
type: string
suggestion:
type: string
example:
error_code: SVCSTG.CAS.{HTTP_CODE}1000
error_mssage: Some error messages
error_detail: Error details.
suggestion: Contact Huawei Cloud Support.
provisionInstance:
required:
- context
- organization_guid
- parameters
- plan_id
- service_id
- space_guid
type: object
properties:
service_id:
type: string
plan_id:
type: string
organization_guid:
type: string
space_guid:
type: string
context:
required:
- order_id
type: object
properties:
order_id:
type: string
parameters:
required:
- name
- version
- size
- source
- type
- category
- platform_type
- platforms
type: object
properties:
name:
type: string
display_name:
type: string
description:
type: string
type:
type: string
version:
type: string
platform_type:
type: string
group_id:
type: string
category:
type: string
enum:
- ServiceComb
- Webapp
- Mobile
size:
type: object
properties:
id:
type: string
replica:
type: integer
listener_port:
type: integer
source:
$ref: '#/components/schemas/source'
services:
$ref: '#/components/schemas/appIntegratedServices'
platforms:
$ref: '#/components/schemas/platforms'
extended_param:
type: object
additionalProperties: true
example:
service_id: SRV238CASUFGHI09314A
plan_id: cas-pay2go
organization_guid: abc_guid
space_guid: abc_guid
context:
order_id: ord123
parameters:
version: "1.0.0"
display_name: ACME online store
type: Tomcat8
platform_type: cce
category: Webapp
listener_port: 8080
description: What my app does ...
size:
id: STANDARD-30G:2.0C:4G
replica: 1
source:
kind: artifact
spec:
app_name:
storage: swr
type: package
url: >-
https://100.125.5.235:20202/swr/v2/domains/d1/namespaces/nodel02/repositories/repo/packages/jar/versions/3.0/file_paths/WebApp-0.0.1-SNAPSHOT.jar
auth: iam
version: 3
artifact_namespace: default
extended_param:
enterprise_project_id: 0
platforms:
cce:
id: 7e1f8760-211b-11e9-98e4-0255ac101e1d
parameters:
namespace: default
elb:
id: 0bf0247d-2321-4c4c-b770-55e34c8b5fb4
apprevisions:
type: object
properties:
action:
type: string
example: Provision
active:
type: boolean
example: false
default: false
created_at:
type: string
format: date-time
spec:
$ref: '#/components/schemas/provisionInstance'
version:
type: integer
example: 2
updateParameters:
type: object
properties:
parameters:
type: object
properties:
size:
type: object
properties:
replica:
type: integer
id:
type: string
description:
type: string
version:
type: string
source:
$ref: '#/components/schemas/source'
display_name:
type: string
extended_param:
type: object
properties: {}
example:
parameters:
display_name: Updated display name [optional]
description: Updated description [optional]
version: 1.0.1
size:
id: MICRO-5G:0.5C:1G
replica: 2
source:
kind: code
spec:
repo_type: GitHub
repo_url: http://10.122.253.128/cas/cas-mock-war.git
repo_namespace: mynamespace
proj_branch: master
secu_token: cas:CloudPaaS
artifact_namespace: cas-abdedfed
appinfo:
type: object
properties:
instance_id:
type: string
project_id:
type: string
name:
type: string
description:
type: string
version:
type: string
example: 1.0.0
group_id:
type: string
example: f19c320e-f9ff-4d83-ad14-f5fc91fa41a8
display_name:
type: string
app_type:
type: string
example: Java8
platform_type:
type: string
example: cce
replica:
type: integer
example: 1
url:
type: string
flavor_id:
type: string
example: MICRO-5G:0.5C:1G
assembling_job_id:
type: string
status:
type: string
description: Current Application Status
enum:
- INITIALIZING
- FAILED
- RUNNING
- DOWN
- DELETING
- DELETED
- STAGING
- STARTING
- STOPPING
- STOPPED
- RESTARTING
- PENDING
- PARTIALLY_FAILED
- UNKNOWN
created_at:
type: string
format: date-time
last_update_at:
type: string
format: date-time
listener_port:
type: integer
source:
$ref: '#/components/schemas/source'
platforms:
$ref: '#/components/schemas/platforms'
services:
$ref: '#/components/schemas/appIntegratedServices'
appIntegratedServices:
type: object
required:
- distributed_session
- relational_database
additionalProperties:
type: object
properties:
desc:
type: string
instances:
type: array
items:
type: object
properties:
id:
type: string
parameters:
type: object
additionalProperties: true
example:
distributed_session:
desc: Distributed caching session
instances:
- id: 9fd9b4cb-057c-4bf2-be6e-581a3216d96f
parameters:
cluster: "false"
password: test123
relational_database:
desc: Relational Database Service
instances:
- id: ddaaa82dcea04b44b839e1529d1989cdno01
parameters:
connection_type: SPRING_CLOUD_CONNECTOR
db_name: musicdb
db_user: dbuser
password: "******"
apptypes:
type: object
properties:
type_name:
type: string
example: Tomcat8
base_image_repo:
type: string
example: /cas-builds/tomcat8-session-redis:latest
container_default_port:
type: integer
example: 8080
type_desc:
type: string
example: Tomcat runtime server (Java servlet 4.0) with Java 8 supported
display_name:
type: string
example: Tomcat8
apps:
type: object
properties:
instance_id:
type: string
project_id:
type: string
name:
type: string
version:
type: string
display_name:
type: string
app_type:
type: string
platform_type:
type: string
url:
type: string
replica:
type: integer
status:
type: string
description: Current Application Status
enum:
- INITIALIZING
- FAILED
- RUNNING
- DOWN
- DELETING
- DELETED
- STAGING
- STARTING
- STOPPING
- STOPPED
- RESTARTING
- PENDING
- PARTIALLY_FAILED
- UNKNOWN
reason:
type: string
description: reason for application partially failed
created_at:
type: string
format: date-time
last_update_at:
type: string
format: date-time
assembling_job_id:
type: string
platforms:
type: object
properties:
id:
type: string
parameters:
type: object
additionalProperties:
type: string
example:
vpc:
id: 32d823b8-7980-4690-8be0-a03018cc3756
cce:
id: 42d7c666-c0e6-11e8-8c28-0255ac101f1d
parameters:
namespace: default
elb: