Skip to content

Commit

Permalink
Bump Rest API Versions for 4.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
arunans23 committed Nov 22, 2022
1 parent 837ac2e commit f03f40b
Show file tree
Hide file tree
Showing 19 changed files with 341 additions and 337 deletions.
Expand Up @@ -2303,7 +2303,7 @@ public enum ApiTypes {

public static class RestApiConstants {

public static final String REST_API_PUBLISHER_DEFAULT_VERSION = "v3";
public static final String REST_API_PUBLISHER_DEFAULT_VERSION = "v4";
public static final String REST_API_OLD_VERSION = "v0.17";
public static final String REST_API_PUBLISHER_CONTEXT = "/api/am/publisher/";
public static final String REST_API_PUBLISHER_CONTEXT_FULL_1 =
Expand Down

Large diffs are not rendered by default.

Expand Up @@ -65,8 +65,8 @@
</jaxrs:server>

<bean id="URLValidationInterceptor" class="org.wso2.carbon.apimgt.rest.api.util.interceptors.URLValidationInterceptor">
<property name="majorVersion" value="v3" />
<property name="latestVersion" value="v3.0" />
<property name="majorVersion" value="v4" />
<property name="latestVersion" value="v4.0" />
</bean>
<bean id="PreAuthenticationInterceptor" class="org.wso2.carbon.apimgt.rest.api.util.interceptors.PreAuthenticationInterceptor" />
<bean id="TokenMergeInterceptor" class="org.wso2.carbon.apimgt.rest.api.util.interceptors.auth.TokenMergeInterceptor" />
Expand Down
Expand Up @@ -90,7 +90,7 @@ info:
Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header.
If you use a different authentication mechanism, this process may change.
version: '1.0'
version: '1.1'
servers:
- url: 'https://apis.wso2.com/api/service-catalog/v1'
- url: 'http://apis.wso2.com/api/service-catalog/v1'
Expand Down
Expand Up @@ -3,7 +3,7 @@ swagger: '2.0'
# Prolog
######################################################
info:
version: "v2.1"
version: "v2.2"
title: "WSO2 API Manager - Gateway"
description: |
This document specifies a **RESTful API** for WSO2 **API Manager** - Gateway.
Expand Down
Expand Up @@ -37,7 +37,7 @@

<bean id="URLValidationInterceptor" class="org.wso2.carbon.apimgt.rest.api.util.interceptors.URLValidationInterceptor">
<property name="majorVersion" value="v2" />
<property name="latestVersion" value="v2.1" />
<property name="latestVersion" value="v2.2" />
</bean>
<bean id="PreAuthenticationInterceptor" class="org.wso2.carbon.apimgt.rest.api.util.interceptors.PreAuthenticationInterceptor" />
<bean id="TokenMergeInterceptor" class="org.wso2.carbon.apimgt.rest.api.util.interceptors.auth.TokenMergeInterceptor" />
Expand Down
Expand Up @@ -2,7 +2,7 @@
"swagger" : "2.0",
"info" : {
"description" : "This document specifies a **RESTful API** for WSO2 **API Manager** - Gateway.\nPlease see [full swagger definition](https://raw.githubusercontent.com/wso2/carbon-apimgt/master/components/apimgt/org.wso2.carbon.apimgt.rest.api.gateway/src/main/resources/gateway-api.yaml) of the API which is written using [swagger 2.0](http://swagger.io/) specification.\n",
"version" : "v2.1",
"version" : "v2.2",
"title" : "WSO2 API Manager - Gateway",
"contact" : {
"name" : "WSO2",
Expand Down
Expand Up @@ -27,7 +27,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.rest.api.publisher.v1.common</artifactId>
<packaging>bundle</packaging>
<name>WSO2 API Manager Publisher REST API - v3</name>
<name>WSO2 API Manager Publisher REST API - v4</name>
<description>WSO2 API Manager REST API for API Publisher</description>


Expand Down
Expand Up @@ -27,7 +27,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.rest.api.publisher.v1</artifactId>
<packaging>war</packaging>
<name>WSO2 API Manager Publisher REST API - v3</name>
<name>WSO2 API Manager Publisher REST API - v4</name>
<description>WSO2 API Manager REST API for API Publisher</description>


Expand Down
Expand Up @@ -105,7 +105,7 @@ public Response addAPIProductDocument(@ApiParam(value = "**API Product ID** cons
@ApiResponse(code = 404, message = "Not Found. The specified resource does not exist.", response = ErrorDTO.class),
@ApiResponse(code = 409, message = "Conflict. Specified resource already exists.", response = ErrorDTO.class),
@ApiResponse(code = 500, message = "Internal Server Error.", response = ErrorDTO.class) })
public Response changeAPIProductLifecycle( @NotNull @ApiParam(value = "The action to demote or promote the state of the API Product. Supported actions are [ **Publish**, **Deploy as a Prototype**, **Demote to Created**, **Block**, **Deprecate**, **Re-Publish**, **Retire** ] ",required=true, allowableValues="Publish, Deploy as a Prototype, Demote to Created, Block, Deprecate, Re-Publish, Retire") @QueryParam("action") String action, @NotNull @ApiParam(value = "**API Product ID** consisting of the **UUID** of the API Product. The combination of the provider, name and the version of the API Product is also accepted as a valid API Product ID. Should be formatted as **provider-name-version**. ",required=true) @QueryParam("apiProductId") String apiProductId, @ApiParam(value = "Supported checklist items are as follows. 1. **Deprecate old versions after publishing the API**: Setting this to true will deprecate older versions of a particular API Product when it is promoted to Published state from Created state. 2. **Requires re-subscription when publishing the API**: If you set this to true, users need to re subscribe to the API Products although they may have subscribed to an older version. You can specify additional checklist items by using an **\"attribute:\"** modifier. Eg: \"Deprecate old versions after publishing the API:true\" will deprecate older versions of a particular API Product when it is promoted to Published state from Created state. Multiple checklist items can be given in \"attribute1:true, attribute2:false\" format. **Sample CURL :** curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v3/api-products/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish&lifecycleChecklist=Deprecate%20old%20versions%20after%20publishing%20the%20API%3Atrue,Requires%20re-subscription%20when%20publishing%20the%20API%3Afalse\" ") @QueryParam("lifecycleChecklist") String lifecycleChecklist, @ApiParam(value = "Validator for conditional requests; based on ETag. " )@HeaderParam("If-Match") String ifMatch) throws APIManagementException{
public Response changeAPIProductLifecycle( @NotNull @ApiParam(value = "The action to demote or promote the state of the API Product. Supported actions are [ **Publish**, **Deploy as a Prototype**, **Demote to Created**, **Block**, **Deprecate**, **Re-Publish**, **Retire** ] ",required=true, allowableValues="Publish, Deploy as a Prototype, Demote to Created, Block, Deprecate, Re-Publish, Retire") @QueryParam("action") String action, @NotNull @ApiParam(value = "**API Product ID** consisting of the **UUID** of the API Product. The combination of the provider, name and the version of the API Product is also accepted as a valid API Product ID. Should be formatted as **provider-name-version**. ",required=true) @QueryParam("apiProductId") String apiProductId, @ApiParam(value = "Supported checklist items are as follows. 1. **Deprecate old versions after publishing the API**: Setting this to true will deprecate older versions of a particular API Product when it is promoted to Published state from Created state. 2. **Requires re-subscription when publishing the API**: If you set this to true, users need to re subscribe to the API Products although they may have subscribed to an older version. You can specify additional checklist items by using an **\"attribute:\"** modifier. Eg: \"Deprecate old versions after publishing the API:true\" will deprecate older versions of a particular API Product when it is promoted to Published state from Created state. Multiple checklist items can be given in \"attribute1:true, attribute2:false\" format. **Sample CURL :** curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v4/api-products/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish&lifecycleChecklist=Deprecate%20old%20versions%20after%20publishing%20the%20API%3Atrue,Requires%20re-subscription%20when%20publishing%20the%20API%3Afalse\" ") @QueryParam("lifecycleChecklist") String lifecycleChecklist, @ApiParam(value = "Validator for conditional requests; based on ETag. " )@HeaderParam("If-Match") String ifMatch) throws APIManagementException{
return delegate.changeAPIProductLifecycle(action, apiProductId, lifecycleChecklist, ifMatch, securityContext);
}

Expand Down Expand Up @@ -305,7 +305,7 @@ public Response exportAPIProduct( @ApiParam(value = "API Product Name ") @Query
@Path("/{apiProductId}/documents/{documentId}/content")

@Produces({ "application/json" })
@ApiOperation(value = "Get the Content of an API Product Document", notes = "This operation can be used to retrive the content of an API's document. The document can be of 3 types. In each cases responses are different. 1. **Inline type**: The content of the document will be retrieved in `text/plain` content type _Sample cURL_ : `curl -k -H \"Authorization:Bearer 579f0af4-37be-35c7-81a4-f1f1e9ee7c51\" -F inlineContent=@\"docs.txt\" -X POST \"https://localhost:9443/api/am/publisher/v3/apis/995a4972-3178-4b17-a374-756e0e19127c/documents/43c2bcce-60e7-405f-bc36-e39c0c5e189e/content` 2. **FILE type**: The file will be downloaded with the related content type (eg. `application/pdf`) 3. **URL type**: The client will recieve the URL of the document as the Location header with the response with - `303 See Other` ", response = Void.class, authorizations = {
@ApiOperation(value = "Get the Content of an API Product Document", notes = "This operation can be used to retrive the content of an API's document. The document can be of 3 types. In each cases responses are different. 1. **Inline type**: The content of the document will be retrieved in `text/plain` content type _Sample cURL_ : `curl -k -H \"Authorization:Bearer 579f0af4-37be-35c7-81a4-f1f1e9ee7c51\" -F inlineContent=@\"docs.txt\" -X POST \"https://localhost:9443/api/am/publisher/v4/apis/995a4972-3178-4b17-a374-756e0e19127c/documents/43c2bcce-60e7-405f-bc36-e39c0c5e189e/content` 2. **FILE type**: The file will be downloaded with the related content type (eg. `application/pdf`) 3. **URL type**: The client will recieve the URL of the document as the Location header with the response with - `303 See Other` ", response = Void.class, authorizations = {
@Authorization(value = "OAuth2Security", scopes = {
@AuthorizationScope(scope = "apim:api_view", description = "View API"),
@AuthorizationScope(scope = "apim:api_publish", description = "Publish API"),
Expand Down
Expand Up @@ -297,7 +297,7 @@ public Response apisApiIdEnvironmentsEnvIdKeysPut(@ApiParam(value = "**API ID**
@ApiResponse(code = 404, message = "Not Found. The specified resource does not exist.", response = ErrorDTO.class),
@ApiResponse(code = 409, message = "Conflict. Specified resource already exists.", response = ErrorDTO.class),
@ApiResponse(code = 412, message = "Precondition Failed. The request has not been performed because one of the preconditions is not met.", response = ErrorDTO.class) })
public Response changeAPILifecycle( @NotNull @ApiParam(value = "The action to demote or promote the state of the API. Supported actions are [ **Publish**, **Deploy as a Prototype**, **Demote to Created**, **Block**, **Deprecate**, **Re-Publish**, **Retire** ] ",required=true, allowableValues="Publish, Deploy as a Prototype, Demote to Created, Block, Deprecate, Re-Publish, Retire") @QueryParam("action") String action, @NotNull @ApiParam(value = "**API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. Should be formatted as **provider-name-version**. ",required=true) @QueryParam("apiId") String apiId, @ApiParam(value = " Supported checklist items are as follows. 1. **Deprecate old versions after publishing the API**: Setting this to true will deprecate older versions of a particular API when it is promoted to Published state from Created state. 2. **Requires re-subscription when publishing the API**: If you set this to true, users need to re subscribe to the API although they may have subscribed to an older version. You can specify additional checklist items by using an **\"attribute:\"** modifier. Eg: \"Deprecate old versions after publishing the API:true\" will deprecate older versions of a particular API when it is promoted to Published state from Created state. Multiple checklist items can be given in \"attribute1:true, attribute2:false\" format. **Sample CURL :** curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v3/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish&lifecycleChecklist=Deprecate%20old%20versions%20after%20publishing%20the%20API%3Atrue,Requires%20re-subscription%20when%20publishing%20the%20API%3Afalse\" ") @QueryParam("lifecycleChecklist") String lifecycleChecklist, @ApiParam(value = "Validator for conditional requests; based on ETag. " )@HeaderParam("If-Match") String ifMatch) throws APIManagementException{
public Response changeAPILifecycle( @NotNull @ApiParam(value = "The action to demote or promote the state of the API. Supported actions are [ **Publish**, **Deploy as a Prototype**, **Demote to Created**, **Block**, **Deprecate**, **Re-Publish**, **Retire** ] ",required=true, allowableValues="Publish, Deploy as a Prototype, Demote to Created, Block, Deprecate, Re-Publish, Retire") @QueryParam("action") String action, @NotNull @ApiParam(value = "**API ID** consisting of the **UUID** of the API. The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. Should be formatted as **provider-name-version**. ",required=true) @QueryParam("apiId") String apiId, @ApiParam(value = " Supported checklist items are as follows. 1. **Deprecate old versions after publishing the API**: Setting this to true will deprecate older versions of a particular API when it is promoted to Published state from Created state. 2. **Requires re-subscription when publishing the API**: If you set this to true, users need to re subscribe to the API although they may have subscribed to an older version. You can specify additional checklist items by using an **\"attribute:\"** modifier. Eg: \"Deprecate old versions after publishing the API:true\" will deprecate older versions of a particular API when it is promoted to Published state from Created state. Multiple checklist items can be given in \"attribute1:true, attribute2:false\" format. **Sample CURL :** curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v4/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish&lifecycleChecklist=Deprecate%20old%20versions%20after%20publishing%20the%20API%3Atrue,Requires%20re-subscription%20when%20publishing%20the%20API%3Afalse\" ") @QueryParam("lifecycleChecklist") String lifecycleChecklist, @ApiParam(value = "Validator for conditional requests; based on ETag. " )@HeaderParam("If-Match") String ifMatch) throws APIManagementException{
return delegate.changeAPILifecycle(action, apiId, lifecycleChecklist, ifMatch, securityContext);
}

Expand Down Expand Up @@ -704,7 +704,7 @@ public Response getAPIClientCertificates(@ApiParam(value = "**API ID** consistin
@Path("/{apiId}/documents/{documentId}/content")

@Produces({ "application/octet-stream", "application/json" })
@ApiOperation(value = "Get the Content of an API Document", notes = "This operation can be used to retrive the content of an API's document. The document can be of 3 types. In each cases responses are different. 1. **Inline type**: The content of the document will be retrieved in `text/plain` content type _Sample cURL_ : `curl -k -H \"Authorization:Bearer 579f0af4-37be-35c7-81a4-f1f1e9ee7c51\" -F inlineContent=@\"docs.txt\" -X POST \"https://localhost:9443/api/am/publisher/v3/apis/995a4972-3178-4b17-a374-756e0e19127c/documents/43c2bcce-60e7-405f-bc36-e39c0c5e189e/content` 2. **FILE type**: The file will be downloaded with the related content type (eg. `application/pdf`) 3. **URL type**: The client will recieve the URL of the document as the Location header with the response with - `303 See Other` ", response = String.class, authorizations = {
@ApiOperation(value = "Get the Content of an API Document", notes = "This operation can be used to retrive the content of an API's document. The document can be of 3 types. In each cases responses are different. 1. **Inline type**: The content of the document will be retrieved in `text/plain` content type _Sample cURL_ : `curl -k -H \"Authorization:Bearer 579f0af4-37be-35c7-81a4-f1f1e9ee7c51\" -F inlineContent=@\"docs.txt\" -X POST \"https://localhost:9443/api/am/publisher/v4/apis/995a4972-3178-4b17-a374-756e0e19127c/documents/43c2bcce-60e7-405f-bc36-e39c0c5e189e/content` 2. **FILE type**: The file will be downloaded with the related content type (eg. `application/pdf`) 3. **URL type**: The client will recieve the URL of the document as the Location header with the response with - `303 See Other` ", response = String.class, authorizations = {
@Authorization(value = "OAuth2Security", scopes = {
@AuthorizationScope(scope = "apim:api_view", description = "View API"),
@AuthorizationScope(scope = "apim:api_manage", description = "Manage all API related operations"),
Expand Down
Expand Up @@ -98,7 +98,7 @@ public Response getSubscriptionUsage(@ApiParam(value = "Subscription Id ",requir


@Produces({ "application/json" })
@ApiOperation(value = "Get all Subscriptions", notes = "This operation can be used to retrieve a list of subscriptions of the user associated with the provided access token. This operation is capable of 1. Retrieving all subscriptions for the user's APIs. `GET https://127.0.0.1:9443/api/am/publisher/v3/subscriptions` 2. Retrieving subscriptions for a specific API. `GET https://127.0.0.1:9443/api/am/publisher/v3/subscriptions?apiId=c43a325c-260b-4302-81cb-768eafaa3aed` ", response = SubscriptionListDTO.class, authorizations = {
@ApiOperation(value = "Get all Subscriptions", notes = "This operation can be used to retrieve a list of subscriptions of the user associated with the provided access token. This operation is capable of 1. Retrieving all subscriptions for the user's APIs. `GET https://127.0.0.1:9443/api/am/publisher/v4/subscriptions` 2. Retrieving subscriptions for a specific API. `GET https://127.0.0.1:9443/api/am/publisher/v4/subscriptions?apiId=c43a325c-260b-4302-81cb-768eafaa3aed` ", response = SubscriptionListDTO.class, authorizations = {
@Authorization(value = "OAuth2Security", scopes = {
@AuthorizationScope(scope = "apim:api_view", description = "View API"),
@AuthorizationScope(scope = "apim:subscription_view", description = "View Subscription"),
Expand Down

0 comments on commit f03f40b

Please sign in to comment.