diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml
index 9ec68e7315e..c99c9d1988a 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml
@@ -48,42 +48,10 @@
cxf-bundle-jaxrsprovided
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
org.codehaus.jacksonjackson-jaxrs
-
-
-
-
-
-
-
-
-
-
commons-httpclient.wso2commons-httpclient
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java
index 96d3c8e059f..702db645279 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java
@@ -27,8 +27,6 @@ import org.wso2.carbon.apimgt.application.extension.api.util.RegistrationProfile
import org.wso2.carbon.apimgt.application.extension.constants.ApiApplicationConstants;
import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey;
import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException;
-//import org.wso2.carbon.apimgt.integration.client.OAuthRequestInterceptor;
-//import org.wso2.carbon.apimgt.integration.client.store.StoreClient;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml
index 9e70ed30091..3f0f92602b9 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml
@@ -51,23 +51,13 @@
org.wso2.carbonorg.wso2.carbon.logging
-
-
-
-
-
-
-
-
org.wso2.carbon.apimgtorg.wso2.carbon.apimgt.api
- 9.0.5org.wso2.carbon.apimgtorg.wso2.carbon.apimgt.impl
- 9.0.5provided
@@ -117,24 +107,30 @@
API Management Application Bundleorg.wso2.carbon.apimgt.application.extension.internal
- org.apache.commons.lang;version="[2.6,3)",org.apache.c
- ommons.logging;version="[1.2,2)",org.json.simple,org.osgi.framework;v
- ersion="${imp.package.version.osgi.framework}",org.osgi.service.component;version="${imp.package.version.osgi.service}",org.wso
- 2.carbon.apimgt.api;version="[9.0,10)",org.wso2.carbon.apimgt.api.dto
- ;version="[9.0,10)",org.wso2.carbon.apimgt.api.model;version="[9.0,10
- )",org.wso2.carbon.apimgt.application.extension.bean,org.wso2.carbon.
- apimgt.application.extension.dto,org.wso2.carbon.apimgt.application.e
- xtension.exception,org.wso2.carbon.apimgt.impl;version="[9.0,10)",org
- .wso2.carbon.apimgt.impl.utils;version="[9.0,10)",org.wso2.carbon.con
- text;version="[4.6,5)",org.wso2.carbon.device.mgt.core.config.ui;vers
- ion="[4.1,5)",org.wso2.carbon.identity.jwt.client.extension,org.wso2.
- carbon.identity.jwt.client.extension.dto,org.wso2.carbon.identity.jwt
- .client.extension.exception,org.wso2.carbon.identity.jwt.client.exten
- sion.service,org.wso2.carbon.registry.core.exceptions;version="[1.0,2
- )",org.wso2.carbon.registry.core.service;version="[1.0,2)",org.wso2.c
- arbon.registry.indexing.service;version="[4.7,5)",org.wso2.carbon.use
- r.api;version="[1.0,2)",org.wso2.carbon.user.core.service;version="[4
- .6,5)",org.wso2.carbon.user.core.tenant;version="[4.6,5)"
+ org.apache.commons.lang;version="[2.6,3)",
+ org.apache.commons.logging;version="[1.2,2)",
+ org.json.simple,org.osgi.framework;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.component;version="${imp.package.version.osgi.service}",
+ org.wso2.carbon.apimgt.api;version="[9.0,10)",
+ org.wso2.carbon.apimgt.api.dto;version="[9.0,10)",
+ org.wso2.carbon.apimgt.api.model;version="[9.0,10)",
+ org.wso2.carbon.apimgt.application.extension.bean,
+ org.wso2.carbon.apimgt.application.extension.dto,
+ org.wso2.carbon.apimgt.application.extension.exception,
+ org.wso2.carbon.apimgt.impl;version="[9.0,10)",
+ org.wso2.carbon.apimgt.impl.utils;version="[9.0,10)",
+ org.wso2.carbon.context;version="[4.6,5)",
+ org.wso2.carbon.device.mgt.core.config.ui;version="[4.1,5)",
+ org.wso2.carbon.identity.jwt.client.extension,
+ org.wso2.carbon.identity.jwt.client.extension.dto,
+ org.wso2.carbon.identity.jwt.client.extension.exception,
+ org.wso2.carbon.identity.jwt.client.extension.service,
+ org.wso2.carbon.registry.core.exceptions;version="[1.0,2)",
+ org.wso2.carbon.registry.core.service;version="[1.0,2)",
+ org.wso2.carbon.registry.indexing.service;version="[4.7,5)",
+ org.wso2.carbon.user.api;version="[1.0,2)",
+ org.wso2.carbon.user.core.service;version="[4.6,5)",
+ org.wso2.carbon.user.core.tenant;version="[4.6,5)"
!org.wso2.carbon.apimgt.application.extension.internal,
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java
index 67fe9e25839..d1bc3911b6e 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java
@@ -21,8 +21,6 @@ package org.wso2.carbon.apimgt.application.extension;
import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey;
import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException;
import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
-//import org.wso2.carbon.apimgt.integration.client.store.StoreClient;
-//import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
/**
* This comprise on operation that is been done with api manager from CDMF. This service needs to be implemented in APIM.
@@ -62,11 +60,10 @@ public interface APIManagementProviderService {
* @param username to whom the application is created
* @param isAllowedAllDomains application is allowed to all the tenants
* @param validityTime validity period of the application
-// * @param storeClient Specified store client
+ * @param scopes scopes
* @return consumerkey and secrete of the created application.
* @throws APIManagerException
*/
-
ApiApplicationKey generateAndRetrieveApplicationKeys(String apiApplicationName,
String tags[],
String keyType,
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java
index cc385dff442..3b46ace15f0 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java
@@ -18,20 +18,17 @@
package org.wso2.carbon.apimgt.application.extension;
-//import feign.FeignException;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.apimgt.api.APIAdmin;
import org.wso2.carbon.apimgt.api.APIConsumer;
import org.wso2.carbon.apimgt.api.APIManagementException;
-import org.wso2.carbon.apimgt.api.APIProvider;
import org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO;
import org.wso2.carbon.apimgt.api.model.API;
import org.wso2.carbon.apimgt.api.model.APIKey;
import org.wso2.carbon.apimgt.api.model.ApiTypeWrapper;
import org.wso2.carbon.apimgt.api.model.Application;
-import org.wso2.carbon.apimgt.api.model.KeyManagerConfiguration;
import org.wso2.carbon.apimgt.api.model.SubscribedAPI;
import org.wso2.carbon.apimgt.api.model.Subscriber;
import org.wso2.carbon.apimgt.application.extension.bean.APIRegistrationProfile;
@@ -43,17 +40,6 @@ import org.wso2.carbon.apimgt.application.extension.util.APIManagerUtil;
import org.wso2.carbon.apimgt.impl.APIAdminImpl;
import org.wso2.carbon.apimgt.impl.APIConstants;
import org.wso2.carbon.apimgt.impl.APIManagerFactory;
-//import org.wso2.carbon.apimgt.integration.client.OAuthRequestInterceptor;
-//import org.wso2.carbon.apimgt.integration.client.store.StoreClient;
-//import org.wso2.carbon.apimgt.integration.generated.client.store.model.APIInfo;
-//import org.wso2.carbon.apimgt.integration.generated.client.store.model.APIList;
-//import org.wso2.carbon.apimgt.integration.generated.client.store.model.Application;
-//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationInfo;
-//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationKey;
-//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationKeyGenerateRequest;
-//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationList;
-//import org.wso2.carbon.apimgt.integration.generated.client.store.model.Subscription;
-//import org.wso2.carbon.apimgt.integration.generated.client.store.model.SubscriptionList;
import org.wso2.carbon.apimgt.impl.utils.APIUtil;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.core.config.ui.UIConfiguration;
@@ -66,7 +52,6 @@ import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -78,66 +63,34 @@ import java.util.Set;
public class APIManagementProviderServiceImpl implements APIManagementProviderService {
private static final Log log = LogFactory.getLog(APIManagementProviderServiceImpl.class);
- private static final String CONTENT_TYPE = "application/json";
- private static final int MAX_API_PER_TAG = 200;
- private static final String APP_TIER_TYPE = "application";
public static final APIManagerFactory API_MANAGER_FACTORY = APIManagerFactory.getInstance();
@Override
public boolean isTierLoaded() {
-// StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService()
-// .getStoreClient();
- String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext()
- .getTenantDomain();
-// String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
-// try {
+
+ String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
+
try {
APIUtil.getTiers(APIConstants.TIER_APPLICATION_TYPE, tenantDomain);
+ return true;
} catch (APIManagementException e) {
log.error("APIs not ready", e);
}
- // storeClient.getIndividualTier().tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER,
-// APP_TIER_TYPE,
-// tenantDomain, CONTENT_TYPE, null, null);
- return true;
-// } catch (FeignException e) {
-// log.error("Feign Exception", e);
-// if (e.status() == 401) {
-// OAuthRequestInterceptor oAuthRequestInterceptor = new OAuthRequestInterceptor();
-// String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
-// oAuthRequestInterceptor.removeToken(username, tenantDomain);
-// try {
-// storeClient.getIndividualTier().tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER,
-// APP_TIER_TYPE, tenantDomain, CONTENT_TYPE, null, null);
-// } catch (FeignException ex) {
-// log.error("Invalid Attempt : " + ex);
-// }
-// }
-// } catch (Exception e) {
-// log.error("APIs not ready", e);
-// }
-// return false;
+
+ return false;
}
@Override
public void removeAPIApplication(String applicationName, String username) throws APIManagerException {
-// StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService()
-// .getStoreClient();
-// ApplicationList applicationList = storeClient.getApplications()
-// .applicationsGet("", applicationName, 1, 0, CONTENT_TYPE, null);
try {
APIConsumer apiConsumer = API_MANAGER_FACTORY.getAPIConsumer(username);
Application application = apiConsumer.getApplicationsByName(username, applicationName, "");
if (application != null) {
-// ApplicationInfo applicationInfo = applicationList.getList().get(0);
-// storeClient.getIndividualApplication().applicationsApplicationIdDelete(applicationInfo.getApplicationId(),
-// null, null);
apiConsumer.removeApplication(application, username);
}
} catch (APIManagementException e) {
- //todo:amalka
- e.printStackTrace();
+ throw new APIManagerException("Failed to remove api application : " + applicationName, e);
}
@@ -148,9 +101,8 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
*/
@Override
public synchronized ApiApplicationKey generateAndRetrieveApplicationKeys(String applicationName, String tags[],
- String keyType, String username,
- boolean isAllowedAllDomains,
- String validityTime, String scopes) throws APIManagerException {
+ String keyType, String username, boolean isAllowedAllDomains, String validityTime, String scopes)
+ throws APIManagerException {
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
if (StringUtils.isEmpty(username)) {
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java
index 368fda3a3b2..26f0320974d 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java
@@ -18,7 +18,6 @@
package org.wso2.carbon.apimgt.application.extension.internal;
import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService;
-//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService;
import org.wso2.carbon.registry.core.service.TenantRegistryLoader;
@@ -35,7 +34,6 @@ public class APIApplicationManagerExtensionDataHolder {
private TenantManager tenantManager;
private TenantRegistryLoader tenantRegistryLoader;
private TenantIndexingLoader indexLoader;
-// private IntegrationClientService integrationClientService;
private JWTClientManagerService jwtClientManagerService;
private APIApplicationManagerExtensionDataHolder() {
@@ -94,15 +92,6 @@ public class APIApplicationManagerExtensionDataHolder {
return indexLoader;
}
-// public IntegrationClientService getIntegrationClientService() {
-// return integrationClientService;
-// }
-//
-// public void setIntegrationClientService(
-// IntegrationClientService integrationClientService) {
-// this.integrationClientService = integrationClientService;
-// }
-
public JWTClientManagerService getJwtClientManagerService() {
if (jwtClientManagerService == null) {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java
index 4d985279569..d2c675c253c 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java
@@ -23,7 +23,6 @@ import org.osgi.framework.BundleContext;
import org.osgi.service.component.ComponentContext;;
import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService;
import org.wso2.carbon.apimgt.application.extension.APIManagementProviderServiceImpl;
-//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
import org.wso2.carbon.registry.core.service.TenantRegistryLoader;
import org.wso2.carbon.registry.indexing.service.TenantIndexingLoader;
import org.wso2.carbon.user.core.service.RealmService;
@@ -91,17 +90,6 @@ public class APIApplicationManagerExtensionServiceComponent {
APIApplicationManagerExtensionDataHolder.getInstance().setIndexLoaderService(null);
}
-// protected void setIntegrationClientService(IntegrationClientService integrationClientService) {
-// if (integrationClientService != null && log.isDebugEnabled()) {
-// log.debug("integrationClientService initialized");
-// }
-// APIApplicationManagerExtensionDataHolder.getInstance().setIntegrationClientService(integrationClientService);
-// }
-//
-// protected void unsetIntegrationClientService(IntegrationClientService integrationClientService) {
-// APIApplicationManagerExtensionDataHolder.getInstance().setIntegrationClientService(null);
-// }
-
/**
* Sets Realm Service.
*
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml
index 0784f282aaa..eeddf628a54 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml
@@ -47,39 +47,46 @@
org.wso2.carbon.apimgt.integration.client.*,
!org.wso2.carbon.apimgt.integration.client.internal
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ org.osgi.framework,
+ org.osgi.service.component,
+ feign,
+ feign.codec,
+ feign.auth,
+ feign.gson,
+ feign.slf4j,
+ org.wso2.carbon.apimgt.integration.generated.client.publisher.api,
+ org.wso2.carbon.apimgt.integration.generated.client.store.api,
+ javax.xml.bind,
+ javax.xml.bind.annotation,
+ javax.xml.parsers;resolution:=optional,
+ org.apache.commons.logging,
+ org.w3c.dom,
+ org.wso2.carbon.context,
+ org.wso2.carbon.identity.jwt.client.*,
+ org.wso2.carbon.user.api,
+ org.wso2.carbon.utils,
+ com.fasterxml.jackson.annotation,
+ io.swagger.annotations,
+ org.wso2.carbon.core.util,
+ javax.xml,
+ org.wso2.carbon.base,
+ javax.net.ssl,
+ org.apache.commons.lang,
+ android.util;resolution:=optional,
+ javax.annotation;resolution:=optional,
+ javax.net;resolution:=optional,
+ javax.security.auth.x500;resolution:=optional,
+ javax.crypto;resolution:=optional,
+ javax.crypto.spec;resolution:=optional
+
+
+ jsr311-api,
+ feign-jaxrs,
+ feign-okhttp,
+ okhttp,
+ okio
+
@@ -113,60 +120,55 @@
-
-
-
-
-
-
-
-
+
+ com.squareup.okhttp3
+ okhttp
+
+
+ com.squareup.okio
+ okio
+ io.github.openfeignfeign-okhttp
-
- io.github.openfeign
- feign-slf4j
- 10.7.2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ org.wso2.carbon
+ org.wso2.carbon.logging
+
+
+ org.eclipse.osgi
+ org.eclipse.osgi
+
+
+ org.eclipse.osgi
+ org.eclipse.osgi.services
+
+
+ com.google.code.gson
+ gson
+
+
+ javax.ws.rs
+ jsr311-api
+
-
-
-
-
-
-
-
-
+
+ io.swagger
+ swagger-annotations
+
+
+ junit
+ junit
+ io.github.openfeignfeign-core
-
-
-
-
+
+ io.github.openfeign
+ feign-jackson
+ io.github.openfeignfeign-jaxrs
@@ -176,10 +178,10 @@
feign-gson
-
-
-
-
+
+ org.testng
+ testng
+ org.wso2.carbon.devicemgtorg.wso2.carbon.identity.jwt.client.extension
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java
index 73a4234a910..3887d59c661 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java
@@ -27,8 +27,7 @@ import feign.slf4j.Slf4jLogger;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.apimgt.integration.client.configs.APIMConfigReader;
-import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.ApIsApi;
-import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.ApiLifecycleApi;
+import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.*;
import org.wso2.carbon.core.util.Utils;
/**
@@ -37,15 +36,13 @@ import org.wso2.carbon.core.util.Utils;
public class PublisherClient {
private static final Log log = LogFactory.getLog(PublisherClient.class);
- private ApIsApi apIsApi = null;
- private ApiLifecycleApi apiLifecycleApi = null;
-// private APIIndividualApi api = null;
-// private APICollectionApi apis = null;
-// private DocumentIndividualApi document = null;
-// private ApplicationIndividualApi application = null;
-// private EnvironmentCollectionApi environments = null;
-// private SubscriptionApi subscriptions = null;
-// private ThrottlingTierCollectionApi tiers = null;
+ private APIIndividualApi api = null;
+ private APICollectionApi apis = null;
+ private DocumentIndividualApi document = null;
+ private ApplicationIndividualApi application = null;
+ private EnvironmentCollectionApi environments = null;
+ private SubscriptionCollectionApi subscriptions = null;
+ private ThrottlingTierCollectionApi tiers = null;
/**
@@ -60,50 +57,40 @@ public class PublisherClient {
.requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder());
String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getPublisherEndpoint());
- apIsApi = builder.target(ApIsApi.class, basePath);
- apiLifecycleApi = builder.target(ApiLifecycleApi.class, basePath);
-// api = builder.target(APIIndividualApi.class, basePath);
-// apis = builder.target(APICollectionApi.class, basePath);
-// document = builder.target(DocumentIndividualApi.class, basePath);
-// application = builder.target(ApplicationIndividualApi.class, basePath);
-// environments = builder.target(EnvironmentCollectionApi.class, basePath);
-// subscriptions = builder.target(SubscriptionCollectionApi.class, basePath);
-// tiers = builder.target(ThrottlingTierCollectionApi.class, basePath);
+ api = builder.target(APIIndividualApi.class, basePath);
+ apis = builder.target(APICollectionApi.class, basePath);
+ document = builder.target(DocumentIndividualApi.class, basePath);
+ application = builder.target(ApplicationIndividualApi.class, basePath);
+ environments = builder.target(EnvironmentCollectionApi.class, basePath);
+ subscriptions = builder.target(SubscriptionCollectionApi.class, basePath);
+ tiers = builder.target(ThrottlingTierCollectionApi.class, basePath);
}
- public ApIsApi getApIsApi() {
- return apIsApi;
+ public APIIndividualApi getApi() {
+ return api;
}
- public ApiLifecycleApi getApiLifecycleApi() {
- return apiLifecycleApi;
+ public APICollectionApi getApis() {
+ return apis;
}
- // public APIIndividualApi getApi() {
-// return api;
-// }
-//
-// public APICollectionApi getApis() {
-// return apis;
-// }
-//
-// public DocumentIndividualApi getDocument() {
-// return document;
-// }
-//
-// public ApplicationIndividualApi getApplication() {
-// return application;
-// }
-//
-// public EnvironmentCollectionApi getEnvironments() {
-// return environments;
-// }
-//
-// public SubscriptionCollectionApi getSubscriptions() {
-// return subscriptions;
-// }
-//
-// public ThrottlingTierCollectionApi getTiers() {
-// return tiers;
-// }
+ public DocumentIndividualApi getDocument() {
+ return document;
+ }
+
+ public ApplicationIndividualApi getApplication() {
+ return application;
+ }
+
+ public EnvironmentCollectionApi getEnvironments() {
+ return environments;
+ }
+
+ public SubscriptionCollectionApi getSubscriptions() {
+ return subscriptions;
+ }
+
+ public ThrottlingTierCollectionApi getTiers() {
+ return tiers;
+ }
}
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java
index 5d8a46d5868..db751f204e8 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java
@@ -39,17 +39,16 @@ import java.util.concurrent.TimeUnit;
public class StoreClient {
private static final org.apache.commons.logging.Log log = LogFactory.getLog(StoreClient.class);
- private ApplicationsApi applicationsApi = null;
-// private APICollectionApi apis = null;
-// private ApIsApi individualApi = null;
-// private ApplicationsApi applications = null;
-// private ApplicationIndividualApi individualApplication = null;
-// private SubscriptionCollectionApi subscriptions = null;
-// private SubscriptionIndividualApi individualSubscription = null;
-// private SubscriptionMultitpleApi subscriptionMultitpleApi = null;
-// private ThrottlingTierIndividualApi individualTier = null;
-// private TagsApi tags = null;
-// private ThrottlingTierCollectionApi tiers = null;
+ private APICollectionApi apis = null;
+ private APIIndividualApi individualApi = null;
+ private ApplicationCollectionApi applications = null;
+ private ApplicationIndividualApi individualApplication = null;
+ private SubscriptionCollectionApi subscriptions = null;
+ private SubscriptionIndividualApi individualSubscription = null;
+ private SubscriptionMultitpleApi subscriptionMultitpleApi = null;
+ private ThrottlingTierIndividualApi individualTier = null;
+ private TagCollectionApi tags = null;
+ private ThrottlingTierCollectionApi tiers = null;
public StoreClient(RequestInterceptor requestInterceptor) {
@@ -61,59 +60,58 @@ public class StoreClient {
.requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder());
String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getStoreEndpoint());
- applicationsApi = builder.target(ApplicationsApi.class, basePath);
-// apis = builder.target(APICollectionApi.class, basePath);
-// individualApi = builder.target(ApIsApi.class, basePath);
-// applications = builder.target(ApplicationCollectionApi.class, basePath);
-// individualApplication = builder.target(ApplicationIndividualApi.class, basePath);
-// subscriptions = builder.target(SubscriptionCollectionApi.class, basePath);
-// individualSubscription = builder.target(SubscriptionIndividualApi.class, basePath);
-// subscriptionMultitpleApi = builder.target(SubscriptionMultitpleApi.class, basePath);
-// tags = builder.target(TagCollectionApi.class, basePath);
-// individualTier = builder.target(ThrottlingTierIndividualApi.class, basePath);
-// tiers = builder.retryer(new Retryer.Default(100L, TimeUnit.SECONDS.toMillis(1L), 1))
-// .options(new Request.Options(10000, 5000))
-// .target(ThrottlingTierCollectionApi.class, basePath);
+ apis = builder.target(APICollectionApi.class, basePath);
+ individualApi = builder.target(APIIndividualApi.class, basePath);
+ applications = builder.target(ApplicationCollectionApi.class, basePath);
+ individualApplication = builder.target(ApplicationIndividualApi.class, basePath);
+ subscriptions = builder.target(SubscriptionCollectionApi.class, basePath);
+ individualSubscription = builder.target(SubscriptionIndividualApi.class, basePath);
+ subscriptionMultitpleApi = builder.target(SubscriptionMultitpleApi.class, basePath);
+ tags = builder.target(TagCollectionApi.class, basePath);
+ individualTier = builder.target(ThrottlingTierIndividualApi.class, basePath);
+ tiers = builder.retryer(new Retryer.Default(100L, TimeUnit.SECONDS.toMillis(1L), 1))
+ .options(new Request.Options(10000, 5000))
+ .target(ThrottlingTierCollectionApi.class, basePath);
}
-// public APICollectionApi getApis() {
-// return apis;
-// }
-//
-// public APIIndividualApi getIndividualApi() {
-// return individualApi;
-// }
-//
-// public ApplicationCollectionApi getApplications() {
-// return applications;
-// }
-//
-// public ApplicationIndividualApi getIndividualApplication() {
-// return individualApplication;
-// }
-//
-// public SubscriptionCollectionApi getSubscriptions() {
-// return subscriptions;
-// }
-//
-// public SubscriptionIndividualApi getIndividualSubscription() {
-// return individualSubscription;
-// }
-//
-// public ThrottlingTierIndividualApi getIndividualTier() {
-// return individualTier;
-// }
-//
-// public TagCollectionApi getTags() {
-// return tags;
-// }
-//
-// public ThrottlingTierCollectionApi getTiers() {
-// return tiers;
-// }
-//
-// public SubscriptionMultitpleApi getSubscriptionMultitpleApi() {
-// return subscriptionMultitpleApi;
-// }
+ public APICollectionApi getApis() {
+ return apis;
+ }
+
+ public APIIndividualApi getIndividualApi() {
+ return individualApi;
+ }
+
+ public ApplicationCollectionApi getApplications() {
+ return applications;
+ }
+
+ public ApplicationIndividualApi getIndividualApplication() {
+ return individualApplication;
+ }
+
+ public SubscriptionCollectionApi getSubscriptions() {
+ return subscriptions;
+ }
+
+ public SubscriptionIndividualApi getIndividualSubscription() {
+ return individualSubscription;
+ }
+
+ public ThrottlingTierIndividualApi getIndividualTier() {
+ return individualTier;
+ }
+
+ public TagCollectionApi getTags() {
+ return tags;
+ }
+
+ public ThrottlingTierCollectionApi getTiers() {
+ return tiers;
+ }
+
+ public SubscriptionMultitpleApi getSubscriptionMultitpleApi() {
+ return subscriptionMultitpleApi;
+ }
}
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml
index cc300b8014f..22c399e5b7e 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml
@@ -26,59 +26,61 @@
http://wso2.org
-
-
- org.openapitools
- openapi-generator-maven-plugin
- 5.0.0
-
-
- process-resources
- publisher
-
- generate
-
-
- ${project.basedir}/src/main/resources/publisher-api.yaml
- java
-
- ${project.artifactId}.publisher.api
- ${project.artifactId}.publisher.model
-
-
-
-
- process-resources
- store
-
- generate
-
-
- ${project.basedir}/src/main/resources/devportal-api.yaml
- java
-
- ${project.artifactId}.store.api
- ${project.artifactId}.store.model
-
-
-
-
-
+
+
+ io.swagger
+ swagger-codegen-maven-plugin
+ 2.2.1
+
+
+ process-resources
+ publisher
+
+ generate
+
+
+ ${project.basedir}/src/main/resources/publisher-api.yaml
+ java
+
+ ${project.artifactId}.publisher.api
+ ${project.artifactId}.publisher.model
+
+ feign
+
+
+
+ process-resources
+ store
+
+ generate
+
+
+ ${project.basedir}/src/main/resources/store-api.yaml
+ java
+
+ ${project.artifactId}.store.api
+ ${project.artifactId}.store.model
+
+ feign
+
+
+
+ com.google.code.maven-replacer-pluginreplacer1.5.2
-
+
process-resources
- replace-for-openapi-genenerated-code-publisher
+ replace-for-swagger-genenerated-code-publisherreplace
- ${project.basedir}/target/generated-sources/openapi/src/main/java/org/wso2/carbon/apimgt/integration/generated/client/publisher/model/API.java
+ ${project.basedir}/target/generated-sources/swagger/src/main/java/org/wso2/carbon/apimgt/integration/generated/client/publisher/model/API.javaCURRENT_TENANT
@@ -113,33 +115,28 @@
org.wso2.carbon.apimgt.integration.generated.client.store.api.*,
org.wso2.carbon.apimgt.integration.generated.client.store.model.*
-
- com.google.gson;version="[2.8,3)",
- com.google.gson.annotations;version="[2.8,3)",
- com.google.gson.internal.bind.util,
- com.google.gson.reflect;version="[2.8,3)",
- com.google.gson.stream;version="[2.8,3)",
- io.gsonfire;version="[1.8,2)",
- io.swagger.annotations;version="[1.5,2)",
- javax.annotation;version="[3.0,4)",
- javax.net.ssl,
- okhttp3,
- okhttp3.internal.http,
- okhttp3.internal.tls,
- okhttp3.logging,
- okio,
- org.apache.oltu.oauth2.client;version="[1.0,2)",
- org.apache.oltu.oauth2.client.request;version="[1.0,2)",
- org.apache.oltu.oauth2.client.response;version="[1.0,2)",
- org.apache.oltu.oauth2.common.exception;version="[1.0,2)",
- org.apache.oltu.oauth2.common.message.types;version="[1.0,2)",
- org.threeten.bp;version="[1.5,2)",
- org.threeten.bp.format;version="[1.5,2)",
- org.threeten.bp.temporal;version="[1.5,2)",
- org.wso2.carbon.apimgt.integration.generated.client.publisher.model,
- org.wso2.carbon.apimgt.integration.generated.client.store.model
-
-
+
+ feign;version="${io.github.openfeign.version.range}",
+ feign.jackson;version="${io.github.openfeign.version.range}",
+ feign.codec;version="${io.github.openfeign.version.range}",
+ feign.auth;version="${io.github.openfeign.version.range}",
+ feign.gson;version="${io.github.openfeign.version.range}",
+ feign.slf4j;version="${io.github.openfeign.version.range}",
+ com.google.gson,
+ com.fasterxml.jackson.core;resolution:=optional,
+ com.fasterxml.jackson.annotation,
+ com.fasterxml.jackson.databind;resolution:=optional,
+ io.swagger.annotations,
+ javax.net.ssl,
+ com.fasterxml.jackson.datatype.joda;resolution:=optional,
+ org.apache.oltu.oauth2.client.*;resolution:=optional,
+ org.apache.oltu.oauth2.common.*;resolution:=optional,
+ org.junit;resolution:=optional,
+
+
+ jsr311-api,
+ feign-jaxrs
+
@@ -148,105 +145,60 @@
-
-
- io.swagger.core.v3
- swagger-annotations
- 2.1.7
-
-
-
com.google.code.gsongson
- 2.8.5
-
-
-
-
+
+ javax.ws.rs
+ jsr311-api
+ io.swaggerswagger-annotations
-
- com.squareup.okhttp3
- okhttp
- 4.9.1
-
-
-
- org.apache.oltu.oauth2
- org.apache.oltu.oauth2.client
- 1.0.1
-
-
-
- com.squareup.okhttp3
- logging-interceptor
- 4.9.1
-
-
-
- org.threeten
- threetenbp
- 1.5.0
-
-
-
- io.gsonfire
- gson-fire
- 1.8.5
-
-
- io.swagger.parser.v3
- swagger-parser
- 2.0.25
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ junit
+ junit
+
+
+ io.github.openfeign
+ feign-core
+
+
+ io.github.openfeign
+ feign-jackson
+
+
+ io.github.openfeign
+ feign-jaxrs
+
+
+ io.github.openfeign
+ feign-gson
+
+
+ org.testng
+ testng
+
+
+ org.apache.oltu.oauth2
+ org.apache.oltu.oauth2.client
+
+
+ io.github.openfeign
+ feign-slf4j
+
+
+ org.wso2.orbit.com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson-databind.version}
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-joda
+ true
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml
index 76fdb6f92d9..b2068857a76 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml
@@ -1,122 +1,115 @@
-# Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
-#
-# 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.
-################################################################################
-openapi: 3.0.1
+
+swagger: '2.0'
+######################################################
+# Prolog
+######################################################
info:
- title: WSO2 API Manager - Publisher API
+ version: "0.12.0"
+ title: "WSO2 API Manager - Publisher API"
description: |
- This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**.
-
- # Authentication
- Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking
- the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps
- that you will need to follow to obtain an access token.
- First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types
- in the payload. A Sample payload is shown below.
- ```
- {
- "callbackUrl":"www.google.lk",
- "clientName":"rest_api_publisher",
- "owner":"admin",
- "grantType":"client_credentials password refresh_token",
- "saasApp":true
- }
- ```
- Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the
- base64 encoded admin username and password.
- **Format of the request**
- ```
- curl -X POST -H "Authorization: Basic Base64(admin_username:admin_password)" -H "Content-Type: application/json"
- \ -d @payload.json https://:/client-registration/v0.17/register
- ```
- **Sample request**
- ```
- curl -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json"
- \ -d @payload.json https://localhost:9443/client-registration/v0.17/register
- ```
- Following is a sample response after invoking the above curl.
- ```
- {
- "clientId": "fOCi4vNJ59PpHucC2CAYfYuADdMa",
- "clientName": "rest_api_publisher",
- "callBackURL": "www.google.lk",
- "clientSecret": "a4FwHlq0iCIKVs2MPIIDnepZnYMa",
- "isSaasApplication": true,
- "appOwner": "admin",
- "jsonString": "{\"grant_types\":\"client_credentials password refresh_token\",\"redirect_uris\":\"www.google.lk\",\"client_name\":\"rest_api123\"}",
- "jsonAppAttribute": "{}",
- "tokenType": null
- }
- ```
- Next you must use the above client id and secret to obtain the access token.
- We will be using the password grant type for this, you can use any grant type you desire.
- You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section
- of this document and scope for each resource is given in **authorization** section of resource documentation.
- Following is the format of the request if you are using the password grant type.
- ```
- curl -k -d "grant_type=password&username=&password="
- \ -H "Authorization: Basic base64(cliet_id:client_secret)"
- \ https://:/token
- ```
- **Sample request**
- ```
- curl https://localhost:8243/token -k \
- -H "Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h" \
- -d "grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create"
- ```
- Shown below is a sample response to the above request.
- ```
- {
- "access_token": "e79bda48-3406-3178-acce-f6e4dbdcbb12",
- "refresh_token": "a757795d-e69f-38b8-bd85-9aded677a97c",
- "scope": "apim:api_create apim:api_view",
- "token_type": "Bearer",
- "expires_in": 3600
- }
- ```
- Now you have a valid access token, which you can use to invoke an API.
- 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.
-
- # Try out in Postman
- If you want to try-out the embedded postman collection with "Run in Postman" option, please follow the guidelines listed below.
- * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes.
- * Make sure you have an API Manager instance up and running.
- * Update the `basepath` parameter to match the hostname and port of the APIM instance.
-
- [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9)
+ This specifies a **RESTful API** for WSO2 **API Manager** - Publisher.
+
+ Please see [full swagger definition](https://raw.githubusercontent.com/wso2/carbon-apimgt/v6.1.66/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher/src/main/resources/publisher-api.yaml) of the API which is written using [swagger 2.0](http://swagger.io/) specification.
contact:
- name: WSO2
- url: http://wso2.com/products/api-manager/
- email: architecture@wso2.com
+ name: "WSO2"
+ url: "http://wso2.com/products/api-manager/"
+ email: "architecture@wso2.com"
license:
- name: Apache 2.0
- url: http://www.apache.org/licenses/LICENSE-2.0.html
- version: v2
-servers:
- - url: https://apis.wso2.com/api/am/publisher/v2
-security:
- - OAuth2Security:
- - apim:api_view
+ name: "Apache 2.0"
+ url: "http://www.apache.org/licenses/LICENSE-2.0.html"
+
+######################################################
+# The fixed parts of the URLs of the API
+######################################################
+
+# The schemes supported by the API
+schemes:
+ - https
+
+# The domain of the API.
+# This is configured by the customer during deployment.
+# The given host is just an example.
+host: apis.wso2.com
+
+# The base path of the API.
+# Will be prefixed to all paths.
+basePath: /api/am/publisher/v0.12
+
+# The following media types can be passed as input in message bodies of the API.
+# The actual media type must be specified in the Content-Type header field of the request.
+# The default is json, i.e. the Content-Type header is not needed to
+# be set, but supporting it serves extensibility.
+consumes:
+ - application/json
+
+# The following media types may be passed as output in message bodies of the API.
+# The media type(s) consumable by the requestor is specified in the Accept header field
+# of the corresponding request.
+# The actual media type returned will be specfied in the Content-Type header field
+# of the of the response.
+# The default of the Accept header is json, i.e. there is not needed to
+# set the value, but supporting it serves extensibility.
+produces:
+ - application/json
+
+
+x-wso2-security:
+ apim:
+ x-wso2-scopes:
+ - description: ""
+ roles: admin
+ name: apim:api_view
+ key: apim:api_view
+ - description: ""
+ roles: admin
+ name: apim:api_create
+ key: apim:api_create
+ - description: ""
+ roles: admin
+ name: apim:api_publish
+ key: apim:api_publish
+ - description: ""
+ roles: admin
+ name: apim:tier_view
+ key: apim:tier_view
+ - description: ""
+ roles: admin
+ name: apim:tier_manage
+ key: apim:tier_manage
+ - description: ""
+ roles: admin
+ name: apim:subscription_view
+ key: apim:subscription_view
+ - description: ""
+ roles: admin
+ name: apim:subscription_block
+ key: apim:subscription_block
+ - description: ""
+ roles: admin
+ name: apim:mediation_policy_view
+ key: apim:mediation_policy_view
+ - description: ""
+ roles: admin
+ name: apim:api_workflow
+ key: apim:api_workflow
+
+
+######################################################
+# The "API Collection" resource APIs
+######################################################
paths:
- ######################################################
- # The "API Collection" resource APIs
- ######################################################
/apis:
+
+#-----------------------------------------------------
+# Retrieving the list of all APIs qualifying under a given search condition
+#-----------------------------------------------------
get:
- tags:
- - APIs
+ x-scope: apim:api_view
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/apis"
+ x-wso2-request: |
+ GET https://localhost:9443/api/am/publisher/v0.12/apis
+ Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
+ x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"previous\": \"\",\n \"list\": [\n {\n \"provider\": \"admin\",\n \"version\": \"1.0.0\",\n \"description\": \"This sample API provides Account Status Validation\",\n \"name\": \"AccountVal\",\n \"context\": \"/account\",\n \"id\": \"2e81f147-c8a8-4f68-b4f0-69e0e7510b01\",\n \"status\": \"PUBLISHED\"\n },\n {\n \"provider\": \"admin\",\n \"version\": \"1.0.0\",\n \"description\": null,\n \"name\": \"api1\",\n \"context\": \"/api1\",\n \"id\": \"3e22d2fb-277a-4e9e-8c7e-1c0f7f73960e\",\n \"status\": \"PUBLISHED\"\n }\n ],\n \"next\": \"\",\n \"count\": 2\n}"
summary: |
Retrieve/Search APIs
description: |
@@ -124,10 +117,9 @@ paths:
Each retrieved API is represented with a minimal amount of attributes. If you want to get complete details of an API, you need to use **Get details of an API** operation.
parameters:
- - $ref: '#/components/parameters/limit'
- - $ref: '#/components/parameters/offset'
- - $ref: '#/components/parameters/requestedTenant'
- - name: query
+ - $ref : '#/parameters/limit'
+ - $ref : '#/parameters/offset'
+ - name : query
in: query
description: |
**Search condition**.
@@ -135,11542 +127,3565 @@ paths:
You can search in attributes by using an **":"** modifier.
Eg.
- "provider:wso2" will match an API if the provider of the API contains "wso2".
- "provider:"wso2"" will match an API if the provider of the API is exactly "wso2".
- "status:PUBLISHED" will match an API if the API is in PUBLISHED state.
- "label:external" will match an API if it contains a Microgateway label called "external".
+ "provider:wso2" will match an API if the provider of the API is exactly "wso2".
+
+ Additionally you can use wildcards.
- Also you can use combined modifiers
Eg.
- name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1.
+ "provider:wso2*" will match an API if the provider of the API starts with "wso2".
- Supported attribute modifiers are [**version, context, name, status,
- description, subcontext, doc, provider, label**]
+ Supported attribute modifiers are [**version, context, status,
+ description, subcontext, doc, provider**]
If no advanced attribute modifier has been specified, the API names containing
the search term will be returned as a result.
- Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl)
- schema:
- type: string
- - $ref: '#/components/parameters/If-None-Match'
- - $ref: '#/components/parameters/expand'
- - $ref: '#/components/parameters/Accept'
+ type: string
+ - $ref : "#/parameters/Accept"
+ - $ref : "#/parameters/If-None-Match"
+ tags:
+ - API (Collection)
responses:
200:
description: |
OK.
List of qualifying APIs is returned.
+ schema:
+ $ref: '#/definitions/APIList'
headers:
+ Content-Type:
+ description: The content type of the body.
+ type: string
ETag:
description: |
Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
- Content-Type:
- description: The content type of the body.
- schema:
- type: string
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/APIList'
+ type: string
304:
description: |
Not Modified.
Empty body because the client has already the latest version of the requested resource (Will be supported in future).
- content: {}
406:
- $ref: '#/components/responses/NotAcceptable'
- security:
- - OAuth2Security:
- - apim:api_view
- - apim:api_import_export
- x-code-samples:
- - lang: Curl
- source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
- "https://127.0.0.1:9443/api/am/publisher/v2/apis"'
- x-examples:
- $ref: docs/examples/apis/apis_get.yaml
- operationId: getAllAPIs
+ description: |
+ Not Acceptable.
+ The requested media type is not supported
+ schema:
+ $ref: '#/definitions/Error'
+#-----------------------------------------------------
+# Create a new API -API (Individual)
+#-----------------------------------------------------
post:
- tags:
- - APIs
- summary: Create a New API
+ x-scope: apim:api_create
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json https://localhost:9443/api/am/publisher/v0.12/apis"
+ x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/apis\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\n\n{\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"PUBLISHED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": false,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"http\",\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 5000,\r\n \"production\": 1000\r\n },\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\": \"in\"},{\"name\":\"log_out_message\",\"type\": \"out\"}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}"
+ x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"integer\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"http\",\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 5000,\r\n \"production\": 1000\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\":\"in\",\"id\":\"142ece76-b208-4aab-b29a-f382045ed066\",\"shared\":false},{\"name\":\"log_out_message\",\"type\":\"out\",\"id\":\"b3527be8-95e6-41e0-8097-3276987b7d4b\",\"shared\":false}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}"
+ summary: Create a new API
description: |
This operation can be used to create a new API specifying the details of the API in the payload. The new API will be in `CREATED` state.
There is a special capability for a user who has `APIM Admin` permission such that he can create APIs on behalf of other users. For that he can to specify `"provider" : "some_other_user"` in the payload so that the API's creator will be shown as `some_other_user` in the UI.
parameters:
- - name: openAPIVersion
- in: query
- description: Open api version
+ - in: body
+ name: body
+ description: |
+ API object that needs to be added
+ required: true
schema:
- type: string
- default: v3
- enum:
- - v2
- - v3
- requestBody:
- description: API object that needs to be added
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/API'
- required: true
+ $ref: '#/definitions/API'
+ - $ref: '#/parameters/Content-Type'
+ - $ref: '#/parameters/Authorization'
+ tags:
+ - API (Individual)
responses:
201:
description: |
Created.
Successful response with the newly created object as entity in the body.
Location header contains URL of newly created entity.
+ schema:
+ $ref: '#/definitions/API'
headers:
- ETag:
- description: |
- Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
Location:
description: |
The URL of the newly created resource.
- schema:
- type: string
+ type: string
Content-Type:
description: |
The content type of the body.
- schema:
- type: string
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/API'
+ type: string
+ Authorization:
+ description: |
+ The brearer token.
+ type: string
+ ETag:
+ description: |
+ Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
+ type: string
400:
- $ref: '#/components/responses/BadRequest'
+ description: |
+ Bad Request.
+ Invalid request or validation error.
+ schema:
+ $ref: '#/definitions/Error'
415:
- $ref: '#/components/responses/UnsupportedMediaType'
- security:
- - OAuth2Security:
- - apim:api_create
- x-code-samples:
- - lang: Curl
- source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
- -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis"'
- x-examples:
- $ref: docs/examples/apis/apis_post.yaml
- operationId: createAPI
-
- ######################################################
- # The "Individual API" resource APIs
- ######################################################
+ description: |
+ Unsupported Media Type.
+ The entity of the request was in a not supported format.
+ schema:
+ $ref: '#/definitions/Error'
+
+######################################################
+# The "Individual API" resource APIs
+######################################################
/apis/{apiId}:
+
+#-----------------------------------------------------
+# Retrieve the details of an API definition
+#-----------------------------------------------------
get:
- tags:
- - APIs
- summary: Get Details of an API
+ x-scope: apim:api_view
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f"
+ x-wso2-request: |
+ GET https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f
+ Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
+ x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"http\",\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 5000,\r\n \"production\": 1000\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}"
+ summary: Get details of an API
description: |
Using this operation, you can retrieve complete details of a single API. You need to provide the Id of the API to retrive it.
parameters:
- - $ref: '#/components/parameters/apiId'
- - $ref: '#/components/parameters/requestedTenant'
- - $ref: '#/components/parameters/If-None-Match'
+ - $ref: '#/parameters/apiId'
+ - $ref: '#/parameters/Accept'
+ - $ref: '#/parameters/If-None-Match'
+ - $ref: '#/parameters/If-Modified-Since'
+ tags:
+ - API (Individual)
responses:
200:
description: |
OK.
Requested API is returned
headers:
+ Content-Type:
+ description: |
+ The content type of the body.
+ type: string
ETag:
description: |
Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
+ type: string
Last-Modified:
description: |
Date and time the resource has been modifed the last time.
Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
- Content-Type:
- description: |
- The content type of the body.
- schema:
- type: string
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/API'
+ type: string
+ schema:
+ $ref: '#/definitions/API'
304:
description: |
Not Modified.
Empty body because the client has already the latest version of the requested resource (Will be supported in future).
- content: {}
404:
- $ref: '#/components/responses/NotFound'
+ description: |
+ Not Found.
+ Requested API does not exist.
+ schema:
+ $ref: '#/definitions/Error'
406:
- $ref: '#/components/responses/NotAcceptable'
- security:
- - OAuth2Security:
- - apim:api_view
- - apim:api_import_export
- - apim:api_product_import_export
- x-code-samples:
- - lang: Curl
- source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
- "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f"'
- x-examples:
- $ref: docs/examples/apis/apis_id_get.yaml
- operationId: getAPI
+ description: |
+ Not Acceptable.
+ The requested media type is not supported
+ schema:
+ $ref: '#/definitions/Error'
+#-----------------------------------------------------
+# Update the definition of an API
+#-----------------------------------------------------
put:
- tags:
- - APIs
+ x-scope: apim:api_create
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X PUT -d @data.json https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f"
+ x-wso2-request: "PUT https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"integer\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\",\"chicken\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 500,\r\n \"production\": 100\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\": \"in\"},{\"name\":\"log_out_message\",\"type\": \"out\"}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}"
+ x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\"https\"],\r\n \"tags\": [\r\n \"chicken\",\r\n \"pizza\"\r\n ],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 500,\r\n \"production\": 100\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\":\"in\",\"id\":\"142ece76-b208-4aab-b29a-f382045ed066\",\"shared\":false},{\"name\":\"log_out_message\",\"type\":\"out\",\"id\":\"b3527be8-95e6-41e0-8097-3276987b7d4b\",\"shared\":false}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}"
summary: Update an API
description: |
This operation can be used to update an existing API.
But the properties `name`, `version`, `context`, `provider`, `state` will not be changed by this operation.
parameters:
- - $ref: '#/components/parameters/apiId'
- - $ref: '#/components/parameters/If-Match'
- requestBody:
- description: API object that needs to be added
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/API'
- required: true
+ - $ref: '#/parameters/apiId'
+ - in: body
+ name: body
+ description: |
+ API object that needs to be added
+ required: true
+ schema:
+ $ref: '#/definitions/API'
+ - $ref: '#/parameters/Content-Type'
+ - $ref: '#/parameters/If-Match'
+ - $ref: '#/parameters/If-Unmodified-Since'
+ tags:
+ - API (Individual)
responses:
200:
description: |
OK.
Successful response with updated API object
+ schema:
+ $ref: '#/definitions/API'
headers:
+ Location:
+ description: |
+ The URL of the newly created resource.
+ type: string
+ Content-Type:
+ description: |
+ The content type of the body.
+ type: string
ETag:
description: |
Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
+ type: string
Last-Modified:
description: |
Date and time the resource has been modifed the last time.
Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
- Location:
- description: |
- The URL of the newly created resource.
- schema:
- type: string
- Content-Type:
- description: |
- The content type of the body.
- schema:
- type: string
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/API'
+ type: string
400:
- $ref: '#/components/responses/BadRequest'
+ description: |
+ Bad Request.
+ Invalid request or validation error
+ schema:
+ $ref: '#/definitions/Error'
403:
- $ref: '#/components/responses/Forbidden'
+ description: |
+ Forbidden.
+ The request must be conditional but no condition has been specified.
+ schema:
+ $ref: '#/definitions/Error'
404:
- $ref: '#/components/responses/NotFound'
- 409:
- $ref: '#/components/responses/Conflict'
+ description: |
+ Not Found.
+ The resource to be updated does not exist.
+ schema:
+ $ref: '#/definitions/Error'
412:
- $ref: '#/components/responses/PreconditionFailed'
- security:
- - OAuth2Security:
- - apim:api_create
- - apim:api_publish
- x-code-samples:
- - lang: Curl
- source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
- -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f"'
- operationId: updateAPI
+ description: |
+ Precondition Failed.
+ The request has not been performed because one of the preconditions is not met.
+ schema:
+ $ref: '#/definitions/Error'
+#-----------------------------------------------------
+# Delete the definition of an API
+#-----------------------------------------------------
delete:
- tags:
- - APIs
+ x-scope: apim:api_create
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE https://localhost:9443/api/am/publisher/v0.12/apis/6fb74674-4ab8-4b52-9886-f9a376985060"
+ x-wso2-request: |
+ DELETE https://localhost:9443/api/am/publisher/v0.12/apis/6fb74674-4ab8-4b52-9886-f9a376985060
+ Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
+ x-wso2-response: "HTTP/1.1 200 OK"
summary: Delete an API
description: |
This operation can be used to delete an existing API proving the Id of the API.
parameters:
- - $ref: '#/components/parameters/apiId'
- - $ref: '#/components/parameters/If-Match'
+ - $ref: '#/parameters/apiId'
+ - $ref: '#/parameters/If-Match'
+ - $ref: '#/parameters/If-Unmodified-Since'
+ tags:
+ - API (Individual)
responses:
200:
description: |
OK.
Resource successfully deleted.
- content: {}
403:
- $ref: '#/components/responses/Forbidden'
+ description: |
+ Forbidden.
+ The request must be conditional but no condition has been specified.
+ schema:
+ $ref: '#/definitions/Error'
404:
- $ref: '#/components/responses/NotFound'
- 409:
- $ref: '#/components/responses/Conflict'
+ description: |
+ Not Found.
+ Resource to be deleted does not exist.
+ schema:
+ $ref: '#/definitions/Error'
412:
- $ref: '#/components/responses/PreconditionFailed'
- security:
- - OAuth2Security:
- - apim:api_delete
- - apim:api_import_export
- x-code-samples:
- - lang: Curl
- source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
- "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f"'
- operationId: deleteAPI
-
- /apis/{apiId}/topics:
- put:
- tags:
- - APIs
- summary: Update Topics
- description: This operation can be used to update topics of an existing API.
- operationId: updateTopics
- parameters:
- - $ref: '#/components/parameters/apiId'
- - $ref: '#/components/parameters/If-Match'
- requestBody:
- description: API object that needs to be added
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TopicList'
- required: true
- responses:
- 200:
description: |
- OK.
- Successful response with updated API object
- headers:
- ETag:
- description: |
- Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
- Last-Modified:
- description: |
- Date and time the resource has been modifed the last time.
- Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
- Location:
- description: |
- The URL of the newly created resource.
- schema:
- type: string
- Content-Type:
- description: |
- The content type of the body.
- schema:
- type: string
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/API'
+ Precondition Failed.
+ The request has not been performed because one of the preconditions is not met.
+ schema:
+ $ref: '#/definitions/Error'
- /apis/{apiId}/reimport-service:
- put:
- tags:
- - APIs
- summary: Update the Service that is used to create the API
- description: This operation can be used to re-import the Service used to create the API
- operationId: reimportServiceFromCatalog
- parameters:
- - $ref: '#/components/parameters/apiId'
- responses:
- 200:
- description: |
- OK.
- Successful response with updated API object
- headers:
- Location:
- description: |
- The URL of the newly created resource.
- schema:
- type: string
- Content-Type:
- description: |
- The content type of the body.
- schema:
- type: string
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/API'
- 404:
- $ref: '#/components/responses/NotFound'
- 500:
- $ref: '#/components/responses/InternalServerError'
+################################################################
+# The swagger resource of "Individual API" resource APIs
+################################################################
/apis/{apiId}/swagger:
- get:
- tags:
- - APIs
- summary: Get Swagger Definition
+#-----------------------------------------------------
+# Retrieve the API swagger definition
+#-----------------------------------------------------
+ get:
+ x-scope: apim:api_view
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/swagger"
+ x-wso2-request: |
+ GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/swagger
+ Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
+ x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\nContent-Length: 329\n\n{\n \"paths\": {\"/*\": {\"get\": {\n \"x-auth-type\": \"Application\",\n \"x-throttling-tier\": \"Unlimited\",\n \"responses\": {\"200\": {\"description\": \"OK\"}}\n }}},\n \"x-wso2-security\": {\"apim\": {\"x-wso2-scopes\": []}},\n \"swagger\": \"2.0\",\n \"info\": {\n \"title\": \"PhoneVerification\",\n \"description\": \"Verify a phone number\",\n \"contact\": {\n \"email\": \"xx@ee.com\",\n \"name\": \"xx\"\n },\n \"version\": \"1.0.0\"\n }\n}"
+ summary: Get swagger definition
description: |
This operation can be used to retrieve the swagger definition of an API.
parameters:
- - $ref: '#/components/parameters/apiId'
- - $ref: '#/components/parameters/If-None-Match'
+ - $ref: '#/parameters/apiId'
+ - $ref: '#/parameters/Accept'
+ - $ref: '#/parameters/If-None-Match'
+ - $ref: '#/parameters/If-Modified-Since'
+ tags:
+ - API (Individual)
responses:
200:
description: |
OK.
Requested swagger document of the API is returned
headers:
+ Content-Type:
+ description: |
+ The content type of the body.
+ type: string
ETag:
description: |
Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
+ type: string
Last-Modified:
description: |
Date and time the resource has been modifed the last time.
Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
- Content-Type:
- description: |
- The content type of the body.
- schema:
- type: string
- content:
- application/json:
- schema:
- type: string
- example: ""
+ type: string
304:
description: |
Not Modified.
Empty body because the client has already the latest version of the requested resource (Will be supported in future).
- content: {}
404:
- $ref: '#/components/responses/NotFound'
+ description: |
+ Not Found.
+ Requested API does not exist.
+ schema:
+ $ref: '#/definitions/Error'
406:
- $ref: '#/components/responses/NotAcceptable'
- security:
- - OAuth2Security:
- - apim:api_view
- x-code-samples:
- - lang: Curl
- source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
- "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f/swagger"'
- operationId: getAPISwagger
+ description: |
+ Not Acceptable.
+ The requested media type is not supported
+ schema:
+ $ref: '#/definitions/Error'
+#-----------------------------------------------------
+# Update the API swagger definition
+#-----------------------------------------------------
put:
- tags:
- - APIs
- summary: Update Swagger Definition
+ consumes:
+ - multipart/form-data
+ x-scope: apim:api_create
+ x-wso2-curl: "curl -k -H \"Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013\" -F apiDefinition=\"{\\\"paths\\\":{\\\"\\/*\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"responses\\\":{\\\"200\\\":{\\\"description\\\":\\\"OK\\\"}}}}},\\\"x-wso2-security\\\":{\\\"apim\\\":{\\\"x-wso2-scopes\\\":[]}},\\\"swagger\\\":\\\"2.0\\\",\\\"info\\\":{\\\"title\\\":\\\"PhoneVerification\\\",\\\"description\\\":\\\"Verify a phone number\\\",\\\"contact\\\":{\\\"email\\\":\\\"xx@ee.com\\\",\\\"name\\\":\\\"xx\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\" -X PUT \"https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/swagger\""
+ x-wso2-request: |
+ PUT https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/swagger
+ Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013
+ Content-Length: 477
+ Content-Type: multipart/form-data; boundary=------------------------4f51e636c0003d99
+
+ --------------------------4f51e636c0003d99
+ Content-Disposition: form-data; name="apiDefinition"
+
+ {"paths":{"\/*":{"get":{"x-auth-type":"Application","x-throttling-tier":"Unlimited","responses":{"200":{"description":"OK"}}}}},"x-wso2-security":{"apim":{"x-wso2-scopes":[]}},"swagger":"2.0","info":{"title":"PhoneVerification","description":"Verify a phone number","contact":{"email":"xx@ee.com","name":"xx"},"version":"1.0.0"}}
+ --------------------------4f51e636c0003d99--
+ x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"paths\": {\"/*\": {\"get\": {\n \"x-auth-type\": \"Application\",\n \"x-throttling-tier\": \"Unlimited\",\n \"responses\": {\"200\": {\"description\": \"OK\"}}\n }}},\n \"x-wso2-security\": {\"apim\": {\"x-wso2-scopes\": []}},\n \"swagger\": \"2.0\",\n \"info\": {\n \"title\": \"PhoneVerification\",\n \"description\": \"Verify a phone number\",\n \"contact\": {\n \"email\": \"xx@ee.com\",\n \"name\": \"xx\"\n },\n \"version\": \"1.0.0\"\n }\n}"
+ summary: Update swagger definition
description: |
This operation can be used to update the swagger definition of an existing API. Swagger definition to be updated is passed as a form data parameter `apiDefinition`.
parameters:
- - $ref: '#/components/parameters/apiId'
- - $ref: '#/components/parameters/If-Match'
- requestBody:
- content:
- multipart/form-data:
- schema:
- properties:
- apiDefinition:
- type: string
- description: Swagger definition of the API
- url:
- type: string
- description: Swagger definition URL of the API
- file:
- type: string
- description: Swagger definitio as a file
- format: binary
+ - $ref: '#/parameters/apiId'
+ - in: formData
+ name: apiDefinition
+ description: Swagger definition of the API
+ type: string
+ required: true
+ - $ref: '#/parameters/Content-Type'
+ - $ref: '#/parameters/If-Match'
+ - $ref: '#/parameters/If-Unmodified-Since'
+ tags:
+ - API (Individual)
responses:
200:
description: |
OK.
Successful response with updated Swagger definition
headers:
+ Location:
+ description: |
+ The URL of the newly created resource.
+ type: string
+ Content-Type:
+ description: |
+ The content type of the body.
+ type: string
ETag:
description: |
Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
+ type: string
Last-Modified:
description: |
Date and time the resource has been modifed the last time.
Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
- Location:
- description: |
- The URL of the newly created resource.
- schema:
- type: string
- Content-Type:
- description: |
- The content type of the body.
- schema:
- type: string
- content:
- application/json:
- schema:
- type: string
- example: ""
+ type: string
400:
- $ref: '#/components/responses/BadRequest'
+ description: |
+ Bad Request.
+ Invalid request or validation error
+ schema:
+ $ref: '#/definitions/Error'
403:
- $ref: '#/components/responses/Forbidden'
+ description: |
+ Forbidden.
+ The request must be conditional but no condition has been specified.
+ schema:
+ $ref: '#/definitions/Error'
404:
- $ref: '#/components/responses/NotFound'
+ description: |
+ Not Found.
+ The resource to be updated does not exist.
+ schema:
+ $ref: '#/definitions/Error'
412:
- $ref: '#/components/responses/PreconditionFailed'
- security:
- - OAuth2Security:
- - apim:api_create
- x-code-samples:
- - lang: Curl
- source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
- -F apiDefinition=@swagger.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/swagger"'
- operationId: updateAPISwagger
-
- /apis/{apiId}/generate-mock-scripts:
- post:
- tags:
- - APIs
- summary: Generate Mock Response Payloads
+ description: |
+ Precondition Failed.
+ The request has not been performed because one of the preconditions is not met.
+ schema:
+ $ref: '#/definitions/Error'
+
+################################################################
+# The thumbnail resource of "Individual API" resource APIs
+################################################################
+
+ /apis/{apiId}/thumbnail:
+#-------------------------------------------------------------------------------------------------
+# Downloads a thumbnail image of an API
+#-------------------------------------------------------------------------------------------------
+ get:
+ x-scope: apim:api_view
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9\" https://localhost:9443/api/am/publisher/v0.12/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail > image.jpg"
+ x-wso2-request: |
+ GET https://localhost:9443/api/am/publisher/v0.12/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail
+ Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9
+ x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: image/jpeg\r\n\r\n[image content]"
+ summary: Get thumbnail image
description: |
- This operation can be used to generate mock responses from examples of swagger definition of an API.
- operationId: generateMockScripts
+ This operation can be used to download a thumbnail image of an API.
parameters:
- - $ref: '#/components/parameters/apiId'
- - $ref: '#/components/parameters/If-None-Match'
+ - $ref: '#/parameters/apiId'
+ - $ref: '#/parameters/Accept'
+ - $ref: '#/parameters/If-None-Match'
+ - $ref: '#/parameters/If-Modified-Since'
+ tags:
+ - API (Individual)
responses:
200:
description: |
OK.
- Requested swagger document of the API is returned with example responses
+ Thumbnail image returned
headers:
+ Content-Type:
+ description: |
+ The content type of the body.
+ type: string
ETag:
description: |
- Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
+ Entity Tag of the response resource.
+ Used by caches, or in conditional requests (Will be supported in future).
+ type: string
Last-Modified:
description: |
Date and time the resource has been modifed the last time.
Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
- Content-Type:
- description: |
- The content type of the body.
- schema:
- type: string
- content:
- application/json:
- schema:
- type: string
- example: ""
+ type: string
304:
description: |
Not Modified.
Empty body because the client has already the latest version of the requested resource (Will be supported in future).
- content: {}
404:
- $ref: '#/components/responses/NotFound'
+ description: |
+ Not Found.
+ Requested Document does not exist.
+ schema:
+ $ref: '#/definitions/Error'
406:
- $ref: '#/components/responses/NotAcceptable'
- security:
- - OAuth2Security:
- - apim:api_create
- x-code-samples:
- - lang: Curl
- source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
- "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f/generate-mock-scripts"'
-
- /apis/{apiId}/generated-mock-scripts:
- get:
- tags:
- - APIs
- summary: Get Generated Mock Response Payloads
+ description: |
+ Not Acceptable.
+ The requested media type is not supported
+ schema:
+ $ref: '#/definitions/Error'
+
+#----------------------------------------------------------------------------
+# Upload a thumbnail image to a certain API
+#----------------------------------------------------------------------------
+ post:
+ consumes:
+ - multipart/form-data
+ x-scope: apim:api_create
+ x-wso2-curl: "curl -X POST -H \"Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9\" https://localhost:9443/api/am/publisher/v0.12/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail -F file=@image.jpg"
+ x-wso2-request: |
+ POST https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail
+ Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9
+ Content-Type: multipart/form-data; boundary=------------------------5e542e0e5b50e1e4
+ Content-Length: 18333
+
+ --------------------------5e542e0e5b50e1e4
+ Content-Disposition: form-data; name="file"; filename="image.jpg"
+ Content-Type: image/jpeg
+
+ [image content]
+
+ --------------------------5e542e0e5b50e1e4--
+ x-wso2-response: "HTTP/1.1 201 Created\r\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail\r\nContent-Type: application/json\r\n\r\n{\r\n \"relativePath\": \"/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail\",\r\n \"mediaType\": \"image/jpeg\"\r\n}"
+ summary: Upload a thumbnail image
description: |
- This operation can be used to get generated mock responses from examples of swagger definition of an API.
- operationId: getGeneratedMockScriptsOfAPI
+ This operation can be used to upload a thumbnail image of an API. The thumbnail to be uploaded should be given as a form data parameter `file`.
parameters:
- - $ref: '#/components/parameters/apiId'
- - $ref: '#/components/parameters/If-None-Match'
+ - $ref: '#/parameters/apiId'
+ - in: formData
+ name: file
+ description: Image to upload
+ type: file
+ required: true
+ - $ref: '#/parameters/Content-Type'
+ - $ref: '#/parameters/If-Match'
+ - $ref: '#/parameters/If-Unmodified-Since'
+ tags:
+ - API (Individual)
responses:
200:
description: |
OK.
- Requested swagger document of the API is returned with example responses
+ Image updated
+ schema:
+ $ref : '#/definitions/FileInfo'
headers:
- ETag:
+ Location:
description: |
- Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
- Last-Modified:
- description: |
- Date and time the resource has been modifed the last time.
- Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
+ The URL of the uploaded thumbnail image of the API.
+ type: string
Content-Type:
description: |
The content type of the body.
- schema:
- type: string
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/MockResponsePayloadList'
- 304:
+ type: string
+ ETag:
+ description: |
+ Entity Tag of the response resource.
+ Used by caches, or in conditional requests (Will be supported in future).
+ type: string
+ Last-Modified:
+ description: |
+ Date and time the resource has been modifed the last time.
+ Used by caches, or in conditional requests (Will be supported in future).
+ type: string
+ 400:
description: |
- Not Modified.
- Empty body because the client has already the latest version of the requested resource (Will be supported in future).
- content: {}
+ Bad Request.
+ Invalid request or validation error.
+ schema:
+ $ref: '#/definitions/Error'
404:
- $ref: '#/components/responses/NotFound'
- 406:
- $ref: '#/components/responses/NotAcceptable'
- security:
- - OAuth2Security:
- - apim:api_create
- x-code-samples:
- - lang: Curl
- source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
- "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f/generated-mock-scripts"'
-
- /apis/{apiId}/resource-policies:
- get:
- tags:
- - API Resource Policies
- summary: Get the Resource Policy(inflow/outflow) Definitions
+ description: |
+ Not Found.
+ The resource to be updated does not exist.
+ schema:
+ $ref: '#/definitions/Error'
+ 412:
+ description: |
+ Precondition Failed.
+ The request has not been performed because one of the preconditions is not met.
+ schema:
+ $ref: '#/definitions/Error'
+
+######################################################
+# The "Copy API" Processing Function resource API
+######################################################
+ /apis/copy-api:
+
+#-----------------------------------------------------
+# Create a new API based on an already existing one
+#-----------------------------------------------------
+ post:
+ x-scope: apim:api_create
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/apis/copy-api?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&newVersion=2.0.0\""
+ x-wso2-request: |
+ POST https://localhost:9443/api/am/publisher/v0.12/apis/copy-api?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&newVersion=2.0.0
+ Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
+ x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/25a84fc9-38c0-4578-95e8-29fb6b1c4771\nContent-Type: application/json\n\n{\r\n \"id\": \"25a84fc9-38c0-4578-95e8-29fb6b1c4771\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"2.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"\\\\/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#\\\\/definitions\\\\/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"schema\\\":{\\\"$ref\\\":\\\"#\\\\/definitions\\\\/Order\\\"},\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"description\\\":\\\"Created.\\\"}}}},\\\"\\\\/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#\\\\/definitions\\\\/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"headers\\\":{},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application\\\\/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application\\\\/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http:\\\\/\\\\/www.apache.org\\\\/licenses\\\\/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http:\\\\/\\\\/www.pizzashack.com\\\"},\\\"version\\\":\\\"2.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\"https\"],\r\n \"tags\": [\r\n \"chicken\",\r\n \"pizza\"\r\n ],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 500,\r\n \"production\": 100\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}"
+ summary: Create a new API version
description: |
- This operation can be used to retrieve conversion policy resource definitions of an API.
+ This operation can be used to create a new version of an existing API. The new version is specified as `newVersion` query parameter. New API will be in `CREATED` state.
parameters:
- - $ref: '#/components/parameters/apiId'
- - name: resourcePath
+ - name: newVersion
+ description: Version of the new API.
+ type: string
in: query
- description: Resource path of the resource policy definition
+ required: true
+ - $ref: '#/parameters/apiId-Q'
+ tags:
+ - API (Individual)
+ responses:
+ 201:
+ description: |
+ Created.
+ Successful response with the newly created API as entity in the body. Location header contains URL of newly created API.
+ headers:
+ Location:
+ description: |
+ The URL of the newly created API.
+ type: string
+ 400:
+ description: |
+ Bad Request.
+ Invalid request or validation error
schema:
- type: string
- - name: verb
- in: query
- description: HTTP verb of the resource path of the resource policy definition
+ $ref: '#/definitions/Error'
+ 404:
+ description: |
+ Not Found.
+ API to copy does not exist.
+ 401:
+ description: |
+ Unauthenticated request.
schema:
- type: string
- - name: sequenceType
+ $ref: '#/definitions/Error'
+
+######################################################
+# The "Change Lifecycle" Processing Function resource API
+######################################################
+ /apis/change-lifecycle:
+
+#-----------------------------------------------------
+# Change the lifecycle of an API
+#-----------------------------------------------------
+ post:
+ x-scope: apim:api_publish
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish\""
+ x-wso2-request: |
+ POST https://localhost:9443/api/am/publisher/v0.12/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish
+ Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
+ x-wso2-response: "HTTP/1.1 200 OK"
+ summary: Change API Status
+ description: |
+ This operation is used to change the lifecycle of an API. Eg: Publish an API which is in `CREATED` state. In order to change the lifecycle, we need to provide the lifecycle `action` as a query parameter.
+
+ For example, to Publish an API, `action` should be `Publish`. Note that the `Re-publish` action is available only after calling `Block`.
+
+ Some actions supports providing additional paramters which should be provided as `lifecycleChecklist` parameter. Please see parameters table for more information.
+ parameters:
+ - name: action
+ description: |
+ The action to demote or promote the state of the API.
+
+ Supported actions are [ **Publish, Deploy as a Prototype, Demote to Created, Demote to Prototyped, Block, Deprecate, Re-Publish, Retire **]
+
in: query
- description: sequence type of the resource policy resource definition
+ type: string
required: true
- schema:
- type: string
- - $ref: '#/components/parameters/If-None-Match'
+ enum:
+ - Publish
+ - Deploy as a Prototype
+ - Demote to Created
+ - Demote to Prototyped
+ - Block
+ - Deprecate
+ - Re-Publish
+ - Retire
+ - name: lifecycleChecklist
+ description: |
+
+ Supported checklist items are as follows.
+ 1. **Deprecate Old Versions**: Setting this to true will deprecate older versions of a particular API when it is promoted to Published state from Created state.
+ 2. **Require Re-Subscription**: 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: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/v0.12/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish&lifecycleChecklist=Deprecate Old Versions:true,Require Re-Subscription:true"
+
+ type: string
+ in: query
+ - $ref: '#/parameters/apiId-Q'
+ - $ref: '#/parameters/If-Match'
+ - $ref: '#/parameters/If-Unmodified-Since'
+ tags:
+ - API (Individual)
responses:
200:
description: |
OK.
- List of resource policy definitions of the API is returned
+ Lifecycle changed successfully.
headers:
ETag:
description: |
- Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
+ Entity Tag of the changed API. Used by caches, or in conditional requests (Will be supported in future).
+ type: string
Last-Modified:
description: |
- Date and time the resource has been modifed the last time.
+ Date and time the API lifecycle has been modified the last time.
Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
- Content-Type:
- description: |
- The content type of the body.
- schema:
- type: string
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ResourcePolicyList'
- 304:
+ type: string
+ 400:
description: |
- Not Modified.
- Empty body because the client has already the latest version of the requested resource (Will be supported in future).
- content: {}
+ Bad Request.
+ Invalid request or validation error
+ schema:
+ $ref: '#/definitions/Error'
404:
- $ref: '#/components/responses/NotFound'
- 406:
- $ref: '#/components/responses/NotAcceptable'
- security:
- - OAuth2Security:
- - apim:api_view
- x-code-samples:
- - lang: Curl
- source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
- "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/resource-policies?resourcePath=checkPhoneNumber&verb=post&sequenceType=in"'
- operationId: getAPIResourcePolicies
-
- /apis/{apiId}/resource-policies/{resourcePolicyId}:
+ description: |
+ Not Found.
+ Requested API does not exist.
+ schema:
+ $ref: '#/definitions/Error'
+ 412:
+ description: |
+ Precondition Failed.
+ The request has not been performed because one of the preconditions is not met.
+ schema:
+ $ref: '#/definitions/Error'
+
+######################################################
+# The "Document Collection" resource APIs
+######################################################
+ /apis/{apiId}/documents:
+
+#-----------------------------------------------------
+# Retrieve the documents associated with an API that qualify under a search condition
+#-----------------------------------------------------
get:
- tags:
- - API Resource Policies
- summary: Get the Resource Policy(inflow/outflow) Definition for a Given Resource
- Identifier.
+ x-scope: apim:api_view
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents\""
+ x-wso2-request: |
+ GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents
+ Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
+ x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"previous\": \"\",\n \"list\": [\n {\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation for v1.0.0\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n },\n {\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"URL\",\n \"sourceUrl\": \"http://wiki.cdyne.com/index.php/Phone_Verification\",\n \"otherTypeName\": null,\n \"documentId\": \"4145df31-04f1-440c-8d08-68952874622c\",\n \"summary\": \"This is the URL for online documentation\",\n \"name\": \"Online Documentation\",\n \"type\": \"SAMPLES\"\n }\n ],\n \"next\": \"\",\n \"count\": 2\n}"
+ summary: Get a list of documents of an API
description: |
- This operation can be used to retrieve conversion policy resource definitions of an API given the resource identifier.
+ This operation can be used to retrive a list of documents belonging to an API by providing the id of the API.
parameters:
- - $ref: '#/components/parameters/apiId'
- - $ref: '#/components/parameters/resourcePolicyId'
- - $ref: '#/components/parameters/If-None-Match'
+ - $ref: '#/parameters/apiId'
+ - $ref: '#/parameters/limit'
+ - $ref: '#/parameters/offset'
+ - $ref: '#/parameters/Accept'
+ - $ref: '#/parameters/If-None-Match'
+ tags:
+ - Document (Collection)
responses:
200:
description: |
OK.
- Requested resource policy definition of the API is returned for the given resource identifier.
+ Document list is returned.
+ schema:
+ $ref: '#/definitions/DocumentList'
headers:
- ETag:
- description: |
- Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
- Last-Modified:
- description: |
- Date and time the resource has been modifed the last time.
- Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
Content-Type:
description: |
The content type of the body.
- schema:
- type: string
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ResourcePolicyInfo'
+ type: string
+ ETag:
+ description: |
+ Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
+ type: string
304:
description: |
Not Modified.
Empty body because the client has already the latest version of the requested resource (Will be supported in future).
- content: {}
- 400:
- $ref: '#/components/responses/BadRequest'
404:
- $ref: '#/components/responses/NotFound'
+ description: |
+ Not Found.
+ Requested API does not exist.
+ schema:
+ $ref: '#/definitions/Error'
406:
- $ref: '#/components/responses/NotAcceptable'
- security:
- - OAuth2Security:
- - apim:api_view
- x-code-samples:
- - lang: Curl
- source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
- "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/resource-policies/8efc32a4-c7f1-4bee-b860-b7566e2bc0d5"'
- operationId: getAPIResourcePoliciesByPolicyId
+ description: |
+ Not Acceptable.
+ The requested media type is not supported
+ schema:
+ $ref: '#/definitions/Error'
- put:
- tags:
- - API Resource Policies
- summary: Update the Resource Policy(inflow/outflow) Definition for the Given
- Resource Identifier
+#-----------------------------------------------------
+# Add a document to a certain API
+#-----------------------------------------------------
+ post:
+ x-scope: apim:api_create
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents\""
+ x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"summary\": \"This is a sample documentation\",\n \"name\": \"Introduction to PhoneVerification API\",\n \"type\": \"HOWTO\"\n}"
+ x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058\",\n \"summary\": \"This is a sample documentation\",\n \"name\": \"Introduction to PhoneVerification API\",\n \"type\": \"HOWTO\"\n}"
+ summary: Add a new document to an API
description: |
- This operation can be used to update the resource policy(inflow/outflow) definition for the given resource identifier of an existing API. resource policy definition to be updated is passed as a body parameter `content`.
+ This operation can be used to add a new documentation to an API. This operation only adds the metadata of a document. To add the actual content we need to use **Upload the content of an API document ** API once we obtain a document Id by this operation.
parameters:
- - $ref: '#/components/parameters/apiId'
- - $ref: '#/components/parameters/resourcePolicyId'
- - $ref: '#/components/parameters/If-Match'
- requestBody:
- description: Content of the resource policy definition that needs to be updated
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ResourcePolicyInfo'
- required: true
+ - $ref: '#/parameters/apiId'
+ - in: body
+ name: body
+ description: |
+ Document object that needs to be added
+ required: true
+ schema:
+ $ref: '#/definitions/Document'
+ - $ref: '#/parameters/Content-Type'
+ tags:
+ - Document (Collection)
responses:
- 200:
+ 201:
description: |
- OK.
- Successful response with updated the resource policy definition
+ Created.
+ Successful response with the newly created Document object as entity in the body.
+ Location header contains URL of newly added document.
+ schema:
+ $ref: '#/definitions/Document'
headers:
- ETag:
- description: |
- Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
- Last-Modified:
- description: |
- Date and time the resource has been modifed the last time.
- Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
Location:
description: |
- The URL of the newly created resource.
- schema:
- type: string
+ Location to the newly created Document.
+ type: string
Content-Type:
description: |
The content type of the body.
- schema:
- type: string
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ResourcePolicyInfo'
+ type: string
+ ETag:
+ description: |
+ Entity Tag of the response resource.
+ Used by caches, or in conditional requests (Will be supported in future).
+ type: string
400:
- $ref: '#/components/responses/BadRequest'
- 403:
- $ref: '#/components/responses/Forbidden'
- 404:
- $ref: '#/components/responses/NotFound'
- 412:
- $ref: '#/components/responses/PreconditionFailed'
- security:
- - OAuth2Security:
- - apim:api_create
- x-code-samples:
- - lang: Curl
- source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
- -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/resource-policies/8efc32a4-c7f1-4bee-b860-b7566e2bc0d5"'
- operationId: updateAPIResourcePoliciesByPolicyId
+ description: |
+ Bad Request.
+ Invalid request or validation error
+ schema:
+ $ref: '#/definitions/Error'
+ 415:
+ description: |
+ Unsupported media type.
+ The entity of the request was in a not supported format.
- /apis/{apiId}/thumbnail:
+######################################################
+# The "Individual Document" resource APIs
+######################################################
+ '/apis/{apiId}/documents/{documentId}':
+
+#-----------------------------------------------------
+# Retrieve a particular document of a certain API
+#-----------------------------------------------------
get:
- tags:
- - APIs
- summary: Get Thumbnail Image
+ x-scope: apim:api_view
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\""
+ x-wso2-request: |
+ GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5
+ Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
+ x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n}"
+ summary: Get a document of an API
description: |
- This operation can be used to download a thumbnail image of an API.
+ This operation can be used to retrieve a particular document's metadata associated with an API.
parameters:
- - $ref: '#/components/parameters/apiId'
- - $ref: '#/components/parameters/If-None-Match'
+ - $ref: '#/parameters/apiId'
+ - $ref: '#/parameters/documentId'
+ - $ref: '#/parameters/Accept'
+ - $ref: '#/parameters/If-None-Match'
+ - $ref: '#/parameters/If-Modified-Since'
+ tags:
+ - Document (Individual)
responses:
200:
description: |
OK.
- Thumbnail image returned
+ Document returned.
+ schema:
+ $ref: '#/definitions/Document'
headers:
+ Content-Type:
+ description: |
+ The content type of the body.
+ type: string
ETag:
description: |
Entity Tag of the response resource.
Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
+ type: string
Last-Modified:
description: |
Date and time the resource has been modifed the last time.
Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
- Content-Type:
- description: |
- The content type of the body.
- schema:
- type: string
- content: {}
+ type: string
304:
description: |
Not Modified.
Empty body because the client has already the latest version of the requested resource (Will be supported in future).
- content: {}
404:
- $ref: '#/components/responses/NotFound'
+ description: |
+ Not Found.
+ Requested Document does not exist.
+ schema:
+ $ref: '#/definitions/Error'
406:
- $ref: '#/components/responses/NotAcceptable'
- security:
- - OAuth2Security:
- - apim:api_view
- x-code-samples:
- - lang: Curl
- source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
- "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/thumbnail"'
- operationId: getAPIThumbnail
+ description: |
+ Not Acceptable.
+ The requested media type is not supported
+ schema:
+ $ref: '#/definitions/Error'
+#-----------------------------------------------------
+# Update a particular document of a certain API
+#-----------------------------------------------------
put:
- tags:
- - APIs
- summary: Upload a Thumbnail Image
+ x-scope: apim:api_create
+ x-wso2-curl: "curl -k -H \"Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\" -H \"Content-Type: application/json\" -X PUT -d data.json \"https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\""
+ x-wso2-request: "PUT https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\nAuthorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation for v1.0.0\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n}"
+ x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation for v1.0.0\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n}"
+ summary: Update a document of an API
description: |
- This operation can be used to upload a thumbnail image of an API. The thumbnail to be uploaded should be given as a form data parameter `file`.
- operationId: updateAPIThumbnail
+ This operation can be used to update metadata of an API's document.
parameters:
- - $ref: '#/components/parameters/apiId'
- - $ref: '#/components/parameters/If-Match'
- requestBody:
- content:
- multipart/form-data:
- schema:
- required:
- - file
- properties:
- file:
- type: string
- description: Image to upload
- format: binary
- required: true
+ - $ref: '#/parameters/apiId'
+ - $ref: '#/parameters/documentId'
+ - in: body
+ name: body
+ description: |
+ Document object that needs to be added
+ required: true
+ schema:
+ $ref: '#/definitions/Document'
+ - $ref: '#/parameters/Content-Type'
+ - $ref: '#/parameters/If-Match'
+ - $ref: '#/parameters/If-Unmodified-Since'
+ tags:
+ - Document (Individual)
responses:
200:
description: |
OK.
- Image updated
+ Document updated
+ schema:
+ $ref: '#/definitions/Document'
headers:
+ Location:
+ description: |
+ The URL of the updated document.
+ type: string
+ Content-Type:
+ description: |
+ The content type of the body.
+ type: string
ETag:
description: |
Entity Tag of the response resource.
Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
+ type: string
Last-Modified:
description: |
Date and time the resource has been modifed the last time.
Used by caches, or in conditional requests (Will be supported in future).
- schema:
- type: string
- Location:
- description: |
- The URL of the uploaded thumbnail image of the API.
- schema:
- type: string
- Content-Type:
- description: |
- The content type of the body.
- schema:
- type: string
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FileInfo'
+ type: string
400:
- $ref: '#/components/responses/BadRequest'
+ description: |
+ Bad Request.
+ Invalid request or validation error.
+ schema:
+ $ref: '#/definitions/Error'
404:
- $ref: '#/components/responses/NotFound'
+ description: |
+ Not Found.
+ The resource to be updated does not exist.
+ schema:
+ $ref: '#/definitions/Error'
412:
- $ref: '#/components/responses/PreconditionFailed'
- security:
- - OAuth2Security:
- - apim:api_create
- - apim:api_publish
- x-code-samples:
- - lang: Curl
- source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
- -F file=image.jpeg "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/thumbnail"'
-
- /apis/{apiId}/subscription-policies:
- get:
- tags:
- - APIs
- summary: |
- Get Details of the Subscription Throttling Policies of an API
- description: |
- This operation can be used to retrieve details of the subscription throttling policy of an API by specifying the API Id.
-
- `X-WSO2-Tenant` header can be used to retrive API subscription throttling policies that belongs to a different tenant domain. If not specified super tenant will be used. If Authorization header is present in the request, the user's tenant associated with the access token will be used.
+ description: |
+ Precondition Failed.
+ The request has not been performed because one of the preconditions is not met.
+ schema:
+ $ref: '#/definitions/Error'
+
+#-----------------------------------------------------
+# Delete a particular document of a certain API
+#-----------------------------------------------------
+ delete:
+ x-scope: apim:api_create
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058"
+ x-wso2-request: |
+ DELETE https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058
+ Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
+ x-wso2-response: "HTTP/1.1 200 OK"
+ summary: Delete a document of an API
+ description: |
+ This operation can be used to delete a document associated with an API.
+ parameters:
+ - $ref: '#/parameters/apiId'
+ - $ref: '#/parameters/documentId'
+ - $ref: '#/parameters/If-Match'
+ - $ref: '#/parameters/If-Unmodified-Since'
+ tags:
+ - Document (Individual)
+ responses:
+ 200:
+ description: |
+ OK.
+ Resource successfully deleted.
+ 404:
+ description: |
+ Not Found.
+ Resource to be deleted does not exist.
+ schema:
+ $ref: '#/definitions/Error'
+ 412:
+ description: |
+ Precondition Failed.
+ The request has not been performed because one of the preconditions is not met.
+ schema:
+ $ref: '#/definitions/Error'
+
+################################################################
+# The content resource of "Individual Document" resource APIs
+################################################################
+
+ '/apis/{apiId}/documents/{documentId}/content':
+
+ #-------------------------------------------------------------------------------------------------
+ # Downloads a FILE type document/get the inline content or source url of a certain document
+ #-------------------------------------------------------------------------------------------------
+ get:
+ x-scope: apim:api_view
+ x-wso2-curl: "curl -k -H \"Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\" \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content\" > sample.pdf"
+ x-wso2-request: |
+ GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content
+ Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a
+ x-wso2-response: "HTTP/1.1 200 OK\nContent-Disposition: attachment; filename=\"sample.pdf\"\nContent-Type: application/octet-stream\nContent-Length: 7802\n\n%PDF-1.4\n%äüöß\n2 0 obj\n<>\nstream\n..\n>>\nstartxref\n7279\n%%EOF"
+ summary: Get the content of an API document
+ description: |
+ 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/v0.12/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`
+ parameters:
+ - $ref: '#/parameters/apiId'
+ - $ref: '#/parameters/documentId'
+ - $ref: '#/parameters/Accept'
+ - $ref: '#/parameters/If-None-Match'
+ - $ref: '#/parameters/If-Modified-Since'
+ tags:
+ - Document (Individual)
+ responses:
+ 200:
+ description: |
+ OK.
+ File or inline content returned.
+ headers:
+ Content-Type:
+ description: |
+ The content type of the body.
+ type: string
+ ETag:
+ description: |
+ Entity Tag of the response resource.
+ Used by caches, or in conditional requests (Will be supported in future).
+ type: string
+ Last-Modified:
+ description: |
+ Date and time the resource has been modifed the last time.
+ Used by caches, or in conditional requests (Will be supported in future).
+ type: string
+ 303:
+ description: |
+ See Other.
+ Source can be retrived from the URL specified at the Location header.
+ headers:
+ Location:
+ description: |
+ The Source URL of the document.
+ type: string
+ 304:
+ description: |
+ Not Modified.
+ Empty body because the client has already the latest version of the requested resource (Will be supported in future).
+ 404:
+ description: |
+ Not Found.
+ Requested Document does not exist.
+ schema:
+ $ref: '#/definitions/Error'
+ 406:
+ description: |
+ Not Acceptable.
+ The requested media type is not supported
+ schema:
+ $ref: '#/definitions/Error'
+
+ #----------------------------------------------------------------------------
+ # Upload a file or add inline content to a document of a certain API
+ #----------------------------------------------------------------------------
+ post:
+ consumes:
+ - multipart/form-data
+ x-scope: apim:api_create
+ x-wso2-curl: "curl -k -H \"Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -F file=@\"sample.pdf\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content\""
+ x-wso2-request: |
+ POST https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/documents/b3a79270-02bb-4e39-9ac1-90ce8f6c84af/content
+ Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
+ Content-Length: 8004
+ Content-Type: multipart/form-data; boundary=------------------------7b9a53f1ffa452b9
+
+ --------------------------7b9a53f1ffa452b9
+ Content-Disposition: form-data; name="file"; filename="sample.pdf"
+ Content-Type: application/octet-stream
+
+ [file content]
+
+ --------------------------7b9a53f1ffa452b9--
+ x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/documents/b3a79270-02bb-4e39-9ac1-90ce8f6c84af/content\nContent-Type: application/json\n\n{\n \"visibility\":\"API_LEVEL\",\n \"sourceType\":\"FILE\",\n \"sourceUrl\":null,\n \"otherTypeName\":null,\n \"documentId\":\"daf732d3-bda2-46da-b381-2c39d901ea61\",\n \"summary\":\"This is a sample documentation pdf\",\n \"name\":\"Introduction to PhoneVerification API PDF\",\n \"type\":\"HOWTO\"\n}"
+ summary: Upload the content of an API document
+ description: |
+ Thid operation can be used to upload a file or add inline content to an API document.
+
+ **IMPORTANT:**
+ * Either **file** or **inlineContent** form data parameters should be specified at one time.
+ * Document's source type should be **FILE** in order to upload a file to the document using **file** parameter.
+ * Document's source type should be **INLINE** in order to add inline content to the document using **inlineContent** parameter.
+ parameters:
+ - $ref: '#/parameters/apiId'
+ - $ref: '#/parameters/documentId'
+ - in: formData
+ name: file
+ description: Document to upload
+ type: file
+ required: false
+ - in: formData
+ name: inlineContent
+ description: Inline content of the document
+ type: string
+ required: false
+ - $ref: '#/parameters/Content-Type'
+ - $ref: '#/parameters/If-Match'
+ - $ref: '#/parameters/If-Unmodified-Since'
+ tags:
+ - Document (Individual)
+ responses:
+ 200:
+ description: |
+ OK.
+ Document updated
+ schema:
+ $ref: '#/definitions/Document'
+ headers:
+ Location:
+ description: |
+ The URL of the updated content of the document.
+ type: string
+ Content-Type:
+ description: |
+ The content type of the body.
+ type: string
+ ETag:
+ description: |
+ Entity Tag of the response resource.
+ Used by caches, or in conditional requests (Will be supported in future).
+ type: string
+ Last-Modified:
+ description: |
+ Date and time the resource has been modifed the last time.
+ Used by caches, or in conditional requests (Will be supported in future).
+ type: string
+ 400:
+ description: |
+ Bad Request.
+ Invalid request or validation error.
+ schema:
+ $ref: '#/definitions/Error'
+ 404:
+ description: |
+ Not Found.
+ The resource to be updated does not exist.
+ schema:
+ $ref: '#/definitions/Error'
+ 412:
+ description: |
+ Precondition Failed.
+ The request has not been performed because one of the preconditions is not met.
+ schema:
+ $ref: '#/definitions/Error'
+
+ ##pp
+######################################################
+# The "specific mediation policy" resource APIs
+######################################################
+ '/apis/{apiId}/policies/mediation':
+
+ #-----------------------------------------------------------------------------------------
+ # Retrieving the list of all API specific mediation sequences under a given search condition
+ #-----------------------------------------------------------------------------------------
+ get:
+ x-scope: apim:api_view
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc\" https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation"
+ x-wso2-request: "GET https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation\r\nAuthorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc"
+ x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"count\": 1,\r\n \"next\": null,\r\n \"previous\": null,\r\n \"list\": [ {\r\n \"name\": \"add_custom_header_fault\",\r\n \"id\": \"6460d7e6-4272-4e3a-9879-437228d83123\",\r\n \"type\": \"fault\"\r\n }]\r\n}"
+ summary: |
+ Get all mediation policies of an API
+ description: |
+ This operation provides you a list of available mediation policies of an API.
+ parameters:
+ - $ref: '#/parameters/apiId'
+ - $ref : '#/parameters/limit'
+ - $ref : '#/parameters/offset'
+ - name : query
+ in: query
+ description: "-Not supported yet-"
+ type: string
+ - $ref : "#/parameters/Accept"
+ - $ref : "#/parameters/If-None-Match"
+ tags:
+ - Mediation Policy (Collection)
+ responses:
+ 200:
+ description: |
+ OK.
+ List of qualifying APIs is returned.
+ schema:
+ $ref: '#/definitions/mediationList'
+ headers:
+ Content-Type:
+ description: The content type of the body.
+ type: string
+ ETag:
+ description: |
+ Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
+ type: string
+ 304:
+ description: |
+ Not Modified.
+ Empty body because the client has already the latest version of the requested resource (Will be supported in future).
+ 406:
+ description: |
+ Not Acceptable.
+ The requested media type is not supported
+ schema:
+ $ref: '#/definitions/Error'
+
+#----------------------------------------------------------------------------
+# Upload an API specific mediation policy
+#----------------------------------------------------------------------------
+ post:
+ x-scope: apim:api_create
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer 6cea3696-0151-3282-bf79-a0c4db6f308a\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation\""
+ x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation\r\nContent-Type: application/json\r\nAuthorization: Bearer 6cea3696-0151-3282-bf79-a0c4db6f308a\r\n\r\n{\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}"
+ x-wso2-response: "HTTP/1.1 201 Created\r\nLocation: https://localhost:9443/api/am/publisher/v0.12/registry/resource/_system/governance/apimgt/applicationdata/provider/admin/hello/1.0.0/fault/add_custom_header_fault.xml\r\nContent-Type: application/json\r\n\r\n{ \r\n \"id\":\"624b9f7d-bfaf-484b-94cc-e84491f5d725\",\r\n \"name\":\"add_custom_header_fault\",\r\n \"type\":\"fault\",\r\n \"config\":\"\\n \\n\\n\"\r\n}"
+ summary: Add an API specific mediation policy
+ description: |
+ This operation can be used to add an API specifc mediation policy.
+ parameters:
+ - in: body
+ name: body
+ description: mediation policy to upload
+ required: true
+ schema:
+ $ref: '#/definitions/Mediation'
+ - $ref: '#/parameters/apiId'
+ - $ref: '#/parameters/Content-Type'
+ - $ref: '#/parameters/If-Match'
+ - $ref: '#/parameters/If-Unmodified-Since'
+ tags:
+ - Mediation Policy (Collection)
+ responses:
+ 200:
+ description: |
+ OK.
+ mediation policy uploaded
+ schema:
+ $ref : '#/definitions/Mediation'
+ headers:
+ Location:
+ description: |
+ The URL of the uploaded thumbnail image of the API.
+ type: string
+ Content-Type:
+ description: |
+ The content type of the body.
+ type: string
+ ETag:
+ description: |
+ Entity Tag of the response resource.
+ Used by caches, or in conditional requests (Will be supported in future).
+ type: string
+ Last-Modified:
+ description: |
+ Date and time the resource has been modifed the last time.
+ Used by caches, or in conditional requests (Will be supported in future).
+ type: string
+ 400:
+ description: |
+ Bad Request.
+ Invalid request or validation error.
+ schema:
+ $ref: '#/definitions/Error'
+ 404:
+ description: |
+ Not Found.
+ The resource to be updated does not exist.
+ schema:
+ $ref: '#/definitions/Error'
+ 412:
+ description: |
+ Precondition Failed.
+ The request has not been performed because one of the preconditions is not met.
+ schema:
+ $ref: '#/definitions/Error'
+
+######################################################
+# The "Individual API specific mediation sequence" resource
+######################################################
+ /apis/{apiId}/policies/mediation/{mediationPolicyId}:
+
+#-----------------------------------------------------
+# Retrieve a particular API specific mediation squence
+#-----------------------------------------------------
+ get:
+ x-scope: apim:api_view
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer 5aa0acc0-0ce3-3a0b-8cc8-db5ef696ee23\" https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/624b9f7d-bfaf-484b-94cc-e84491f5d725"
+ x-wso2-request: "GET https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/624b9f7d-bfaf-484b-94cc-e84491f5d725\r\nAuthorization: Bearer 5aa0acc0-0ce3-3a0b-8cc8-db5ef696ee23"
+ x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"id\": \"624b9f7d-bfaf-484b-94cc-e84491f5d725\",\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}"
+ summary: Get an API specific mediation policy
+ description: |
+ This operation can be used to retrieve a particular API specific mediation policy.
+ parameters:
+ - $ref: '#/parameters/apiId'
+ - $ref: '#/parameters/mediationPolicyId'
+ - $ref: '#/parameters/Accept'
+ - $ref: '#/parameters/If-None-Match'
+ - $ref: '#/parameters/If-Modified-Since'
+ tags:
+ - Mediation Policy (Individual)
+ responses:
+ 200:
+ description: |
+ OK.
+ Mediation policy returned.
+ schema:
+ $ref: '#/definitions/Mediation'
+ headers:
+ Content-Type:
+ description: |
+ The content type of the body.
+ type: string
+ ETag:
+ description: |
+ Entity Tag of the response resource.
+ Used by caches, or in conditional requests (Will be supported in future).
+ type: string
+ Last-Modified:
+ description: |
+ Date and time the resource has been modifed the last time.
+ Used by caches, or in conditional requests (Will be supported in future).
+ type: string
+ 304:
+ description: |
+ Not Modified.
+ Empty body because the client has already the latest version of the requested resource (Will be supported in future).
+ 404:
+ description: |
+ Not Found.
+ Requested Document does not exist.
+ schema:
+ $ref: '#/definitions/Error'
+ 406:
+ description: |
+ Not Acceptable.
+ The requested media type is not supported
+ schema:
+ $ref: '#/definitions/Error'
+
+#-----------------------------------------------------
+# Delete the mediation policy
+#-----------------------------------------------------
+ delete:
+ x-scope: apim:api_create
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc\" -X DELETE https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/60f5146d-1774-405d-86b3-9b040ac266d5"
+ x-wso2-request: "DELETE https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/60f5146d-1774-405d-86b3-9b040ac266d5\r\nAuthorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc"
+ x-wso2-response: "HTTP/1.1 200 OK"
+ summary: Delete an API specific mediation policy
+ description: |
+ This operation can be used to delete an existing API specific mediation policy providing the Id of the API and the Id of the mediation policy.
+ parameters:
+ - $ref: '#/parameters/apiId'
+ - $ref: '#/parameters/mediationPolicyId'
+ - $ref: '#/parameters/If-Match'
+ - $ref: '#/parameters/If-Unmodified-Since'
+ tags:
+ - Mediation Policy (Individual)
+ responses:
+ 200:
+ description: |
+ OK.
+ Resource successfully deleted.
+ 403:
+ description: |
+ Forbidden.
+ The request must be conditional but no condition has been specified.
+ schema:
+ $ref: '#/definitions/Error'
+ 404:
+ description: |
+ Not Found.
+ Resource to be deleted does not exist.
+ schema:
+ $ref: '#/definitions/Error'
+ 412:
+ description: |
+ Precondition Failed.
+ The request has not been performed because one of the preconditions is not met.
+ schema:
+ $ref: '#/definitions/Error'
+
+#-----------------------------------------------------
+# Update the a mediation policy
+#-----------------------------------------------------
+ put:
+ x-scope: apim:api_create
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer 9e41fae2-3ada-3dd1-8f12-2077202f4285\" -H \"Content-Type: application/json\" -X PUT -d @data.json https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/820fdcf7-7258-42b5-809e-674b893644d1"
+ x-wso2-request: "PUT https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/820fdcf7-7258-42b5-809e-674b893644d1\r\nContent-Type: application/json\r\nAuthorization: Bearer 9e41fae2-3ada-3dd1-8f12-2077202f4285\r\n\r\n{\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}"
+ x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"id\": \"a7365481-5b3f-463c-a646-a498895ac210\",\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}"
+ summary: Update an API specific mediation policy
+ description: |
+ This operation can be used to update an existing mediation policy of an API.
+ parameters:
+ - $ref: '#/parameters/apiId'
+ - $ref: '#/parameters/mediationPolicyId'
+ - in: body
+ name: body
+ description: |
+ Mediation policy object that needs to be updated
+ required: true
+ schema:
+ $ref: '#/definitions/Mediation'
+ - $ref: '#/parameters/Content-Type'
+ - $ref: '#/parameters/If-Match'
+ - $ref: '#/parameters/If-Unmodified-Since'
+ tags:
+ - Mediation Policy (Individual)
+ responses:
+ 200:
+ description: |
+ OK.
+ Successful response with updated API object
+ schema:
+ $ref: '#/definitions/Mediation'
+ headers:
+ Location:
+ description: |
+ The URL of the newly created resource.
+ type: string
+ Content-Type:
+ description: |
+ The content type of the body.
+ type: string
+ ETag:
+ description: |
+ Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
+ type: string
+ Last-Modified:
+ description: |
+ Date and time the resource has been modifed the last time.
+ Used by caches, or in conditional requests (Will be supported in future).
+ type: string
+ 400:
+ description: |
+ Bad Request.
+ Invalid request or validation error
+ schema:
+ $ref: '#/definitions/Error'
+ 403:
+ description: |
+ Forbidden.
+ The request must be conditional but no condition has been specified.
+ schema:
+ $ref: '#/definitions/Error'
+ 404:
+ description: |
+ Not Found.
+ The resource to be updated does not exist.
+ schema:
+ $ref: '#/definitions/Error'
+ 412:
+ description: |
+ Precondition Failed.
+ The request has not been performed because one of the preconditions is not met.
+ schema:
+ $ref: '#/definitions/Error'
+
+######################################################
+# The wsdl Resource
+######################################################
+ /apis/{apiId}/wsdl:
+
+#-----------------------------------------------------
+# Retrieve the details about a certain wsdl
+#-----------------------------------------------------
+ get:
+ x-scope: apim:api_view
+ x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/apis/7f82f6b0-2667-441e-af23-c0fc44cf3a17/wsdl\""
+ x-wso2-request: |
+ GET https://localhost:9443/api/am/publisher/v0.12/apis/7f82f6b0-2667-441e-af23-c0fc44cf3a17/wsdl
+ Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
+ x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"name\": \"admin--hello1.0.0.wsdl\",\r\n \"wsdlDefinition\": \"\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n \\n <\\/input>\\n