/
IOrganizationResource.java
1803 lines (1711 loc) · 104 KB
/
IOrganizationResource.java
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
/*
* Copyright 2014 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.apiman.manager.api.rest.contract;
import io.apiman.manager.api.beans.apps.ApplicationBean;
import io.apiman.manager.api.beans.apps.ApplicationVersionBean;
import io.apiman.manager.api.beans.apps.NewApplicationBean;
import io.apiman.manager.api.beans.apps.NewApplicationVersionBean;
import io.apiman.manager.api.beans.apps.UpdateApplicationBean;
import io.apiman.manager.api.beans.audit.AuditEntryBean;
import io.apiman.manager.api.beans.contracts.ContractBean;
import io.apiman.manager.api.beans.contracts.NewContractBean;
import io.apiman.manager.api.beans.idm.GrantRolesBean;
import io.apiman.manager.api.beans.members.MemberBean;
import io.apiman.manager.api.beans.metrics.AppUsagePerServiceBean;
import io.apiman.manager.api.beans.metrics.HistogramIntervalType;
import io.apiman.manager.api.beans.metrics.ResponseStatsHistogramBean;
import io.apiman.manager.api.beans.metrics.ResponseStatsPerAppBean;
import io.apiman.manager.api.beans.metrics.ResponseStatsPerPlanBean;
import io.apiman.manager.api.beans.metrics.ResponseStatsSummaryBean;
import io.apiman.manager.api.beans.metrics.UsageHistogramBean;
import io.apiman.manager.api.beans.metrics.UsagePerAppBean;
import io.apiman.manager.api.beans.metrics.UsagePerPlanBean;
import io.apiman.manager.api.beans.orgs.NewOrganizationBean;
import io.apiman.manager.api.beans.orgs.OrganizationBean;
import io.apiman.manager.api.beans.orgs.UpdateOrganizationBean;
import io.apiman.manager.api.beans.plans.NewPlanBean;
import io.apiman.manager.api.beans.plans.NewPlanVersionBean;
import io.apiman.manager.api.beans.plans.PlanBean;
import io.apiman.manager.api.beans.plans.PlanVersionBean;
import io.apiman.manager.api.beans.plans.UpdatePlanBean;
import io.apiman.manager.api.beans.policies.NewPolicyBean;
import io.apiman.manager.api.beans.policies.PolicyBean;
import io.apiman.manager.api.beans.policies.PolicyChainBean;
import io.apiman.manager.api.beans.policies.UpdatePolicyBean;
import io.apiman.manager.api.beans.search.SearchResultsBean;
import io.apiman.manager.api.beans.services.NewServiceBean;
import io.apiman.manager.api.beans.services.NewServiceVersionBean;
import io.apiman.manager.api.beans.services.ServiceBean;
import io.apiman.manager.api.beans.services.ServiceVersionBean;
import io.apiman.manager.api.beans.services.UpdateServiceBean;
import io.apiman.manager.api.beans.services.UpdateServiceVersionBean;
import io.apiman.manager.api.beans.summary.ApiRegistryBean;
import io.apiman.manager.api.beans.summary.ApplicationSummaryBean;
import io.apiman.manager.api.beans.summary.ApplicationVersionSummaryBean;
import io.apiman.manager.api.beans.summary.ContractSummaryBean;
import io.apiman.manager.api.beans.summary.PlanSummaryBean;
import io.apiman.manager.api.beans.summary.PlanVersionSummaryBean;
import io.apiman.manager.api.beans.summary.PolicySummaryBean;
import io.apiman.manager.api.beans.summary.ServicePlanSummaryBean;
import io.apiman.manager.api.beans.summary.ServiceSummaryBean;
import io.apiman.manager.api.beans.summary.ServiceVersionEndpointSummaryBean;
import io.apiman.manager.api.beans.summary.ServiceVersionSummaryBean;
import io.apiman.manager.api.rest.contract.exceptions.ApplicationAlreadyExistsException;
import io.apiman.manager.api.rest.contract.exceptions.ApplicationNotFoundException;
import io.apiman.manager.api.rest.contract.exceptions.ApplicationVersionAlreadyExistsException;
import io.apiman.manager.api.rest.contract.exceptions.ApplicationVersionNotFoundException;
import io.apiman.manager.api.rest.contract.exceptions.ContractAlreadyExistsException;
import io.apiman.manager.api.rest.contract.exceptions.ContractNotFoundException;
import io.apiman.manager.api.rest.contract.exceptions.GatewayNotFoundException;
import io.apiman.manager.api.rest.contract.exceptions.InvalidMetricCriteriaException;
import io.apiman.manager.api.rest.contract.exceptions.InvalidNameException;
import io.apiman.manager.api.rest.contract.exceptions.InvalidServiceStatusException;
import io.apiman.manager.api.rest.contract.exceptions.InvalidVersionException;
import io.apiman.manager.api.rest.contract.exceptions.NotAuthorizedException;
import io.apiman.manager.api.rest.contract.exceptions.OrganizationAlreadyExistsException;
import io.apiman.manager.api.rest.contract.exceptions.OrganizationNotFoundException;
import io.apiman.manager.api.rest.contract.exceptions.PlanAlreadyExistsException;
import io.apiman.manager.api.rest.contract.exceptions.PlanNotFoundException;
import io.apiman.manager.api.rest.contract.exceptions.PlanVersionAlreadyExistsException;
import io.apiman.manager.api.rest.contract.exceptions.PlanVersionNotFoundException;
import io.apiman.manager.api.rest.contract.exceptions.PolicyNotFoundException;
import io.apiman.manager.api.rest.contract.exceptions.RoleNotFoundException;
import io.apiman.manager.api.rest.contract.exceptions.ServiceAlreadyExistsException;
import io.apiman.manager.api.rest.contract.exceptions.ServiceNotFoundException;
import io.apiman.manager.api.rest.contract.exceptions.ServiceVersionAlreadyExistsException;
import io.apiman.manager.api.rest.contract.exceptions.ServiceVersionNotFoundException;
import io.apiman.manager.api.rest.contract.exceptions.UserNotFoundException;
import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
/**
* The Organization API.
*
* @author eric.wittmann@redhat.com
*/
@Path("organizations")
public interface IOrganizationResource {
/**
* Use this endpoint to create a new Organization.
* @summary Create Organization
* @param bean Information about the new Organization.
* @statuscode 200 If the Organization was successfully created.
* @return Full details about the Organization that was created.
* @throws OrganizationAlreadyExistsException when trying to create an Organization that already exists
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
* @throws InvalidNameException when the user attempts to create an Organization with an invalid name
*/
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public OrganizationBean create(NewOrganizationBean bean) throws OrganizationAlreadyExistsException,
NotAuthorizedException, InvalidNameException;
/**
* Use this endpoint to get information about a single Organization
* by its ID.
* @summary Get Organization By ID
* @param organizationId The Organization id.
* @statuscode 200 If the Organization was successfully returned.
* @statuscode 404 If the Organization does not exist.
* @return The Organization.
* @throws OrganizationNotFoundException when trying to get, update, or delete an organization that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}")
@Produces(MediaType.APPLICATION_JSON)
public OrganizationBean get(@PathParam("organizationId") String organizationId) throws OrganizationNotFoundException, NotAuthorizedException;
/**
* Updates meta-information about a single Organization.
* @summary Update Organization By ID
* @param organizationId The Organization ID.
* @param bean Updated Organization information.
* @statuscode 200 If the Organization meta-data is successfully updated.
* @statuscode 404 If the Organization does not exist.
* @throws OrganizationNotFoundException when trying to get, update, or delete an organization that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@PUT
@Path("{organizationId}")
@Consumes(MediaType.APPLICATION_JSON)
public void update(@PathParam("organizationId") String organizationId, UpdateOrganizationBean bean)
throws OrganizationNotFoundException, NotAuthorizedException;
/**
* Returns audit activity information for a single Organization. The audit
* information that is returned represents all of the activity associated
* with this Organization (i.e. an audit log for everything in the Organization).
* @summary Get Organization Activity
* @param organizationId The Organization ID.
* @param page Which page of activity results to return.
* @param pageSize The number of entries per page.
* @statuscode 200 If the audit information is successfully returned.
* @statuscode 404 If the Organization does not exist.
* @return List of audit/activity entries.
* @throws OrganizationNotFoundException when trying to get, update, or delete an organization that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/activity")
@Produces(MediaType.APPLICATION_JSON)
public SearchResultsBean<AuditEntryBean> activity(
@PathParam("organizationId") String organizationId, @QueryParam("page") int page,
@QueryParam("count") int pageSize) throws OrganizationNotFoundException, NotAuthorizedException;
/*
* APPLICATIONS
*/
/**
* Use this endpoint to create a new Application. Note that it is important to also
* create an initial version of the Application (e.g. 1.0). This can either be done
* by including the 'initialVersion' property in the request, or by immediately following
* up with a call to "Create Application Version". If the former is done, then a first
* Application version will be created automatically by this endpoint.
* @summary Create Application
* @param organizationId The Organization ID.
* @param bean Information about the new Application.
* @statuscode 200 If the Application is successfully created.
* @statuscode 404 If the Organization does not exist.
* @return Full details about the newly created Application.
* @throws OrganizationNotFoundException when trying to get, update, or delete an organization that does not exist
* @throws ApplicationAlreadyExistsException when trying to create an Application that already exists
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
* @throws InvalidNameException when the user attempts the create with an invalid name
*/
@POST
@Path("{organizationId}/applications")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public ApplicationBean createApp(@PathParam("organizationId") String organizationId,
NewApplicationBean bean) throws OrganizationNotFoundException, ApplicationAlreadyExistsException,
NotAuthorizedException, InvalidNameException;
/**
* Use this endpoint to retrieve information about a single Application by ID. Note
* that this only returns information about the Application, not about any particular
* *version* of the Application.
* @summary Get Application By ID
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @statuscode 200 If the Application is successfully returned.
* @statuscode 404 If the Organization does not exist.
* @statuscode 404 If the Application does not exist.
* @return An Application.
* @throws ApplicationNotFoundException when trying to get, update, or delete an application that does not exist when trying to get, update, or delete an application that does not exist.
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/applications/{applicationId}")
@Produces(MediaType.APPLICATION_JSON)
public ApplicationBean getApp(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId) throws ApplicationNotFoundException,
NotAuthorizedException;
/**
* This endpoint returns audit activity information about the Application.
* @summary Get Application Activity
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param page Which page of activity should be returned.
* @param pageSize The number of entries per page to return.
* @statuscode 200 If the audit information is successfully returned.
* @statuscode 404 If the Organization does not exist.
* @statuscode 404 If the Application does not exist.
* @return A list of audit activity entries.
* @throws ApplicationNotFoundException when trying to get, update, or delete an application that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/applications/{applicationId}/activity")
@Produces(MediaType.APPLICATION_JSON)
public SearchResultsBean<AuditEntryBean> getAppActivity(
@PathParam("organizationId") String organizationId, @PathParam("applicationId") String applicationId,
@QueryParam("page") int page, @QueryParam("count") int pageSize) throws ApplicationNotFoundException,
NotAuthorizedException;
/**
* Use this endpoint to get a list of all Applications in the Organization.
* @summary List Applications
* @param organizationId The Organization ID.
* @statuscode 200 If the list of Applications is successfully returned.
* @statuscode 404 If the Organization does not exist.
* @return A list of Applications.
* @throws OrganizationNotFoundException when trying to get, update, or delete an organization that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/applications")
@Produces(MediaType.APPLICATION_JSON)
public List<ApplicationSummaryBean> listApps(@PathParam("organizationId") String organizationId)
throws OrganizationNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to update information about an Application.
* @summary Update Application
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param bean Updated Application information.
* @statuscode 204 If the Application is updated successfully.
* @statuscode 404 If the Application does not exist.
* @throws ApplicationNotFoundException when trying to get, update, or delete an application that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@PUT
@Path("{organizationId}/applications/{applicationId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public void updateApp(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, UpdateApplicationBean bean)
throws ApplicationNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to create a new version of the Application.
* @summary Create Application Version
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param bean Initial information about the new Application version.
* @statuscode 200 If the Application version is created successfully.
* @statuscode 404 If the Application does not exist.
* @statuscode 409 If the Application version already exists.
* @return Full details about the newly created Application version.
* @throws ApplicationNotFoundException when trying to get, update, or delete an application that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
* @throws InvalidVersionException when the user attempts to use an invalid version value
*/
@POST
@Path("{organizationId}/applications/{applicationId}/versions")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public ApplicationVersionBean createAppVersion(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, NewApplicationVersionBean bean)
throws ApplicationNotFoundException, NotAuthorizedException, InvalidVersionException,
ApplicationVersionAlreadyExistsException;
/**
* Use this endpoint to list all of the versions of an Application.
* @summary List Application Versions
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @statuscode 200 If the list of Application versions is successfully returned.
* @return A list of Applications.
* @throws ApplicationNotFoundException when trying to get, update, or delete an application that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/applications/{applicationId}/versions")
@Produces(MediaType.APPLICATION_JSON)
public List<ApplicationVersionSummaryBean> listAppVersions(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId) throws ApplicationNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to get detailed information about a single version of
* an Application.
* @summary Get Application Version
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param version The Application version.
* @statuscode 200 If the Application version is successfully returned.
* @statuscode 404 If the Application version does not exist.
* @return An Application version.
* @throws ApplicationVersionNotFoundException when trying to get, update, or delete a application version that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/applications/{applicationId}/versions/{version}")
@Produces(MediaType.APPLICATION_JSON)
public ApplicationVersionBean getAppVersion(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, @PathParam("version") String version)
throws ApplicationVersionNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to get audit activity information for a single version of the
* Application.
* @summary Get Application Version Activity
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param version The Application version.
* @param page Which page of activity data to return.
* @param pageSize The number of entries per page to return.
* @statuscode 200 If the audit activity entries are successfully returned.
* @statuscode 404 If the Application version does not exist.
* @return A list of audit entries.
* @throws ApplicationVersionNotFoundException when trying to get, update, or delete a application version that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/applications/{applicationId}/versions/{version}/activity")
@Produces(MediaType.APPLICATION_JSON)
public SearchResultsBean<AuditEntryBean> getAppVersionActivity(
@PathParam("organizationId") String organizationId, @PathParam("applicationId") String applicationId,
@PathParam("version") String version, @QueryParam("page") int page,
@QueryParam("count") int pageSize) throws ApplicationVersionNotFoundException, NotAuthorizedException;
/**
* Retrieves metrics/analytics information for a specific application. This will
* return request count data broken down by service. It basically answers
* the question "which services is my app really using?".
*
* @summary Get App Usage Metrics (per Service)
* @param organizationId The organization ID.
* @param applicationId The application ID.
* @param version The application version.
* @param fromDate The start of a valid date range.
* @param toDate The end of a valid date range.
* @statuscode 200 If the metrics data is successfully returned.
* @return Usage metrics information.
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/applications/{applicationId}/versions/{version}/metrics/serviceUsage")
@Produces(MediaType.APPLICATION_JSON)
public AppUsagePerServiceBean getAppUsagePerService(
@PathParam("organizationId") String organizationId, @PathParam("applicationId") String applicationId,
@PathParam("version") String version, @QueryParam("from") String fromDate,
@QueryParam("to") String toDate) throws NotAuthorizedException, InvalidMetricCriteriaException;
/**
* Use this endpoint to create a Contract between the Application and a Service. In order
* to create a Contract, the caller must specify the Organization, ID, and Version of the
* Service. Additionally the caller must specify the ID of the Plan it wished to use for
* the Contract with the Service.
* @summary Create a Service Contract
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param version The Application version.
* @param bean Required information about the new Contract.
* @statuscode 200 If the Contract is successfully created.
* @statuscode 404 If the Application version does not exist.
* @return Full details about the newly created Contract.
* @throws OrganizationNotFoundException when trying to get, update, or delete an organization that does not exist
* @throws ApplicationNotFoundException when trying to get, update, or delete an application that does not exist
* @throws ServiceNotFoundException when trying to get, update, or delete an service that does not exist
* when trying to get, update, or delete an plan that does not exist
* @throws PlanNotFoundException when trying to get, update, or delete an plan that does not exist
* @throws ContractAlreadyExistsException when trying to create an Contract that already exists
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@POST
@Path("{organizationId}/applications/{applicationId}/versions/{version}/contracts")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public ContractBean createContract(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, @PathParam("version") String version,
NewContractBean bean) throws OrganizationNotFoundException, ApplicationNotFoundException,
ServiceNotFoundException, PlanNotFoundException, ContractAlreadyExistsException,
NotAuthorizedException;
/**
* Use this endpoint to retrieve detailed information about a single Service Contract
* for an Application.
* @summary Get Service Contract
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param version The Application version.
* @param contractId The ID of the Contract.
* @statuscode 200 If the Contract is successfully returned.
* @statuscode 404 If the Application version does not exist.
* @statuscode 404 If the Contract is not found.
* @return Details about a single Contract.
* @throws ApplicationNotFoundException when trying to get, update, or delete an application that does not exist
* @throws ContractNotFoundException when trying to get, update, or delete a contract that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/applications/{applicationId}/versions/{version}/contracts/{contractId}")
@Produces(MediaType.APPLICATION_JSON)
public ContractBean getContract(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, @PathParam("version") String version,
@PathParam("contractId") Long contractId) throws ApplicationNotFoundException,
ContractNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to get a list of all Contracts for an Application.
* @summary List All Contracts for an Application
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param version The Application version.
* @statuscode 200 If the list of Contracts is successfully returned.
* @statuscode 404 If the Application is not found.
* @return A list of Contracts.
* @throws ApplicationNotFoundException when trying to get, update, or delete an application that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/applications/{applicationId}/versions/{version}/contracts")
@Produces(MediaType.APPLICATION_JSON)
public List<ContractSummaryBean> getApplicationVersionContracts(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, @PathParam("version") String version)
throws ApplicationNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to get registry style information about all Services that this
* Application consumes. This is a useful endpoint to invoke in order to retrieve
* a summary of every Service consumed by the application. The information returned
* by this endpoint could potentially be included directly in a client application
* as a way to lookup endpoint information for the APIs it wishes to consume. This
* variant of the API Registry is formatted as JSON data.
* @summary Get API Registry (JSON)
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param version The Application version.
* @statuscode 200 If the API Registry information is successfully returned.
* @statuscode 404 If the Application does not exist.
* @return API Registry information.
* @throws ApplicationNotFoundException when trying to get, update, or delete an application that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/applications/{applicationId}/versions/{version}/apiregistry/json")
@Produces(MediaType.APPLICATION_JSON)
public ApiRegistryBean getApiRegistryJSON(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, @PathParam("version") String version)
throws ApplicationNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to get registry style information about all Services that this
* Application consumes. This is a useful endpoint to invoke in order to retrieve
* a summary of every Service consumed by the application. The information returned
* by this endpoint could potentially be included directly in a client application
* as a way to lookup endpoint information for the APIs it wishes to consume. This
* variant of the API Registry is formatted as XML data.
* @summary Get API Registry (XML)
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param version The Application version.
* @statuscode 200 If the API Registry information is successfully returned.
* @statuscode 404 If the Application does not exist.
* @return API Registry information.
* @throws ApplicationNotFoundException when trying to get, update, or delete an application that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/applications/{applicationId}/versions/{version}/apiregistry/xml")
@Produces(MediaType.APPLICATION_XML)
public ApiRegistryBean getApiRegistryXML(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, @PathParam("version") String version)
throws ApplicationNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to break all contracts between this application and its services.
* @summary Break All Contracts
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param version The Application version.
* @statuscode 200 If the operation is successful.
* @statuscode 404 If the Application does not exist.
* @throws ApplicationNotFoundException when trying to get, update, or delete an application that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@DELETE
@Path("{organizationId}/applications/{applicationId}/versions/{version}/contracts")
public void deleteAllContracts(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, @PathParam("version") String version)
throws ApplicationNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to break a Contract with a Service.
* @summary Break Contract
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param version The Application version.
* @param contractId The Contract ID.
* @statuscode 200 If the Contract is successfully broken.
* @statuscode 404 If the Application does not exist.
* @statuscode 404 If the Contract does not exist.
* @throws ApplicationNotFoundException when trying to get, update, or delete an application that does not exist
* @throws ContractNotFoundException when trying to get, update, or delete a contract that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@DELETE
@Path("{organizationId}/applications/{applicationId}/versions/{version}/contracts/{contractId}")
public void deleteContract(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, @PathParam("version") String version,
@PathParam("contractId") Long contractId) throws ApplicationNotFoundException,
ContractNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to add a new Policy to the Application version.
* @summary Add Application Policy
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param version The Application version.
* @param bean Information about the new Policy.
* @statuscode 200 If the Policy is successfully added.
* @statuscode 404 If the Application does not exist.
* @return Full details about the newly added Policy.
* @throws OrganizationNotFoundException when trying to get, update, or delete an organization that does not exist
* @throws ApplicationVersionNotFoundException when trying to get, update, or delete a application version that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@POST
@Path("{organizationId}/applications/{applicationId}/versions/{version}/policies")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public PolicyBean createAppPolicy(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, @PathParam("version") String version,
NewPolicyBean bean) throws OrganizationNotFoundException, ApplicationVersionNotFoundException,
NotAuthorizedException;
/**
* Use this endpoint to get information about a single Policy in the Application version.
* @summary Get Application Policy
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param version The Application version.
* @param policyId The Policy ID.
* @statuscode 200 If the Policy is successfully returned.
* @statuscode 404 If the Application does not exist.
* @return Full information about the Policy.
* @throws OrganizationNotFoundException when trying to get, update, or delete an organization that does not exist
* @throws ApplicationVersionNotFoundException when trying to get, update, or delete a application version that does not exist
* @throws PolicyNotFoundException when trying to get, update, or delete a policy that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/applications/{applicationId}/versions/{version}/policies/{policyId}")
@Produces(MediaType.APPLICATION_JSON)
public PolicyBean getAppPolicy(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, @PathParam("version") String version,
@PathParam("policyId") long policyId) throws OrganizationNotFoundException, ApplicationVersionNotFoundException,
PolicyNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to update the meta-data or configuration of a single Application Policy.
* @summary Update Application Policy
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param version The Application version.
* @param policyId The Policy ID.
* @param bean New meta-data and/or configuration for the Policy.
* @statuscode 204 If the Policy was successfully updated.
* @statuscode 404 If the Application does not exist.
* @statuscode 404 If the Policy does not exist.
* @throws OrganizationNotFoundException when trying to get, update, or delete an organization that does not exist
* @throws ApplicationVersionNotFoundException when trying to get, update, or delete a application version that does not exist
* @throws PolicyNotFoundException when trying to get, update, or delete a policy that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@PUT
@Path("{organizationId}/applications/{applicationId}/versions/{version}/policies/{policyId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public void updateAppPolicy(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, @PathParam("version") String version,
@PathParam("policyId") long policyId, UpdatePolicyBean bean) throws OrganizationNotFoundException,
ApplicationVersionNotFoundException, PolicyNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to remove a Policy from the Application.
* @summary Remove Application Policy
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param version The Application version.
* @param policyId The Policy ID.
* @statuscode 204 If the Policy was successfully deleted.
* @statuscode 404 If the Application does not exist.
* @statuscode 404 If the Policy does not exist.
* @throws OrganizationNotFoundException when trying to get, update, or delete an organization that does not exist
* @throws ApplicationVersionNotFoundException when trying to get, update, or delete a application version that does not exist
* @throws PolicyNotFoundException when trying to get, update, or delete a policy that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@DELETE
@Path("{organizationId}/applications/{applicationId}/versions/{version}/policies/{policyId}")
public void deleteAppPolicy(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, @PathParam("version") String version,
@PathParam("policyId") long policyId) throws OrganizationNotFoundException, ApplicationVersionNotFoundException,
PolicyNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to list all of the Policies configured for the Application.
* @summary List All Application Policies
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param version The Application version.
* @statuscode 200 If the list of Policies is successfully returned.
* @statuscode 404 If the Application does not exist.
* @return A List of Policies.
* @throws OrganizationNotFoundException when trying to get, update, or delete an organization that does not exist
* @throws ApplicationVersionNotFoundException when trying to get, update, or delete a application version that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/applications/{applicationId}/versions/{version}/policies")
@Produces(MediaType.APPLICATION_JSON)
public List<PolicySummaryBean> listAppPolicies(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, @PathParam("version") String version)
throws OrganizationNotFoundException, ApplicationVersionNotFoundException,
NotAuthorizedException;
/**
* Use this endpoint to change the order of Policies for an Application. When a
* Policy is added to the Application, it is added as the last Policy in the list
* of Application Policies. Sometimes the order of Policies is important, so it
* is often useful to re-order the Policies by invoking this endpoint. The body
* of the request should include all of the Policies for the Application, in the
* new desired order. Note that only the IDs of each of the Policies is actually
* required in the request, at a minimum.
* @summary Re-Order Application Policies
* @param organizationId The Organization ID.
* @param applicationId The Application ID.
* @param version The Application version.
* @param policyChain The Policies in the desired order.
* @statuscode 204 If the re-ordering of Policies was successful.
* @statuscode 404 If the Application does not exist.
* @throws OrganizationNotFoundException when trying to get, update, or delete an organization that does not exist
* @throws ApplicationVersionNotFoundException when trying to get, update, or delete a application version that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@POST
@Path("{organizationId}/applications/{applicationId}/versions/{version}/reorderPolicies")
@Consumes(MediaType.APPLICATION_JSON)
public void reorderApplicationPolicies(@PathParam("organizationId") String organizationId,
@PathParam("applicationId") String applicationId, @PathParam("version") String version,
PolicyChainBean policyChain) throws OrganizationNotFoundException,
ApplicationVersionNotFoundException, NotAuthorizedException;
/*
* SERVICES
*/
/**
* Use this endpoint to create a new Service. Note that it is important to also
* create an initial version of the Service (e.g. 1.0). This can either be done
* by including the 'initialVersion' property in the request, or by immediately following
* up with a call to "Create Service Version". If the former is done, then a first
* Service version will be created automatically by this endpoint.
* @summary Create Service
* @param organizationId The Organization ID.
* @param bean Information about the new Service.
* @statuscode 200 If the Service is successfully created.
* @statuscode 404 If the Organization does not exist.
* @return Full details about the newly created Service.
* @throws OrganizationNotFoundException when trying to get, update, or delete an organization that does not exist
* @throws ServiceAlreadyExistsException when trying to create an Service that already exists
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
* @throws InvalidNameException when the user attempts the create with an invalid name
*/
@POST
@Path("{organizationId}/services")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public ServiceBean createService(@PathParam("organizationId") String organizationId, NewServiceBean bean)
throws OrganizationNotFoundException, ServiceAlreadyExistsException, NotAuthorizedException,
InvalidNameException;
/**
* Use this endpoint to retrieve information about a single Service by ID. Note
* that this only returns information about the Service, not about any particular
* *version* of the Service.
* @summary Get Service By ID
* @param organizationId The Organization ID.
* @param serviceId The Service ID.
* @statuscode 200 If the Service is successfully returned.
* @statuscode 404 If the Organization does not exist.
* @statuscode 404 If the Service does not exist.
* @return A Service.
* @throws ServiceNotFoundException when trying to get, update, or delete an service that does not exist when trying to get, update, or delete an service that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/services/{serviceId}")
@Produces(MediaType.APPLICATION_JSON)
public ServiceBean getService(@PathParam("organizationId") String organizationId,
@PathParam("serviceId") String serviceId) throws ServiceNotFoundException,
NotAuthorizedException;
/**
* Use this endpoint to get a list of all Services in the Organization.
* @summary List Services
* @param organizationId The Organization ID.
* @statuscode 200 If the list of Services is successfully returned.
* @statuscode 404 If the Organization does not exist.
* @return A list of Services.
* @throws OrganizationNotFoundException when trying to get, update, or delete an organization that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/services")
@Produces(MediaType.APPLICATION_JSON)
public List<ServiceSummaryBean> listServices(@PathParam("organizationId") String organizationId)
throws OrganizationNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to update information about a Service.
* @summary Update Service
* @param organizationId The Organization ID.
* @param serviceId The Service ID.
* @param bean Updated Service information.
* @statuscode 204 If the Service is updated successfully.
* @statuscode 404 If the Service does not exist.
* @throws ServiceNotFoundException when trying to get, update, or delete an service that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@PUT
@Path("{organizationId}/services/{serviceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public void updateService(@PathParam("organizationId") String organizationId,
@PathParam("serviceId") String serviceId, UpdateServiceBean bean)
throws ServiceNotFoundException, NotAuthorizedException;
/**
* This endpoint returns audit activity information about the Service.
* @summary Get Service Activity
* @param organizationId The Organization ID.
* @param serviceId The Service ID.
* @param page Which page of activity should be returned.
* @param pageSize The number of entries per page to return.
* @statuscode 200 If the audit information is successfully returned.
* @statuscode 404 If the Organization does not exist.
* @statuscode 404 If the Service does not exist.
* @return A list of audit activity entries.
* @throws ServiceNotFoundException when trying to get, update, or delete an service that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/services/{serviceId}/activity")
@Produces(MediaType.APPLICATION_JSON)
public SearchResultsBean<AuditEntryBean> getServiceActivity(
@PathParam("organizationId") String organizationId, @PathParam("serviceId") String serviceId,
@QueryParam("page") int page, @QueryParam("count") int pageSize) throws ServiceNotFoundException,
NotAuthorizedException;
/**
* Use this endpoint to create a new version of the Service.
* @summary Create Service Version
* @param organizationId The Organization ID.
* @param serviceId The Service ID.
* @param bean Initial information about the new Service version.
* @statuscode 200 If the Service version is created successfully.
* @statuscode 404 If the Service does not exist.
* @statuscode 409 If the Service version already exists.
* @return Full details about the newly created Service version.
* @throws ServiceNotFoundException when trying to get, update, or delete an service that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
* @throws InvalidVersionException when the user attempts to use an invalid version value
*/
@POST
@Path("{organizationId}/services/{serviceId}/versions")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public ServiceVersionBean createServiceVersion(@PathParam("organizationId") String organizationId,
@PathParam("serviceId") String serviceId, NewServiceVersionBean bean)
throws ServiceNotFoundException, NotAuthorizedException, InvalidVersionException,
ServiceVersionAlreadyExistsException;
/**
* Use this endpoint to list all of the versions of a Service.
* @summary List Service Versions
* @param organizationId The Organization ID.
* @param serviceId The Service ID.
* @statuscode 200 If the list of Service versions is successfully returned.
* @return A list of Services.
* @throws ServiceNotFoundException when trying to get, update, or delete an service that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/services/{serviceId}/versions")
@Produces(MediaType.APPLICATION_JSON)
public List<ServiceVersionSummaryBean> listServiceVersions(@PathParam("organizationId") String organizationId,
@PathParam("serviceId") String serviceId) throws ServiceNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to get detailed information about a single version of
* a Service.
* @summary Get Service Version
* @param organizationId The Organization ID.
* @param serviceId The Service ID.
* @param version The Service version.
* @statuscode 200 If the Service version is successfully returned.
* @statuscode 404 If the Service version does not exist.
* @return A Service version.
* @throws ServiceVersionNotFoundException when trying to get, update, or delete a service version that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/services/{serviceId}/versions/{version}")
@Produces(MediaType.APPLICATION_JSON)
public ServiceVersionBean getServiceVersion(@PathParam("organizationId") String organizationId,
@PathParam("serviceId") String serviceId, @PathParam("version") String version)
throws ServiceVersionNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to retrieve the Service's definition document. A service
* definition document can be several different types, depending on the Service
* type and technology used to define the service. For example, this endpoint
* might return a WSDL document, or a Swagger JSON document.
* @summary Get Service Definition
* @param organizationId The Organization ID.
* @param serviceId The Service ID.
* @param version The Service version.
* @statuscode 200 If the Service definition is successfully returned.
* @statuscode 404 If the Service version does not exist.
* @return The Service Definition document (e.g. a Swagger JSON file).
* @throws ServiceVersionNotFoundException when trying to get, update, or delete a service version that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/services/{serviceId}/versions/{version}/definition")
@Produces({ MediaType.APPLICATION_JSON, "application/wsdl+xml", "application/x-yaml" })
public Response getServiceDefinition(@PathParam("organizationId") String organizationId,
@PathParam("serviceId") String serviceId, @PathParam("version") String version)
throws ServiceVersionNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to get information about the Managed Service's gateway
* endpoint. In other words, this returns the actual live endpoint on the
* API Gateway - the endpoint that a client should use when invoking the Service.
* @summary Get Service Endpoint
* @param organizationId The Organization ID.
* @param serviceId The Service ID.
* @param version The Service version.
* @statuscode 200 If the endpoint information is successfully returned.
* @statuscode 404 If the Service does not exist.
* @return The live Service endpoint information.
* @throws ServiceVersionNotFoundException when trying to get, update, or delete a service version that does not exist
* @throws InvalidServiceStatusException when the user attempts some action on the service when it is not in an appropriate state/status
* @throws GatewayNotFoundException when trying to get, update, or delete a gateay that does not exist
*/
@GET
@Path("{organizationId}/services/{serviceId}/versions/{version}/endpoint")
@Produces(MediaType.APPLICATION_JSON)
public ServiceVersionEndpointSummaryBean getServiceVersionEndpointInfo(@PathParam("organizationId") String organizationId,
@PathParam("serviceId") String serviceId, @PathParam("version") String version)
throws ServiceVersionNotFoundException, InvalidServiceStatusException, GatewayNotFoundException;
/**
* Use this endpoint to update information about a single version of a Service.
* @summary Update Service Version
* @param organizationId The Organization ID.
* @param serviceId The Service ID.
* @param version The Service version.
* @param bean Updated information about the Service version.
* @return The updated Service Version.
* @statuscode 204 If the Service version information was successfully updated.
* @statuscode 404 If the Service does not exist.
* @throws ServiceVersionNotFoundException when trying to get, update, or delete a service version that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
* @throws InvalidServiceStatusException when the user attempts some action on the service when it is not in an appropriate state/status
*/
@PUT
@Path("{organizationId}/services/{serviceId}/versions/{version}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public ServiceVersionBean updateServiceVersion(@PathParam("organizationId") String organizationId,
@PathParam("serviceId") String serviceId, @PathParam("version") String version,
UpdateServiceVersionBean bean) throws ServiceVersionNotFoundException, NotAuthorizedException,
InvalidServiceStatusException;
/**
* Use this endpoint to update the Service's definition document. A service
* definition will vary depending on the type of service, and the type of
* definition used. For example, it might be a Swagger document or a WSDL file.
* To use this endpoint, simply PUT the updated Service Definition document
* in its entirety, making sure to set the Content-Type appropriately for the
* type of definition document. The content will be stored and the Service's
* "Definition Type" field will be updated.
* <br />
* Whenever a service's definition is updated, the "definitionType" property of
* that service is automatically set based on the request Content-Type. There
* is no other way to set the service's definition type property. The following
* is a map of Content-Type to service definition type.
*
* <table>
* <thead>
* <tr><th>Content Type</th><th>Service Definition Type</th></tr>
* </thead>
* <tbody>
* <tr><td>application/json</td><td>SwaggerJSON</td></tr>
* <tr><td>application/x-yaml</td><td>SwaggerYAML</td></tr>
* <tr><td>application/wsdl+xml</td><td>WSDL</td></tr>
* </tbody>
* </table>
* @summary Update Service Definition
* @param organizationId The Organization ID.
* @param serviceId The Service ID.
* @param version The Service version.
* @statuscode 204 If the Service definition was successfully updated.
* @statuscode 404 If the Service does not exist.
* @throws ServiceVersionNotFoundException when trying to get, update, or delete a service version that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
* @throws InvalidServiceStatusException when the user attempts some action on the service when it is not in an appropriate state/status
*/
@PUT
@Path("{organizationId}/services/{serviceId}/versions/{version}/definition")
@Consumes({ MediaType.APPLICATION_JSON, "application/wsdl+xml", "application/x-yaml" })
public void updateServiceDefinition(@PathParam("organizationId") String organizationId,
@PathParam("serviceId") String serviceId, @PathParam("version") String version)
throws ServiceVersionNotFoundException, NotAuthorizedException, InvalidServiceStatusException;
/**
* Use this endpoint to get audit activity information for a single version of the
* Service.
* @summary Get Service Version Activity
* @param organizationId The Organization ID.
* @param serviceId The Service ID.
* @param version The Service version.
* @param page Which page of activity data to return.
* @param pageSize The number of entries per page to return.
* @statuscode 200 If the audit activity entries are successfully returned.
* @statuscode 404 If the Service version does not exist.
* @return A list of audit entries.
* @throws ServiceVersionNotFoundException when trying to get, update, or delete a service version that does not exist
* @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to
*/
@GET
@Path("{organizationId}/services/{serviceId}/versions/{version}/activity")
@Produces(MediaType.APPLICATION_JSON)
public SearchResultsBean<AuditEntryBean> getServiceVersionActivity(
@PathParam("organizationId") String organizationId, @PathParam("serviceId") String serviceId,
@PathParam("version") String version, @QueryParam("page") int page,
@QueryParam("count") int pageSize) throws ServiceVersionNotFoundException, NotAuthorizedException;
/**
* Use this endpoint to list the Plans configured for the given Service version.
* @summary List Service Plans
* @param organizationId The Organization ID.
* @param serviceId The Service ID.