diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml
index 4c32e6f2ae..a530cbcfa1 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml
@@ -73,8 +73,8 @@
org.wso2.carbon.apimgt.annotations.*
- org.osgi.framework,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.logging,
javax.servlet,
javax.xml.*,
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 a77543fc93..9ec68e7315 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
@@ -34,42 +34,56 @@
http://wso2.org
+
+ io.swagger
+ swagger-annotations
+
+
+ org.springframework
+ spring-web
+ provided
+
+
+ org.apache.cxf
+ cxf-bundle-jaxrs
+ provided
+
-
- org.apache.cxf
- cxf-rt-frontend-jaxws
- provided
-
-
- org.apache.cxf
- cxf-rt-frontend-jaxrs
- provided
-
-
- org.apache.cxf
- cxf-rt-transports-http
- provided
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- org.codehaus.jackson
- jackson-core-asl
-
+
+
+
+
org.codehaus.jackson
jackson-jaxrs
-
- javax
- javaee-web-api
- provided
-
-
- javax.ws.rs
- jsr311-api
- provided
-
+
+
+
+
+
+
+
+
+
+
commons-httpclient.wso2
commons-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 aec0df4a16..96d3c8e059 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,8 @@ 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.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;
@@ -110,12 +110,10 @@ public class ApiApplicationRegistrationServiceImpl implements ApiApplicationRegi
if (username.equals(registrationProfile.getUsername())) {
synchronized (ApiApplicationRegistrationServiceImpl.class) {
- StoreClient storeClient = new StoreClient(new OAuthRequestInterceptor(registrationProfile.getUsername(),
- registrationProfile.getPassword()));
ApiApplicationKey apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys(
applicationName, registrationProfile.getTags(),
ApiApplicationConstants.DEFAULT_TOKEN_TYPE, username,
- registrationProfile.isAllowedToAllDomains(), validityPeriod, storeClient);
+ registrationProfile.isAllowedToAllDomains(), validityPeriod);
return Response.status(Response.Status.CREATED).entity(apiApplicationKey.toString()).build();
}
}
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/filter/ApiPermissionFilter.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/filter/ApiPermissionFilter.java
index 0c78488a2d..fc3efadb42 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/filter/ApiPermissionFilter.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/filter/ApiPermissionFilter.java
@@ -25,7 +25,12 @@ import org.wso2.carbon.user.api.UserRealm;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
-import javax.servlet.*;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.bind.JAXBContext;
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/META-INF/webapp-classloading.xml
index b410b42670..5cb6aa6282 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/META-INF/webapp-classloading.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/META-INF/webapp-classloading.xml
@@ -31,5 +31,5 @@
Tomcat environment is the default and every webapps gets it even if they didn't specify it.
e.g. If a webapps requires CXF, they will get both Tomcat and CXF.
-->
- CXF,Carbon
+ CXF3,Carbon
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 a04bf65bb9..9e70ed3009 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,14 +51,25 @@
org.wso2.carbon
org.wso2.carbon.logging
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.apimgt.integration.client
-
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.apimgt.integration.generated.client
-
+
+
+
+
+
+
+
+
+
+ org.wso2.carbon.apimgt
+ org.wso2.carbon.apimgt.api
+ 9.0.5
+
+
+ org.wso2.carbon.apimgt
+ org.wso2.carbon.apimgt.impl
+ 9.0.5
+ provided
+
com.googlecode.json-simple.wso2
json-simple
@@ -72,6 +83,11 @@
org.wso2.carbon.identity.jwt.client.extension
provided
+
+ org.wso2.carbon.devicemgt
+ org.wso2.carbon.device.mgt.core
+ provided
+
@@ -100,24 +116,26 @@
${carbon.device.mgt.version}
API Management Application Bundle
org.wso2.carbon.apimgt.application.extension.internal
-
- org.osgi.framework,
- org.osgi.service.component,
- org.apache.commons.logging.*,
- org.wso2.carbon.user.core.*,
- org.wso2.carbon.user.api,
- org.wso2.carbon.utils.multitenancy,
- org.json.simple,
- org.wso2.carbon.context,
- org.wso2.carbon.base,
- org.wso2.carbon.registry.core.*;resolution:=optional,
- org.wso2.carbon.registry.indexing.*; version="${carbon.registry.imp.pkg.version.range}",
- org.wso2.carbon.apimgt.integration.client.*,
- org.wso2.carbon.apimgt.integration.generated.client.store.api,
- org.wso2.carbon.apimgt.integration.generated.client.store.model,
- org.wso2.carbon.identity.jwt.client.extension.*,
- feign
-
+
+ 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.wso2.carbon.apimgt.application.extension.internal,
org.wso2.carbon.apimgt.application.extension.*
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 62d353d0fd..67fe9e2583 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
@@ -20,8 +20,9 @@ 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.apimgt.integration.client.store.StoreClient;
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.
@@ -61,17 +62,17 @@ 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 storeClient Specified store client
* @return consumerkey and secrete of the created application.
* @throws APIManagerException
*/
+
ApiApplicationKey generateAndRetrieveApplicationKeys(String apiApplicationName,
String tags[],
String keyType,
String username,
boolean isAllowedAllDomains,
- String validityTime,
- StoreClient storeClient) throws APIManagerException;
+ String validityTime, String scopes) throws APIManagerException;
/**
* Remove APIM Application.
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 0c957fd4e7..cc385dff44 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,19 +18,46 @@
package org.wso2.carbon.apimgt.application.extension;
-import feign.FeignException;
+//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;
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.application.extension.internal.APIApplicationManagerExtensionDataHolder;
import org.wso2.carbon.apimgt.application.extension.util.APIManagerUtil;
-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.*;
+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;
+import org.wso2.carbon.device.mgt.core.config.ui.UIConfigurationManager;
import org.wso2.carbon.identity.jwt.client.extension.JWTClient;
import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException;
@@ -39,7 +66,11 @@ 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;
+import java.util.Set;
/**
* This class represents an implementation of APIManagementProviderService.
@@ -50,48 +81,66 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
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();
+// StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService()
+// .getStoreClient();
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext()
.getTenantDomain();
+// String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
+// try {
try {
- 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) {
+ APIUtil.getTiers(APIConstants.TIER_APPLICATION_TYPE, tenantDomain);
+ } catch (APIManagementException e) {
log.error("APIs not ready", e);
}
- return false;
+ // 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;
}
@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);
- if (applicationList.getList() != null && applicationList.getList().size() > 0) {
- ApplicationInfo applicationInfo = applicationList.getList().get(0);
- storeClient.getIndividualApplication().applicationsApplicationIdDelete(applicationInfo.getApplicationId(),
- null, null);
+// 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();
}
+
+
}
/**
@@ -100,94 +149,80 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
@Override
public synchronized ApiApplicationKey generateAndRetrieveApplicationKeys(String applicationName, String tags[],
String keyType, String username,
- boolean isAllowedAllDomains, String validityTime,
- StoreClient sClient) throws APIManagerException {
+ boolean isAllowedAllDomains,
+ String validityTime, String scopes) throws APIManagerException {
- StoreClient storeClient;
-
- if (sClient == null) {
- storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService()
- .getStoreClient();
- } else {
- storeClient = sClient;
+ String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
+ if (StringUtils.isEmpty(username)) {
+ username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
}
-
- String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext()
- .getTenantDomain();
try {
- ApplicationList applicationList = storeClient.getApplications()
- .applicationsGet("", applicationName, 1, 0, CONTENT_TYPE, null);
- Application application;
- if (applicationList == null || applicationList.getList() == null || applicationList.getList().size() == 0) {
- //create application;
- application = new Application();
- application.setName(applicationName);
- application.setSubscriber(username);
- application.setDescription("");
- application.setThrottlingTier(ApiApplicationConstants.DEFAULT_TIER);
- application.setGroupId("");
- application = storeClient.getIndividualApplication().applicationsPost(application, CONTENT_TYPE);
- } else {
- ApplicationInfo applicationInfo = applicationList.getList().get(0);
- application = storeClient.getIndividualApplication()
- .applicationsApplicationIdGet(applicationInfo.getApplicationId(), CONTENT_TYPE, null, null);
- }
+ APIConsumer apiConsumer = API_MANAGER_FACTORY.getAPIConsumer(username);
+ Application application = apiConsumer.getApplicationsByName(username, applicationName, "");
+
+ int applicationId = 0;
+ Subscriber subscriber = null;
if (application == null) {
- throw new APIManagerException(
- "Api application creation failed for " + applicationName + " to the user " + username);
+ subscriber = apiConsumer.getSubscriber(username);
+ if (subscriber == null) {
+ // create subscriber
+ apiConsumer.addSubscriber(username, "");
+ subscriber = apiConsumer.getSubscriber(username);
+ }
+ //create application
+ application = new Application(applicationName, subscriber);
+ application.setTier(ApiApplicationConstants.DEFAULT_TIER);
+ application.setGroupId("");
+ applicationId = apiConsumer.addApplication(application, username);
+ } else {
+ applicationId = application.getId();
+ subscriber = apiConsumer.getSubscriber(username);
}
- SubscriptionList subscriptionList = storeClient.getSubscriptions().subscriptionsGet
- (null, application.getApplicationId(), "", 0, 100, CONTENT_TYPE, null);
- List needToSubscribe = new ArrayList<>();
+ Set subscribedAPIs =
+ apiConsumer.getSubscribedAPIsByApplicationId(subscriber, applicationId, "");
+
+ log.info("Already subscribed API count: " + subscribedAPIs.size());
+
// subscribe to apis.
+ Set tempApiIds = new HashSet<>();
if (tags != null && tags.length > 0) {
for (String tag : tags) {
- APIList apiList = storeClient.getApis().apisGet(MAX_API_PER_TAG, 0, tenantDomain, "tag:" + tag
- , CONTENT_TYPE, null);
- if (apiList.getList() == null || apiList.getList().size() == 0) {
- apiList = storeClient.getApis().apisGet(MAX_API_PER_TAG, 0
- , MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, "tag:" + tag, CONTENT_TYPE, null);
+ Set apisWithTag = apiConsumer.getAPIsWithTag(tag, tenantDomain);
+ if (apisWithTag == null || apisWithTag.size() == 0) {
+ apisWithTag = apiConsumer.getAPIsWithTag(tag, MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
}
- if (apiList.getList() != null && apiList.getList().size() > 0) {
- for (APIInfo apiInfo : apiList.getList()) {
- String id = apiInfo.getProvider().replace("@", "-AT-")
- + "-" + apiInfo.getName() + "-" + apiInfo.getVersion();
- id = id.replace(" ", "+");
+ if (apisWithTag != null && apisWithTag.size() > 0) {
+ for (API apiInfo : apisWithTag) {
+ String id = apiInfo.getId().getProviderName().replace("@", "-AT-")
+ + "-" + apiInfo.getId().getName() + "-" + apiInfo.getId().getVersion();
+ // todo: amalka will this break old apis?
boolean subscriptionExist = false;
- if (subscriptionList.getList() != null && subscriptionList.getList().size() > 0) {
- for (Subscription subs : subscriptionList.getList()) {
- if (subs.getApiIdentifier().equals(id)) {
+ if (subscribedAPIs.size() > 0) {
+ for (SubscribedAPI subscribedAPI : subscribedAPIs) {
+ if (String.valueOf(subscribedAPI.getApiId().toString()).equals(id)) {
subscriptionExist = true;
break;
}
}
}
- if (!subscriptionExist) {
- Subscription subscription = new Subscription();
- //fix for APIMANAGER-5566 admin-AT-tenant1.com-Tenant1API1-1.0.0
-
- subscription.setApiIdentifier(id);
- subscription.setApplicationId(application.getApplicationId());
- subscription.tier(ApiApplicationConstants.DEFAULT_TIER);
- if (!needToSubscribe.contains(subscription)) {
- needToSubscribe.add(subscription);
- }
+ if (!subscriptionExist && !tempApiIds.contains(id)) {
+ ApiTypeWrapper apiTypeWrapper = new ApiTypeWrapper(apiInfo);
+ apiTypeWrapper.setTier(ApiApplicationConstants.DEFAULT_TIER);
+ apiConsumer.addSubscription(apiTypeWrapper, username, applicationId, "");
+ tempApiIds.add(id);
}
}
}
}
}
- if (!needToSubscribe.isEmpty()) {
- storeClient.getSubscriptionMultitpleApi().subscriptionsMultiplePost(needToSubscribe, CONTENT_TYPE);
- }
//end of subscription
- List applicationKeys = application.getKeys();
+ List applicationKeys = application.getKeys();
if (applicationKeys != null) {
- for (ApplicationKey applicationKey : applicationKeys) {
- if (keyType.equals(applicationKey.getKeyType().toString())) {
+ for (APIKey applicationKey : applicationKeys) {
+ if (keyType.equals(applicationKey.getType())) {
if (applicationKey.getConsumerKey() != null && !applicationKey.getConsumerKey().isEmpty()) {
ApiApplicationKey apiApplicationKey = new ApiApplicationKey();
apiApplicationKey.setConsumerKey(applicationKey.getConsumerKey());
@@ -198,33 +233,74 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
}
}
- ApplicationKeyGenerateRequest applicationKeyGenerateRequest = new ApplicationKeyGenerateRequest();
List allowedDomains = new ArrayList<>();
if (isAllowedAllDomains) {
allowedDomains.add(ApiApplicationConstants.ALLOWED_DOMAINS);
} else {
allowedDomains.add(APIManagerUtil.getTenantDomain());
}
- applicationKeyGenerateRequest.setAccessAllowDomains(allowedDomains);
- applicationKeyGenerateRequest.setCallbackUrl("");
- applicationKeyGenerateRequest.setKeyType(ApplicationKeyGenerateRequest.KeyTypeEnum.PRODUCTION);
- applicationKeyGenerateRequest.setValidityTime(validityTime);
- ApplicationKey applicationKey = storeClient.getIndividualApplication().applicationsGenerateKeysPost(
- application.getApplicationId(), applicationKeyGenerateRequest, CONTENT_TYPE, null, null);
- if (applicationKey.getConsumerKey() != null && !applicationKey.getConsumerKey().isEmpty()) {
- ApiApplicationKey apiApplicationKey = new ApiApplicationKey();
- apiApplicationKey.setConsumerKey(applicationKey.getConsumerKey());
- apiApplicationKey.setConsumerSecret(applicationKey.getConsumerSecret());
- return apiApplicationKey;
+ APIAdmin apiAdmin = new APIAdminImpl();
+ String keyManagerId = null;
+ try {
+ List keyManagerConfigurations = apiAdmin
+ .getKeyManagerConfigurationsByTenant(tenantDomain);
+ if (keyManagerConfigurations != null) {
+ for (KeyManagerConfigurationDTO keyManagerConfigurationDTO : keyManagerConfigurations) {
+ keyManagerId = keyManagerConfigurationDTO.getUuid();
+ }
+ }
+ String jsonString = "{\"grant_types\":\"refresh_token,urn:ietf:params:oauth:grant-type:saml2-bearer," +
+ "password,client_credentials,iwa:ntlm,urn:ietf:params:oauth:grant-type:jwt-bearer\"," +
+ "\"additionalProperties\":\"{\\\"application_access_token_expiry_time\\\":\\\"N\\/A\\\"," +
+ "\\\"user_access_token_expiry_time\\\":\\\"N\\/A\\\"," +
+ "\\\"refresh_token_expiry_time\\\":\\\"N\\/A\\\"," +
+ "\\\"id_token_expiry_time\\\":\\\"N\\/A\\\"}\"," +
+ "\"username\":\"" + username + "\"}";
+
+ // if scopes not defined
+ if (StringUtils.isEmpty(scopes)) {
+ UIConfigurationManager uiConfigurationManager = UIConfigurationManager.getInstance();
+ UIConfiguration uiConfiguration = uiConfigurationManager.getUIConfig();
+ List scopeList = uiConfiguration.getScopes();
+
+ if (scopeList != null && scopeList.size() > 0) {
+ StringBuilder builder = new StringBuilder();
+ for (String scope : scopeList) {
+ String tmpScope = scope + " ";
+ builder.append(tmpScope);
+ }
+ scopes = builder.toString();
+ }
+
+ if (StringUtils.isEmpty(scopes)) {
+ scopes = scopes.trim();
+ } else {
+ scopes = "default";
+ }
+ }
+
+ Map keyDetails = apiConsumer
+ .requestApprovalForApplicationRegistration(username, applicationName, keyType, "",
+ allowedDomains.toArray(new String[allowedDomains.size()]), validityTime, scopes, "",
+ jsonString, keyManagerId, tenantDomain);
+
+ if (keyDetails != null) {
+ ApiApplicationKey apiApplicationKey = new ApiApplicationKey();
+ apiApplicationKey.setConsumerKey((String) keyDetails.get("consumerKey"));
+ apiApplicationKey.setConsumerSecret((String) keyDetails.get("consumerSecret"));
+ return apiApplicationKey;
+ }
+ throw new APIManagerException("Failed to generate keys for tenant: " + tenantDomain);
+ } catch (APIManagementException e) {
+ throw new APIManagerException("Failed to create api application for tenant: " + tenantDomain, e);
}
- throw new APIManagerException("Failed to generate keys for tenant: " + tenantDomain);
- } catch (FeignException e) {
+ } catch (APIManagementException e) {
throw new APIManagerException("Failed to create api application for tenant: " + tenantDomain, e);
}
}
- /**
+ /**
* {@inheritDoc}
*/
@Override
@@ -311,7 +387,7 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
if (registrationProfile.getUsername() == null || registrationProfile.getUsername().isEmpty()) {
info = generateAndRetrieveApplicationKeys(registrationProfile.getApplicationName(),
- registrationProfile.getTags(), tokenType, registrationProfile.getApplicationName(),
+ registrationProfile.getTags(), tokenType, null,
registrationProfile.isAllowedToAllDomains(), validityPeriod);
}
} finally {
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 90f297e6d3..368fda3a3b 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,7 @@
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.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 +35,7 @@ public class APIApplicationManagerExtensionDataHolder {
private TenantManager tenantManager;
private TenantRegistryLoader tenantRegistryLoader;
private TenantIndexingLoader indexLoader;
- private IntegrationClientService integrationClientService;
+// private IntegrationClientService integrationClientService;
private JWTClientManagerService jwtClientManagerService;
private APIApplicationManagerExtensionDataHolder() {
@@ -94,14 +94,14 @@ public class APIApplicationManagerExtensionDataHolder {
return indexLoader;
}
- public IntegrationClientService getIntegrationClientService() {
- return integrationClientService;
- }
-
- public void setIntegrationClientService(
- IntegrationClientService integrationClientService) {
- this.integrationClientService = integrationClientService;
- }
+// public IntegrationClientService getIntegrationClientService() {
+// return integrationClientService;
+// }
+//
+// public void setIntegrationClientService(
+// IntegrationClientService integrationClientService) {
+// this.integrationClientService = integrationClientService;
+// }
public JWTClientManagerService getJwtClientManagerService() {
if (jwtClientManagerService == null) {
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 9d28c89f16..4d98527956 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,7 @@ 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.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;
@@ -49,12 +49,6 @@ import org.wso2.carbon.user.core.service.RealmService;
* policy="dynamic"
* bind="setRealmService"
* unbind="unsetRealmService"
- * @scr.reference name="integration.client.service"
- * interface="org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService"
- * cardinality="1..1"
- * policy="dynamic"
- * bind="setIntegrationClientService"
- * unbind="unsetIntegrationClientService"
*/
public class APIApplicationManagerExtensionServiceComponent {
@@ -97,16 +91,16 @@ 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);
- }
+// 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 eeddf628a5..0784f282aa 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,46 +47,39 @@
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
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -120,55 +113,60 @@
-
- com.squareup.okhttp3
- okhttp
-
-
- com.squareup.okio
- okio
-
+
+
+
+
+
+
+
+
io.github.openfeign
feign-okhttp
-
- 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.github.openfeign
+ feign-slf4j
+ 10.7.2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- io.swagger
- swagger-annotations
-
-
- junit
- junit
-
+
+
+
+
+
+
+
+
io.github.openfeign
feign-core
-
- io.github.openfeign
- feign-jackson
-
+
+
+
+
io.github.openfeign
feign-jaxrs
@@ -178,10 +176,10 @@
feign-gson
-
- org.testng
- testng
-
+
+
+
+
org.wso2.carbon.devicemgt
org.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 3887d59c66..73a4234a91 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,7 +27,8 @@ 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.*;
+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.core.util.Utils;
/**
@@ -36,13 +37,15 @@ import org.wso2.carbon.core.util.Utils;
public class PublisherClient {
private static final Log log = LogFactory.getLog(PublisherClient.class);
- 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;
+ 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;
/**
@@ -57,40 +60,50 @@ public class PublisherClient {
.requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder());
String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getPublisherEndpoint());
- 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);
+ 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);
}
- public APIIndividualApi getApi() {
- return api;
+ public ApIsApi getApIsApi() {
+ return apIsApi;
}
- public APICollectionApi getApis() {
- return apis;
+ public ApiLifecycleApi getApiLifecycleApi() {
+ return apiLifecycleApi;
}
- 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 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;
+// }
}
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 db751f204e..5d8a46d586 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,16 +39,17 @@ import java.util.concurrent.TimeUnit;
public class StoreClient {
private static final org.apache.commons.logging.Log log = LogFactory.getLog(StoreClient.class);
- 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;
+ 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;
public StoreClient(RequestInterceptor requestInterceptor) {
@@ -60,58 +61,59 @@ public class StoreClient {
.requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder());
String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getStoreEndpoint());
- 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);
+ 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);
}
- 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 22c399e5b7..cc300b8014 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,61 +26,59 @@
http://wso2.org
+
-
-
- 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
-
-
-
-
+
+ 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
+
+
+
+
+
com.google.code.maven-replacer-plugin
replacer
1.5.2
-
+
process-resources
- replace-for-swagger-genenerated-code-publisher
+ replace-for-openapi-genenerated-code-publisher
replace
- ${project.basedir}/target/generated-sources/swagger/src/main/java/org/wso2/carbon/apimgt/integration/generated/client/publisher/model/API.java
+ ${project.basedir}/target/generated-sources/openapi/src/main/java/org/wso2/carbon/apimgt/integration/generated/client/publisher/model/API.java
CURRENT_TENANT
@@ -115,28 +113,33 @@
org.wso2.carbon.apimgt.integration.generated.client.store.api.*,
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
-
+
+ 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
+
+
@@ -145,60 +148,105 @@
+
+
+ io.swagger.core.v3
+ swagger-annotations
+ 2.1.7
+
+
+
com.google.code.gson
gson
+ 2.8.5
-
- javax.ws.rs
- jsr311-api
-
+
+
+
+
io.swagger
swagger-annotations
-
- 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
-
+
+ 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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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 b2068857a7..76fdb6f92d 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,115 +1,122 @@
-
-swagger: '2.0'
-######################################################
-# Prolog
-######################################################
+# 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
info:
- version: "0.12.0"
- title: "WSO2 API Manager - Publisher API"
+ title: WSO2 API Manager - Publisher API
description: |
- This specifies a **RESTful API** for WSO2 **API Manager** - Publisher.
+ This document 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.
+ # 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.
+
+ [](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9)
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"
-
-######################################################
-# 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
-######################################################
+ 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
paths:
+ ######################################################
+ # The "API Collection" resource APIs
+ ######################################################
/apis:
-
-#-----------------------------------------------------
-# Retrieving the list of all APIs qualifying under a given search condition
-#-----------------------------------------------------
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"
- 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}"
+ tags:
+ - APIs
summary: |
Retrieve/Search APIs
description: |
@@ -117,9 +124,10 @@ 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 : '#/parameters/limit'
- - $ref : '#/parameters/offset'
- - name : query
+ - $ref: '#/components/parameters/limit'
+ - $ref: '#/components/parameters/offset'
+ - $ref: '#/components/parameters/requestedTenant'
+ - name: query
in: query
description: |
**Search condition**.
@@ -127,610 +135,1011 @@ paths:
You can search in attributes by using an **":"** modifier.
Eg.
- "provider:wso2" will match an API if the provider of the API is exactly "wso2".
-
- Additionally you can use wildcards.
+ "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".
+ Also you can use combined modifiers
Eg.
- "provider:wso2*" will match an API if the provider of the API starts with "wso2".
+ name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1.
- Supported attribute modifiers are [**version, context, status,
- description, subcontext, doc, provider**]
+ Supported attribute modifiers are [**version, context, name, status,
+ description, subcontext, doc, provider, label**]
If no advanced attribute modifier has been specified, the API names containing
the search term will be returned as a result.
- type: string
- - $ref : "#/parameters/Accept"
- - $ref : "#/parameters/If-None-Match"
- tags:
- - API (Collection)
+ 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'
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).
- type: string
+ schema:
+ type: string
+ Content-Type:
+ description: The content type of the body.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIList'
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:
- description: |
- Not Acceptable.
- The requested media type is not supported
- schema:
- $ref: '#/definitions/Error'
+ $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
-#-----------------------------------------------------
-# Create a new API -API (Individual)
-#-----------------------------------------------------
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"
- 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
+ tags:
+ - APIs
+ 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:
- - in: body
- name: body
- description: |
- API object that needs to be added
- required: true
+ - name: openAPIVersion
+ in: query
+ description: Open api version
schema:
- $ref: '#/definitions/API'
- - $ref: '#/parameters/Content-Type'
- - $ref: '#/parameters/Authorization'
- tags:
- - API (Individual)
+ 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
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:
- Location:
- description: |
- The URL of the newly created resource.
- type: string
- Content-Type:
- description: |
- The content type of the body.
- 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
+ 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'
400:
- description: |
- Bad Request.
- Invalid request or validation error.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/BadRequest'
415:
- description: |
- Unsupported Media Type.
- The entity of the request was in a not supported format.
- schema:
- $ref: '#/definitions/Error'
+ $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
-######################################################
+ ######################################################
+ # The "Individual API" resource APIs
+ ######################################################
/apis/{apiId}:
-
-#-----------------------------------------------------
-# Retrieve the details of an API 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/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
+ tags:
+ - APIs
+ 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: '#/parameters/apiId'
- - $ref: '#/parameters/Accept'
- - $ref: '#/parameters/If-None-Match'
- - $ref: '#/parameters/If-Modified-Since'
- tags:
- - API (Individual)
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/requestedTenant'
+ - $ref: '#/components/parameters/If-None-Match'
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).
- type: string
+ 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).
- type: string
- schema:
- $ref: '#/definitions/API'
+ schema:
+ type: string
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/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:
- description: |
- Not Found.
- Requested API does not exist.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/NotFound'
406:
- description: |
- Not Acceptable.
- The requested media type is not supported
- schema:
- $ref: '#/definitions/Error'
+ $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
-#-----------------------------------------------------
-# Update the definition of an API
-#-----------------------------------------------------
put:
- 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}"
+ tags:
+ - APIs
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: '#/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)
+ - $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
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).
- type: string
+ 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).
- type: string
+ 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'
400:
- description: |
- Bad Request.
- Invalid request or validation error
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/BadRequest'
403:
- description: |
- Forbidden.
- The request must be conditional but no condition has been specified.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/Forbidden'
404:
- description: |
- Not Found.
- The resource to be updated does not exist.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/NotFound'
+ 409:
+ $ref: '#/components/responses/Conflict'
412:
- description: |
- Precondition Failed.
- The request has not been performed because one of the preconditions is not met.
- schema:
- $ref: '#/definitions/Error'
+ $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
-#-----------------------------------------------------
-# Delete the definition of an 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/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"
+ tags:
+ - APIs
summary: Delete an API
description: |
This operation can be used to delete an existing API proving the Id of the API.
parameters:
- - $ref: '#/parameters/apiId'
- - $ref: '#/parameters/If-Match'
- - $ref: '#/parameters/If-Unmodified-Since'
- tags:
- - API (Individual)
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/If-Match'
responses:
200:
description: |
OK.
Resource successfully deleted.
+ content: {}
403:
- description: |
- Forbidden.
- The request must be conditional but no condition has been specified.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/Forbidden'
404:
- description: |
- Not Found.
- Resource to be deleted does not exist.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/NotFound'
+ 409:
+ $ref: '#/components/responses/Conflict'
412:
- description: |
- Precondition Failed.
- The request has not been performed because one of the preconditions is not met.
- schema:
- $ref: '#/definitions/Error'
+ $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
-################################################################
-# The swagger resource of "Individual API" resource APIs
-################################################################
+ /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'
+
+ /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'
/apis/{apiId}/swagger:
-#-----------------------------------------------------
-# 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
+ tags:
+ - APIs
+ summary: Get Swagger Definition
description: |
This operation can be used to retrieve the swagger definition of an API.
parameters:
- - $ref: '#/parameters/apiId'
- - $ref: '#/parameters/Accept'
- - $ref: '#/parameters/If-None-Match'
- - $ref: '#/parameters/If-Modified-Since'
- tags:
- - API (Individual)
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/If-None-Match'
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).
- type: string
+ 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).
- type: string
+ schema:
+ type: string
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ type: string
+ example: ""
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:
- description: |
- Not Found.
- Requested API does not exist.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/NotFound'
406:
- description: |
- Not Acceptable.
- The requested media type is not supported
- schema:
- $ref: '#/definitions/Error'
+ $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
-#-----------------------------------------------------
-# Update the API swagger definition
-#-----------------------------------------------------
put:
- 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
+ tags:
+ - APIs
+ 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: '#/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)
+ - $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
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).
- type: string
+ 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).
- type: string
+ 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: ""
400:
- description: |
- Bad Request.
- Invalid request or validation error
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/BadRequest'
403:
- description: |
- Forbidden.
- The request must be conditional but no condition has been specified.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/Forbidden'
404:
- description: |
- Not Found.
- The resource to be updated does not exist.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/NotFound'
412:
- description: |
- Precondition Failed.
- The request has not been performed because one of the preconditions is not met.
- schema:
- $ref: '#/definitions/Error'
+ $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
-################################################################
-# The thumbnail resource of "Individual API" resource APIs
-################################################################
+ /apis/{apiId}/generate-mock-scripts:
+ post:
+ tags:
+ - APIs
+ summary: Generate Mock Response Payloads
+ description: |
+ This operation can be used to generate mock responses from examples of swagger definition of an API.
+ operationId: generateMockScripts
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/If-None-Match'
+ responses:
+ 200:
+ description: |
+ OK.
+ Requested swagger document of the API is returned with example responses
+ 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:
+ type: string
+ example: ""
+ 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'
+ 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: |
+ This operation can be used to get generated mock responses from examples of swagger definition of an API.
+ operationId: getGeneratedMockScriptsOfAPI
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/If-None-Match'
+ responses:
+ 200:
+ description: |
+ OK.
+ Requested swagger document of the API is returned with example responses
+ 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/MockResponsePayloadList'
+ 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'
+ 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: |
+ This operation can be used to retrieve conversion policy resource definitions of an API.
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - name: resourcePath
+ in: query
+ description: Resource path of the resource policy definition
+ schema:
+ type: string
+ - name: verb
+ in: query
+ description: HTTP verb of the resource path of the resource policy definition
+ schema:
+ type: string
+ - name: sequenceType
+ in: query
+ description: sequence type of the resource policy resource definition
+ required: true
+ schema:
+ type: string
+ - $ref: '#/components/parameters/If-None-Match'
+ responses:
+ 200:
+ description: |
+ OK.
+ List of resource policy definitions of the API is returned
+ 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/ResourcePolicyList'
+ 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'
+ 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}:
+ get:
+ tags:
+ - API Resource Policies
+ summary: Get the Resource Policy(inflow/outflow) Definition for a Given Resource
+ Identifier.
+ description: |
+ This operation can be used to retrieve conversion policy resource definitions of an API given the resource identifier.
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/resourcePolicyId'
+ - $ref: '#/components/parameters/If-None-Match'
+ responses:
+ 200:
+ description: |
+ OK.
+ Requested resource policy definition of the API is returned for the given resource identifier.
+ 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'
+ 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'
+ 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
+
+ put:
+ tags:
+ - API Resource Policies
+ summary: Update the Resource Policy(inflow/outflow) Definition for the Given
+ Resource Identifier
+ 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`.
+ 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
+ responses:
+ 200:
+ description: |
+ OK.
+ Successful response with updated the resource policy definition
+ 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/ResourcePolicyInfo'
+ 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
/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
+ tags:
+ - APIs
+ summary: Get Thumbnail Image
description: |
This operation can be used to download a thumbnail image of an API.
parameters:
- - $ref: '#/parameters/apiId'
- - $ref: '#/parameters/Accept'
- - $ref: '#/parameters/If-None-Match'
- - $ref: '#/parameters/If-Modified-Since'
- tags:
- - API (Individual)
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/If-None-Match'
responses:
200:
description: |
OK.
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).
- type: string
+ 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).
- type: string
+ schema:
+ type: string
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content: {}
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:
- description: |
- Not Found.
- Requested Document does not exist.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/NotFound'
406:
- description: |
- Not Acceptable.
- The requested media type is not supported
- schema:
- $ref: '#/definitions/Error'
+ $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
-#----------------------------------------------------------------------------
-# 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
+ put:
+ tags:
+ - APIs
+ summary: Upload a Thumbnail Image
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
parameters:
- - $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)
+ - $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
responses:
200:
description: |
OK.
Image updated
- schema:
- $ref : '#/definitions/FileInfo'
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
+ 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).
- type: string
+ 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'
400:
- description: |
- Bad Request.
- Invalid request or validation error.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/BadRequest'
404:
- description: |
- Not Found.
- The resource to be updated does not exist.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/NotFound'
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.
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/requestedTenant'
+ - $ref: '#/components/parameters/If-None-Match'
+ responses:
+ 200:
description: |
- Precondition Failed.
- The request has not been performed because one of the preconditions is not met.
- schema:
- $ref: '#/definitions/Error'
+ OK.
+ Throttling Policy returned
+ headers:
+ ETag:
+ description: |
+ Entity Tag of the response resource.
+ Used by caches, or in conditional requests.
+ schema:
+ type: string
+ Last-Modified:
+ description: |
+ Date and time the resource has been modifed the last time.
+ Used by caches, or in conditional requests.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ThrottlingPolicy'
+ 304:
+ description: |
+ Not Modified.
+ Empty body because the client has already the latest version of the requested resource.
+ content: {}
+ 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/subscription-policies"'
+ operationId: getAPISubscriptionPolicies
-######################################################
-# 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
+ tags:
+ - APIs
+ summary: Create a New API Version
description: |
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:
- - name: newVersion
- description: Version of the new API.
+ - name: newVersion
+ in: query
+ description: Version of the new API.
+ required: true
+ schema:
+ maxLength: 30
type: string
- in: query
- required: true
- - $ref: '#/parameters/apiId-Q'
- tags:
- - API (Individual)
+ - name: defaultVersion
+ in: query
+ description: Specifies whether new API should be added as default version.
+ schema:
+ type: boolean
+ default: false
+ - name: serviceVersion
+ in: query
+ description: Version of the Service that will used in creating new version
+ schema:
+ type: string
+ required: false
+ - $ref: '#/components/parameters/apiId-Q'
responses:
201:
description: |
@@ -740,38 +1149,31 @@ paths:
Location:
description: |
The URL of the newly created API.
- type: string
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/API'
400:
- description: |
- Bad Request.
- Invalid request or validation error
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/BadRequest'
404:
- description: |
- Not Found.
- API to copy does not exist.
- 401:
- description: |
- Unauthenticated request.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/NotFound'
+ 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/copy-api?newVersion=2.0&defaultVersion=false&apiId=2fd14eb8-b828-4013-b448-0739d2e76bf7"'
+ x-examples:
+ $ref: docs/examples/apis/apis_copyapi.yaml#/post
+ operationId: createNewAPIVersion
-######################################################
-# 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"
+ tags:
+ - API Lifecycle
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.
@@ -781,43 +1183,36 @@ paths:
Some actions supports providing additional paramters which should be provided as `lifecycleChecklist` parameter. Please see parameters table for more information.
parameters:
- name: action
+ in: query
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
- type: string
+ Supported actions are [ **Publish**, **Deploy as a Prototype**, **Demote to Created**, **Block**, **Deprecate**, **Re-Publish**, **Retire** ]
required: true
- enum:
- - Publish
- - Deploy as a Prototype
- - Demote to Created
- - Demote to Prototyped
- - Block
- - Deprecate
- - Re-Publish
- - Retire
+ schema:
+ type: string
+ enum:
+ - Publish
+ - Deploy as a Prototype
+ - Demote to Created
+ - Block
+ - Deprecate
+ - Re-Publish
+ - Retire
- name: lifecycleChecklist
- description: |
+ in: query
+ description: |2
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.
-
+ 1. **Deprecate old versions after publishing the API**: Setting this to true will deprecate older versions of a particular API when it is promoted to Published state from Created state.
+ 2. **Requires re-subscription when publishing the API**: If you set this to true, users need to re subscribe to the API although they may have subscribed to an older version.
You can specify additional checklist items by using an **"attribute:"** modifier.
-
- Eg: "Deprecate Old Versions: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)
+ Eg: "Deprecate old versions after publishing the API:true" will deprecate older versions of a particular API when it is promoted to Published state from Created state. Multiple checklist items can be given in "attribute1:true, attribute2:false" format.
+ **Sample CURL :** curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -X POST "https://localhost:9443/api/am/publisher/v2/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish&lifecycleChecklist=Deprecate%20old%20versions%20after%20publishing%20the%20API%3Atrue,Requires%20re-subscription%20when%20publishing%20the%20API%3Afalse"
+ schema:
+ type: string
+ - $ref: '#/components/parameters/apiId-Q'
+ - $ref: '#/components/parameters/If-Match'
responses:
200:
description: |
@@ -827,1151 +1222,3198 @@ paths:
ETag:
description: |
Entity Tag of the changed API. Used by caches, or in conditional requests (Will be supported in future).
- type: string
+ schema:
+ type: string
Last-Modified:
description: |
Date and time the API lifecycle has been modified the last time.
Used by caches, or in conditional requests (Will be supported in future).
- type: string
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/WorkflowResponse'
+ 202:
+ description: |
+ Accepted.
+ The request has been accepted.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/WorkflowResponse'
400:
- description: |
- Bad Request.
- Invalid request or validation error
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/BadRequest'
404:
- description: |
- Not Found.
- Requested API does not exist.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/NotFound'
+ 409:
+ $ref: '#/components/responses/Conflict'
412:
- description: |
- Precondition Failed.
- The request has not been performed because one of the preconditions is not met.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/PreconditionFailed'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ - apim:api_import_export
+ 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/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish"'
+ operationId: changeAPILifecycle
-######################################################
-# The "Document Collection" resource APIs
-######################################################
- /apis/{apiId}/documents:
-
-#-----------------------------------------------------
-# Retrieve the documents associated with an API that qualify under a search condition
-#-----------------------------------------------------
+ /apis/{apiId}/lifecycle-history:
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/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 retrive a list of documents belonging to an API by providing the id of the API.
- parameters:
- - $ref: '#/parameters/apiId'
- - $ref: '#/parameters/limit'
- - $ref: '#/parameters/offset'
- - $ref: '#/parameters/Accept'
- - $ref: '#/parameters/If-None-Match'
tags:
- - Document (Collection)
+ - API Lifecycle
+ summary: Get Lifecycle State Change History of the API.
+ description: |
+ This operation can be used to retrieve Lifecycle state change history of the API.
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/If-None-Match'
+ responses:
+ 200:
+ description: |
+ OK.
+ Lifecycle state change history returned 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
+ 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:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/LifecycleHistory'
+ 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'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ 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/890a4f4d-09eb-4877-a323-57f6ce2ed79b/lifecycle-history"'
+ operationId: getAPILifecycleHistory
+
+ /apis/{apiId}/lifecycle-state:
+ get:
+ tags:
+ - API Lifecycle
+ summary: Get Lifecycle State Data of the API.
+ description: |
+ This operation can be used to retrieve Lifecycle state data of the API.
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/If-None-Match'
+ responses:
+ 200:
+ description: |
+ OK.
+ Lifecycle state data returned 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
+ 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/LifecycleState'
+ 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'
+ 412:
+ $ref: '#/components/responses/PreconditionFailed'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ - 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/890a4f4d-09eb-4877-a323-57f6ce2ed79b/lifecycle-state"'
+ operationId: getAPILifecycleState
+
+ /apis/{apiId}/lifecycle-state/pending-tasks:
+ delete:
+ tags:
+ - API Lifecycle
+ summary: Delete Pending Lifecycle State Change Tasks
+ description: |
+ This operation can be used to remove pending lifecycle state change requests that are in pending state
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ responses:
+ 200:
+ description: |
+ OK.
+ Lifecycle state change pending task removed successfully.
+ content: {}
+ 404:
+ $ref: '#/components/responses/NotFound'
+ 412:
+ $ref: '#/components/responses/PreconditionFailed'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ 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/890a4f4d-09eb-4877-a323-57f6ce2ed79b/lifecycle-state/pending-tasks"'
+ operationId: deleteAPILifecycleStatePendingTasks
+
+ ######################################################
+ # The "API Revisions" resource API
+ ######################################################
+ /apis/{apiId}/revisions:
+
+ #--------------------------------------------
+ # List available revisions of an API
+ #--------------------------------------------
+ get:
+ tags:
+ - API Revisions
+ summary: List available revisions of an API
+ description: |
+ List available revisions of an API
+ operationId: getAPIRevisions
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - name: query
+ in: query
+ schema:
+ type: string
+ responses:
+ 200:
+ description: |
+ OK.
+ List of API revisions are returned.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIRevisionList'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ - 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/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions?query=deployed:true"'
+
+ #--------------------------------------------
+ # Create a new API revision
+ #--------------------------------------------
+ post:
+ tags:
+ - API Revisions
+ summary: Create a new API revision
+ description: |
+ Create a new API revision
+ operationId: createAPIRevision
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ requestBody:
+ description: API object that needs to be added
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIRevision'
+ responses:
+ 201:
+ description: |
+ Created.
+ Successful response with the newly created APIRevision object as the entity in the body.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIRevision'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ 412:
+ $ref: '#/components/responses/PreconditionFailed'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ - apim:api_import_export
+ 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/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions"'
+
+ ######################################################
+ # The "API Revisions" individual resource API
+ ######################################################
+ /apis/{apiId}/revisions/{revisionId}:
+
+ #--------------------------------------------
+ # Get a revision
+ #--------------------------------------------
+ get:
+ tags:
+ - API Revisions
+ summary: Retrieve a revision of an API
+ description: |
+ Retrieve a revision of an API
+ operationId: getAPIRevision
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/revisionId'
+ responses:
+ 200:
+ description: |
+ OK.
+ An API revision is returned.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIRevision'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ 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/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"'
+
+ #--------------------------------------------
+ # Delete a revision
+ #--------------------------------------------
+ delete:
+ tags:
+ - API Revisions
+ summary: Delete a revision of an API
+ description: |
+ Delete a revision of an API
+ operationId: deleteAPIRevision
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/revisionId'
+ responses:
+ 200:
+ description: |
+ OK.
+ List of remaining API revisions are returned.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIRevisionList'
+ 204:
+ description: |
+ No Content.
+ Successfully deleted the revision
+ 404:
+ $ref: '#/components/responses/NotFound'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ - 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/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"'
+
+ /apis/{apiId}/deploy-revision:
+
+ #--------------------------------------------
+ # List available deployed revision deployment details of an API
+ #--------------------------------------------
+ get:
+ tags:
+ - API Revisions
+ summary: List available deployed revision deployment details of an API
+ description: |
+ List available deployed revision deployment details of an API
+ operationId: getAPIRevisionDeployments
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ responses:
+ 200:
+ description: |
+ OK.
+ List of deployed revision deployment details are returned.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIRevisionDeploymentList'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ 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/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision"'
+
+ #--------------------------------------------
+ # Deploy a revision
+ #--------------------------------------------
+ post:
+ tags:
+ - API Revisions
+ summary: Deploy a revision
+ description: |
+ Deploy a revision
+ operationId: deployAPIRevision
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/revisionId-Q'
+ requestBody:
+ description: Deployment object that needs to be added
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/APIRevisionDeployment'
+ responses:
+ 200:
+ description: |
+ OK.
+ 201:
+ description: |
+ Created.
+ Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body.
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/APIRevisionDeployment'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ 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/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"'
+
+ /apis/{apiId}/undeploy-revision:
+ #--------------------------------------------
+ # Un-Deploy a revision from deployed gateway
+ #--------------------------------------------
+ post:
+ tags:
+ - API Revisions
+ summary: Un-Deploy a revision
+ description: |
+ Un-Deploy a revision
+ operationId: undeployAPIRevision
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/revisionId-Q'
+ - $ref: '#/components/parameters/revisionNum-Q'
+ - name: allEnvironments
+ in: query
+ schema:
+ type: boolean
+ default: false
+ requestBody:
+ description: Deployment object that needs to be added
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/APIRevisionDeployment'
+ responses:
+ 200:
+ description: |
+ OK.
+ 201:
+ description: |
+ Created.
+ Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body.
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/APIRevisionDeployment'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ - apim:api_import_export
+ 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/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/undeploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"'
+
+ /apis/{apiId}/restore-revision:
+
+ #--------------------------------------------------------
+ # Restore a revision to the working copy of the API
+ #--------------------------------------------------------
+ post:
+ tags:
+ - API Revisions
+ summary: Restore a revision
+ description: |
+ Restore a revision to the working copy of the API
+ operationId: restoreAPIRevision
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/revisionId-Q'
+ responses:
+ 201:
+ description: |
+ Restored.
+ Successful response with the newly restored API object as the entity in the body.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/API'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ 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/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/restore-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"'
+
+ /apis/import-service:
+ post:
+ tags:
+ - APIs
+ summary: Import a Service from Service Catalog
+ description: This operation can be used to create an API from a Service from Service Catalog
+ operationId: importServiceFromCatalog
+ parameters:
+ - name: serviceKey
+ in: query
+ required: true
+ schema:
+ type: string
+ description: ID of service that should be imported from Service Catalog
+ requestBody:
+ content:
+ application/json:
+ schema:
+ '$ref': '#/components/schemas/API'
+ responses:
+ 201:
+ description: |
+ Created.
+ Successful response with the newly created object as entity in the body.
+ Location header contains the URL of the newly created entity.
+ 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'
+
+ /apis/{apiId}/comments:
+ get:
+ tags:
+ - Comments
+ summary: Retrieve API Comments
+ description: |
+ Get a list of Comments that are already added to APIs
+ operationId: getAllCommentsOfAPI
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/requestedTenant'
+ - $ref: '#/components/parameters/limit'
+ - $ref: '#/components/parameters/offset'
+ - $ref: '#/components/parameters/includeCommenterInfo'
+ responses:
+ 200:
+ description: |
+ OK.
+ Comments list is returned.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CommentList'
+ 401:
+ $ref: '#/components/responses/Unauthorized'
+ 406:
+ $ref: '#/components/responses/NotAcceptable'
+ security:
+ - OAuth2Security: []
+ x-code-samples:
+ - lang: Curl
+ source: curl -k "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments"
+
+ post:
+ tags:
+ - Comments
+ summary: Add an API Comment
+ operationId: addCommentToAPI
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/parentCommentID'
+ requestBody:
+ description: |
+ Comment object that should to be added
+ content:
+ application/json:
+ schema:
+ title: Post request body
+ type: object
+ properties:
+ content:
+ type: string
+ description: |
+ Content of the comment
+ example: This is a comment
+ category:
+ type: string
+ description: |
+ Category of the comment
+ example: general
+ required:
+ - content
+ required: true
+ responses:
+ 201:
+ description: |
+ Created.
+ Successful response with the newly created object as entity in the body.
+ Location header contains URL of newly created entity.
+ headers:
+ ETag:
+ description: |
+ Entity Tag of the response resource. Used by caches, or in conditional request.
+ schema:
+ type: string
+ Location:
+ description: |
+ Location to the newly created Comment.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Comment'
+ 400:
+ $ref: '#/components/responses/BadRequest'
+ 401:
+ $ref: '#/components/responses/Unauthorized'
+ 415:
+ $ref: '#/components/responses/UnsupportedMediaType'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ 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://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments"'
+
+ /apis/{apiId}/comments/{commentId}:
+ get:
+ tags:
+ - Comments
+ summary: Get Details of an API Comment
+ description: |
+ Get the individual comment given by a username for a certain API.
+ operationId: getCommentOfAPI
+ parameters:
+ - $ref: '#/components/parameters/commentId'
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/requestedTenant'
+ - $ref: '#/components/parameters/If-None-Match'
+ - $ref: '#/components/parameters/includeCommenterInfo'
+ - $ref: '#/components/parameters/replyLimit'
+ - $ref: '#/components/parameters/replyOffset'
+ responses:
+ 200:
+ description: |
+ OK.
+ Comment returned.
+ headers:
+ ETag:
+ description: |
+ Entity Tag of the response resource.
+ Used by caches, or in conditional requests.
+ schema:
+ type: string
+ Last-Modified:
+ description: |
+ Date and time the resource has been modifed the last time.
+ Used by caches, or in conditional requests.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Comment'
+ 304:
+ description: |
+ Not Modified.
+ Empty body because the client has already the latest version of the requested resource.
+ content: {}
+ 401:
+ $ref: '#/components/responses/Unauthorized'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ 406:
+ $ref: '#/components/responses/NotAcceptable'
+ security:
+ - OAuth2Security: []
+ x-code-samples:
+ - lang: Curl
+ source: curl -k "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4"
+
+ patch:
+ tags:
+ - Comments
+ summary: Edit a comment
+ description: |
+ Edit the individual comment
+ operationId: editCommentOfAPI
+ parameters:
+ - $ref: '#/components/parameters/commentId'
+ - $ref: '#/components/parameters/apiId'
+ requestBody:
+ description: |
+ Comment object that should to be updated
+ content:
+ application/json:
+ schema:
+ title: Patch request body
+ type: object
+ properties:
+ content:
+ type: string
+ description: |
+ Content of the comment
+ example: This is a comment
+ category:
+ type: string
+ description: |
+ Category of the comment
+ example: general
+ required: true
+ responses:
+ 200:
+ description: |
+ OK.
+ Comment updated.
+ headers:
+ ETag:
+ description: |
+ Entity Tag of the response resource. Used by caches, or in conditional request.
+ schema:
+ type: string
+ Location: #???
+ description: |
+ Location to the newly created Comment.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Comment'
+ 400:
+ $ref: '#/components/responses/BadRequest'
+ 401:
+ $ref: '#/components/responses/Unauthorized'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ 415:
+ $ref: '#/components/responses/UnsupportedMediaType'
+ security:
+ - OAuth2Security:
+ - 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://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4"'
+
+ delete:
+ tags:
+ - Comments
+ summary: Delete an API Comment
+ description: |
+ Remove a Comment
+ operationId: deleteComment
+ parameters:
+ - $ref: '#/components/parameters/commentId'
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/If-Match'
+ responses:
+ 200:
+ description: |
+ OK.
+ Resource successfully deleted.
+ content: {}
+ 401:
+ $ref: '#/components/responses/Unauthorized'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ x-code-samples:
+ - lang: Curl
+ source: curl -k -X DELETE -H "Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
+ "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4"
+
+ /apis/{apiId}/comments/{commentId}/replies:
+ get:
+ tags:
+ - Comments
+ summary: Get replies of a comment
+ description: |
+ Get replies of a comment
+ operationId: getRepliesOfComment
+ parameters:
+ - $ref: '#/components/parameters/commentId'
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/requestedTenant'
+ - $ref: '#/components/parameters/limit'
+ - $ref: '#/components/parameters/offset'
+ - $ref: '#/components/parameters/If-None-Match'
+ - $ref: '#/components/parameters/includeCommenterInfo'
+ responses:
+ 200:
+ description: |
+ OK.
+ Comment returned.
+ headers:
+ ETag:
+ description: |
+ Entity Tag of the response resource.
+ Used by caches, or in conditional requests.
+ schema:
+ type: string
+ Last-Modified:
+ description: |
+ Date and time the resource has been modifed the last time.
+ Used by caches, or in conditional requests.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CommentList'
+ 304:
+ description: |
+ Not Modified.
+ Empty body because the client has already the latest version of the requested resource.
+ content: {}
+ 401:
+ $ref: '#/components/responses/Unauthorized'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ 406:
+ $ref: '#/components/responses/NotAcceptable'
+ security:
+ - OAuth2Security: []
+ x-code-samples:
+ - lang: Curl
+ source: curl -k "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4"
+
+ /apis/import-openapi:
+ post:
+ tags:
+ - APIs
+ summary: Import an OpenAPI Definition
+ description: |
+ This operation can be used to create an API from an OpenAPI definition. Provide either `url` or `file`
+ to specify the definition.
+
+ Specify additionalProperties with **at least** API's name, version, context and endpointConfig.
+ operationId: importOpenAPIDefinition
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ properties:
+ file:
+ type: string
+ description: Definition to upload as a file
+ format: binary
+ url:
+ type: string
+ description: Definition url
+ additionalProperties:
+ type: string
+ description: Additional attributes specified as a stringified JSON with API's schema
+ responses:
+ 201:
+ description: |
+ Created.
+ Successful response with the newly created object as entity in the body.
+ Location header contains URL of newly created entity.
+ 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
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/API'
+ 400:
+ $ref: '#/components/responses/BadRequest'
+ 415:
+ $ref: '#/components/responses/UnsupportedMediaType'
+ security:
+ - OAuth2Security:
+ - apim:api_create
+ x-code-samples:
+ - lang: Curl
+ source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
+ -F file=@openapi.json -F additionalProperties=@data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-openapi"'
+ x-examples:
+ $ref: docs/examples/apis/import_openapi_post.yaml
+
+ /apis/import-wsdl:
+ post:
+ tags:
+ - APIs
+ summary: Import a WSDL Definition
+ description: |
+ This operation can be used to create an API using a WSDL definition. Provide either `url` or `file`
+ to specify the definition.
+
+ WSDL can be speficied as a single file or a ZIP archive with WSDLs and reference XSDs etc.
+ Specify additionalProperties with **at least** API's name, version, context and endpointConfig.
+ operationId: importWSDLDefinition
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ properties:
+ file:
+ type: string
+ description: |
+ WSDL definition as a file or archive
+
+ **Sample cURL to Upload WSDL File**
+
+ curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -F file=@api.wsdl -F additionalProperties=@data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-wsdl"
+
+ **Sample cURL to Upload WSDL Archive**
+
+ curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -F file="@wsdl.zip;type=application/zip" -F additionalProperties=@data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-wsdl"
+ format: binary
+ url:
+ type: string
+ description: WSDL Definition url
+ additionalProperties:
+ type: string
+ description: Additional attributes specified as a stringified JSON
+ with API's schema
+ implementationType:
+ type: string
+ description: |
+ If 'SOAP' is specified, the API will be created with only one resource 'POST /*' which is to be used for SOAP
+ operations.
+
+ If 'HTTP_BINDING' is specified, the API will be created with resources using HTTP binding operations
+ which are extracted from the WSDL.
+ default: SOAP
+ enum:
+ - SOAPTOREST
+ - SOAP
+ responses:
+ 201:
+ description: |
+ Created.
+ Successful response with the newly created object as entity in the body.
+ Location header contains URL of newly created entity.
+ 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
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/API'
+ 400:
+ $ref: '#/components/responses/BadRequest'
+ 415:
+ $ref: '#/components/responses/UnsupportedMediaType'
+ security:
+ - OAuth2Security:
+ - apim:api_create
+ x-code-samples:
+ - lang: Curl
+ source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
+ -F file=@api.wsdl -F additionalProperties=@data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-wsdl"'
+ x-examples:
+ $ref: docs/examples/apis/wsdl/import_wsdl_post.yaml
+
+ /apis/import-graphql-schema:
+ post:
+ tags:
+ - APIs
+ summary: Import API Definition
+ description: |
+ This operation can be used to create api from api definition.APIMgtDAOTest
+
+ API definition is GraphQL Schema
+ parameters:
+ - name: If-Match
+ in: header
+ description: |
+ Validator for conditional requests; based on ETag.
+ schema:
+ type: string
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ properties:
+ type:
+ type: string
+ description: Definition type to upload
+ file:
+ type: string
+ description: Definition to uploads a file
+ format: binary
+ additionalProperties:
+ type: string
+ description: Additional attributes specified as a stringified JSON
+ with API's schema
+ responses:
+ 201:
+ description: |
+ Created.
+ Successful response with the newly created object as entity in the body.
+ Location header contains URL of newly created entity.
+ 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
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/API'
+ 400:
+ $ref: '#/components/responses/BadRequest'
+ 415:
+ $ref: '#/components/responses/UnsupportedMediaType'
+ security:
+ - OAuth2Security:
+ - apim:api_create
+ x-code-samples:
+ - lang: Curl
+ source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
+ -F file=@schema.graphql -F additionalProperties=@data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-graphql-schema"'
+ operationId: importGraphQLSchema
+
+ /apis/validate-openapi:
+ post:
+ tags:
+ - Validation
+ summary: Validate an OpenAPI Definition
+ description: |
+ This operation can be used to validate an OpenAPI definition and retrieve a summary. Provide either `url`
+ or `file` to specify the definition.
+ operationId: validateOpenAPIDefinition
+ parameters:
+ - name: returnContent
+ in: query
+ description: |
+ Specify whether to return the full content of the OpenAPI definition in the response. This is only
+ applicable when using url based validation
+ schema:
+ type: boolean
+ default: false
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ properties:
+ url:
+ type: string
+ description: OpenAPI definition url
+ file:
+ type: string
+ description: OpenAPI definition as a file
+ format: binary
+ responses:
+ 200:
+ description: |
+ OK.
+ API definition validation information is returned
+ headers:
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAPIDefinitionValidationResponse'
+ 400:
+ $ref: '#/components/responses/BadRequest'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ security:
+ - OAuth2Security:
+ - apim:api_create
+ x-code-samples:
+ - lang: Curl
+ source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
+ -F file=@openapi.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/validate-openapi"'
+ x-examples:
+ $ref: docs/examples/apis/validate_openapi_post.yaml
+
+ /apis/validate-endpoint:
+ post:
+ tags:
+ - Validation
+ summary: Check Whether Given Endpoint URL is Valid
+ description: |
+ Using this operation, it is possible check whether the given API endpoint url is a valid url
+ operationId: validateEndpoint
+ parameters:
+ - name: endpointUrl
+ in: query
+ description: API endpoint url
+ required: true
+ schema:
+ type: string
+ - name: apiId
+ in: query
+ schema:
+ type: string
+ responses:
+ 200:
+ description: |
+ OK.
+ API definition validation information is returned
+ headers:
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiEndpointValidationResponse'
+ 400:
+ $ref: '#/components/responses/BadRequest'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ 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/validate-endpoint?apiId=e0824883-3e86-403a-aec1-22bbc454eb7c&endpointUrl=https%3A%2F%2Flocalhost%3A9443%2Fam%2Fsample%2Fpizzashack%2Fv1%2Fapi%2F"'
+
+ /apis/validate:
+ post:
+ tags:
+ - Validation
+ summary: Check Given API Context Name already Exists
+ description: |
+ Using this operation, you can check a given API context is already used. You need to provide the context name you want to check.
+ operationId: validateAPI
+ parameters:
+ - name: query
+ in: query
+ description: |
+ **Search condition**.
+
+ You can search in attributes by using an **":"** modifier.
+
+ Eg.
+ "name:wso2" will match an API if the provider of the API is exactly "wso2".
+
+ Supported attribute modifiers are [** version, context, name **]
+
+ If no advanced attribute modifier has been specified, search will match the
+ given query string against API Name.
+ required: true
+ schema:
+ type: string
+ - $ref: '#/components/parameters/If-None-Match'
+ responses:
+ 200:
+ description: |
+ OK.
+ API definition validation information is returned
+ headers:
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content: {}
+ 400:
+ $ref: '#/components/responses/BadRequest'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ 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/validate?query=name%3Awso2"'
+ x-examples:
+ $ref: docs/examples/apis/apis_validate.yaml
+
+ /apis/validate-wsdl:
+ post:
+ tags:
+ - Validation
+ summary: Validate a WSDL Definition
+ description: |
+ This operation can be used to validate a WSDL definition and retrieve a summary. Provide either `url`
+ or `file` to specify the definition.
+ operationId: validateWSDLDefinition
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ properties:
+ url:
+ type: string
+ description: Definition url
+ file:
+ type: string
+ description: Definition to upload as a file
+ format: binary
+ responses:
+ 200:
+ description: |
+ OK.
+ API definition validation information is returned
+ headers:
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/WSDLValidationResponse'
+ 400:
+ $ref: '#/components/responses/BadRequest'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ security:
+ - OAuth2Security:
+ - apim:api_create
+ x-code-samples:
+ - lang: Curl
+ source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
+ -F file=@api.wsdl "https://127.0.0.1:9443/api/am/publisher/v2/apis/validate-wsdl"'
+ x-examples:
+ $ref: docs/examples/apis/wsdl/validate_wsdl_post.yaml
+
+ /apis/validate-graphql-schema:
+ post:
+ tags:
+ - Validation
+ summary: Validate GraphQL API Definition and Retrieve a Summary
+ description: |
+ This operation can be used to validate a graphQL definition and retrieve a summary.
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ required:
+ - file
+ properties:
+ file:
+ type: string
+ description: Definition to upload as a file
+ format: binary
+ required: true
+ responses:
+ 200:
+ description: |
+ OK.
+ API definition validation information is returned
+ headers:
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GraphQLValidationResponse'
+ 400:
+ $ref: '#/components/responses/BadRequest'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ security:
+ - OAuth2Security:
+ - apim:api_create
+ x-code-samples:
+ - lang: Curl
+ source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
+ -F file=@schema.graphql "https://127.0.0.1:9443/api/am/publisher/v2/apis/validate-graphql-schema"'
+ operationId: validateGraphQLSchema
+
+ /apis/{apiId}/graphql-schema:
+ get:
+ tags:
+ - GraphQL Schema (Individual)
+ summary: Get the Schema of a GraphQL API
+ description: |
+ This operation can be used to retrieve the Schema definition of a GraphQL API.
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/Accept'
+ - $ref: '#/components/parameters/If-None-Match'
+ responses:
+ 200:
+ description: |
+ OK.
+ Requested GraphQL Schema DTO object belongs to the 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
+ 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/GraphQLSchema'
+ 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'
+ 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/e0824883-3e86-403a-aec1-22bbc454eb7c/graphql-schema"'
+ operationId: getAPIGraphQLSchema
+
+ put:
+ tags:
+ - GraphQL Schema
+ summary: Add a Schema to a GraphQL API
+ description: |
+ This operation can be used to add a GraphQL Schema definition to an existing GraphQL API.
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/If-Match'
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ required:
+ - schemaDefinition
+ properties:
+ schemaDefinition:
+ type: string
+ description: schema definition of the GraphQL API
+ required: true
+ responses:
+ 200:
+ description: |
+ OK.
+ Successful response with updated schema definition
+ headers:
+ ETag:
+ description: |
+ Entity Tag of the response resource. Used by cache, 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: {}
+ 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 -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
+ -F schemaDefinition=@schema.graphql "https://127.0.0.1:9443/api/am/publisher/v2/apis/e0824883-3e86-403a-aec1-22bbc454eb7c/graphql-schema"'
+ operationId: updateAPIGraphQLSchema
+
+ /apis/{apiId}/amznResourceNames:
+ get:
+ tags:
+ - AWS Lambda (Individual)
+ summary: Retrieve the ARNs of AWS Lambda Functions
+ description: |
+ This operation can be use to retrieve ARNs of AWS Lambda function for a given AWS credentials.
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ responses:
+ 200:
+ description: |
+ OK.
+ Requested ARN List of the API is returned
+ headers:
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ type: string
+ example: |-
+ {
+ "count": "2",
+ "list": [
+ "arn:aws:lambda:us-west-2:123456789012:function:my-function1",
+ "arn:aws:lambda:us-west-2:123456789012:function:my-function2"
+ ]
+ }
+ 404:
+ $ref: '#/components/responses/NotFound'
+ 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/e0824883-3e86-403a-aec1-22bbc454eb7c/amznResourceNames"'
+ x-examples:
+ $ref: docs/examples/apis/apis_id_amznresourcenames_get.yaml
+ operationId: getAmazonResourceNamesOfAPI
+
+ /apis/{apiId}/monetize:
+ post:
+ tags:
+ - API Monetization
+ summary: Configure Monetization for a Given API
+ description: |
+ This operation can be used to configure monetization for a given API.
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ requestBody:
+ description: Monetization data object
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIMonetizationInfo'
+ required: true
+ responses:
+ 201:
+ description: |
+ OK.
+ Monetization status changed successfully.
+ content: {}
+ 400:
+ $ref: '#/components/responses/BadRequest'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ 406:
+ $ref: '#/components/responses/NotAcceptable'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ 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/96077508-fd01-4fae-bc64-5de0e2baf43c/monetize'
+ operationId: addAPIMonetization
+
+ /apis/{apiId}/monetization:
+ get:
+ tags:
+ - API Monetization
+ summary: Get Monetization Status for each Tier in a Given API
+ description: |
+ This operation can be used to get monetization status for each tier in a given API
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ responses:
+ 200:
+ description: |
+ OK.
+ Monetization status for each tier returned successfully.
+ content: {}
+ 400:
+ $ref: '#/components/responses/BadRequest'
+ 404:
+ $ref: '#/components/responses/NotFound'
+ 406:
+ $ref: '#/components/responses/NotAcceptable'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ 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/96077508-fd01-4fae-bc64-5de0e2baf43c/monetize"'
+ operationId: getAPIMonetization
+
+ /apis/{apiId}/revenue:
+ get:
+ tags:
+ - API Monetization
+ summary: Get Total Revenue Details of a Given Monetized API with Meterd Billing
+ description: |
+ This operation can be used to get details of total revenue details of a given monetized API with meterd billing.
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ responses:
+ 200:
+ description: |
+ OK.
+ Details of a total revenue returned.
+ 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 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/APIRevenue'
+ 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'
+ security:
+ - OAuth2Security:
+ - apim:api_publish
+ 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/96077508-fd01-4fae-bc64-5de0e2baf43c/revenue"'
+ operationId: getAPIRevenue
+
+ /apis/{apiId}/documents:
+ get:
+ tags:
+ - API Documents
+ summary: Get a List of Documents of an API
+ description: |
+ This operation can be used to retrieve a list of documents belonging to an API by providing the id of the API.
+ parameters:
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/limit'
+ - $ref: '#/components/parameters/offset'
+ - $ref: '#/components/parameters/If-None-Match'
responses:
200:
description: |
OK.
Document list is returned.
- schema:
- $ref: '#/definitions/DocumentList'
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
+ schema:
+ type: string
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DocumentList'
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:
- description: |
- Not Found.
- Requested API does not exist.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/NotFound'
406:
- description: |
- Not Acceptable.
- The requested media type is not supported
- schema:
- $ref: '#/definitions/Error'
+ $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/e0824883-3e86-403a-aec1-22bbc454eb7c/documents"'
+ operationId: getAPIDocuments
-#-----------------------------------------------------
-# 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
+ tags:
+ - API Documents
+ summary: Add a New Document to an API
description: |
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: '#/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)
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/If-Match'
+ requestBody:
+ description: Document object that needs to be added
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Document'
+ required: true
responses:
201:
description: |
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:
- Location:
- description: |
- Location to the newly created 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
+ schema:
+ type: string
+ Location:
+ description: |
+ Location to the newly created Document.
+ schema:
+ type: string
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Document'
400:
- description: |
- Bad Request.
- Invalid request or validation error
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/BadRequest'
415:
- description: |
- Unsupported media type.
- The entity of the request was in a not supported format.
+ $ref: '#/components/responses/UnsupportedMediaType'
+ security:
+ - OAuth2Security:
+ - apim:api_create
+ - apim:document_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/96077508-fd01-4fae-bc64-5de0e2baf43c/documents"'
+ operationId: addAPIDocument
-######################################################
-# The "Individual Document" resource APIs
-######################################################
- '/apis/{apiId}/documents/{documentId}':
-
-#-----------------------------------------------------
-# Retrieve a particular document of a certain API
-#-----------------------------------------------------
+ /apis/{apiId}/documents/{documentId}:
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/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
+ tags:
+ - API Documents
+ summary: Get a Document of an API
description: |
This operation can be used to retrieve a particular document's metadata associated with an API.
parameters:
- - $ref: '#/parameters/apiId'
- - $ref: '#/parameters/documentId'
- - $ref: '#/parameters/Accept'
- - $ref: '#/parameters/If-None-Match'
- - $ref: '#/parameters/If-Modified-Since'
- tags:
- - Document (Individual)
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/documentId'
+ - $ref: '#/components/parameters/If-None-Match'
responses:
200:
description: |
OK.
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).
- type: string
+ 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).
- type: string
+ schema:
+ type: string
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Document'
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:
- description: |
- Not Found.
- Requested Document does not exist.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/NotFound'
406:
- description: |
- Not Acceptable.
- The requested media type is not supported
- schema:
- $ref: '#/definitions/Error'
+ $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/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5"'
+ operationId: getAPIDocumentByDocumentId
-#-----------------------------------------------------
-# Update a particular document of a certain API
-#-----------------------------------------------------
put:
- 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
+ tags:
+ - API Documents
+ summary: Update a Document of an API
description: |
This operation can be used to update metadata of an API's document.
parameters:
- - $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)
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/documentId'
+ - $ref: '#/components/parameters/If-Match'
+ requestBody:
+ description: Document object that needs to be added
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Document'
+ required: true
responses:
200:
description: |
OK.
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).
- type: string
+ 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).
- type: string
+ schema:
+ type: string
+ Location:
+ description: |
+ The URL of the updated document.
+ schema:
+ type: string
+ Content-Type:
+ description: |
+ The content type of the body.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Document'
400:
- description: |
- Bad Request.
- Invalid request or validation error.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/BadRequest'
404:
- description: |
- Not Found.
- The resource to be updated does not exist.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/NotFound'
412:
- description: |
- Precondition Failed.
- The request has not been performed because one of the preconditions is not met.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/PreconditionFailed'
+ security:
+ - OAuth2Security:
+ - apim:api_create
+ - apim:document_manage
+ x-code-samples:
+ - lang: Curl
+ source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
+ -H "Content-Type: application/json" -d @doc.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5"'
+ operationId: updateAPIDocument
-#-----------------------------------------------------
-# 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
+ tags:
+ - API Documents
+ 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)
+ - $ref: '#/components/parameters/apiId'
+ - $ref: '#/components/parameters/documentId'
+ - $ref: '#/components/parameters/If-Match'
responses:
200:
description: |
OK.
Resource successfully deleted.
+ content: {}
404:
- description: |
- Not Found.
- Resource to be deleted does not exist.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/NotFound'
412:
- description: |
- Precondition Failed.
- The request has not been performed because one of the preconditions is not met.
- schema:
- $ref: '#/definitions/Error'
+ $ref: '#/components/responses/PreconditionFailed'
+ security:
+ - OAuth2Security:
+ - apim:api_create
+ - apim:document_manage
+ 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/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5"'
+ operationId: deleteAPIDocument
-################################################################
-# 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
-#-----------------------------------------------------
+ /apis/{apiId}/documents/{documentId}/content:
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
org.wso2.carbon.device.application.mgt.common.*
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml
index 82d75d4687..f861513e29 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml
@@ -51,8 +51,66 @@
Application Management Core Bundle
org.wso2.carbon.device.application.mgt.core.internal
- org.osgi.framework,
- org.osgi.service.component,
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.logging,
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
org.wso2.carbon.context.*,
@@ -62,8 +120,8 @@
javax.sql,
com.google.gson.*,
javax.naming,
- javax.xml.bind.annotation,
- javax.xml.bind,
+ javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}",
+ javax.xml.bind; version="${javax.xml.bind.imp.pkg.version}",
org.wso2.carbon.device.application.mgt.common.*,
org.wso2.carbon.device.mgt.core.*,
org.wso2.carbon.device.mgt.common.*,
@@ -348,6 +406,14 @@
+
+ org.wso2.carbon.devicemgt
+ org.wso2.carbon.identity.jwt.client.extension
+
+
+
+
+
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/OAuthUtils.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/OAuthUtils.java
index b57ffebeb7..33a9d0706f 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/OAuthUtils.java
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/OAuthUtils.java
@@ -63,7 +63,7 @@ public class OAuthUtils {
apiApplicationKeyInfo = apiManagementProviderService.
generateAndRetrieveApplicationKeys(registrationProfile.getApplicationName(),
registrationProfile.getTags(), Constants.ApplicationInstall.DEFAULT_TOKEN_TYPE,
- registrationProfile.getApplicationName(), registrationProfile.isAllowedToAllDomains(),
+ null, registrationProfile.isAllowedToAllDomains(),
Constants.ApplicationInstall.DEFAULT_VALIDITY_PERIOD);
} finally {
PrivilegedCarbonContext.endTenantFlow();
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/META-INF/webapp-classloading.xml
index da8baef61f..7a71395445 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/META-INF/webapp-classloading.xml
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/META-INF/webapp-classloading.xml
@@ -31,5 +31,5 @@
Tomcat environment is the default and every webapps gets it even if they didn't specify it.
e.g. If a webapps requires CXF, they will get both Tomcat and CXF.
-->
- CXF,Carbon
+ CXF3,Carbon
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/META-INF/webapp-classloading.xml
index da8baef61f..7a71395445 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/META-INF/webapp-classloading.xml
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/META-INF/webapp-classloading.xml
@@ -31,5 +31,5 @@
Tomcat environment is the default and every webapps gets it even if they didn't specify it.
e.g. If a webapps requires CXF, they will get both Tomcat and CXF.
-->
- CXF,Carbon
+ CXF3,Carbon
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml
index fa191390be..888eda3b79 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml
@@ -133,10 +133,22 @@
+
+
+
+
+
+
+ org.springframework
+ spring-web
+ provided
+
org.apache.cxf
- cxf-rt-frontend-jaxws
+ cxf-bundle-jaxrs
+ provided
+
commons-codec.wso2
commons-codec
@@ -147,24 +159,26 @@
-
- org.apache.cxf
- cxf-rt-frontend-jaxrs
-
-
- org.apache.cxf
- cxf-rt-transports-http
-
+
+
+
+
+
+
+
+
+
+
junit
junit
test
-
- javax.ws.rs
- jsr311-api
- provided
-
+
+
+
+
+
org.wso2.carbon
org.wso2.carbon.logging
@@ -207,11 +221,11 @@
-
- javax.servlet
- javax.servlet-api
- provided
-
+
+
+
+
+
org.wso2.carbon.devicemgt
org.wso2.carbon.apimgt.annotations
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml
index ed2ed21624..60db8782e9 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml
@@ -31,5 +31,5 @@
Tomcat environment is the default and every webapps gets it even if they didn't specify it.
e.g. If a webapps requires CXF, they will get both Tomcat and CXF.
-->
- CXF,Carbon
+ CXF3,Carbon
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml
index cbe533dd6d..94d2a8fec1 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml
@@ -133,10 +133,26 @@
+
+
+
+
+
+ org.springframework
+ spring-web
+ provided
+
org.apache.cxf
- cxf-rt-frontend-jaxws
+ cxf-bundle-jaxrs
+ provided
+
+
+
+
+
+
commons-codec.wso2
commons-codec
@@ -147,14 +163,10 @@
-
- org.apache.cxf
- cxf-rt-frontend-jaxrs
-
-
- org.apache.cxf
- cxf-rt-transports-http
-
+
+
+
+
junit
junit
@@ -204,11 +216,11 @@
-
- javax.servlet
- javax.servlet-api
- provided
-
+
+
+
+
+
org.wso2.carbon.devicemgt
org.wso2.carbon.apimgt.annotations
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/META-INF/webapp-classloading.xml
index ed2ed21624..60db8782e9 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/META-INF/webapp-classloading.xml
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/META-INF/webapp-classloading.xml
@@ -31,5 +31,5 @@
Tomcat environment is the default and every webapps gets it even if they didn't specify it.
e.g. If a webapps requires CXF, they will get both Tomcat and CXF.
-->
- CXF,Carbon
+ CXF3,Carbon
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml
index 6942c86d84..898f828dc5 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml
@@ -72,8 +72,8 @@
org.wso2.carbon.certificate.mgt.core.util
- org.osgi.framework,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.logging,
org.apache.commons.collections.map,
javax.security.auth.x500,
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml
index 6c47262ab0..698bba5d44 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml
@@ -140,8 +140,8 @@
org.apache.axis2.deployment.*,
org.apache.commons.lang;version="${commons-lang.wso2.osgi.version.range}",
org.apache.commons.logging,
- org.osgi.framework,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.w3c.dom,
org.wso2.carbon.context,
org.wso2.carbon.device.mgt.common.*,
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml
index 14a9d8c308..e8f93ec911 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml
@@ -82,8 +82,8 @@
org.wso2.carbon.device.mgt.extensions.pull.notification.*
- org.osgi.framework,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.logging,
org.wso2.carbon.device.mgt.common.*,
org.wso2.carbon.device.mgt.core.service
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml
index b102c68e13..a40a895622 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml
@@ -135,7 +135,8 @@
com.google.gson,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.device.mgt.common.operation.mgt,
org.wso2.carbon.device.mgt.common.push.notification,
org.apache.commons.logging,
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml
index 447951938b..994f41bfe5 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml
@@ -126,13 +126,13 @@
org.apache.commons.logging,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.context,
org.wso2.carbon.device.mgt.common.operation.mgt,
org.wso2.carbon.device.mgt.common.push.notification,
org.wso2.carbon.device.mgt.common,
org.wso2.carbon.device.mgt.core.service,
- org.osgi.framework,
org.wso2.carbon.device.mgt.core.operation.mgt,
org.wso2.carbon.core,
com.google.gson,
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml
index a59a3728a5..5b6766bb66 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml
@@ -148,7 +148,8 @@
org.apache.commons.logging,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.context,
org.wso2.carbon.device.mgt.common.operation.mgt,
org.wso2.carbon.device.mgt.common.push.notification,
@@ -157,7 +158,6 @@
org.wso2.carbon.device.mgt.core.service,
org.wso2.carbon.event.output.adapter.core,
org.wso2.carbon.event.output.adapter.core.exception,
- org.osgi.framework,
org.wso2.carbon.device.mgt.core.operation.mgt,
org.wso2.carbon.core,
org.wso2.carbon.device.application.mgt.common.*,
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml
index 1a6e1a58ab..81ac96adc5 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml
@@ -135,14 +135,14 @@
org.apache.commons.logging,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.context,
org.wso2.carbon.device.mgt.common.operation.mgt,
org.wso2.carbon.device.mgt.common.push.notification,
org.wso2.carbon.device.mgt.core.service,
org.wso2.carbon.event.output.adapter.core,
org.wso2.carbon.event.output.adapter.core.exception,
- org.osgi.framework,
org.wso2.carbon.core,
org.wso2.carbon.device.mgt.common.*
diff --git a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml
index bd43c8b626..4eada72d20 100644
--- a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml
+++ b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml
@@ -146,15 +146,26 @@
- org.apache.cxf
- cxf-rt-frontend-jaxrs
+ org.springframework
+ spring-web
provided
org.apache.cxf
- cxf-rt-transports-http
+ cxf-bundle-jaxrs
provided
+
+
+
+
+
+
+
+
+
+
+
javax.ws.rs
jsr311-api
diff --git a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java
index 9ccbecda3d..f9ee5e913d 100644
--- a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java
+++ b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java
@@ -200,8 +200,8 @@ public class DeviceManagementConfigServiceImpl implements DeviceManagementConfig
DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance().getDeviceManagementConfig();
KeyManagerConfigurations kmConfig = deviceManagementConfig.getKeyManagerConfigurations();
AppRegistrationCredentials credentials = DeviceManagerUtil.getApplicationRegistrationCredentials(
- System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_GATEWAY_HOST),
- System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_GATEWAY_HTTPS_PORT),
+ System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_CORE_HOST),
+ System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_CORE_HTTPS_PORT),
kmConfig.getAdminUsername(),
kmConfig.getAdminPassword());
AccessTokenInfo accessTokenForAdmin = DeviceManagerUtil.getAccessTokenForDeviceOwner(
diff --git a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/webapp/META-INF/webapp-classloading.xml
index 01aceabde5..a16c0a9cbf 100644
--- a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/webapp/META-INF/webapp-classloading.xml
+++ b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/webapp/META-INF/webapp-classloading.xml
@@ -31,5 +31,5 @@
Tomcat environment is the default and every webapps gets it even if they didn't specify it.
e.g. If a webapps requires CXF, they will get both Tomcat and CXF.
-->
- CXF,Carbon
+ CXF3,Carbon
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml
index 7e7060e5b2..d4849aceef 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml
@@ -107,8 +107,8 @@
org.wso2.carbon.device.mgt.analytics.data.publisher.*;version="${carbon.device.mgt.version}"
- org.osgi.framework,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.logging.*,
org.wso2.carbon.utils.multitenancy,
org.wso2.carbon.context;version="${carbon.kernel.version.range}",
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml
index d2992949d2..86b7e6e035 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml
@@ -146,30 +146,41 @@
- org.apache.cxf
- cxf-rt-frontend-jaxws
+ org.springframework
+ spring-web
provided
org.apache.cxf
- cxf-rt-frontend-jaxrs
- provided
-
-
- org.apache.cxf
- cxf-rt-transports-http
+ cxf-bundle-jaxrs
provided
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
commons-httpclient.wso2
commons-httpclient
provided
-
- javax.ws.rs
- jsr311-api
- provided
-
+
+
+
+
+
org.wso2.carbon
org.wso2.carbon.utils
@@ -200,11 +211,11 @@
org.wso2.carbon.device.mgt.common
provided
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.device.mgt.analytics.data.publisher
- provided
-
+
+
+
+
+
org.wso2.carbon.devicemgt
org.wso2.carbon.device.mgt.extensions
@@ -351,11 +362,11 @@
org.wso2.carbon.analytics.api
provided
-
- org.wso2.carbon.analytics
- org.wso2.carbon.analytics.datasource.commons
- provided
-
+
+
+
+
+
org.wso2.carbon.devicemgt
org.wso2.carbon.identity.jwt.client.extension
@@ -402,11 +413,11 @@
org.wso2.carbon.event.stream.persistence.stub
provided
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.apimgt.integration.client
- provided
-
+
+
+
+
+
org.powermock
powermock-module-testng
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java
index 9eddd91aeb..fc0ce9c794 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java
@@ -67,64 +67,64 @@ import javax.ws.rs.core.Response;
@Consumes(MediaType.APPLICATION_JSON)
public interface DeviceEventManagementService {
- @POST
- @Path("/{type}")
- @ApiOperation(
- produces = MediaType.APPLICATION_JSON,
- httpMethod = "POST",
- value = "Adding the Event Type Definition",
- notes = "Add the event definition for a device.",
- tags = "Device Event Management",
- extensions = {
- @Extension(properties = {
- @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events")
- })
- }
- )
- @ApiResponses(
- value = {
- @ApiResponse(
- code = 200,
- message = "OK. \n Successfully added the event defintion.",
- responseHeaders = {
- @ResponseHeader(
- name = "Content-Type",
- description = "The content type of the body"),
- @ResponseHeader(
- name = "ETag",
- description = "Entity Tag of the response resource.\n" +
- "Used by caches, or in conditional requests."),
- @ResponseHeader(
- name = "Last-Modified",
- description =
- "Date and time the resource was last modified.\n" +
- "Used by caches, or in conditional requests."),
- }
- ),
- @ApiResponse(
- code = 400,
- message =
- "Bad Request. \n"),
- @ApiResponse(
- code = 406,
- message = "Not Acceptable.\n The requested media type is not supported"),
- @ApiResponse(
- code = 500,
- message = "Internal Server Error. \n Server error occurred while fetching the " +
- "list of supported device types.",
- response = ErrorResponse.class)
- }
- )
- Response deployDeviceTypeEventDefinition(
- @ApiParam(name = "type", value = "The device type, such as android, ios, and windows.")
- @PathParam("type")String deviceType,
- @ApiParam(name = "skipPersist", value = "Is it required to persist the data or not")
- @QueryParam("skipPersist") boolean skipPersist,
- @ApiParam(name = "isSharedWithAllTenants", value = "Should artifacts be available to all tenants")
- @QueryParam("isSharedWithAllTenants") boolean isSharedWithAllTenants,
- @ApiParam(name = "deviceTypeEvent", value = "Add the data to complete the DeviceTypeEvent object.",
- required = true)
- @Valid DeviceTypeEvent deviceTypeEvent);
+// @POST
+// @Path("/{type}")
+// @ApiOperation(
+// produces = MediaType.APPLICATION_JSON,
+// httpMethod = "POST",
+// value = "Adding the Event Type Definition",
+// notes = "Add the event definition for a device.",
+// tags = "Device Event Management",
+// extensions = {
+// @Extension(properties = {
+// @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events")
+// })
+// }
+// )
+// @ApiResponses(
+// value = {
+// @ApiResponse(
+// code = 200,
+// message = "OK. \n Successfully added the event defintion.",
+// responseHeaders = {
+// @ResponseHeader(
+// name = "Content-Type",
+// description = "The content type of the body"),
+// @ResponseHeader(
+// name = "ETag",
+// description = "Entity Tag of the response resource.\n" +
+// "Used by caches, or in conditional requests."),
+// @ResponseHeader(
+// name = "Last-Modified",
+// description =
+// "Date and time the resource was last modified.\n" +
+// "Used by caches, or in conditional requests."),
+// }
+// ),
+// @ApiResponse(
+// code = 400,
+// message =
+// "Bad Request. \n"),
+// @ApiResponse(
+// code = 406,
+// message = "Not Acceptable.\n The requested media type is not supported"),
+// @ApiResponse(
+// code = 500,
+// message = "Internal Server Error. \n Server error occurred while fetching the " +
+// "list of supported device types.",
+// response = ErrorResponse.class)
+// }
+// )
+// Response deployDeviceTypeEventDefinition(
+// @ApiParam(name = "type", value = "The device type, such as android, ios, and windows.")
+// @PathParam("type")String deviceType,
+// @ApiParam(name = "skipPersist", value = "Is it required to persist the data or not")
+// @QueryParam("skipPersist") boolean skipPersist,
+// @ApiParam(name = "isSharedWithAllTenants", value = "Should artifacts be available to all tenants")
+// @QueryParam("isSharedWithAllTenants") boolean isSharedWithAllTenants,
+// @ApiParam(name = "deviceTypeEvent", value = "Add the data to complete the DeviceTypeEvent object.",
+// required = true)
+// @Valid DeviceTypeEvent deviceTypeEvent);
@DELETE
@Path("/{type}")
@@ -178,183 +178,183 @@ public interface DeviceEventManagementService {
"ios, and windows.", required = false)
@PathParam("type")String deviceType);
- @GET
- @Path("/{type}/{deviceId}")
- @ApiOperation(
- produces = MediaType.APPLICATION_JSON,
- httpMethod = "GET",
- value = "Getting Device Events",
- notes = "Get the events for the device.",
- tags = "Device Event Management",
- extensions = {
- @Extension(properties = {
- @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events:view")
- })
- }
- )
- @ApiResponses(
- value = {
- @ApiResponse(
- code = 200,
- message = "OK. \n Successfully fetched the event definition.",
- response = EventRecords.class,
- responseHeaders = {
- @ResponseHeader(
- name = "Content-Type",
- description = "The content type of the body"),
- @ResponseHeader(
- name = "ETag",
- description = "Entity Tag of the response resource.\n" +
- "Used by caches, or in conditional requests."),
- @ResponseHeader(
- name = "Last-Modified",
- description =
- "Date and time the resource was last modified.\n" +
- "Used by caches, or in conditional requests."),
- }
- ),
- @ApiResponse(
- code = 400,
- message =
- "Bad Request. \n"),
- @ApiResponse(
- code = 406,
- message = "Not Acceptable.\n The requested media type is not supported"),
- @ApiResponse(
- code = 500,
- message = "Internal Server Error. \n Server error occurred while fetching the " +
- "list of supported device types.",
- response = ErrorResponse.class)
- }
- )
- Response getData(@ApiParam(name = "deviceId", value = "id of the device ", required = false)
- @PathParam("deviceId") String deviceId,
- @ApiParam(name = "from", value = "unix timestamp to retrieve", required = false)
- @QueryParam("from") long from,
- @ApiParam(name = "to", value = "unix time to retrieve", required = false)
- @QueryParam("to") long to,
- @ApiParam(name = "type", value = "name of the device type", required = false)
- @PathParam("type") String deviceType,
- @ApiParam(name = "offset", value = "offset of the records that needs to be picked up", required = false)
- @QueryParam("offset") int offset,
- @ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false)
- @QueryParam("limit") int limit);
+// @GET
+// @Path("/{type}/{deviceId}")
+// @ApiOperation(
+// produces = MediaType.APPLICATION_JSON,
+// httpMethod = "GET",
+// value = "Getting Device Events",
+// notes = "Get the events for the device.",
+// tags = "Device Event Management",
+// extensions = {
+// @Extension(properties = {
+// @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events:view")
+// })
+// }
+// )
+// @ApiResponses(
+// value = {
+// @ApiResponse(
+// code = 200,
+// message = "OK. \n Successfully fetched the event definition.",
+// response = EventRecords.class,
+// responseHeaders = {
+// @ResponseHeader(
+// name = "Content-Type",
+// description = "The content type of the body"),
+// @ResponseHeader(
+// name = "ETag",
+// description = "Entity Tag of the response resource.\n" +
+// "Used by caches, or in conditional requests."),
+// @ResponseHeader(
+// name = "Last-Modified",
+// description =
+// "Date and time the resource was last modified.\n" +
+// "Used by caches, or in conditional requests."),
+// }
+// ),
+// @ApiResponse(
+// code = 400,
+// message =
+// "Bad Request. \n"),
+// @ApiResponse(
+// code = 406,
+// message = "Not Acceptable.\n The requested media type is not supported"),
+// @ApiResponse(
+// code = 500,
+// message = "Internal Server Error. \n Server error occurred while fetching the " +
+// "list of supported device types.",
+// response = ErrorResponse.class)
+// }
+// )
+// Response getData(@ApiParam(name = "deviceId", value = "id of the device ", required = false)
+// @PathParam("deviceId") String deviceId,
+// @ApiParam(name = "from", value = "unix timestamp to retrieve", required = false)
+// @QueryParam("from") long from,
+// @ApiParam(name = "to", value = "unix time to retrieve", required = false)
+// @QueryParam("to") long to,
+// @ApiParam(name = "type", value = "name of the device type", required = false)
+// @PathParam("type") String deviceType,
+// @ApiParam(name = "offset", value = "offset of the records that needs to be picked up", required = false)
+// @QueryParam("offset") int offset,
+// @ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false)
+// @QueryParam("limit") int limit);
- @GET
- @Path("last-known/{type}/{deviceId}")
- @ApiOperation(
- produces = MediaType.APPLICATION_JSON,
- httpMethod = "GET",
- value = "Getting Last Known Device Events",
- notes = "Get the last known events for the device.",
- tags = "Device Event Management",
- extensions = {
- @Extension(properties = {
- @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events:view")
- })
- }
- )
- @ApiResponses(
- value = {
- @ApiResponse(
- code = 200,
- message = "OK. \n Successfully fetched the event.",
- response = EventRecords.class,
- responseHeaders = {
- @ResponseHeader(
- name = "Content-Type",
- description = "The content type of the body"),
- @ResponseHeader(
- name = "ETag",
- description = "Entity Tag of the response resource.\n" +
- "Used by caches, or in conditional requests."),
- @ResponseHeader(
- name = "Last-Modified",
- description =
- "Date and time the resource was last modified.\n" +
- "Used by caches, or in conditional requests."),
- }
- ),
- @ApiResponse(
- code = 400,
- message =
- "Bad Request. \n"),
- @ApiResponse(
- code = 406,
- message = "Not Acceptable.\n The requested media type is not supported"),
- @ApiResponse(
- code = 500,
- message = "Internal Server Error. \n Server error occurred while fetching the " +
- "list of supported device types.",
- response = ErrorResponse.class)
- }
- )
- Response getLastKnownData(@ApiParam(name = "deviceId", value = "id of the device ", required = true)
- @PathParam("deviceId") String deviceId,
- @ApiParam(name = "type", value = "name of the device type", required = true)
- @PathParam("type") String deviceType,
- @ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false)
- @QueryParam("limit") int limit);
+// @GET
+// @Path("last-known/{type}/{deviceId}")
+// @ApiOperation(
+// produces = MediaType.APPLICATION_JSON,
+// httpMethod = "GET",
+// value = "Getting Last Known Device Events",
+// notes = "Get the last known events for the device.",
+// tags = "Device Event Management",
+// extensions = {
+// @Extension(properties = {
+// @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events:view")
+// })
+// }
+// )
+// @ApiResponses(
+// value = {
+// @ApiResponse(
+// code = 200,
+// message = "OK. \n Successfully fetched the event.",
+// response = EventRecords.class,
+// responseHeaders = {
+// @ResponseHeader(
+// name = "Content-Type",
+// description = "The content type of the body"),
+// @ResponseHeader(
+// name = "ETag",
+// description = "Entity Tag of the response resource.\n" +
+// "Used by caches, or in conditional requests."),
+// @ResponseHeader(
+// name = "Last-Modified",
+// description =
+// "Date and time the resource was last modified.\n" +
+// "Used by caches, or in conditional requests."),
+// }
+// ),
+// @ApiResponse(
+// code = 400,
+// message =
+// "Bad Request. \n"),
+// @ApiResponse(
+// code = 406,
+// message = "Not Acceptable.\n The requested media type is not supported"),
+// @ApiResponse(
+// code = 500,
+// message = "Internal Server Error. \n Server error occurred while fetching the " +
+// "list of supported device types.",
+// response = ErrorResponse.class)
+// }
+// )
+// Response getLastKnownData(@ApiParam(name = "deviceId", value = "id of the device ", required = true)
+// @PathParam("deviceId") String deviceId,
+// @ApiParam(name = "type", value = "name of the device type", required = true)
+// @PathParam("type") String deviceType,
+// @ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false)
+// @QueryParam("limit") int limit);
- @GET
- @Path("filter/{type}/{parameter}")
- @ApiOperation(
- produces = MediaType.APPLICATION_JSON,
- httpMethod = "GET",
- value = "Getting the filtered devices",
- notes = "Get the list of devices based on the filter parameter",
- tags = "Device Event Management",
- extensions = {
- @Extension(properties = {
- @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events:view")
- })
- }
- )
- @ApiResponses(
- value = {
- @ApiResponse(
- code = 200,
- message = "OK. \n Successfully fetched the event.",
- response = EventRecords.class,
- responseHeaders = {
- @ResponseHeader(
- name = "Content-Type",
- description = "The content type of the body"),
- @ResponseHeader(
- name = "ETag",
- description = "Entity Tag of the response resource.\n" +
- "Used by caches, or in conditional requests."),
- @ResponseHeader(
- name = "Last-Modified",
- description =
- "Date and time the resource was last modified.\n" +
- "Used by caches, or in conditional requests."),
- }
- ),
- @ApiResponse(
- code = 400,
- message =
- "Bad Request. \n"),
- @ApiResponse(
- code = 406,
- message = "Not Acceptable.\n The requested media type is not supported"),
- @ApiResponse(
- code = 500,
- message = "Internal Server Error. \n Server error occurred while fetching the " +
- "list of supported device types.",
- response = ErrorResponse.class)
- }
- )
- Response getFilteredDevices(
- @ApiParam(name = "type", value = "name of the device type", required = true)
- @PathParam("type") String deviceType,
- @ApiParam(name = "type", value = "name of the parameter", required = true)
- @PathParam("type") String parameter,
- @ApiParam(name = "limit", value = "minimum value the parameter can have", required = false)
- @QueryParam("min") double min,
- @ApiParam(name = "max", value = "max value the parameter can have", required = false)
- @QueryParam("max") double max
- );
+// @GET
+// @Path("filter/{type}/{parameter}")
+// @ApiOperation(
+// produces = MediaType.APPLICATION_JSON,
+// httpMethod = "GET",
+// value = "Getting the filtered devices",
+// notes = "Get the list of devices based on the filter parameter",
+// tags = "Device Event Management",
+// extensions = {
+// @Extension(properties = {
+// @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events:view")
+// })
+// }
+// )
+// @ApiResponses(
+// value = {
+// @ApiResponse(
+// code = 200,
+// message = "OK. \n Successfully fetched the event.",
+// response = EventRecords.class,
+// responseHeaders = {
+// @ResponseHeader(
+// name = "Content-Type",
+// description = "The content type of the body"),
+// @ResponseHeader(
+// name = "ETag",
+// description = "Entity Tag of the response resource.\n" +
+// "Used by caches, or in conditional requests."),
+// @ResponseHeader(
+// name = "Last-Modified",
+// description =
+// "Date and time the resource was last modified.\n" +
+// "Used by caches, or in conditional requests."),
+// }
+// ),
+// @ApiResponse(
+// code = 400,
+// message =
+// "Bad Request. \n"),
+// @ApiResponse(
+// code = 406,
+// message = "Not Acceptable.\n The requested media type is not supported"),
+// @ApiResponse(
+// code = 500,
+// message = "Internal Server Error. \n Server error occurred while fetching the " +
+// "list of supported device types.",
+// response = ErrorResponse.class)
+// }
+// )
+// Response getFilteredDevices(
+// @ApiParam(name = "type", value = "name of the device type", required = true)
+// @PathParam("type") String deviceType,
+// @ApiParam(name = "type", value = "name of the parameter", required = true)
+// @PathParam("type") String parameter,
+// @ApiParam(name = "limit", value = "minimum value the parameter can have", required = false)
+// @QueryParam("min") double min,
+// @ApiParam(name = "max", value = "max value the parameter can have", required = false)
+// @QueryParam("max") double max
+// );
@GET
@Path("/{type}")
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java
index 5e55acdc77..8b3071f1ef 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java
@@ -97,71 +97,71 @@ public interface GeoLocationBasedService {
/**
* Retrieve Analytics for the device type
*/
- @GET
- @Path("stats/{deviceType}/{deviceId}")
- @ApiOperation(
- consumes = "application/json",
- produces = "application/json",
- httpMethod = "GET",
- value = "Getting the Location Details of a Device",
- notes = "Get the location details of a device during a define time period.",
- response = Response.class,
- tags = "Geo Service Management",
- extensions = {
- @Extension(properties = {
- @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:analytics-view")
- })
- }
- )
- @ApiResponses(value = {
- @ApiResponse(
- code = 200,
- message = "OK.",
- response = Response.class,
- responseHeaders = {
- @ResponseHeader(
- name = "Content-Type",
- description = "The content type of the body"),
- @ResponseHeader(
- name = "Last-Modified",
- description = "Date and time the resource was last modified.\n" +
- "Used by caches, or in conditional requests."),
- }),
- @ApiResponse(
- code = 400,
- message = "Bad Request. \n Invalid Device Identifiers found.",
- response = Response.class),
- @ApiResponse(
- code = 401,
- message = "Unauthorized. \n Unauthorized request."),
- @ApiResponse(
- code = 500,
- message = "Internal Server Error. \n Error on retrieving stats",
- response = Response.class)
- })
- Response getGeoDeviceStats(
- @ApiParam(
- name = "deviceId",
- value = "The device ID.",
- required = true)
- @PathParam("deviceId") String deviceId,
- @ApiParam(
- name = "device-type",
- value = "The device type, such as ios, android, or windows.",
- required = true)
- @PathParam("deviceType")
- @Size(max = 45)
- String deviceType,
- @ApiParam(
- name = "from",
- value = "Define the time to start getting the geo location history of the device in the Epoch or UNIX format.",
- required = true)
- @QueryParam("from") long from,
- @ApiParam(
- name = "to",
- value = "Define the time to finish getting the geo location history of the device in the Epoch or UNIX format.",
- required = true)
- @QueryParam("to") long to);
+// @GET
+// @Path("stats/{deviceType}/{deviceId}")
+// @ApiOperation(
+// consumes = "application/json",
+// produces = "application/json",
+// httpMethod = "GET",
+// value = "Getting the Location Details of a Device",
+// notes = "Get the location details of a device during a define time period.",
+// response = Response.class,
+// tags = "Geo Service Management",
+// extensions = {
+// @Extension(properties = {
+// @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:analytics-view")
+// })
+// }
+// )
+// @ApiResponses(value = {
+// @ApiResponse(
+// code = 200,
+// message = "OK.",
+// response = Response.class,
+// responseHeaders = {
+// @ResponseHeader(
+// name = "Content-Type",
+// description = "The content type of the body"),
+// @ResponseHeader(
+// name = "Last-Modified",
+// description = "Date and time the resource was last modified.\n" +
+// "Used by caches, or in conditional requests."),
+// }),
+// @ApiResponse(
+// code = 400,
+// message = "Bad Request. \n Invalid Device Identifiers found.",
+// response = Response.class),
+// @ApiResponse(
+// code = 401,
+// message = "Unauthorized. \n Unauthorized request."),
+// @ApiResponse(
+// code = 500,
+// message = "Internal Server Error. \n Error on retrieving stats",
+// response = Response.class)
+// })
+// Response getGeoDeviceStats(
+// @ApiParam(
+// name = "deviceId",
+// value = "The device ID.",
+// required = true)
+// @PathParam("deviceId") String deviceId,
+// @ApiParam(
+// name = "device-type",
+// value = "The device type, such as ios, android, or windows.",
+// required = true)
+// @PathParam("deviceType")
+// @Size(max = 45)
+// String deviceType,
+// @ApiParam(
+// name = "from",
+// value = "Define the time to start getting the geo location history of the device in the Epoch or UNIX format.",
+// required = true)
+// @QueryParam("from") long from,
+// @ApiParam(
+// name = "to",
+// value = "Define the time to finish getting the geo location history of the device in the Epoch or UNIX format.",
+// required = true)
+// @QueryParam("to") long to);
/**
* Get data to show device locations in a map
@@ -602,128 +602,128 @@ public interface GeoLocationBasedService {
/**
* Retrieve Geo alerts history
*/
- @GET
- @Path("alerts/history/{deviceType}/{deviceId}")
- @ApiOperation(
- consumes = "application/json",
- produces = "application/json",
- httpMethod = "GET",
- value = "Getting the Geo Service Alert History of a Device",
- notes = "Get the geo alert history of a device during the defined time period.",
- response = Response.class,
- tags = "Geo Service Management",
- extensions = {
- @Extension(properties = {
- @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage")
- })
- }
- )
- @ApiResponses(value = {
- @ApiResponse(
- code = 200,
- message = "OK.",
- response = Response.class,
- responseHeaders = {
- @ResponseHeader(
- name = "Content-Type",
- description = "The content type of the body"),
- @ResponseHeader(
- name = "Last-Modified",
- description = "Date and time the resource was last modified.\n" +
- "Used by caches, or in conditional requests.")
- }),
- @ApiResponse(
- code = 400,
- message = "Bad Request. \n Invalid Device Identifiers found.",
- response = Response.class),
- @ApiResponse(
- code = 401,
- message = "Unauthorized. \n Unauthorized request."),
- @ApiResponse(
- code = 500,
- message = "Internal Server Error. \n Error on retrieving stats",
- response = Response.class)
- })
- Response getGeoAlertsHistory(
- @ApiParam(
- name = "deviceId",
- value = "The device ID.",
- required = true)
- @PathParam("deviceId") String deviceId,
- @ApiParam(
- name = "device-type",
- value = "The device type, such as ios, android, or windows.",
- required = true)
- @PathParam("deviceType")
- @Size(max = 45)
- String deviceType,
- @ApiParam(
- name = "from",
- value = "Define the time to start getting the geo location history of the device in the Epoch or UNIX format.",
- required = true)
- @QueryParam("from") long from,
- @ApiParam(
- name = "to",
- value = "Define the time to finish getting the geo location history of the device in the Epoch or UNIX format.",
- required = true)
- @QueryParam("to") long to);
+// @GET
+// @Path("alerts/history/{deviceType}/{deviceId}")
+// @ApiOperation(
+// consumes = "application/json",
+// produces = "application/json",
+// httpMethod = "GET",
+// value = "Getting the Geo Service Alert History of a Device",
+// notes = "Get the geo alert history of a device during the defined time period.",
+// response = Response.class,
+// tags = "Geo Service Management",
+// extensions = {
+// @Extension(properties = {
+// @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage")
+// })
+// }
+// )
+// @ApiResponses(value = {
+// @ApiResponse(
+// code = 200,
+// message = "OK.",
+// response = Response.class,
+// responseHeaders = {
+// @ResponseHeader(
+// name = "Content-Type",
+// description = "The content type of the body"),
+// @ResponseHeader(
+// name = "Last-Modified",
+// description = "Date and time the resource was last modified.\n" +
+// "Used by caches, or in conditional requests.")
+// }),
+// @ApiResponse(
+// code = 400,
+// message = "Bad Request. \n Invalid Device Identifiers found.",
+// response = Response.class),
+// @ApiResponse(
+// code = 401,
+// message = "Unauthorized. \n Unauthorized request."),
+// @ApiResponse(
+// code = 500,
+// message = "Internal Server Error. \n Error on retrieving stats",
+// response = Response.class)
+// })
+// Response getGeoAlertsHistory(
+// @ApiParam(
+// name = "deviceId",
+// value = "The device ID.",
+// required = true)
+// @PathParam("deviceId") String deviceId,
+// @ApiParam(
+// name = "device-type",
+// value = "The device type, such as ios, android, or windows.",
+// required = true)
+// @PathParam("deviceType")
+// @Size(max = 45)
+// String deviceType,
+// @ApiParam(
+// name = "from",
+// value = "Define the time to start getting the geo location history of the device in the Epoch or UNIX format.",
+// required = true)
+// @QueryParam("from") long from,
+// @ApiParam(
+// name = "to",
+// value = "Define the time to finish getting the geo location history of the device in the Epoch or UNIX format.",
+// required = true)
+// @QueryParam("to") long to);
/**
* Retrieve Geo alerts history for geo clusters
*/
- @GET
- @Path("alerts/history")
- @ApiOperation(
- consumes = "application/json",
- produces = "application/json",
- httpMethod = "GET",
- value = "Retrieve Geo alerts history for geo clusters",
- notes = "Retrieving geo alert history of all defined alerts for geo clusters",
- response = Response.class,
- tags = "Geo Service Management",
- extensions = {
- @Extension(properties = {
- @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage")
- })
- }
- )
- @ApiResponses(value = {
- @ApiResponse(
- code = 200,
- message = "OK.",
- response = Response.class,
- responseHeaders = {
- @ResponseHeader(
- name = "Content-Type",
- description = "The content type of the body"),
- @ResponseHeader(
- name = "Last-Modified",
- description = "Date and time the resource was last modified.\n" +
- "Used by caches, or in conditional requests.")
- }),
- @ApiResponse(
- code = 400,
- message = "Bad Request. \n Invalid Device Identifiers found.",
- response = Response.class),
- @ApiResponse(
- code = 401,
- message = "Unauthorized. \n Unauthorized request."),
- @ApiResponse(
- code = 500,
- message = "Internal Server Error. \n Error on retrieving stats",
- response = Response.class)
- })
- Response getGeoAlertsHistoryForGeoClusters(
- @ApiParam(
- name = "from",
- value = "Get stats from what time",
- required = true)
- @QueryParam("from") long from,
- @ApiParam(
- name = "to",
- value = "Get stats up to what time",
- required = true)
- @QueryParam("to") long to);
+// @GET
+// @Path("alerts/history")
+// @ApiOperation(
+// consumes = "application/json",
+// produces = "application/json",
+// httpMethod = "GET",
+// value = "Retrieve Geo alerts history for geo clusters",
+// notes = "Retrieving geo alert history of all defined alerts for geo clusters",
+// response = Response.class,
+// tags = "Geo Service Management",
+// extensions = {
+// @Extension(properties = {
+// @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage")
+// })
+// }
+// )
+// @ApiResponses(value = {
+// @ApiResponse(
+// code = 200,
+// message = "OK.",
+// response = Response.class,
+// responseHeaders = {
+// @ResponseHeader(
+// name = "Content-Type",
+// description = "The content type of the body"),
+// @ResponseHeader(
+// name = "Last-Modified",
+// description = "Date and time the resource was last modified.\n" +
+// "Used by caches, or in conditional requests.")
+// }),
+// @ApiResponse(
+// code = 400,
+// message = "Bad Request. \n Invalid Device Identifiers found.",
+// response = Response.class),
+// @ApiResponse(
+// code = 401,
+// message = "Unauthorized. \n Unauthorized request."),
+// @ApiResponse(
+// code = 500,
+// message = "Internal Server Error. \n Error on retrieving stats",
+// response = Response.class)
+// })
+// Response getGeoAlertsHistoryForGeoClusters(
+// @ApiParam(
+// name = "from",
+// value = "Get stats from what time",
+// required = true)
+// @QueryParam("from") long from,
+// @ApiParam(
+// name = "to",
+// value = "Get stats up to what time",
+// required = true)
+// @QueryParam("to") long to);
/**
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceImpl.java
index f759ed13a9..52702536d1 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceImpl.java
@@ -26,7 +26,7 @@ import org.apache.axis2.AxisFault;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.PrivilegedCarbonContext;
-import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException;
+//import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
@@ -280,19 +280,20 @@ public class DeviceAgentServiceImpl implements DeviceAgentService {
i++;
}
- if (DeviceMgtAPIUtils.getEventPublisherService().publishEvent(DeviceMgtAPIUtils.getStreamDefinition(type
- , PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain())
- , Constants.DEFAULT_STREAM_VERSION, metaData
- , null, payloadData)) {
+ // todo: amalka: commented data publishing
+// if (DeviceMgtAPIUtils.getEventPublisherService().publishEvent(DeviceMgtAPIUtils.getStreamDefinition(type
+// , PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain())
+// , Constants.DEFAULT_STREAM_VERSION, metaData
+// , null, payloadData)) {
return Response.status(Response.Status.OK).build();
- } else {
- String msg = "Error occurred while publishing the event.";
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
- }
- } catch (DataPublisherConfigurationException e) {
- String msg = "Error occurred while publishing the event.";
- log.error(msg, e);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
+// } else {
+// String msg = "Error occurred while publishing the event.";
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
+// }
+// } catch (DataPublisherConfigurationException e) {
+// String msg = "Error occurred while publishing the event.";
+// log.error(msg, e);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
} catch (DeviceAccessAuthorizationException e) {
String msg = "Error occurred when checking for authorization";
log.error(msg, e);
@@ -380,19 +381,20 @@ public class DeviceAgentServiceImpl implements DeviceAgentService {
i++;
}
- if (DeviceMgtAPIUtils.getEventPublisherService().publishEvent(DeviceMgtAPIUtils.getStreamDefinition(type
- , PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain())
- , Constants.DEFAULT_STREAM_VERSION, metaData
- , null, payloadData)) {
+ // todo: amalka: commented data publishing
+// if (DeviceMgtAPIUtils.getEventPublisherService().publishEvent(DeviceMgtAPIUtils.getStreamDefinition(type
+// , PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain())
+// , Constants.DEFAULT_STREAM_VERSION, metaData
+// , null, payloadData)) {
return Response.status(Response.Status.OK).build();
- } else {
- String msg = "Error occurred while publishing the event.";
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
- }
- } catch (DataPublisherConfigurationException e) {
- String msg = "Error occurred while publishing the event.";
- log.error(msg, e);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
+// } else {
+// String msg = "Error occurred while publishing the event.";
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
+// }
+// } catch (DataPublisherConfigurationException e) {
+// String msg = "Error occurred while publishing the event.";
+// log.error(msg, e);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
} catch (DeviceAccessAuthorizationException e) {
String msg = "Error occurred when checking for authorization";
log.error(msg, e);
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java
index 6c04581110..f5a7dacfd1 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java
@@ -4,18 +4,18 @@ import org.apache.axis2.AxisFault;
import org.apache.axis2.client.Stub;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.analytics.api.AnalyticsDataAPI;
-import org.wso2.carbon.analytics.api.AnalyticsDataAPIUtil;
-import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse;
-import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry;
-import org.wso2.carbon.analytics.dataservice.commons.SortByField;
-import org.wso2.carbon.analytics.dataservice.commons.SortType;
-import org.wso2.carbon.analytics.datasource.commons.Record;
-import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException;
-import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException;
-import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub;
-import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTable;
-import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTableRecord;
+//import org.wso2.carbon.analytics.api.AnalyticsDataAPI;
+//import org.wso2.carbon.analytics.api.AnalyticsDataAPIUtil;
+//import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse;
+//import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry;
+//import org.wso2.carbon.analytics.dataservice.commons.SortByField;
+//import org.wso2.carbon.analytics.dataservice.commons.SortType;
+//import org.wso2.carbon.analytics.datasource.commons.Record;
+//import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException;
+//import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException;
+//import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub;
+//import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTable;
+//import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTableRecord;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
@@ -81,49 +81,49 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
private static final String MQTT_CONTENT_VALIDATOR = "default";
private static final String TIMESTAMP_FIELD_NAME = "_timestamp";
- private static AnalyticsDataAPI getAnalyticsDataAPI() {
- PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
- AnalyticsDataAPI analyticsDataAPI =
- (AnalyticsDataAPI) ctx.getOSGiService(AnalyticsDataAPI.class, null);
- if (analyticsDataAPI == null) {
- String msg = "Analytics api service has not initialized.";
- log.error(msg);
- throw new IllegalStateException(msg);
- }
- return analyticsDataAPI;
- }
+// private static AnalyticsDataAPI getAnalyticsDataAPI() {
+// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+// AnalyticsDataAPI analyticsDataAPI =
+// (AnalyticsDataAPI) ctx.getOSGiService(AnalyticsDataAPI.class, null);
+// if (analyticsDataAPI == null) {
+// String msg = "Analytics api service has not initialized.";
+// log.error(msg);
+// throw new IllegalStateException(msg);
+// }
+// return analyticsDataAPI;
+// }
- private static EventRecords getAllEventsForDevice(String tableName, String query, List sortByFields
- , int offset, int limit) throws AnalyticsException {
- int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
- AnalyticsDataAPI analyticsDataAPI = getAnalyticsDataAPI();
- EventRecords eventRecords = new EventRecords();
- int eventCount = analyticsDataAPI.searchCount(tenantId, tableName, query);
- if (eventCount == 0) {
- eventRecords.setCount(0);
- }
- List resultEntries = analyticsDataAPI.search(tenantId, tableName, query, offset, limit,
- sortByFields);
- List recordIds = getRecordIds(resultEntries);
- AnalyticsDataResponse response = analyticsDataAPI.get(tenantId, tableName, 1, null, recordIds);
- eventRecords.setCount(eventCount);
- List records = AnalyticsDataAPIUtil.listRecords(analyticsDataAPI, response);
- records.sort(new Comparator() {
- @Override public int compare(Record r1, Record r2) {
- return Long.compare(r2.getTimestamp(), r1.getTimestamp());
- }
- });
- eventRecords.setList(records);
- return eventRecords;
- }
+// private static EventRecords getAllEventsForDevice(String tableName, String query, List sortByFields
+// , int offset, int limit) throws AnalyticsException {
+// int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
+// AnalyticsDataAPI analyticsDataAPI = getAnalyticsDataAPI();
+// EventRecords eventRecords = new EventRecords();
+// int eventCount = analyticsDataAPI.searchCount(tenantId, tableName, query);
+// if (eventCount == 0) {
+// eventRecords.setCount(0);
+// }
+// List resultEntries = analyticsDataAPI.search(tenantId, tableName, query, offset, limit,
+// sortByFields);
+// List recordIds = getRecordIds(resultEntries);
+// AnalyticsDataResponse response = analyticsDataAPI.get(tenantId, tableName, 1, null, recordIds);
+// eventRecords.setCount(eventCount);
+// List records = AnalyticsDataAPIUtil.listRecords(analyticsDataAPI, response);
+// records.sort(new Comparator() {
+// @Override public int compare(Record r1, Record r2) {
+// return Long.compare(r2.getTimestamp(), r1.getTimestamp());
+// }
+// });
+// eventRecords.setList(records);
+// return eventRecords;
+// }
- private static List getRecordIds(List searchResults) {
- List ids = new ArrayList<>();
- for (SearchResultEntry searchResult : searchResults) {
- ids.add(searchResult.getId());
- }
- return ids;
- }
+// private static List getRecordIds(List searchResults) {
+// List ids = new ArrayList<>();
+// for (SearchResultEntry searchResult : searchResults) {
+// ids.add(searchResult.getId());
+// }
+// return ids;
+// }
/**
* Retrieves the stream definition from das for the given device type.
@@ -195,65 +195,65 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
/**
* Deploy Event Stream, Receiver, Publisher and Store Configuration.
*/
- @POST
- @Path("/{type}")
- @Override
- public Response deployDeviceTypeEventDefinition(@PathParam("type") String deviceType,
- @QueryParam("skipPersist") boolean skipPersist,
- @QueryParam("isSharedWithAllTenants") boolean isSharedWithAllTenants,
- @Valid DeviceTypeEvent deviceTypeEvent) {
- TransportType transportType = deviceTypeEvent.getTransportType();
- EventAttributeList eventAttributes = deviceTypeEvent.getEventAttributeList();
- String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
- try {
- if (eventAttributes == null || eventAttributes.getList() == null || eventAttributes.getList().size() == 0 ||
- deviceType == null || transportType == null ||
- !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) {
- String errorMessage = "Invalid Payload";
- log.error(errorMessage);
- return Response.status(Response.Status.BAD_REQUEST).build();
- }
- String streamName = DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain);
- String streamNameWithVersion = streamName + ":" + Constants.DEFAULT_STREAM_VERSION;
- publishStreamDefinitons(streamName, Constants.DEFAULT_STREAM_VERSION, deviceType, eventAttributes);
- publishEventReceivers(streamNameWithVersion, transportType, tenantDomain, isSharedWithAllTenants, deviceType);
- if (!skipPersist) {
- publishEventStore(streamName, Constants.DEFAULT_STREAM_VERSION, eventAttributes);
- }
- publishWebsocketPublisherDefinition(streamNameWithVersion, deviceType);
- try {
- PrivilegedCarbonContext.startTenantFlow();
- PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(
- MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, true);
- if (!MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
- publishStreamDefinitons(streamName, Constants.DEFAULT_STREAM_VERSION, deviceType, eventAttributes);
- publishEventReceivers(streamNameWithVersion, transportType, tenantDomain, isSharedWithAllTenants, deviceType);
- }
- } finally {
- PrivilegedCarbonContext.endTenantFlow();
- }
- return Response.ok().build();
- } catch (AxisFault e) {
- log.error("Failed to create event definitions for tenantDomain:" + tenantDomain, e);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
- } catch (RemoteException e) {
- log.error("Failed to connect with the remote services:" + tenantDomain, e);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
- } catch (JWTClientException e) {
- log.error("Failed to generate jwt token for tenantDomain:" + tenantDomain, e);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
- } catch (UserStoreException e) {
- log.error("Failed to connect with the user store, tenantDomain: " + tenantDomain, e);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
- } catch (DeviceManagementException e) {
- log.error("Failed to access device management service, tenantDomain: " + tenantDomain, e);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
- } catch (EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException e) {
- log.error("Failed to create event store for, tenantDomain: " + tenantDomain + " deviceType" + deviceType,
- e);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
- }
- }
+// @POST
+// @Path("/{type}")
+// @Override
+// public Response deployDeviceTypeEventDefinition(@PathParam("type") String deviceType,
+// @QueryParam("skipPersist") boolean skipPersist,
+// @QueryParam("isSharedWithAllTenants") boolean isSharedWithAllTenants,
+// @Valid DeviceTypeEvent deviceTypeEvent) {
+// TransportType transportType = deviceTypeEvent.getTransportType();
+// EventAttributeList eventAttributes = deviceTypeEvent.getEventAttributeList();
+// String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
+// try {
+// if (eventAttributes == null || eventAttributes.getList() == null || eventAttributes.getList().size() == 0 ||
+// deviceType == null || transportType == null ||
+// !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) {
+// String errorMessage = "Invalid Payload";
+// log.error(errorMessage);
+// return Response.status(Response.Status.BAD_REQUEST).build();
+// }
+// String streamName = DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain);
+// String streamNameWithVersion = streamName + ":" + Constants.DEFAULT_STREAM_VERSION;
+// publishStreamDefinitons(streamName, Constants.DEFAULT_STREAM_VERSION, deviceType, eventAttributes);
+// publishEventReceivers(streamNameWithVersion, transportType, tenantDomain, isSharedWithAllTenants, deviceType);
+// if (!skipPersist) {
+// publishEventStore(streamName, Constants.DEFAULT_STREAM_VERSION, eventAttributes);
+// }
+// publishWebsocketPublisherDefinition(streamNameWithVersion, deviceType);
+// try {
+// PrivilegedCarbonContext.startTenantFlow();
+// PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(
+// MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, true);
+// if (!MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
+// publishStreamDefinitons(streamName, Constants.DEFAULT_STREAM_VERSION, deviceType, eventAttributes);
+// publishEventReceivers(streamNameWithVersion, transportType, tenantDomain, isSharedWithAllTenants, deviceType);
+// }
+// } finally {
+// PrivilegedCarbonContext.endTenantFlow();
+// }
+// return Response.ok().build();
+// } catch (AxisFault e) {
+// log.error("Failed to create event definitions for tenantDomain:" + tenantDomain, e);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
+// } catch (RemoteException e) {
+// log.error("Failed to connect with the remote services:" + tenantDomain, e);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
+// } catch (JWTClientException e) {
+// log.error("Failed to generate jwt token for tenantDomain:" + tenantDomain, e);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
+// } catch (UserStoreException e) {
+// log.error("Failed to connect with the user store, tenantDomain: " + tenantDomain, e);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
+// } catch (DeviceManagementException e) {
+// log.error("Failed to access device management service, tenantDomain: " + tenantDomain, e);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
+// } catch (EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException e) {
+// log.error("Failed to create event store for, tenantDomain: " + tenantDomain + " deviceType" + deviceType,
+// e);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
+// }
+// }
/**
* Delete device type specific artifacts from DAS.
@@ -349,175 +349,175 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
/**
* Returns device specific data for the give period of time.
*/
- @GET
- @Path("/{type}/{deviceId}")
- @Override
- public Response getData(@PathParam("deviceId") String deviceId, @QueryParam("from") long from,
- @QueryParam("to") long to, @PathParam("type") String deviceType, @QueryParam("offset")
- int offset, @QueryParam("limit") int limit) {
- if (from == 0 || to == 0) {
- String errorMessage = "Invalid values for from/to";
- return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build();
- }
- if (limit == 0) {
- String errorMessage = "Invalid values for offset/limit";
- return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build();
- }
- String fromDate = String.valueOf(from);
- String toDate = String.valueOf(to);
- String query = DEFAULT_META_DEVICE_ID_ATTRIBUTE + ":" + deviceId
- + " AND _timestamp : [" + fromDate + " TO " + toDate + "]";
- String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
- String sensorTableName = getTableName(DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain));
- try {
- if (deviceType == null ||
- !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) {
- String errorMessage = "Invalid device type";
- log.error(errorMessage);
- return Response.status(Response.Status.BAD_REQUEST).build();
- }
- if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized(
- new DeviceIdentifier(deviceId, deviceType))) {
- return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
- }
- List sortByFields = new ArrayList<>();
- SortByField sortByField = new SortByField(TIMESTAMP_FIELD_NAME, SortType.DESC);
- sortByFields.add(sortByField);
- EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, offset, limit);
- return Response.status(Response.Status.OK.getStatusCode()).entity(eventRecords).build();
- } catch (AnalyticsException e) {
- String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
- log.error(errorMsg);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build();
- } catch (DeviceAccessAuthorizationException e) {
- log.error(e.getErrorMessage(), e);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
- } catch (DeviceManagementException e) {
- String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
- log.error(errorMsg);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build();
- }
- }
+// @GET
+// @Path("/{type}/{deviceId}")
+// @Override
+// public Response getData(@PathParam("deviceId") String deviceId, @QueryParam("from") long from,
+// @QueryParam("to") long to, @PathParam("type") String deviceType, @QueryParam("offset")
+// int offset, @QueryParam("limit") int limit) {
+// if (from == 0 || to == 0) {
+// String errorMessage = "Invalid values for from/to";
+// return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build();
+// }
+// if (limit == 0) {
+// String errorMessage = "Invalid values for offset/limit";
+// return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build();
+// }
+// String fromDate = String.valueOf(from);
+// String toDate = String.valueOf(to);
+// String query = DEFAULT_META_DEVICE_ID_ATTRIBUTE + ":" + deviceId
+// + " AND _timestamp : [" + fromDate + " TO " + toDate + "]";
+// String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
+// String sensorTableName = getTableName(DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain));
+// try {
+// if (deviceType == null ||
+// !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) {
+// String errorMessage = "Invalid device type";
+// log.error(errorMessage);
+// return Response.status(Response.Status.BAD_REQUEST).build();
+// }
+// if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized(
+// new DeviceIdentifier(deviceId, deviceType))) {
+// return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
+// }
+// List sortByFields = new ArrayList<>();
+// SortByField sortByField = new SortByField(TIMESTAMP_FIELD_NAME, SortType.DESC);
+// sortByFields.add(sortByField);
+// EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, offset, limit);
+// return Response.status(Response.Status.OK.getStatusCode()).entity(eventRecords).build();
+// } catch (AnalyticsException e) {
+// String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
+// log.error(errorMsg);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build();
+// } catch (DeviceAccessAuthorizationException e) {
+// log.error(e.getErrorMessage(), e);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
+// } catch (DeviceManagementException e) {
+// String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
+// log.error(errorMsg);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build();
+// }
+// }
/**
* Returns last known data points up to the limit if limit is specified. Otherwise returns last known data point.
* Limit parameter needs to be zero or positive.
*/
- @GET
- @Path("/last-known/{type}/{deviceId}")
- @Override
- public Response getLastKnownData(@PathParam("deviceId") String deviceId, @PathParam("type") String deviceType, @QueryParam("limit") int limit) {
- String query = DEFAULT_META_DEVICE_ID_ATTRIBUTE + ":" + deviceId;
- String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
- String sensorTableName = getTableName(DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain));
- try {
- if (deviceType == null ||
- !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) {
- String errorMessage = "Invalid device type";
- log.error(errorMessage);
- return Response.status(Response.Status.BAD_REQUEST).build();
- }
- if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized(
- new DeviceIdentifier(deviceId, deviceType))) {
- return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
- }
- List sortByFields = new ArrayList<>();
- SortByField sortByField = new SortByField(TIMESTAMP_FIELD_NAME, SortType.DESC);
- sortByFields.add(sortByField);
- if (limit == 0) {
- EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, 0, 1);
- return Response.status(Response.Status.OK.getStatusCode()).entity(eventRecords).build();
- } else if (limit > 0) {
- EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, 0, limit);
- return Response.status(Response.Status.OK.getStatusCode()).entity(eventRecords).build();
- } else {
- String errorMessage = "Invalid limit value";
- return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build();
- }
- } catch (AnalyticsException e) {
- String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
- log.error(errorMsg);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build();
- } catch (DeviceAccessAuthorizationException e) {
- log.error(e.getErrorMessage(), e);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
- } catch (DeviceManagementException e) {
- String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
- log.error(errorMsg);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build();
- }
- }
+// @GET
+// @Path("/last-known/{type}/{deviceId}")
+// @Override
+// public Response getLastKnownData(@PathParam("deviceId") String deviceId, @PathParam("type") String deviceType, @QueryParam("limit") int limit) {
+// String query = DEFAULT_META_DEVICE_ID_ATTRIBUTE + ":" + deviceId;
+// String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
+// String sensorTableName = getTableName(DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain));
+// try {
+// if (deviceType == null ||
+// !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) {
+// String errorMessage = "Invalid device type";
+// log.error(errorMessage);
+// return Response.status(Response.Status.BAD_REQUEST).build();
+// }
+// if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized(
+// new DeviceIdentifier(deviceId, deviceType))) {
+// return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
+// }
+// List sortByFields = new ArrayList<>();
+// SortByField sortByField = new SortByField(TIMESTAMP_FIELD_NAME, SortType.DESC);
+// sortByFields.add(sortByField);
+// if (limit == 0) {
+// EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, 0, 1);
+// return Response.status(Response.Status.OK.getStatusCode()).entity(eventRecords).build();
+// } else if (limit > 0) {
+// EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, 0, limit);
+// return Response.status(Response.Status.OK.getStatusCode()).entity(eventRecords).build();
+// } else {
+// String errorMessage = "Invalid limit value";
+// return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build();
+// }
+// } catch (AnalyticsException e) {
+// String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
+// log.error(errorMsg);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build();
+// } catch (DeviceAccessAuthorizationException e) {
+// log.error(e.getErrorMessage(), e);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
+// } catch (DeviceManagementException e) {
+// String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
+// log.error(errorMsg);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build();
+// }
+// }
/**
* Returns the filterd device list. Devices are filterd using the paramter given and the timestamp of the record.
* parameter should given as a range.
*/
- @GET
- @Path("filter/{type}/{parameter}")
- @Override
- public Response getFilteredDevices(@PathParam("type") String deviceType, @PathParam("parameter") String parameter,
- @QueryParam("min") double min, @QueryParam("max") double max) {
- String query;
- Calendar c = java.util.Calendar.getInstance();
- long currentTimestamp = c.getTimeInMillis();
- long previousTimestamp = currentTimestamp - 300 * 1000;
- String fromDate = String.valueOf(previousTimestamp);
- String toDate = String.valueOf(currentTimestamp);
- if (min != 0 & max != 0) {
- query = parameter + " : [" + min + " TO " + max + "]" +
- " AND _timestamp : [" + fromDate + " TO " + toDate + "]";
- } else {
- String errorMessage = "The of range values need to be given";
- log.error(errorMessage);
- return Response.status(Response.Status.BAD_REQUEST).build();
- }
-
- String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
- String sensorTableName = getTableName(DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain));
- try {
- if (deviceType == null ||
- !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) {
- String errorMessage = "Invalid device type";
- log.error(errorMessage);
- return Response.status(Response.Status.BAD_REQUEST).build();
- }
-
- List sortByFields = new ArrayList<>();
- SortByField sortByField = new SortByField(TIMESTAMP_FIELD_NAME, SortType.DESC);
- sortByFields.add(sortByField);
- EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, 0, 100);
- List filterdEvents = eventRecords.getRecord();
- List uniqueFilterdEvents = new ArrayList();
- Set devices = new HashSet<>();
-
- for (int i = 0; i < filterdEvents.size(); i++) {
- String deviceid = (String) filterdEvents.get(i).getValue("meta_deviceId");
- if (!devices.contains(deviceid) && DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized(
- new DeviceIdentifier(deviceid, deviceType))) {
- devices.add(deviceid);
- uniqueFilterdEvents.add(filterdEvents.get(i));
- }
- }
-
- EventRecords filterdRecords = new EventRecords();
- filterdRecords.setList(uniqueFilterdEvents);
- return Response.status(Response.Status.OK.getStatusCode()).entity(filterdRecords).build();
-
- } catch (AnalyticsException e) {
- String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
- log.error(errorMsg);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build();
- } catch (DeviceManagementException e) {
- String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
- log.error(errorMsg);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build();
- } catch (DeviceAccessAuthorizationException e) {
- String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
- log.error(errorMsg);
- return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
- }
- }
+// @GET
+// @Path("filter/{type}/{parameter}")
+// @Override
+// public Response getFilteredDevices(@PathParam("type") String deviceType, @PathParam("parameter") String parameter,
+// @QueryParam("min") double min, @QueryParam("max") double max) {
+// String query;
+// Calendar c = java.util.Calendar.getInstance();
+// long currentTimestamp = c.getTimeInMillis();
+// long previousTimestamp = currentTimestamp - 300 * 1000;
+// String fromDate = String.valueOf(previousTimestamp);
+// String toDate = String.valueOf(currentTimestamp);
+// if (min != 0 & max != 0) {
+// query = parameter + " : [" + min + " TO " + max + "]" +
+// " AND _timestamp : [" + fromDate + " TO " + toDate + "]";
+// } else {
+// String errorMessage = "The of range values need to be given";
+// log.error(errorMessage);
+// return Response.status(Response.Status.BAD_REQUEST).build();
+// }
+//
+// String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
+// String sensorTableName = getTableName(DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain));
+// try {
+// if (deviceType == null ||
+// !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) {
+// String errorMessage = "Invalid device type";
+// log.error(errorMessage);
+// return Response.status(Response.Status.BAD_REQUEST).build();
+// }
+//
+// List sortByFields = new ArrayList<>();
+// SortByField sortByField = new SortByField(TIMESTAMP_FIELD_NAME, SortType.DESC);
+// sortByFields.add(sortByField);
+// EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, 0, 100);
+// List filterdEvents = eventRecords.getRecord();
+// List uniqueFilterdEvents = new ArrayList();
+// Set devices = new HashSet<>();
+//
+// for (int i = 0; i < filterdEvents.size(); i++) {
+// String deviceid = (String) filterdEvents.get(i).getValue("meta_deviceId");
+// if (!devices.contains(deviceid) && DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized(
+// new DeviceIdentifier(deviceid, deviceType))) {
+// devices.add(deviceid);
+// uniqueFilterdEvents.add(filterdEvents.get(i));
+// }
+// }
+//
+// EventRecords filterdRecords = new EventRecords();
+// filterdRecords.setList(uniqueFilterdEvents);
+// return Response.status(Response.Status.OK.getStatusCode()).entity(filterdRecords).build();
+//
+// } catch (AnalyticsException e) {
+// String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
+// log.error(errorMsg);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build();
+// } catch (DeviceManagementException e) {
+// String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
+// log.error(errorMsg);
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build();
+// } catch (DeviceAccessAuthorizationException e) {
+// String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
+// log.error(errorMsg);
+// return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
+// }
+// }
private void publishEventReceivers(String streamNameWithVersion, TransportType transportType
@@ -613,47 +613,47 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
}
}
- private void publishEventStore(String streamName, String version, EventAttributeList eventAttributes)
- throws RemoteException, UserStoreException, JWTClientException,
- EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException {
- EventStreamPersistenceAdminServiceStub eventStreamPersistenceAdminServiceStub =
- DeviceMgtAPIUtils.getEventStreamPersistenceAdminServiceStub();
- try {
- AnalyticsTable analyticsTable = new AnalyticsTable();
- analyticsTable.setRecordStoreName(DEFAULT_EVENT_STORE_NAME);
- analyticsTable.setStreamVersion(version);
- analyticsTable.setTableName(streamName);
- analyticsTable.setMergeSchema(false);
- analyticsTable.setPersist(true);
- AnalyticsTableRecord analyticsTableRecords[] = new AnalyticsTableRecord[eventAttributes.getList().size() + 1];
- int i = 0;
- for (Attribute attribute : eventAttributes.getList()) {
- AnalyticsTableRecord analyticsTableRecord = new AnalyticsTableRecord();
- analyticsTableRecord.setColumnName(attribute.getName());
- analyticsTableRecord.setColumnType(attribute.getType().toString().toUpperCase());
- analyticsTableRecord.setFacet(false);
- analyticsTableRecord.setIndexed(false);
- analyticsTableRecord.setPersist(true);
- analyticsTableRecord.setPrimaryKey(false);
- analyticsTableRecord.setScoreParam(false);
- analyticsTableRecords[i] = analyticsTableRecord;
- i++;
- }
- AnalyticsTableRecord analyticsTableRecord = new AnalyticsTableRecord();
- analyticsTableRecord.setColumnName(DEFAULT_META_DEVICE_ID_ATTRIBUTE);
- analyticsTableRecord.setColumnType(AttributeType.STRING.toString().toUpperCase());
- analyticsTableRecord.setFacet(false);
- analyticsTableRecord.setIndexed(true);
- analyticsTableRecord.setPersist(true);
- analyticsTableRecord.setPrimaryKey(false);
- analyticsTableRecord.setScoreParam(false);
- analyticsTableRecords[i] = analyticsTableRecord;
- analyticsTable.setAnalyticsTableRecords(analyticsTableRecords);
- eventStreamPersistenceAdminServiceStub.addAnalyticsTable(analyticsTable);
- } finally {
- cleanup(eventStreamPersistenceAdminServiceStub);
- }
- }
+// private void publishEventStore(String streamName, String version, EventAttributeList eventAttributes)
+// throws RemoteException, UserStoreException, JWTClientException,
+// EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException {
+// EventStreamPersistenceAdminServiceStub eventStreamPersistenceAdminServiceStub =
+// DeviceMgtAPIUtils.getEventStreamPersistenceAdminServiceStub();
+// try {
+// AnalyticsTable analyticsTable = new AnalyticsTable();
+// analyticsTable.setRecordStoreName(DEFAULT_EVENT_STORE_NAME);
+// analyticsTable.setStreamVersion(version);
+// analyticsTable.setTableName(streamName);
+// analyticsTable.setMergeSchema(false);
+// analyticsTable.setPersist(true);
+// AnalyticsTableRecord analyticsTableRecords[] = new AnalyticsTableRecord[eventAttributes.getList().size() + 1];
+// int i = 0;
+// for (Attribute attribute : eventAttributes.getList()) {
+// AnalyticsTableRecord analyticsTableRecord = new AnalyticsTableRecord();
+// analyticsTableRecord.setColumnName(attribute.getName());
+// analyticsTableRecord.setColumnType(attribute.getType().toString().toUpperCase());
+// analyticsTableRecord.setFacet(false);
+// analyticsTableRecord.setIndexed(false);
+// analyticsTableRecord.setPersist(true);
+// analyticsTableRecord.setPrimaryKey(false);
+// analyticsTableRecord.setScoreParam(false);
+// analyticsTableRecords[i] = analyticsTableRecord;
+// i++;
+// }
+// AnalyticsTableRecord analyticsTableRecord = new AnalyticsTableRecord();
+// analyticsTableRecord.setColumnName(DEFAULT_META_DEVICE_ID_ATTRIBUTE);
+// analyticsTableRecord.setColumnType(AttributeType.STRING.toString().toUpperCase());
+// analyticsTableRecord.setFacet(false);
+// analyticsTableRecord.setIndexed(true);
+// analyticsTableRecord.setPersist(true);
+// analyticsTableRecord.setPrimaryKey(false);
+// analyticsTableRecord.setScoreParam(false);
+// analyticsTableRecords[i] = analyticsTableRecord;
+// analyticsTable.setAnalyticsTableRecords(analyticsTableRecords);
+// eventStreamPersistenceAdminServiceStub.addAnalyticsTable(analyticsTable);
+// } finally {
+// cleanup(eventStreamPersistenceAdminServiceStub);
+// }
+// }
private void publishWebsocketPublisherDefinition(String streamNameWithVersion, String deviceType)
throws RemoteException, UserStoreException, JWTClientException {
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java
index b2c28d8f1e..9075dceddd 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java
@@ -25,14 +25,14 @@ import com.google.gson.Gson;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpStatus;
-import org.wso2.carbon.analytics.api.AnalyticsDataAPI;
-import org.wso2.carbon.analytics.api.AnalyticsDataAPIUtil;
-import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse;
-import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry;
-import org.wso2.carbon.analytics.dataservice.commons.SortByField;
-import org.wso2.carbon.analytics.dataservice.commons.SortType;
-import org.wso2.carbon.analytics.datasource.commons.Record;
-import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException;
+//import org.wso2.carbon.analytics.api.AnalyticsDataAPI;
+//import org.wso2.carbon.analytics.api.AnalyticsDataAPIUtil;
+//import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse;
+//import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry;
+//import org.wso2.carbon.analytics.dataservice.commons.SortByField;
+//import org.wso2.carbon.analytics.dataservice.commons.SortType;
+//import org.wso2.carbon.analytics.datasource.commons.Record;
+//import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
@@ -93,63 +93,63 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService {
private static Log log = LogFactory.getLog(GeoLocationBasedServiceImpl.class);
- @Path("stats/{deviceType}/{deviceId}")
- @GET
- @Consumes("application/json")
- @Produces("application/json")
- public Response getGeoDeviceStats(@PathParam("deviceId") String deviceId,
- @PathParam("deviceType") String deviceType,
- @QueryParam("from") long from, @QueryParam("to") long to) {
- try {
- if (!DeviceManagerUtil.isPublishLocationResponseEnabled()) {
- return Response.status(Response.Status.BAD_REQUEST.getStatusCode())
- .entity("Unable to retrive Geo Device stats. Geo Data publishing does not enabled.").build();
- }
- } catch (DeviceManagementException e) {
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(e.getMessage()).build();
- }
- String tableName = "IOT_PER_DEVICE_STREAM_GEO_FUSEDSPATIALEVENT";
- String fromDate = String.valueOf(from);
- String toDate = String.valueOf(to);
- String query = "id:" + deviceId + " AND type:" + deviceType;
- if (from != 0 || to != 0) {
- query += " AND timeStamp : [" + fromDate + " TO " + toDate + "]";
- }
- try {
- if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized(
- new DeviceIdentifier(deviceId, deviceType),
- DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) {
- return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
- }
- List sortByFields = new ArrayList<>();
- SortByField sortByField = new SortByField("timeStamp", SortType.ASC);
- sortByFields.add(sortByField);
-
- // this is the user who initiates the request
- String authorizedUser = MultitenantUtils.getTenantAwareUsername(
- CarbonContext.getThreadLocalCarbonContext().getUsername());
-
- try {
- String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain();
- int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain);
- AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI();
- List searchResults = analyticsDataAPI.search(tenantId, tableName, query,
- 0,
- 100,
- sortByFields);
- List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(),
- searchResults);
- return Response.ok().entity(events).build();
- } catch (AnalyticsException | UserStoreException e) {
- log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e);
- throw DeviceMgtUtil.buildBadRequestException(
- Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT);
- }
- } catch (DeviceAccessAuthorizationException e) {
- log.error(e.getErrorMessage());
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
- }
- }
+// @Path("stats/{deviceType}/{deviceId}")
+// @GET
+// @Consumes("application/json")
+// @Produces("application/json")
+// public Response getGeoDeviceStats(@PathParam("deviceId") String deviceId,
+// @PathParam("deviceType") String deviceType,
+// @QueryParam("from") long from, @QueryParam("to") long to) {
+// try {
+// if (!DeviceManagerUtil.isPublishLocationResponseEnabled()) {
+// return Response.status(Response.Status.BAD_REQUEST.getStatusCode())
+// .entity("Unable to retrive Geo Device stats. Geo Data publishing does not enabled.").build();
+// }
+// } catch (DeviceManagementException e) {
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(e.getMessage()).build();
+// }
+// String tableName = "IOT_PER_DEVICE_STREAM_GEO_FUSEDSPATIALEVENT";
+// String fromDate = String.valueOf(from);
+// String toDate = String.valueOf(to);
+// String query = "id:" + deviceId + " AND type:" + deviceType;
+// if (from != 0 || to != 0) {
+// query += " AND timeStamp : [" + fromDate + " TO " + toDate + "]";
+// }
+// try {
+// if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized(
+// new DeviceIdentifier(deviceId, deviceType),
+// DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) {
+// return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
+// }
+// List sortByFields = new ArrayList<>();
+// SortByField sortByField = new SortByField("timeStamp", SortType.ASC);
+// sortByFields.add(sortByField);
+//
+// // this is the user who initiates the request
+// String authorizedUser = MultitenantUtils.getTenantAwareUsername(
+// CarbonContext.getThreadLocalCarbonContext().getUsername());
+//
+// try {
+// String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain();
+// int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain);
+// AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI();
+// List searchResults = analyticsDataAPI.search(tenantId, tableName, query,
+// 0,
+// 100,
+// sortByFields);
+// List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(),
+// searchResults);
+// return Response.ok().entity(null).build();
+// } catch (AnalyticsException| UserStoreException e) {
+// log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e);
+// throw DeviceMgtUtil.buildBadRequestException(
+// Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT);
+// }
+// } catch (DeviceAccessAuthorizationException e) {
+// log.error(e.getErrorMessage());
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
+// }
+// }
@Path("stats/device-locations")
@GET
@@ -471,142 +471,142 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService {
}
}
- @Path("alerts/history/{deviceType}/{deviceId}")
- @GET
- @Consumes("application/json")
- @Produces("application/json")
- public Response getGeoAlertsHistory(@PathParam("deviceId") String deviceId,
- @PathParam("deviceType") String deviceType,
- @QueryParam("from") long from, @QueryParam("to") long to) {
- String tableName = "IOT_PER_DEVICE_STREAM_GEO_ALERTNOTIFICATIONS";
- String fromDate = String.valueOf(from);
- String toDate = String.valueOf(to);
- String query = "id:" + deviceId + " AND type:" + deviceType;
- if (from != 0 || to != 0) {
- query += " AND timeStamp : [" + fromDate + " TO " + toDate + "]";
- }
- try {
- if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized(
- new DeviceIdentifier(deviceId, deviceType),
- DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) {
- return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
- }
- List sortByFields = new ArrayList<>();
- SortByField sortByField = new SortByField("timeStamp", SortType.ASC);
- sortByFields.add(sortByField);
+// @Path("alerts/history/{deviceType}/{deviceId}")
+// @GET
+// @Consumes("application/json")
+// @Produces("application/json")
+// public Response getGeoAlertsHistory(@PathParam("deviceId") String deviceId,
+// @PathParam("deviceType") String deviceType,
+// @QueryParam("from") long from, @QueryParam("to") long to) {
+// String tableName = "IOT_PER_DEVICE_STREAM_GEO_ALERTNOTIFICATIONS";
+// String fromDate = String.valueOf(from);
+// String toDate = String.valueOf(to);
+// String query = "id:" + deviceId + " AND type:" + deviceType;
+// if (from != 0 || to != 0) {
+// query += " AND timeStamp : [" + fromDate + " TO " + toDate + "]";
+// }
+// try {
+// if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized(
+// new DeviceIdentifier(deviceId, deviceType),
+// DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) {
+// return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
+// }
+// List sortByFields = new ArrayList<>();
+// SortByField sortByField = new SortByField("timeStamp", SortType.ASC);
+// sortByFields.add(sortByField);
+//
+// // this is the user who initiates the request
+// String authorizedUser = MultitenantUtils.getTenantAwareUsername(
+// CarbonContext.getThreadLocalCarbonContext().getUsername());
+//
+// try {
+// String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser);
+// int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain);
+// AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI();
+// List searchResults = analyticsDataAPI.search(tenantId, tableName, query,
+// 0,
+// 100,
+// sortByFields);
+// List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(),
+// searchResults);
+// return Response.ok().entity(events).build();
+// } catch (AnalyticsException | UserStoreException e) {
+// log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e);
+// throw DeviceMgtUtil.buildBadRequestException(
+// Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT);
+// }
+// } catch (DeviceAccessAuthorizationException e) {
+// log.error(e.getErrorMessage());
+// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
+// }
+// }
- // this is the user who initiates the request
- String authorizedUser = MultitenantUtils.getTenantAwareUsername(
- CarbonContext.getThreadLocalCarbonContext().getUsername());
+// @Path("alerts/history")
+// @GET
+// @Consumes("application/json")
+// @Produces("application/json")
+// public Response getGeoAlertsHistoryForGeoClusters(@QueryParam("from") long from, @QueryParam("to") long to) {
+// String tableName = "IOT_PER_DEVICE_STREAM_GEO_ALERTNOTIFICATIONS";
+// String fromDate = String.valueOf(from);
+// String toDate = String.valueOf(to);
+// String query = "";
+// if (from != 0 || to != 0) {
+// query = "timeStamp : [" + fromDate + " TO " + toDate + "]";
+// }
+// try {
+// List sortByFields = new ArrayList<>();
+// SortByField sortByField = new SortByField("timeStamp", SortType.ASC);
+// sortByFields.add(sortByField);
+//
+// // this is the user who initiates the request
+// String authorizedUser = MultitenantUtils.getTenantAwareUsername(
+// CarbonContext.getThreadLocalCarbonContext().getUsername());
+//
+// String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser);
+// int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain);
+// AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI();
+// List searchResults = analyticsDataAPI.search(tenantId, tableName, query,
+// 0,
+// 100,
+// sortByFields);
+// List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(),
+// searchResults);
+// return Response.ok().entity(events).build();
+//
+// } catch (AnalyticsException | UserStoreException e) {
+// log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e);
+// throw DeviceMgtUtil.buildBadRequestException(
+// Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT);
+// }
+// }
- try {
- String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser);
- int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain);
- AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI();
- List searchResults = analyticsDataAPI.search(tenantId, tableName, query,
- 0,
- 100,
- sortByFields);
- List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(),
- searchResults);
- return Response.ok().entity(events).build();
- } catch (AnalyticsException | UserStoreException e) {
- log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e);
- throw DeviceMgtUtil.buildBadRequestException(
- Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT);
- }
- } catch (DeviceAccessAuthorizationException e) {
- log.error(e.getErrorMessage());
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
- }
- }
+// private List getEventBeans(AnalyticsDataAPI analyticsDataAPI, int tenantId, String tableName,
+// List columns,
+// List searchResults) throws AnalyticsException {
+// List ids = getIds(searchResults);
+// List requiredColumns = (columns == null || columns.isEmpty()) ? null : columns;
+// AnalyticsDataResponse response = analyticsDataAPI.get(tenantId, tableName, 1, requiredColumns, ids);
+// List records = AnalyticsDataAPIUtil.listRecords(analyticsDataAPI, response);
+// Map eventBeanMap = getEventBeanKeyedWithIds(records);
+// return getSortedEventBeans(eventBeanMap, searchResults);
+// }
- @Path("alerts/history")
- @GET
- @Consumes("application/json")
- @Produces("application/json")
- public Response getGeoAlertsHistoryForGeoClusters(@QueryParam("from") long from, @QueryParam("to") long to) {
- String tableName = "IOT_PER_DEVICE_STREAM_GEO_ALERTNOTIFICATIONS";
- String fromDate = String.valueOf(from);
- String toDate = String.valueOf(to);
- String query = "";
- if (from != 0 || to != 0) {
- query = "timeStamp : [" + fromDate + " TO " + toDate + "]";
- }
- try {
- List sortByFields = new ArrayList<>();
- SortByField sortByField = new SortByField("timeStamp", SortType.ASC);
- sortByFields.add(sortByField);
+// private List getSortedEventBeans(Map eventBeanMap,
+// List searchResults) {
+// List sortedRecords = new ArrayList<>();
+// for (SearchResultEntry entry : searchResults) {
+// sortedRecords.add(eventBeanMap.get(entry.getId()));
+// }
+// return sortedRecords;
+// }
- // this is the user who initiates the request
- String authorizedUser = MultitenantUtils.getTenantAwareUsername(
- CarbonContext.getThreadLocalCarbonContext().getUsername());
+// private Map getEventBeanKeyedWithIds(List records) {
+// Map eventBeanMap = new HashMap<>();
+// for (Record record : records) {
+// Event event = getEventBean(record);
+// eventBeanMap.put(event.getId(), event);
+// }
+// return eventBeanMap;
+// }
- String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser);
- int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain);
- AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI();
- List searchResults = analyticsDataAPI.search(tenantId, tableName, query,
- 0,
- 100,
- sortByFields);
- List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(),
- searchResults);
- return Response.ok().entity(events).build();
+// private List getIds(List searchResults) {
+// List ids = new ArrayList<>();
+// if (searchResults != null) {
+// for (SearchResultEntry resultEntry : searchResults) {
+// ids.add(resultEntry.getId());
+// }
+// }
+// return ids;
+// }
- } catch (AnalyticsException | UserStoreException e) {
- log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e);
- throw DeviceMgtUtil.buildBadRequestException(
- Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT);
- }
- }
-
- private List getEventBeans(AnalyticsDataAPI analyticsDataAPI, int tenantId, String tableName,
- List columns,
- List searchResults) throws AnalyticsException {
- List ids = getIds(searchResults);
- List requiredColumns = (columns == null || columns.isEmpty()) ? null : columns;
- AnalyticsDataResponse response = analyticsDataAPI.get(tenantId, tableName, 1, requiredColumns, ids);
- List records = AnalyticsDataAPIUtil.listRecords(analyticsDataAPI, response);
- Map eventBeanMap = getEventBeanKeyedWithIds(records);
- return getSortedEventBeans(eventBeanMap, searchResults);
- }
-
- private List getSortedEventBeans(Map eventBeanMap,
- List searchResults) {
- List sortedRecords = new ArrayList<>();
- for (SearchResultEntry entry : searchResults) {
- sortedRecords.add(eventBeanMap.get(entry.getId()));
- }
- return sortedRecords;
- }
-
- private Map getEventBeanKeyedWithIds(List records) {
- Map eventBeanMap = new HashMap<>();
- for (Record record : records) {
- Event event = getEventBean(record);
- eventBeanMap.put(event.getId(), event);
- }
- return eventBeanMap;
- }
-
- private List getIds(List searchResults) {
- List ids = new ArrayList<>();
- if (searchResults != null) {
- for (SearchResultEntry resultEntry : searchResults) {
- ids.add(resultEntry.getId());
- }
- }
- return ids;
- }
-
- private static Event getEventBean(Record record) {
- Event eventBean = new Event();
- eventBean.setId(record.getId());
- eventBean.setTableName(record.getTableName());
- eventBean.setTimestamp(record.getTimestamp());
- eventBean.setValues(record.getValues());
- return eventBean;
- }
+// private static Event getEventBean(Record record) {
+// Event eventBean = new Event();
+// eventBean.setId(record.getId());
+// eventBean.setTableName(record.getTableName());
+// eventBean.setTimestamp(record.getTimestamp());
+// eventBean.setValues(record.getValues());
+// return eventBean;
+// }
@Path("/geo-fence")
@POST
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/CredentialManagementResponseBuilder.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/CredentialManagementResponseBuilder.java
index d326802c2a..16d4102176 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/CredentialManagementResponseBuilder.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/CredentialManagementResponseBuilder.java
@@ -64,8 +64,9 @@ public class CredentialManagementResponseBuilder {
username = CarbonContext.getThreadLocalCarbonContext().getUsername();
userStoreManager.updateCredential(username, credentials.getNewPassword(),
credentials.getOldPassword());
- DeviceMgtAPIUtils.getIntegrationClientService().resetUserInfo(username,
- PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain());
+ //todo:amalka
+// DeviceMgtAPIUtils.getIntegrationClientService().resetUserInfo(username,
+// PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain());
return Response.status(Response.Status.OK).entity("UserImpl password by username: " +
username + " was successfully changed.").build();
} catch (UserStoreException e) {
@@ -108,8 +109,9 @@ public class CredentialManagementResponseBuilder {
new ErrorResponse.ErrorResponseBuilder().setMessage(errorMsg).build()).build();
}
userStoreManager.updateCredentialByAdmin(username, credentials.getNewPassword());
- DeviceMgtAPIUtils.getIntegrationClientService().resetUserInfo(username,
- PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain());
+ //todo:amalka
+// DeviceMgtAPIUtils.getIntegrationClientService().resetUserInfo(username,
+// PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain());
return Response.status(Response.Status.OK).entity("UserImpl password by username: " +
username + " was successfully changed.").build();
} catch (UserStoreException e) {
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java
index 6a6f5daf88..fd8b0d9f59 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java
@@ -46,14 +46,14 @@ import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub;
-import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
+//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
import org.wso2.carbon.base.ServerConfiguration;
import org.wso2.carbon.analytics.api.AnalyticsDataAPI;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.core.util.Utils;
import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager;
-import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService;
+//import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
@@ -171,7 +171,7 @@ public class DeviceMgtAPIUtils {
private static KeyStore trustStore;
private static char[] keyStorePassword;
- private static IntegrationClientService integrationClientService;
+// private static IntegrationClientService integrationClientService;
private static MetadataManagementService metadataManagementService;
private static OTPManagementService otpManagementService;
@@ -374,22 +374,22 @@ public class DeviceMgtAPIUtils {
}
- public static IntegrationClientService getIntegrationClientService() {
- if (integrationClientService == null) {
- synchronized (DeviceMgtAPIUtils.class) {
- if (integrationClientService == null) {
- PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
- integrationClientService = (IntegrationClientService) ctx.getOSGiService(IntegrationClientService.class, null);
- if (integrationClientService == null) {
- String msg = "IntegrationClientService is not initialized";
- log.error(msg);
- throw new IllegalStateException(msg);
- }
- }
- }
- }
- return integrationClientService;
- }
+// public static IntegrationClientService getIntegrationClientService() {
+// if (integrationClientService == null) {
+// synchronized (DeviceMgtAPIUtils.class) {
+// if (integrationClientService == null) {
+// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+// integrationClientService = (IntegrationClientService) ctx.getOSGiService(IntegrationClientService.class, null);
+// if (integrationClientService == null) {
+// String msg = "IntegrationClientService is not initialized";
+// log.error(msg);
+// throw new IllegalStateException(msg);
+// }
+// }
+// }
+// }
+// return integrationClientService;
+// }
/**
* Initializing and accessing method for OTPManagementService.
@@ -626,17 +626,18 @@ public class DeviceMgtAPIUtils {
return username;
}
- public static EventsPublisherService getEventPublisherService() {
- PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
- EventsPublisherService eventsPublisherService =
- (EventsPublisherService) ctx.getOSGiService(EventsPublisherService.class, null);
- if (eventsPublisherService == null) {
- String msg = "Event Publisher service has not initialized.";
- log.error(msg);
- throw new IllegalStateException(msg);
- }
- return eventsPublisherService;
- }
+ // todo: amalka: commented
+// public static EventsPublisherService getEventPublisherService() {
+// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+// EventsPublisherService eventsPublisherService =
+// (EventsPublisherService) ctx.getOSGiService(EventsPublisherService.class, null);
+// if (eventsPublisherService == null) {
+// String msg = "Event Publisher service has not initialized.";
+// log.error(msg);
+// throw new IllegalStateException(msg);
+// }
+// return eventsPublisherService;
+// }
public static String getStreamDefinition(String deviceType, String tenantDomain) {
return STREAM_DEFINITION_PREFIX + tenantDomain + "." + deviceType.replace(" ", ".");
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml
index ed2ed21624..60db8782e9 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml
@@ -31,5 +31,5 @@
Tomcat environment is the default and every webapps gets it even if they didn't specify it.
e.g. If a webapps requires CXF, they will get both Tomcat and CXF.
-->
- CXF,Carbon
+ CXF3,Carbon
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml
index eca6c9a3b7..d896782b1a 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml
@@ -50,7 +50,7 @@
javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}",
com.fasterxml.jackson.annotation;version="${jackson-annotations.version}",
- org.wso2.carbon.analytics.datasource.commons;version="${carbon.analytics.version.range}",
+
io.swagger.annotations; version="${swagger.annotations.version}"; resolution:=optional,
com.google.gson
@@ -96,14 +96,14 @@
org.wso2.orbit.com.fasterxml.jackson.core
jackson-annotations
-
- org.wso2.carbon.analytics
- org.wso2.carbon.analytics.api
-
-
- org.wso2.carbon.analytics
- org.wso2.carbon.analytics.datasource.commons
-
+
+
+
+
+
+
+
+
com.google.code.gson
gson
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
index d9b34a770d..ae28f57c44 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
@@ -78,8 +78,8 @@
org.wso2.carbon.device.mgt.core.internal
org.apache.axis2.*;version="${axis2.osgi.version.range}",
- org.osgi.framework,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.logging,
javax.naming,
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
@@ -90,7 +90,7 @@
org.wso2.carbon.core,
org.wso2.carbon.utils.*,
org.wso2.carbon.device.mgt.common.*,
- org.wso2.carbon.device.mgt.analytics.data.publisher.service,
+
org.wso2.carbon.user.api,
org.wso2.carbon.user.core.*,
org.wso2.carbon.registry.core.service,
@@ -104,8 +104,8 @@
org.wso2.carbon.ndatasource.core,
org.wso2.carbon.ntask.core.*,
org.wso2.carbon.ntask.common,
- org.apache.catalina,
- org.apache.catalina.core,
+
+
org.apache.commons.collections;version="${commons-collections.version.range}",
org.wso2.carbon.email.sender.*,
io.swagger.annotations.*;resolution:=optional,
@@ -166,32 +166,32 @@
org.wso2.carbon.devicemgt
org.wso2.carbon.device.mgt.common
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.device.mgt.analytics.data.publisher
-
-
- org.slf4j
- slf4j-api
-
-
- javax.servlet
- javax.servlet-api
-
-
- org.wso2.carbon.registry
- org.wso2.carbon.registry.indexing
-
-
- org.wso2.carbon.identity.framework
- org.wso2.carbon.user.mgt
-
-
- commons-lang
- commons-lang
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
org.wso2.carbon
org.wso2.carbon.logging
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java
index df5f030684..f29afccfcf 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java
@@ -53,6 +53,8 @@ public final class DeviceManagementConstants {
public static final String SCOPES_FOR_TOKEN = "perm:device:operations perm:device:publish-event perm:windows:enroll";
public static final String IOT_GATEWAY_HOST = "iot.gateway.host";
public static final String IOT_GATEWAY_HTTPS_PORT = "iot.gateway.https.port";
+ public static final String IOT_CORE_HOST = "iot.core.host";
+ public static final String IOT_CORE_HTTPS_PORT = "iot.core.https.port";
public static final String APPLICATION_REGISTRATION_API_ENDPOINT =
"/api-application-registration/register";
public static final String AUTHORIZATION_HEADER = "authorization";
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java
index b152e65a84..396df0f61f 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java
@@ -23,7 +23,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
-import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException;
+//import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService;
@@ -178,9 +178,9 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
deviceInfo.getAvailableRAMMemory(),
deviceInfo.isPluggedIn()
};
- DeviceManagerUtil.getEventPublisherService().publishEvent(
- DEVICE_INFO_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
- );
+// DeviceManagerUtil.getEventPublisherService().publishEvent(
+// DEVICE_INFO_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
+// );
}
} catch (TransactionManagementException e) {
throw new DeviceDetailsMgtException("Transactional error occurred while adding the device information.", e);
@@ -193,8 +193,8 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
DeviceManagementDAOFactory.rollbackTransaction();
throw new DeviceDetailsMgtException("Error occurred while updating the last update timestamp of the " +
"device", e);
- } catch (DataPublisherConfigurationException e) {
- throw new DeviceDetailsMgtException("Error occurred while publishing the device location information.", e);
+// } catch (DataPublisherConfigurationException e) {
+// throw new DeviceDetailsMgtException("Error occurred while publishing the device location information.", e);
} finally {
DeviceManagementDAOFactory.closeConnection();
}
@@ -389,9 +389,9 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
deviceLocation.getBearing(),
deviceLocation.getDistance()
};
- DeviceManagerUtil.getEventPublisherService().publishEvent(
- LOCATION_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
- );
+// DeviceManagerUtil.getEventPublisherService().publishEvent(
+// LOCATION_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
+// );
}
DeviceManagementDAOFactory.commitTransaction();
} catch (TransactionManagementException e) {
@@ -403,9 +403,9 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
} catch (DeviceManagementException e) {
DeviceManagementDAOFactory.rollbackTransaction();
throw new DeviceDetailsMgtException("Error occurred while getting the device information.", e);
- } catch (DataPublisherConfigurationException e) {
- DeviceManagementDAOFactory.rollbackTransaction();
- throw new DeviceDetailsMgtException("Error occurred while publishing the device location information.", e);
+// } catch (DataPublisherConfigurationException e) {
+// DeviceManagementDAOFactory.rollbackTransaction();
+// throw new DeviceDetailsMgtException("Error occurred while publishing the device location information.", e);
} finally {
DeviceManagementDAOFactory.closeConnection();
}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java
index 7456111973..52a169ef61 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java
@@ -49,7 +49,7 @@ import org.apache.http.protocol.HTTP;
import org.wso2.carbon.CarbonConstants;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
-import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException;
+//import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException;
import org.wso2.carbon.device.mgt.common.ActivityPaginationRequest;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceEnrollmentInfoNotification;
@@ -1964,20 +1964,20 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
operation.getStatus() != null ? operation.getStatus().toString() : null,
operation.getOperationResponse()
};
- DeviceManagerUtil.getEventPublisherService().publishEvent(
- OPERATION_RESPONSE_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
- );
+// DeviceManagerUtil.getEventPublisherService().publishEvent(
+// OPERATION_RESPONSE_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
+// );
}
}
} catch (DeviceManagementException e) {
String msg = "Error occurred while reading configs.";
log.error(msg, e);
throw new OperationManagementException(msg, e);
- } catch (DataPublisherConfigurationException e) {
- String msg = "Error occurred while publishing event.";
- log.error(msg, e);
- throw new OperationManagementException(msg, e);
- }
+ } //catch (DataPublisherConfigurationException e) {
+// String msg = "Error occurred while publishing event.";
+// log.error(msg, e);
+// throw new OperationManagementException(msg, e);
+// }
}
@Override
@@ -2006,20 +2006,20 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
operation.getStatus() != null ? operation.getStatus().toString() : null,
operation.getOperationResponse()
};
- DeviceManagerUtil.getEventPublisherService().publishEvent(
- OPERATION_RESPONSE_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
- );
+// DeviceManagerUtil.getEventPublisherService().publishEvent(
+// OPERATION_RESPONSE_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
+// );
}
}
} catch (DeviceManagementException e) {
String msg = "Error occurred while reading configs.";
log.error(msg, e);
throw new OperationManagementException(msg, e);
- } catch (DataPublisherConfigurationException e) {
- String msg = "Error occurred while publishing event.";
- log.error(msg, e);
- throw new OperationManagementException(msg, e);
- }
+ } //catch (DataPublisherConfigurationException e) {
+// String msg = "Error occurred while publishing event.";
+// log.error(msg, e);
+// throw new OperationManagementException(msg, e);
+// }
}
@Override
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java
index 7822754208..13593baf12 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java
@@ -50,7 +50,7 @@ import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.caching.impl.CacheImpl;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
-import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService;
+//import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService;
import org.wso2.carbon.device.mgt.common.AppRegistrationCredentials;
import org.wso2.carbon.device.mgt.common.ApplicationRegistration;
import org.wso2.carbon.device.mgt.common.ApplicationRegistrationException;
@@ -595,17 +595,17 @@ public final class DeviceManagerUtil {
return Caching.getCacheManagerFactory().getCacheManager(DeviceManagementConstants.DM_CACHE_MANAGER);
}
- public static EventsPublisherService getEventPublisherService() {
- PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
- EventsPublisherService eventsPublisherService =
- (EventsPublisherService) ctx.getOSGiService(EventsPublisherService.class, null);
- if (eventsPublisherService == null) {
- String msg = "Event Publisher service has not initialized.";
- log.error(msg);
- throw new IllegalStateException(msg);
- }
- return eventsPublisherService;
- }
+// public static EventsPublisherService getEventPublisherService() {
+// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+// EventsPublisherService eventsPublisherService =
+// (EventsPublisherService) ctx.getOSGiService(EventsPublisherService.class, null);
+// if (eventsPublisherService == null) {
+// String msg = "Event Publisher service has not initialized.";
+// log.error(msg);
+// throw new IllegalStateException(msg);
+// }
+// return eventsPublisherService;
+// }
/**
* Retrieve EventConfigurationProviderService osgi service component
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml
index 43353e1468..11c9471e76 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml
@@ -178,15 +178,15 @@
javax.xml.stream,
javax.xml.parsers;resolution:=optional,
org.apache.commons.lang,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.w3c.dom,
org.wso2.carbon.ndatasource.core,
org.wso2.carbon.registry.core.service,
org.wso2.carbon.utils.dbcreator,
org.wso2.carbon.utils.multitenancy,
org.wso2.carbon.device.mgt.core.service,
- com.google.gson,
- org.osgi.framework
+ com.google.gson
org.wso2.carbon.device.mgt.extensions.pull.notification,
org.wso2.carbon.device.mgt.extensions.pull.notification.*
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml
index b3bef7291a..744abc8ba1 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml
@@ -61,8 +61,8 @@
IoT Server Impl Bundle
org.wso2.carbon.device.mgt.url.printer.internal
- org.osgi.framework,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.logging,
org.apache.axis2.*;version="${axis2.osgi.version.range}",
org.wso2.carbon.core,
diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml
index 2d489faa9e..709e09d6bc 100644
--- a/components/device-mgt/pom.xml
+++ b/components/device-mgt/pom.xml
@@ -38,9 +38,9 @@
org.wso2.carbon.device.mgt.extensions
org.wso2.carbon.device.mgt.ui
org.wso2.carbon.device.mgt.api
- org.wso2.carbon.device.mgt.analytics.data.publisher
+
org.wso2.carbon.device.mgt.url.printer
- org.wso2.carbon.device.mgt.analytics.wsproxy
+
io.entgra.carbon.device.mgt.config.api
diff --git a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml
index 70cdb93216..65b62fca38 100644
--- a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml
+++ b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml
@@ -53,20 +53,20 @@
org.apache.axis2.*;version="${axis2.osgi.version.range}",
org.apache.axiom.*; version="${axiom.osgi.version.range}",
- org.osgi.framework,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.logging,
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
org.wso2.carbon.context,
org.wso2.carbon.utils.*,
org.wso2.carbon.ndatasource.core,
org.w3c.dom,
- org.apache.velocity;version="${velocity.version}",
- org.apache.velocity.app;version="${velocity.version}",
- org.apache.velocity.context;version="${velocity.version}",
- org.apache.velocity.exception;version="${velocity.version}",
- org.apache.velocity.runtime.resource;version="${velocity.version}",
- org.apache.velocity.runtime.resource.loader;version="${velocity.version}",
+
+
+
+
+
+
org.apache.commons.io,
org.apache.axis2.transport.mail,
org.apache.commons.collections,
@@ -149,10 +149,14 @@
org.apache.axis2.wso2
axis2
-
- org.wso2.orbit.org.apache.velocity
- velocity
-
+
+
+
+
+
+
+
+
commons-io.wso2
commons-io
diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml
index ae46c74805..27de8ac3a6 100644
--- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml
+++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml
@@ -87,10 +87,11 @@
org.wso2.carbon.device.mgt.oauth.extensions.*
- org.wso2.carbon.identity.oauth2.grant.jwt;version="${carbon.identity.jwt.grant.version.range}",
+
org.apache.commons.lang,
org.apache.commons.logging,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.identity.application.common.model;version="${carbon.identity.framework.version.range}",
org.wso2.carbon.identity.application.common;version="${carbon.identity.framework.version.range}",
org.wso2.carbon.identity.application.mgt.*;version="${carbon.identity.framework.version.range}",
@@ -113,6 +114,10 @@
org.apache.oltu.oauth2.common.validators,
org.apache.commons.lang3.tuple,
+
+
+
+
diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java
index 1153cb0561..4cc7881344 100644
--- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java
+++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java
@@ -21,7 +21,6 @@ package org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.apimgt.keymgt.ScopesIssuer;
import org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant.oauth.validator.LocalOAuthValidator;
import org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant.oauth.validator.OAuthValidationResponse;
import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser;
@@ -58,8 +57,8 @@ public class AccessTokenGrantHandler extends AbstractAuthorizationGrantHandler {
}
@Override
- public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) {
- return ScopesIssuer.getInstance().setScopes(tokReqMsgCtx);
+ public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) throws IdentityOAuth2Exception {
+ return super.validateScope(tokReqMsgCtx);
}
@Override
diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedJWTGrantHandler.java b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedJWTGrantHandler.java
index 006317f179..f6560e76eb 100644
--- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedJWTGrantHandler.java
+++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedJWTGrantHandler.java
@@ -20,14 +20,10 @@ package org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.apimgt.keymgt.ScopesIssuer;
-import org.wso2.carbon.base.MultitenantConstants;
-import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser;
import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception;
import org.wso2.carbon.identity.oauth2.grant.jwt.JWTBearerGrantHandler;
import org.wso2.carbon.identity.oauth2.model.RequestParameter;
import org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext;
-import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
/**
* This sets up user with tenant aware username.
@@ -38,8 +34,8 @@ public class ExtendedJWTGrantHandler extends JWTBearerGrantHandler {
private static final String TENANT_DOMAIN_KEY = "tenantDomain";
@Override
- public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) {
- return ScopesIssuer.getInstance().setScopes(tokReqMsgCtx);
+ public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) throws IdentityOAuth2Exception {
+ return super.validateScope(tokReqMsgCtx);
}
@Override
diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedSAML2BearerGrantHandler.java b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedSAML2BearerGrantHandler.java
index 5caededdaf..2193d2d3ed 100644
--- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedSAML2BearerGrantHandler.java
+++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedSAML2BearerGrantHandler.java
@@ -20,7 +20,6 @@ package org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.apimgt.keymgt.ScopesIssuer;
import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser;
import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception;
import org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext;
@@ -35,8 +34,8 @@ public class ExtendedSAML2BearerGrantHandler extends SAML2BearerGrantHandler {
private static Log log = LogFactory.getLog(ExtendedSAML2BearerGrantHandler.class);
@Override
- public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) {
- return ScopesIssuer.getInstance().setScopes(tokReqMsgCtx);
+ public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) throws IdentityOAuth2Exception {
+ return super.validateScope(tokReqMsgCtx);
}
@Override
diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml
index 4adb6539ab..abcf3859a3 100644
--- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml
+++ b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml
@@ -109,8 +109,8 @@
org.apache.commons.httpclient,
org.apache.commons.logging,
org.apache.commons.codec.binary;version="${commons-codec.wso2.osgi.version.range}",
- org.osgi.framework,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.core.security,
org.wso2.carbon.core.services.authentication,
org.wso2.carbon.utils.multitenancy,
diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml
index b793b016fa..7e171cd155 100644
--- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml
+++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml
@@ -185,8 +185,8 @@
org.wso2.carbon.identity.jwt.client.extension.*
- org.osgi.framework,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.context,
org.wso2.carbon.registry.core,
org.wso2.carbon.registry.core.exceptions,
diff --git a/components/identity-extensions/pom.xml b/components/identity-extensions/pom.xml
index e10007a1ac..de175d9dba 100644
--- a/components/identity-extensions/pom.xml
+++ b/components/identity-extensions/pom.xml
@@ -33,8 +33,8 @@
http://wso2.org
- org.wso2.carbon.identity.authenticator.backend.oauth
- org.wso2.carbon.device.mgt.oauth.extensions
+
+
org.wso2.carbon.identity.jwt.client.extension
diff --git a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml
index 89a475e259..0c3d56ebc2 100644
--- a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml
+++ b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml
@@ -35,9 +35,9 @@
Policy Decision Point Bundle
org.wso2.carbon.policy.decision.point.internal
- org.wso2.carbon.context.*;
- org.osgi.framework,
- org.osgi.service.component,
+ org.wso2.carbon.context;version="${carbon.kernel.version.range}",
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.logging,
org.wso2.carbon.policy.mgt.common.*,
org.wso2.carbon.policy.mgt.core.*,
diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml
index 20aab933b0..38acfd2d93 100644
--- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml
+++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml
@@ -53,8 +53,8 @@
Policy Management Core Bundle
org.wso2.carbon.policy.mgt.core.internal
- org.osgi.framework,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.logging,
javax.sql,
javax.cache,
diff --git a/components/policy-mgt/pom.xml b/components/policy-mgt/pom.xml
index dd4d6e80c8..e047aa2278 100644
--- a/components/policy-mgt/pom.xml
+++ b/components/policy-mgt/pom.xml
@@ -39,7 +39,7 @@
org.wso2.carbon.policy.mgt.core
org.wso2.carbon.policy.information.point
org.wso2.carbon.policy.decision.point
- org.wso2.carbon.complex.policy.decision.point
+
diff --git a/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml b/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml
index 1888660a53..6ae1098d84 100644
--- a/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml
+++ b/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml
@@ -53,8 +53,8 @@
org.apache.axis2.*;version="${axis2.osgi.version.range}",
org.apache.axiom.*; version="${axiom.osgi.version.range}",
- org.osgi.framework,
- org.osgi.service.component,
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.logging,
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
org.wso2.carbon.context,
diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml
index d4f72461b4..edc6bfedb2 100644
--- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml
+++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml
@@ -87,20 +87,30 @@
- org.apache.cxf
- cxf-rt-frontend-jaxws
+ org.springframework
+ spring-web
provided
org.apache.cxf
- cxf-rt-frontend-jaxrs
- provided
-
-
- org.apache.cxf
- cxf-rt-transports-http
+ cxf-bundle-jaxrs
provided
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
javax.servlet
javax.servlet-api
diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/webapp/META-INF/webapp-classloading.xml
index d0d7a01621..c0925583a3 100644
--- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/webapp/META-INF/webapp-classloading.xml
+++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/webapp/META-INF/webapp-classloading.xml
@@ -31,5 +31,5 @@
Tomcat environment is the default and every webapps gets it even if they didn't specify it.
e.g. If a webapps requires CXF, they will get both Tomcat and CXF.
-->
- CXF,Carbon
+ CXF3,Carbon
diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml
index d00ef252ad..783643a999 100644
--- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml
+++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml
@@ -99,20 +99,35 @@
- org.apache.cxf
- cxf-rt-frontend-jaxws
+ org.wso2.carbon.devicemgt
+ org.wso2.carbon.apimgt.application.extension
+ provided
+
+
+ org.springframework
+ spring-web
provided
org.apache.cxf
- cxf-rt-frontend-jaxrs
- provided
-
-
- org.apache.cxf
- cxf-rt-transports-http
+ cxf-bundle-jaxrs
provided
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
javax.servlet
javax.servlet-api
diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/InvokerHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/InvokerHandler.java
index 49e0489de3..7bf0861f72 100644
--- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/InvokerHandler.java
+++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/InvokerHandler.java
@@ -73,6 +73,7 @@ public class InvokerHandler extends HttpServlet {
private static final long serialVersionUID = -6508020875358160165L;
private static AuthData authData;
private static String apiEndpoint;
+ private static String iotsCoreUrl;
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) {
@@ -368,8 +369,14 @@ public class InvokerHandler extends HttpServlet {
if (log.isDebugEnabled()) {
log.debug("refreshing the token");
}
+ String iotsCorePort = System.getProperty("iot.core.https.port");
+ if (HandlerConstants.HTTP_PROTOCOL.equals(req.getScheme())) {
+ iotsCorePort = System.getProperty("iot.core.http.port");
+ }
+ iotsCoreUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host")
+ + HandlerConstants.COLON + iotsCorePort;
HttpPost tokenEndpoint = new HttpPost(
- apiEndpoint + HandlerConstants.API_COMMON_CONTEXT + HandlerConstants.TOKEN_ENDPOINT);
+ iotsCoreUrl + HandlerConstants.TOKEN_ENDPOINT);
HttpSession session = req.getSession(false);
if (session == null) {
log.error("Couldn't find a session, hence it is required to login and proceed.");
diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java
index 133681355b..5a664552b8 100644
--- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java
+++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java
@@ -35,7 +35,16 @@ import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.protocol.HTTP;
+import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService;
+import org.wso2.carbon.apimgt.application.extension.APIManagementProviderServiceImpl;
+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.authenticator.stub.AuthenticationAdmin;
+import org.wso2.carbon.authenticator.stub.Login;
+import org.wso2.carbon.context.PrivilegedCarbonContext;
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
+import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
@@ -44,7 +53,9 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Base64;
+import java.util.List;
@MultipartConfig
@WebServlet("/login")
@@ -56,6 +67,7 @@ public class LoginHandler extends HttpServlet {
private static String password;
private static String gatewayUrl;
private static String uiConfigUrl;
+ private static String keyManagerUrl;
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) {
@@ -68,26 +80,37 @@ public class LoginHandler extends HttpServlet {
httpSession = req.getSession(true);
//setting session to expiry in 5 minutes
httpSession.setMaxInactiveInterval(Math.toIntExact(HandlerConstants.TIMEOUT));
-
+ //todo: amalka do we need this remote call?
JsonObject uiConfigJsonObject = HandlerUtil.getUIConfigAndPersistInSession(uiConfigUrl, gatewayUrl, httpSession, resp);
JsonArray tags = uiConfigJsonObject.get("appRegistration").getAsJsonObject().get("tags").getAsJsonArray();
JsonArray scopes = uiConfigJsonObject.get("scopes").getAsJsonArray();
- HttpPost apiRegEndpoint = new HttpPost(gatewayUrl + HandlerConstants.APP_REG_ENDPOINT);
- apiRegEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + Base64.getEncoder()
- .encodeToString((username + HandlerConstants.COLON + password).getBytes()));
- apiRegEndpoint.setHeader(HTTP.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString());
- apiRegEndpoint.setEntity(HandlerUtil.constructAppRegPayload(tags, HandlerConstants.PUBLISHER_APPLICATION_NAME, username, password));
-
- ProxyResponse clientAppResponse = HandlerUtil.execute(apiRegEndpoint);
-
- if (clientAppResponse.getCode() == HttpStatus.SC_UNAUTHORIZED) {
- HandlerUtil.handleError(resp, clientAppResponse);
- return;
+ List list = new ArrayList();
+ for(int i=0; i < tags.size(); i++) {
+ list.add(tags.get(i).getAsString());
}
- if (clientAppResponse.getCode() == HttpStatus.SC_CREATED && getTokenAndPersistInSession(req, resp,
- clientAppResponse.getData(), scopes)) {
+
+ String[] tagsAsStringArray = list.toArray(new String[list.size()]);
+
+ String scopeString = HandlerUtil.getScopeString(scopes);
+
+ if (scopeString != null) {
+ scopeString = scopeString.trim();
+ } else {
+ scopeString = "default";
+ }
+
+ APIManagementProviderService apiManagementProviderService = new APIManagementProviderServiceImpl();
+ ApiApplicationKey apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys(
+ HandlerConstants.PUBLISHER_APPLICATION_NAME,
+ tagsAsStringArray, HandlerConstants.PRODUCTION_KEY, username, false,
+ ApiApplicationConstants.DEFAULT_VALIDITY_PERIOD, scopeString);
+
+ if (apiApplicationKey != null && getTokenAndPersistInSession(apiApplicationKey.getConsumerKey(),
+ apiApplicationKey.getConsumerSecret(), req, resp, scopes)) {
+ log.info("tenantDomain : " + PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain());
+ log.info("username : " + PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername());
ProxyResponse proxyResponse = new ProxyResponse();
proxyResponse.setCode(HttpStatus.SC_OK);
HandlerUtil.handleSuccess(resp, proxyResponse);
@@ -100,6 +123,8 @@ public class LoginHandler extends HttpServlet {
log.error("Error occurred while parsing the response. ", e);
} catch (LoginException e) {
log.error("Error occurred while getting token data. ", e);
+ } catch (APIManagerException e) {
+ log.error("Error occurred while creating application. ", e);
}
}
@@ -107,19 +132,19 @@ public class LoginHandler extends HttpServlet {
* Generates token from token endpoint and persists them inside the session
*
* @param req - {@link HttpServletRequest}
- * @param clientAppResult - clientAppResult
+// * @param clientAppResult - clientAppResult
* @param scopes - scopes defied in the application-mgt.xml
* @throws LoginException - login exception throws when getting token result
*/
- private boolean getTokenAndPersistInSession(HttpServletRequest req, HttpServletResponse resp,
- String clientAppResult, JsonArray scopes) throws LoginException {
+ private boolean getTokenAndPersistInSession(String clientId, String clientSecret, HttpServletRequest req,
+ HttpServletResponse resp, JsonArray scopes) throws LoginException {
JsonParser jsonParser = new JsonParser();
try {
- JsonElement jClientAppResult = jsonParser.parse(clientAppResult);
- if (jClientAppResult.isJsonObject()) {
- JsonObject jClientAppResultAsJsonObject = jClientAppResult.getAsJsonObject();
- String clientId = jClientAppResultAsJsonObject.get("client_id").getAsString();
- String clientSecret = jClientAppResultAsJsonObject.get("client_secret").getAsString();
+// JsonElement jClientAppResult = jsonParser.parse(clientAppResult);
+ if (clientId != null && clientSecret != null) {
+// JsonObject jClientAppResultAsJsonObject = jClientAppResult.getAsJsonObject();
+// String clientId = jClientAppResultAsJsonObject.get("client_id").getAsString();
+// String clientSecret = jClientAppResultAsJsonObject.get("client_secret").getAsString();
String encodedClientApp = Base64.getEncoder()
.encodeToString((clientId + HandlerConstants.COLON + clientSecret).getBytes());
@@ -171,12 +196,18 @@ public class LoginHandler extends HttpServlet {
if (HandlerConstants.HTTP_PROTOCOL.equals(req.getScheme())) {
iotsCorePort = System.getProperty("iot.core.http.port");
}
+
+ String keyManagerPort = System.getProperty("iot.keymanager.https.port");
+
username = req.getParameter("username");
password = req.getParameter("password");
gatewayUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.gateway.host")
+ HandlerConstants.COLON + HandlerUtil.getGatewayPort(req.getScheme());
uiConfigUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host")
+ HandlerConstants.COLON + iotsCorePort + HandlerConstants.UI_CONFIG_ENDPOINT;
+ keyManagerUrl = HandlerConstants.HTTPS_PROTOCOL + HandlerConstants.SCHEME_SEPARATOR +
+ System.getProperty("iot.keymanager.host") + HandlerConstants.COLON + keyManagerPort;
+
if (username == null || password == null) {
String msg = "Invalid login request. Username or Password is not received for login request.";
log.error(msg);
@@ -193,7 +224,7 @@ public class LoginHandler extends HttpServlet {
* @throws IOException IO exception throws if an error occurred when invoking token endpoint
*/
private ProxyResponse getTokenResult(String encodedClientApp, JsonArray scopes) throws IOException {
- HttpPost tokenEndpoint = new HttpPost(gatewayUrl + HandlerConstants.TOKEN_ENDPOINT);
+ HttpPost tokenEndpoint = new HttpPost(keyManagerUrl + HandlerConstants.TOKEN_ENDPOINT);
tokenEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + encodedClientApp);
tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString());
String scopeString = HandlerUtil.getScopeString(scopes);
diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java
index 8ee6ec776b..641aa6d990 100644
--- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java
+++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java
@@ -61,7 +61,7 @@ public class SsoLoginCallbackHandler extends HttpServlet {
String iotsCoreUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host")
+ HandlerConstants.COLON + iotsCorePort;
- HttpPost tokenEndpoint = new HttpPost(gatewayUrl + HandlerConstants.TOKEN_ENDPOINT);
+ HttpPost tokenEndpoint = new HttpPost(iotsCoreUrl + HandlerConstants.TOKEN_ENDPOINT);
tokenEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + session.getAttribute("encodedClientApp"));
tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString());
diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java
index 1ade046d43..23e76b81ae 100644
--- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java
+++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java
@@ -101,7 +101,7 @@ public class SsoLoginHandler extends HttpServlet {
*/
private void dynamicClientRegistration(HttpServletRequest req, HttpServletResponse resp) {
try {
- File userMgtConf = new File("conf/user-mgt.xml");
+ File userMgtConf = new File("repository/conf/user-mgt.xml");
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(userMgtConf);
@@ -136,7 +136,7 @@ public class SsoLoginHandler extends HttpServlet {
JsonArray scopes = uiConfigJsonObject.get("scopes").getAsJsonArray();
// Register the client application
- HttpPost apiRegEndpoint = new HttpPost(gatewayUrl + HandlerConstants.APP_REG_ENDPOINT);
+ HttpPost apiRegEndpoint = new HttpPost(iotsCoreUrl + HandlerConstants.APP_REG_ENDPOINT);
encodedAdminCredentials = Base64.getEncoder()
.encodeToString((adminUsername + HandlerConstants.COLON + adminPassword).getBytes());
apiRegEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC +
@@ -262,7 +262,7 @@ public class SsoLoginHandler extends HttpServlet {
* @throws IOException IO exception throws if an error occurred when invoking token endpoint
*/
private ProxyResponse getTokenResult(String encodedClientApp) throws IOException {
- HttpPost tokenEndpoint = new HttpPost(gatewayUrl + HandlerConstants.TOKEN_ENDPOINT);
+ HttpPost tokenEndpoint = new HttpPost(iotsCoreUrl + HandlerConstants.TOKEN_ENDPOINT);
tokenEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + encodedClientApp);
tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString());
diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java
index 9686979d53..67b2834516 100644
--- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java
+++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java
@@ -41,6 +41,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
+import java.util.Base64;
@MultipartConfig
@WebServlet("/user")
@@ -52,8 +53,8 @@ public class UserHandler extends HttpServlet {
protected void doPost(HttpServletRequest req, HttpServletResponse resp) {
try {
String serverUrl =
- req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.gateway.host")
- + HandlerConstants.COLON + HandlerUtil.getGatewayPort(req.getScheme());
+ req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host")
+ + HandlerConstants.COLON + HandlerUtil.getCorePort(req.getScheme());
HttpSession httpSession = req.getSession(false);
if (httpSession == null) {
HandlerUtil.sendUnAuthorizeResponse(resp);
@@ -68,26 +69,32 @@ public class UserHandler extends HttpServlet {
String accessToken = authData.getAccessToken();
- HttpPost tokenEndpoint = new HttpPost(serverUrl + HandlerConstants.INTROSPECT_ENDPOINT);
- tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString());
- StringEntity tokenEPPayload = new StringEntity("token=" + accessToken,
+ HttpPost introspectionEndpoint = new HttpPost(serverUrl + HandlerConstants.INTROSPECT_ENDPOINT);
+ introspectionEndpoint.setHeader(HttpHeaders.CONTENT_TYPE,
+ ContentType.APPLICATION_FORM_URLENCODED.toString());
+ //todo:amalka
+ String username = "admin";
+ String password = "admin";
+ introspectionEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + Base64.getEncoder()
+ .encodeToString((username + HandlerConstants.COLON + password).getBytes()));
+ StringEntity introspectionPayload = new StringEntity("token=" + accessToken,
ContentType.APPLICATION_FORM_URLENCODED);
- tokenEndpoint.setEntity(tokenEPPayload);
- ProxyResponse tokenStatus = HandlerUtil.execute(tokenEndpoint);
+ introspectionEndpoint.setEntity(introspectionPayload);
+ ProxyResponse introspectionStatus = HandlerUtil.execute(introspectionEndpoint);
- if (tokenStatus.getExecutorResponse().contains(HandlerConstants.EXECUTOR_EXCEPTION_PREFIX)) {
+ if (introspectionStatus.getExecutorResponse().contains(HandlerConstants.EXECUTOR_EXCEPTION_PREFIX)) {
log.error("Error occurred while invoking the API to get token status.");
- HandlerUtil.handleError(resp, tokenStatus);
+ HandlerUtil.handleError(resp, introspectionStatus);
return;
}
- String tokenData = tokenStatus.getData();
- if (tokenData == null) {
+ String introspectionData = introspectionStatus.getData();
+ if (introspectionData == null) {
log.error("Invalid token data is received.");
- HandlerUtil.handleError(resp, tokenStatus);
+ HandlerUtil.handleError(resp, introspectionStatus);
return;
}
JsonParser jsonParser = new JsonParser();
- JsonElement jTokenResult = jsonParser.parse(tokenData);
+ JsonElement jTokenResult = jsonParser.parse(introspectionData);
if (jTokenResult.isJsonObject()) {
JsonObject jTokenResultAsJsonObject = jTokenResult.getAsJsonObject();
if (!jTokenResultAsJsonObject.get("active").getAsBoolean()) {
diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java
index 3d4255c0aa..bedf62385c 100644
--- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java
+++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java
@@ -22,7 +22,7 @@ public class HandlerConstants {
public static final String PUBLISHER_APPLICATION_NAME = "application-mgt-publisher";
public static final String APP_REG_ENDPOINT = "/api-application-registration/register";
public static final String UI_CONFIG_ENDPOINT = "/api/device-mgt-config/v1.0/configurations/ui-config";
- public static final String TOKEN_ENDPOINT = "/token";
+ public static final String TOKEN_ENDPOINT = "/oauth2/token";
public static final String INTROSPECT_ENDPOINT = "/oauth2/introspect";
public static final String AUTHORIZATION_ENDPOINT = "/oauth2/authorize";
public static final String APIM_APPLICATIONS_ENDPOINT = "/api/am/store/v0.12/applications/";
@@ -59,6 +59,7 @@ public class HandlerConstants {
public static final String SCHEME_SEPARATOR = "://";
public static final String COLON = ":";
public static final String HTTP_PROTOCOL = "http";
+ public static final String HTTPS_PROTOCOL = "https";
public static final String UNDERSCORE = "_";
public static final int INTERNAL_ERROR_CODE = 500;
diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java
index 4582468a0c..bc864c03ee 100644
--- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java
+++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java
@@ -23,6 +23,8 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
+import com.sun.org.apache.xml.internal.serialize.OutputFormat;
+import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -36,12 +38,12 @@ import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.XMLSerializer;
import org.json.JSONException;
import org.json.JSONObject;
import org.w3c.dom.Document;
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
+import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService;
+import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.xml.sax.SAXException;
import javax.servlet.http.HttpServletRequest;
@@ -80,6 +82,7 @@ public class HandlerUtil {
HandlerConstants.INTERNAL_ERROR_CODE));
return proxyResponse;
} else {
+
int statusCode = response.getStatusLine().getStatusCode();
try (BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()))) {
StringBuilder result = new StringBuilder();
@@ -400,4 +403,16 @@ public class HandlerUtil {
return stringOutput;
}
+
+ public static APIManagementProviderService getAPIManagementProviderService() {
+ PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+ APIManagementProviderService apiManagementProviderService =
+ (APIManagementProviderService) ctx.getOSGiService(APIManagementProviderService.class, null);
+ if (apiManagementProviderService == null) {
+ String msg = "API management provider service has not initialized.";
+ log.error(msg);
+ throw new IllegalStateException(msg);
+ }
+ return apiManagementProviderService;
+ }
}
diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/webapp/META-INF/webapp-classloading.xml b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/webapp/META-INF/webapp-classloading.xml
index cc5b3c66d7..9f50930c4f 100644
--- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/webapp/META-INF/webapp-classloading.xml
+++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/webapp/META-INF/webapp-classloading.xml
@@ -31,5 +31,5 @@
Tomcat environment is the default and every webapps gets it even if they didn't specify it.
e.g. If a webapps requires CXF, they will get both Tomcat and CXF.
-->
- Carbon
+ CXF3,Carbon
diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml
index 2d3df3e061..64e71e342d 100644
--- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml
+++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml
@@ -63,15 +63,15 @@
javax.xml.bind.annotation,
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
javax.xml.validation,
- org.apache.catalina,
- org.apache.catalina.connector,
- org.apache.catalina.util,
+
+
+
org.apache.commons.logging,
- org.apache.coyote,
- org.apache.tomcat.util.buf,
- org.apache.tomcat.util.http,
- org.osgi.service.component,
- org.osgi.framework,
+
+
+
+ org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
+ org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.w3c.dom,
org.wso2.carbon.context,
org.wso2.carbon.core.util,
@@ -79,7 +79,7 @@
org.wso2.carbon.identity.core.util; version="${carbon.identity.imp.pkg.version}",
org.wso2.carbon.identity.oauth2.*;
version="${carbon.identity-inbound-auth-oauth.imp.pkg.version}",
- org.wso2.carbon.tomcat.ext.valves,
+
org.wso2.carbon.user.api,
org.wso2.carbon.user.core.service,
org.wso2.carbon.user.core.tenant,
@@ -106,8 +106,8 @@
org.apache.commons.pool.impl,
org.apache.http.conn,
org.apache.http.impl.conn,
- javax.xml.soap; version="${javax.xml.soap.imp.pkg.version}",
- javax.xml.stream,
+
+
org.apache.axiom.*; version="${axiom.osgi.version.range}",
org.wso2.carbon.registry.core.*,
org.wso2.carbon.registry.common.*;version="${carbon.registry.imp.pkg.version.range}",
diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml
index a934c7dc4c..401ad66f4e 100644
--- a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml
+++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml
@@ -107,9 +107,9 @@
org.wso2.carbon.devicemgt:org.wso2.carbon.apimgt.integration.client:${project.version}
-
- org.wso2.carbon.devicemgt:org.wso2.carbon.apimgt.integration.generated.client:${project.version}
-
+
+
+
diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml
index 067a6af7f8..ff54fb9cb8 100644
--- a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml
+++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml
@@ -24,7 +24,7 @@
- https://${iot.core.host}:${iot.core.https.port}
+ https://localhost:9443
true
diff --git a/features/apimgt-extensions/pom.xml b/features/apimgt-extensions/pom.xml
index 201296d7d7..956fdf8d49 100644
--- a/features/apimgt-extensions/pom.xml
+++ b/features/apimgt-extensions/pom.xml
@@ -35,10 +35,10 @@
http://wso2.org
- org.wso2.carbon.apimgt.integration.client.feature
+
org.wso2.carbon.apimgt.webapp.publisher.feature
org.wso2.carbon.apimgt.application.extension.feature
- org.wso2.carbon.apimgt.handler.server.feature
+
diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml
index ddeeaa5005..9e91286a79 100644
--- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml
+++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml
@@ -30,7 +30,7 @@
- jdbc:h2:repository/database/WSO2DM_APPM_DB;DB_CLOSE_ON_EXIT=FALSE
+ jdbc:h2:./repository/database/WSO2DM_APPM_DB;DB_CLOSE_ON_EXIT=FALSE
wso2carbon
wso2carbon
org.h2.Driver
diff --git a/features/certificate-mgt/pom.xml b/features/certificate-mgt/pom.xml
index bce727f0f2..29ce4363df 100644
--- a/features/certificate-mgt/pom.xml
+++ b/features/certificate-mgt/pom.xml
@@ -27,7 +27,6 @@
4.0.0
- org.wso2.carbon.devicemgt
certificate-mgt-feature
4.1.16-SNAPSHOT
pom
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml
index 055fcd0a57..845938c469 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml
@@ -43,34 +43,34 @@
org.wso2.carbon.devicemgt
org.wso2.carbon.device.mgt.common
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.device.mgt.analytics.data.publisher
-
-
- org.wso2.carbon.registry
- org.wso2.carbon.registry.indexing
-
-
- org.wso2.carbon.analytics-common
- org.wso2.carbon.event.receiver.stub
-
-
- org.wso2.carbon.analytics-common
- org.wso2.carbon.event.stream.stub
-
-
- org.wso2.carbon.analytics-common
- org.wso2.carbon.event.publisher.stub
-
-
- org.wso2.carbon.analytics-common
- org.wso2.carbon.event.stream.persistence.stub
-
-
- org.wso2.orbit.org.scannotation
- scannotation
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -127,27 +127,27 @@
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.common:${carbon.device.mgt.version}
-
- org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.analytics.data.publisher:${carbon.device.mgt.version}
-
-
- org.wso2.carbon.analytics-common:org.wso2.carbon.event.receiver.stub:${carbon.analytics.common.version}
-
-
- org.wso2.carbon.analytics-common:org.wso2.carbon.event.stream.stub:${carbon.analytics.common.version}
-
-
- org.wso2.carbon.analytics-common:org.wso2.carbon.event.publisher.stub:${carbon.analytics.common.version}
-
-
- org.wso2.carbon.analytics-common:org.wso2.carbon.event.stream.persistence.stub:${carbon.analytics.common.version}
-
-
- org.wso2.orbit.com.fasterxml.jackson.core:jackson-annotations:${jackson-annotations.version}
-
-
- org.wso2.orbit.org.scannotation:scannotation:${scannotation.version}
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--OAuth2TokenManagement.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--OAuth2TokenManagement.xml
index 9e7e2fd601..23c74aaedb 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--OAuth2TokenManagement.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--OAuth2TokenManagement.xml
@@ -20,7 +20,7 @@
-
+
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--UserManagementValidateUser.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--UserManagementValidateUser.xml
index 5b8ee2f562..7d26b7b857 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--UserManagementValidateUser.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--UserManagementValidateUser.xml
@@ -20,7 +20,7 @@
-
+
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml
index a0ba89e8b7..5bbf9e040b 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml
@@ -19,7 +19,7 @@
true
- true
+ false
application_management
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml
index 3c4216dfb9..0222243bf9 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml
@@ -87,8 +87,8 @@
org.wso2.carbon.core.server:${carbon.kernel.version}
- org.wso2.carbon.governance.metadata.server:${carbon.governance.version}
-
+
+
diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml
index 28f576bf2e..1c4c45ab71 100644
--- a/features/device-mgt/pom.xml
+++ b/features/device-mgt/pom.xml
@@ -39,7 +39,7 @@
org.wso2.carbon.device.mgt.api.feature
org.wso2.carbon.device.mgt.feature
org.wso2.carbon.device.mgt.extensions.feature
- org.wso2.carbon.device.mgt.analytics.feature
+
diff --git a/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml b/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml
index db6da06d04..6d17103c21 100644
--- a/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml
+++ b/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml
@@ -73,14 +73,14 @@
org.codehaus.woodstox
wstx-asl
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.device.mgt.analytics.data.publisher
-
-
- org.wso2.carbon.analytics
- org.wso2.carbon.analytics.api
-
+
+
+
+
+
+
+
+
diff --git a/pom.xml b/pom.xml
index 39f8ff4e85..bfa525b9df 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,7 +27,6 @@
WSO2 Carbon - Device Management - Parent
http://wso2.org
WSO2 Connected Device Manager Components
-
org.wso2
wso2
@@ -43,21 +42,23 @@
components/application-mgt
components/policy-mgt
components/certificate-mgt
- components/webapp-authenticator-framework
components/ui-request-interceptor
components/transport-mgt
features/device-mgt
features/apimgt-extensions
features/application-mgt
features/policy-mgt
- features/webapp-authenticator-framework
features/certificate-mgt
- features/oauth-extensions
features/heartbeat-management
features/ui-request-interceptor
features/jwt-client
features/device-mgt-extensions
features/transport-mgt
+
+
+
+
+
@@ -245,16 +246,16 @@
org.wso2.carbon.apimgt.webapp.publisher
${carbon.device.mgt.version}
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.apimgt.integration.client
- ${carbon.device.mgt.version}
-
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.apimgt.integration.generated.client
- ${carbon.device.mgt.version}
-
+
+
+
+
+
+
+
+
+
+
org.wso2.carbon.devicemgt
org.wso2.carbon.apimgt.annotations
@@ -286,11 +287,11 @@
org.wso2.carbon.device.mgt.analytics.data.publisher
${carbon.device.mgt.version}
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.device.mgt.analytics.wsproxy
- ${carbon.device.mgt.version}
-
+
+
+
+
+
org.wso2.carbon.devicemgt
org.wso2.carbon.device.mgt.server.feature
@@ -331,11 +332,11 @@
${carbon.device.mgt.version}
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.apimgt.handlers
- ${carbon.device.mgt.version}
-
+
+
+
+
+
org.wso2.carbon.devicemgt
org.wso2.carbon.device.application.mgt.server.feature
@@ -832,7 +833,7 @@
org.wso2.carbon
org.wso2.carbon.logging
- ${carbon.kernel.version}
+ 4.4.9
org.wso2.carbon
@@ -1153,17 +1154,17 @@
-
- org.apache.cxf
- cxf-rt-bindings-http
- ${cxf.bindings.version}
-
-
- org.codehaus.jra
- jra
-
-
-
+
+
+
+
+
+
+
+
+
+
+
org.apache.cxf
cxf-rt-rs-extension-providers
@@ -1347,11 +1348,21 @@
gson
${google.gson.version}
+
+ org.wso2.orbit.com.squareup.okhttp
+ okhttp
+ ${okhttp.wso2.version}
+
com.squareup.okhttp3
okhttp
${squareup.okhttp3.version}
+
+ org.wso2.orbit.com.squareup.okio
+ okio
+ ${okio.wso2.version}
+
com.squareup.okio
okio
@@ -1794,6 +1805,16 @@
commons-validator
${apache.validator.version}
+
+ org.springframework
+ spring-web
+ ${spring-web.version}
+
+
+ org.apache.cxf
+ cxf-bundle-jaxrs
+ ${cxf-bundle-package.version}
+
@@ -2054,9 +2075,9 @@
2.2.1
6.1.1
- 4.4.26
- [4.4.0, 5.0.0)
- 1.5.4
+ 4.6.1
+ [4.6.0, 5.0.0)
+ 5.1.2
1.3
3.1.3
@@ -2097,16 +2118,16 @@
4.7.15
- 5.11.148
- [5.2.0, 6.0.0)
- 5.6.63
+ 5.18.187
+ [5.2.0, 7.0.0)
+ 6.4.111
5.4.6
- 1.0.10
- [1.0.10, 2.0.0)
+ 1.0.31
+ [1.0.31, 2.0.0)
[5.7.0, 6.0.0)
- [5.2.0, 6.0.0)
- [5.1.0, 6.0.0)
+ [5.2.0, 7.0.0)
+ [5.1.0, 7.0.0)
4.6.11
@@ -2131,8 +2152,8 @@
[2.6.0,3.0.0)
- 6.2.201
- (6.0.0,7.0.0]
+ 9.0.5
+ (6.0.0,10.0.0]
5.1.37
@@ -2142,20 +2163,20 @@
2.1.23
- 4.6.28
- 4.6.8
- [4.4.8, 5.0.0)
+ 4.7.38
+ ${carbon.registry.version}
+ [4.7.0, 5.0.0)
- 3.2.0
- 2.5.11
+ 3.3.6
+
1.1.wso2v1
1.9.0
- 1.52.0.wso2v1
- 1.52.0.wso2v2
- [1.52.0,1.60.0)
+ 1.60.0.wso2v1
+ 1.60.0.wso2v1
+ [1.52.0,1.70.0)
2.3.0.wso2v2
@@ -2166,7 +2187,9 @@
3.0.0.wso2v1
1.3
2.3.1
- 3.8.1
+ 4.6.0
+ 4.2.0.wso2v1
+ 2.4.0.wso2v1
1.13.0
9.3.1
1.1.1
@@ -2282,6 +2305,12 @@
7.0.85
1.0
1.13.1
+
+ 5.1.2.RELEASE
+ 2.7.18
+
+ [1.6.0, 2.0.0)
+ [1.2.0,1.3.0)