From 3ea79ecf77d59a2a48abf9202d67bc1508249072 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 10 May 2021 10:51:19 +0530 Subject: [PATCH] cleaned up components/apimgt-extensions --- .../pom.xml | 32 - ...ApiApplicationRegistrationServiceImpl.java | 2 - .../pom.xml | 52 +- .../APIManagementProviderService.java | 5 +- .../APIManagementProviderServiceImpl.java | 66 +- ...ApplicationManagerExtensionDataHolder.java | 11 - ...ationManagerExtensionServiceComponent.java | 12 - .../pom.xml | 166 +- .../client/publisher/PublisherClient.java | 89 +- .../integration/client/store/StoreClient.java | 124 +- .../pom.xml | 268 +- .../src/main/resources/publisher-api.yaml | 14193 ++++------------ .../pom.xml | 220 +- .../publisher/APIPublisherServiceImpl.java | 8 - .../internal/APIPublisherDataHolder.java | 11 - .../APIPublisherServiceComponent.java | 12 - components/apimgt-extensions/pom.xml | 3 - pom.xml | 10 + 18 files changed, 3503 insertions(+), 11781 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml index 9ec68e7315e..c99c9d1988a 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml @@ -48,42 +48,10 @@ cxf-bundle-jaxrs provided - - - - - - - - - - - - - - - - - - - - - - org.codehaus.jackson jackson-jaxrs - - - - - - - - - - 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 96d3c8e059f..702db645279 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java @@ -27,8 +27,6 @@ import org.wso2.carbon.apimgt.application.extension.api.util.RegistrationProfile import org.wso2.carbon.apimgt.application.extension.constants.ApiApplicationConstants; import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey; import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException; -//import org.wso2.carbon.apimgt.integration.client.OAuthRequestInterceptor; -//import org.wso2.carbon.apimgt.integration.client.store.StoreClient; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml index 9e70ed30091..3f0f92602b9 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml @@ -51,23 +51,13 @@ org.wso2.carbon org.wso2.carbon.logging - - - - - - - - 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 @@ -117,24 +107,30 @@ API Management Application Bundle org.wso2.carbon.apimgt.application.extension.internal - org.apache.commons.lang;version="[2.6,3)",org.apache.c - ommons.logging;version="[1.2,2)",org.json.simple,org.osgi.framework;v - ersion="${imp.package.version.osgi.framework}",org.osgi.service.component;version="${imp.package.version.osgi.service}",org.wso - 2.carbon.apimgt.api;version="[9.0,10)",org.wso2.carbon.apimgt.api.dto - ;version="[9.0,10)",org.wso2.carbon.apimgt.api.model;version="[9.0,10 - )",org.wso2.carbon.apimgt.application.extension.bean,org.wso2.carbon. - apimgt.application.extension.dto,org.wso2.carbon.apimgt.application.e - xtension.exception,org.wso2.carbon.apimgt.impl;version="[9.0,10)",org - .wso2.carbon.apimgt.impl.utils;version="[9.0,10)",org.wso2.carbon.con - text;version="[4.6,5)",org.wso2.carbon.device.mgt.core.config.ui;vers - ion="[4.1,5)",org.wso2.carbon.identity.jwt.client.extension,org.wso2. - carbon.identity.jwt.client.extension.dto,org.wso2.carbon.identity.jwt - .client.extension.exception,org.wso2.carbon.identity.jwt.client.exten - sion.service,org.wso2.carbon.registry.core.exceptions;version="[1.0,2 - )",org.wso2.carbon.registry.core.service;version="[1.0,2)",org.wso2.c - arbon.registry.indexing.service;version="[4.7,5)",org.wso2.carbon.use - r.api;version="[1.0,2)",org.wso2.carbon.user.core.service;version="[4 - .6,5)",org.wso2.carbon.user.core.tenant;version="[4.6,5)" + org.apache.commons.lang;version="[2.6,3)", + org.apache.commons.logging;version="[1.2,2)", + org.json.simple,org.osgi.framework;version="${imp.package.version.osgi.framework}", + org.osgi.service.component;version="${imp.package.version.osgi.service}", + org.wso2.carbon.apimgt.api;version="[9.0,10)", + org.wso2.carbon.apimgt.api.dto;version="[9.0,10)", + org.wso2.carbon.apimgt.api.model;version="[9.0,10)", + org.wso2.carbon.apimgt.application.extension.bean, + org.wso2.carbon.apimgt.application.extension.dto, + org.wso2.carbon.apimgt.application.extension.exception, + org.wso2.carbon.apimgt.impl;version="[9.0,10)", + org.wso2.carbon.apimgt.impl.utils;version="[9.0,10)", + org.wso2.carbon.context;version="[4.6,5)", + org.wso2.carbon.device.mgt.core.config.ui;version="[4.1,5)", + org.wso2.carbon.identity.jwt.client.extension, + org.wso2.carbon.identity.jwt.client.extension.dto, + org.wso2.carbon.identity.jwt.client.extension.exception, + org.wso2.carbon.identity.jwt.client.extension.service, + org.wso2.carbon.registry.core.exceptions;version="[1.0,2)", + org.wso2.carbon.registry.core.service;version="[1.0,2)", + org.wso2.carbon.registry.indexing.service;version="[4.7,5)", + org.wso2.carbon.user.api;version="[1.0,2)", + org.wso2.carbon.user.core.service;version="[4.6,5)", + org.wso2.carbon.user.core.tenant;version="[4.6,5)" !org.wso2.carbon.apimgt.application.extension.internal, diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java index 67fe9e25839..d1bc3911b6e 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java @@ -21,8 +21,6 @@ package org.wso2.carbon.apimgt.application.extension; import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey; import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException; import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; -//import org.wso2.carbon.apimgt.integration.client.store.StoreClient; -//import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; /** * This comprise on operation that is been done with api manager from CDMF. This service needs to be implemented in APIM. @@ -62,11 +60,10 @@ public interface APIManagementProviderService { * @param username to whom the application is created * @param isAllowedAllDomains application is allowed to all the tenants * @param validityTime validity period of the application -// * @param storeClient Specified store client + * @param scopes scopes * @return consumerkey and secrete of the created application. * @throws APIManagerException */ - ApiApplicationKey generateAndRetrieveApplicationKeys(String apiApplicationName, String tags[], String keyType, diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java index cc385dff442..3b46ace15f0 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java @@ -18,20 +18,17 @@ package org.wso2.carbon.apimgt.application.extension; -//import feign.FeignException; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.apimgt.api.APIAdmin; import org.wso2.carbon.apimgt.api.APIConsumer; import org.wso2.carbon.apimgt.api.APIManagementException; -import org.wso2.carbon.apimgt.api.APIProvider; import org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO; import org.wso2.carbon.apimgt.api.model.API; import org.wso2.carbon.apimgt.api.model.APIKey; import org.wso2.carbon.apimgt.api.model.ApiTypeWrapper; import org.wso2.carbon.apimgt.api.model.Application; -import org.wso2.carbon.apimgt.api.model.KeyManagerConfiguration; import org.wso2.carbon.apimgt.api.model.SubscribedAPI; import org.wso2.carbon.apimgt.api.model.Subscriber; import org.wso2.carbon.apimgt.application.extension.bean.APIRegistrationProfile; @@ -43,17 +40,6 @@ import org.wso2.carbon.apimgt.application.extension.util.APIManagerUtil; import org.wso2.carbon.apimgt.impl.APIAdminImpl; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.impl.APIManagerFactory; -//import org.wso2.carbon.apimgt.integration.client.OAuthRequestInterceptor; -//import org.wso2.carbon.apimgt.integration.client.store.StoreClient; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.APIInfo; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.APIList; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.Application; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationInfo; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationKey; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationKeyGenerateRequest; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationList; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.Subscription; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.SubscriptionList; import org.wso2.carbon.apimgt.impl.utils.APIUtil; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.core.config.ui.UIConfiguration; @@ -66,7 +52,6 @@ import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import java.util.ArrayList; -import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -78,66 +63,34 @@ import java.util.Set; public class APIManagementProviderServiceImpl implements APIManagementProviderService { private static final Log log = LogFactory.getLog(APIManagementProviderServiceImpl.class); - private static final String CONTENT_TYPE = "application/json"; - private static final int MAX_API_PER_TAG = 200; - private static final String APP_TIER_TYPE = "application"; public static final APIManagerFactory API_MANAGER_FACTORY = APIManagerFactory.getInstance(); @Override public boolean isTierLoaded() { -// StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService() -// .getStoreClient(); - String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext() - .getTenantDomain(); -// String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); -// try { + + String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); + try { APIUtil.getTiers(APIConstants.TIER_APPLICATION_TYPE, tenantDomain); + return true; } catch (APIManagementException e) { log.error("APIs not ready", e); } - // storeClient.getIndividualTier().tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER, -// APP_TIER_TYPE, -// tenantDomain, CONTENT_TYPE, null, null); - return true; -// } catch (FeignException e) { -// log.error("Feign Exception", e); -// if (e.status() == 401) { -// OAuthRequestInterceptor oAuthRequestInterceptor = new OAuthRequestInterceptor(); -// String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); -// oAuthRequestInterceptor.removeToken(username, tenantDomain); -// try { -// storeClient.getIndividualTier().tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER, -// APP_TIER_TYPE, tenantDomain, CONTENT_TYPE, null, null); -// } catch (FeignException ex) { -// log.error("Invalid Attempt : " + ex); -// } -// } -// } catch (Exception e) { -// log.error("APIs not ready", e); -// } -// return false; + + return false; } @Override public void removeAPIApplication(String applicationName, String username) throws APIManagerException { -// StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService() -// .getStoreClient(); -// ApplicationList applicationList = storeClient.getApplications() -// .applicationsGet("", applicationName, 1, 0, CONTENT_TYPE, null); try { APIConsumer apiConsumer = API_MANAGER_FACTORY.getAPIConsumer(username); Application application = apiConsumer.getApplicationsByName(username, applicationName, ""); if (application != null) { -// ApplicationInfo applicationInfo = applicationList.getList().get(0); -// storeClient.getIndividualApplication().applicationsApplicationIdDelete(applicationInfo.getApplicationId(), -// null, null); apiConsumer.removeApplication(application, username); } } catch (APIManagementException e) { - //todo:amalka - e.printStackTrace(); + throw new APIManagerException("Failed to remove api application : " + applicationName, e); } @@ -148,9 +101,8 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe */ @Override public synchronized ApiApplicationKey generateAndRetrieveApplicationKeys(String applicationName, String tags[], - String keyType, String username, - boolean isAllowedAllDomains, - String validityTime, String scopes) throws APIManagerException { + String keyType, String username, boolean isAllowedAllDomains, String validityTime, String scopes) + throws APIManagerException { String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); if (StringUtils.isEmpty(username)) { diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java index 368fda3a3b2..26f0320974d 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java @@ -18,7 +18,6 @@ package org.wso2.carbon.apimgt.application.extension.internal; import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService; -//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService; import org.wso2.carbon.registry.core.service.TenantRegistryLoader; @@ -35,7 +34,6 @@ public class APIApplicationManagerExtensionDataHolder { private TenantManager tenantManager; private TenantRegistryLoader tenantRegistryLoader; private TenantIndexingLoader indexLoader; -// private IntegrationClientService integrationClientService; private JWTClientManagerService jwtClientManagerService; private APIApplicationManagerExtensionDataHolder() { @@ -94,15 +92,6 @@ public class APIApplicationManagerExtensionDataHolder { return indexLoader; } -// public IntegrationClientService getIntegrationClientService() { -// return integrationClientService; -// } -// -// public void setIntegrationClientService( -// IntegrationClientService integrationClientService) { -// this.integrationClientService = integrationClientService; -// } - public JWTClientManagerService getJwtClientManagerService() { if (jwtClientManagerService == null) { PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java index 4d985279569..d2c675c253c 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java @@ -23,7 +23,6 @@ import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext;; import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService; import org.wso2.carbon.apimgt.application.extension.APIManagementProviderServiceImpl; -//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.registry.core.service.TenantRegistryLoader; import org.wso2.carbon.registry.indexing.service.TenantIndexingLoader; import org.wso2.carbon.user.core.service.RealmService; @@ -91,17 +90,6 @@ public class APIApplicationManagerExtensionServiceComponent { APIApplicationManagerExtensionDataHolder.getInstance().setIndexLoaderService(null); } -// protected void setIntegrationClientService(IntegrationClientService integrationClientService) { -// if (integrationClientService != null && log.isDebugEnabled()) { -// log.debug("integrationClientService initialized"); -// } -// APIApplicationManagerExtensionDataHolder.getInstance().setIntegrationClientService(integrationClientService); -// } -// -// protected void unsetIntegrationClientService(IntegrationClientService integrationClientService) { -// APIApplicationManagerExtensionDataHolder.getInstance().setIntegrationClientService(null); -// } - /** * Sets Realm Service. * diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml index 0784f282aaa..eeddf628a54 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml @@ -47,39 +47,46 @@ org.wso2.carbon.apimgt.integration.client.*, !org.wso2.carbon.apimgt.integration.client.internal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + org.osgi.framework, + org.osgi.service.component, + feign, + feign.codec, + feign.auth, + feign.gson, + feign.slf4j, + org.wso2.carbon.apimgt.integration.generated.client.publisher.api, + org.wso2.carbon.apimgt.integration.generated.client.store.api, + javax.xml.bind, + javax.xml.bind.annotation, + javax.xml.parsers;resolution:=optional, + org.apache.commons.logging, + org.w3c.dom, + org.wso2.carbon.context, + org.wso2.carbon.identity.jwt.client.*, + org.wso2.carbon.user.api, + org.wso2.carbon.utils, + com.fasterxml.jackson.annotation, + io.swagger.annotations, + org.wso2.carbon.core.util, + javax.xml, + org.wso2.carbon.base, + javax.net.ssl, + org.apache.commons.lang, + android.util;resolution:=optional, + javax.annotation;resolution:=optional, + javax.net;resolution:=optional, + javax.security.auth.x500;resolution:=optional, + javax.crypto;resolution:=optional, + javax.crypto.spec;resolution:=optional + + + jsr311-api, + feign-jaxrs, + feign-okhttp, + okhttp, + okio + @@ -113,60 +120,55 @@ - - - - - - - - + + com.squareup.okhttp3 + okhttp + + + com.squareup.okio + okio + io.github.openfeign feign-okhttp - - io.github.openfeign - feign-slf4j - 10.7.2 - - - - - - - - - - - - - - - - - - - - - + + org.wso2.carbon + org.wso2.carbon.logging + + + org.eclipse.osgi + org.eclipse.osgi + + + org.eclipse.osgi + org.eclipse.osgi.services + + + com.google.code.gson + gson + + + javax.ws.rs + jsr311-api + - - - - - - - - + + io.swagger + swagger-annotations + + + junit + junit + io.github.openfeign feign-core - - - - + + io.github.openfeign + feign-jackson + io.github.openfeign feign-jaxrs @@ -176,10 +178,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 73a4234a910..3887d59c661 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java @@ -27,8 +27,7 @@ import feign.slf4j.Slf4jLogger; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.apimgt.integration.client.configs.APIMConfigReader; -import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.ApIsApi; -import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.ApiLifecycleApi; +import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.*; import org.wso2.carbon.core.util.Utils; /** @@ -37,15 +36,13 @@ import org.wso2.carbon.core.util.Utils; public class PublisherClient { private static final Log log = LogFactory.getLog(PublisherClient.class); - private ApIsApi apIsApi = null; - private ApiLifecycleApi apiLifecycleApi = null; -// private APIIndividualApi api = null; -// private APICollectionApi apis = null; -// private DocumentIndividualApi document = null; -// private ApplicationIndividualApi application = null; -// private EnvironmentCollectionApi environments = null; -// private SubscriptionApi subscriptions = null; -// private ThrottlingTierCollectionApi tiers = null; + private APIIndividualApi api = null; + private APICollectionApi apis = null; + private DocumentIndividualApi document = null; + private ApplicationIndividualApi application = null; + private EnvironmentCollectionApi environments = null; + private SubscriptionCollectionApi subscriptions = null; + private ThrottlingTierCollectionApi tiers = null; /** @@ -60,50 +57,40 @@ public class PublisherClient { .requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder()); String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getPublisherEndpoint()); - apIsApi = builder.target(ApIsApi.class, basePath); - apiLifecycleApi = builder.target(ApiLifecycleApi.class, basePath); -// api = builder.target(APIIndividualApi.class, basePath); -// apis = builder.target(APICollectionApi.class, basePath); -// document = builder.target(DocumentIndividualApi.class, basePath); -// application = builder.target(ApplicationIndividualApi.class, basePath); -// environments = builder.target(EnvironmentCollectionApi.class, basePath); -// subscriptions = builder.target(SubscriptionCollectionApi.class, basePath); -// tiers = builder.target(ThrottlingTierCollectionApi.class, basePath); + api = builder.target(APIIndividualApi.class, basePath); + apis = builder.target(APICollectionApi.class, basePath); + document = builder.target(DocumentIndividualApi.class, basePath); + application = builder.target(ApplicationIndividualApi.class, basePath); + environments = builder.target(EnvironmentCollectionApi.class, basePath); + subscriptions = builder.target(SubscriptionCollectionApi.class, basePath); + tiers = builder.target(ThrottlingTierCollectionApi.class, basePath); } - public ApIsApi getApIsApi() { - return apIsApi; + public APIIndividualApi getApi() { + return api; } - public ApiLifecycleApi getApiLifecycleApi() { - return apiLifecycleApi; + public APICollectionApi getApis() { + return apis; } - // public APIIndividualApi getApi() { -// return api; -// } -// -// public APICollectionApi getApis() { -// return apis; -// } -// -// public DocumentIndividualApi getDocument() { -// return document; -// } -// -// public ApplicationIndividualApi getApplication() { -// return application; -// } -// -// public EnvironmentCollectionApi getEnvironments() { -// return environments; -// } -// -// public SubscriptionCollectionApi getSubscriptions() { -// return subscriptions; -// } -// -// public ThrottlingTierCollectionApi getTiers() { -// return tiers; -// } + public DocumentIndividualApi getDocument() { + return document; + } + + public ApplicationIndividualApi getApplication() { + return application; + } + + public EnvironmentCollectionApi getEnvironments() { + return environments; + } + + public SubscriptionCollectionApi getSubscriptions() { + return subscriptions; + } + + public ThrottlingTierCollectionApi getTiers() { + return tiers; + } } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java index 5d8a46d5868..db751f204e8 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java @@ -39,17 +39,16 @@ import java.util.concurrent.TimeUnit; public class StoreClient { private static final org.apache.commons.logging.Log log = LogFactory.getLog(StoreClient.class); - private ApplicationsApi applicationsApi = null; -// private APICollectionApi apis = null; -// private ApIsApi individualApi = null; -// private ApplicationsApi applications = null; -// private ApplicationIndividualApi individualApplication = null; -// private SubscriptionCollectionApi subscriptions = null; -// private SubscriptionIndividualApi individualSubscription = null; -// private SubscriptionMultitpleApi subscriptionMultitpleApi = null; -// private ThrottlingTierIndividualApi individualTier = null; -// private TagsApi tags = null; -// private ThrottlingTierCollectionApi tiers = null; + private APICollectionApi apis = null; + private APIIndividualApi individualApi = null; + private ApplicationCollectionApi applications = null; + private ApplicationIndividualApi individualApplication = null; + private SubscriptionCollectionApi subscriptions = null; + private SubscriptionIndividualApi individualSubscription = null; + private SubscriptionMultitpleApi subscriptionMultitpleApi = null; + private ThrottlingTierIndividualApi individualTier = null; + private TagCollectionApi tags = null; + private ThrottlingTierCollectionApi tiers = null; public StoreClient(RequestInterceptor requestInterceptor) { @@ -61,59 +60,58 @@ public class StoreClient { .requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder()); String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getStoreEndpoint()); - applicationsApi = builder.target(ApplicationsApi.class, basePath); -// apis = builder.target(APICollectionApi.class, basePath); -// individualApi = builder.target(ApIsApi.class, basePath); -// applications = builder.target(ApplicationCollectionApi.class, basePath); -// individualApplication = builder.target(ApplicationIndividualApi.class, basePath); -// subscriptions = builder.target(SubscriptionCollectionApi.class, basePath); -// individualSubscription = builder.target(SubscriptionIndividualApi.class, basePath); -// subscriptionMultitpleApi = builder.target(SubscriptionMultitpleApi.class, basePath); -// tags = builder.target(TagCollectionApi.class, basePath); -// individualTier = builder.target(ThrottlingTierIndividualApi.class, basePath); -// tiers = builder.retryer(new Retryer.Default(100L, TimeUnit.SECONDS.toMillis(1L), 1)) -// .options(new Request.Options(10000, 5000)) -// .target(ThrottlingTierCollectionApi.class, basePath); + apis = builder.target(APICollectionApi.class, basePath); + individualApi = builder.target(APIIndividualApi.class, basePath); + applications = builder.target(ApplicationCollectionApi.class, basePath); + individualApplication = builder.target(ApplicationIndividualApi.class, basePath); + subscriptions = builder.target(SubscriptionCollectionApi.class, basePath); + individualSubscription = builder.target(SubscriptionIndividualApi.class, basePath); + subscriptionMultitpleApi = builder.target(SubscriptionMultitpleApi.class, basePath); + tags = builder.target(TagCollectionApi.class, basePath); + individualTier = builder.target(ThrottlingTierIndividualApi.class, basePath); + tiers = builder.retryer(new Retryer.Default(100L, TimeUnit.SECONDS.toMillis(1L), 1)) + .options(new Request.Options(10000, 5000)) + .target(ThrottlingTierCollectionApi.class, basePath); } -// public APICollectionApi getApis() { -// return apis; -// } -// -// public APIIndividualApi getIndividualApi() { -// return individualApi; -// } -// -// public ApplicationCollectionApi getApplications() { -// return applications; -// } -// -// public ApplicationIndividualApi getIndividualApplication() { -// return individualApplication; -// } -// -// public SubscriptionCollectionApi getSubscriptions() { -// return subscriptions; -// } -// -// public SubscriptionIndividualApi getIndividualSubscription() { -// return individualSubscription; -// } -// -// public ThrottlingTierIndividualApi getIndividualTier() { -// return individualTier; -// } -// -// public TagCollectionApi getTags() { -// return tags; -// } -// -// public ThrottlingTierCollectionApi getTiers() { -// return tiers; -// } -// -// public SubscriptionMultitpleApi getSubscriptionMultitpleApi() { -// return subscriptionMultitpleApi; -// } + public APICollectionApi getApis() { + return apis; + } + + public APIIndividualApi getIndividualApi() { + return individualApi; + } + + public ApplicationCollectionApi getApplications() { + return applications; + } + + public ApplicationIndividualApi getIndividualApplication() { + return individualApplication; + } + + public SubscriptionCollectionApi getSubscriptions() { + return subscriptions; + } + + public SubscriptionIndividualApi getIndividualSubscription() { + return individualSubscription; + } + + public ThrottlingTierIndividualApi getIndividualTier() { + return individualTier; + } + + public TagCollectionApi getTags() { + return tags; + } + + public ThrottlingTierCollectionApi getTiers() { + return tiers; + } + + public SubscriptionMultitpleApi getSubscriptionMultitpleApi() { + return subscriptionMultitpleApi; + } } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml index cc300b8014f..22c399e5b7e 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml @@ -26,59 +26,61 @@ http://wso2.org - - - org.openapitools - openapi-generator-maven-plugin - 5.0.0 - - - process-resources - publisher - - generate - - - ${project.basedir}/src/main/resources/publisher-api.yaml - java - - ${project.artifactId}.publisher.api - ${project.artifactId}.publisher.model - - - - - process-resources - store - - generate - - - ${project.basedir}/src/main/resources/devportal-api.yaml - java - - ${project.artifactId}.store.api - ${project.artifactId}.store.model - - - - - + + + io.swagger + swagger-codegen-maven-plugin + 2.2.1 + + + process-resources + publisher + + generate + + + ${project.basedir}/src/main/resources/publisher-api.yaml + java + + ${project.artifactId}.publisher.api + ${project.artifactId}.publisher.model + + feign + + + + process-resources + store + + generate + + + ${project.basedir}/src/main/resources/store-api.yaml + java + + ${project.artifactId}.store.api + ${project.artifactId}.store.model + + feign + + + + com.google.code.maven-replacer-plugin replacer 1.5.2 - + process-resources - replace-for-openapi-genenerated-code-publisher + replace-for-swagger-genenerated-code-publisher replace - ${project.basedir}/target/generated-sources/openapi/src/main/java/org/wso2/carbon/apimgt/integration/generated/client/publisher/model/API.java + ${project.basedir}/target/generated-sources/swagger/src/main/java/org/wso2/carbon/apimgt/integration/generated/client/publisher/model/API.java CURRENT_TENANT @@ -113,33 +115,28 @@ org.wso2.carbon.apimgt.integration.generated.client.store.api.*, org.wso2.carbon.apimgt.integration.generated.client.store.model.* - - com.google.gson;version="[2.8,3)", - com.google.gson.annotations;version="[2.8,3)", - com.google.gson.internal.bind.util, - com.google.gson.reflect;version="[2.8,3)", - com.google.gson.stream;version="[2.8,3)", - io.gsonfire;version="[1.8,2)", - io.swagger.annotations;version="[1.5,2)", - javax.annotation;version="[3.0,4)", - javax.net.ssl, - okhttp3, - okhttp3.internal.http, - okhttp3.internal.tls, - okhttp3.logging, - okio, - org.apache.oltu.oauth2.client;version="[1.0,2)", - org.apache.oltu.oauth2.client.request;version="[1.0,2)", - org.apache.oltu.oauth2.client.response;version="[1.0,2)", - org.apache.oltu.oauth2.common.exception;version="[1.0,2)", - org.apache.oltu.oauth2.common.message.types;version="[1.0,2)", - org.threeten.bp;version="[1.5,2)", - org.threeten.bp.format;version="[1.5,2)", - org.threeten.bp.temporal;version="[1.5,2)", - org.wso2.carbon.apimgt.integration.generated.client.publisher.model, - org.wso2.carbon.apimgt.integration.generated.client.store.model - - + + feign;version="${io.github.openfeign.version.range}", + feign.jackson;version="${io.github.openfeign.version.range}", + feign.codec;version="${io.github.openfeign.version.range}", + feign.auth;version="${io.github.openfeign.version.range}", + feign.gson;version="${io.github.openfeign.version.range}", + feign.slf4j;version="${io.github.openfeign.version.range}", + com.google.gson, + com.fasterxml.jackson.core;resolution:=optional, + com.fasterxml.jackson.annotation, + com.fasterxml.jackson.databind;resolution:=optional, + io.swagger.annotations, + javax.net.ssl, + com.fasterxml.jackson.datatype.joda;resolution:=optional, + org.apache.oltu.oauth2.client.*;resolution:=optional, + org.apache.oltu.oauth2.common.*;resolution:=optional, + org.junit;resolution:=optional, + + + jsr311-api, + feign-jaxrs + @@ -148,105 +145,60 @@ - - - io.swagger.core.v3 - swagger-annotations - 2.1.7 - - - com.google.code.gson gson - 2.8.5 - - - - + + javax.ws.rs + jsr311-api + io.swagger swagger-annotations - - com.squareup.okhttp3 - okhttp - 4.9.1 - - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - 1.0.1 - - - - com.squareup.okhttp3 - logging-interceptor - 4.9.1 - - - - org.threeten - threetenbp - 1.5.0 - - - - io.gsonfire - gson-fire - 1.8.5 - - - io.swagger.parser.v3 - swagger-parser - 2.0.25 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + junit + junit + + + io.github.openfeign + feign-core + + + io.github.openfeign + feign-jackson + + + io.github.openfeign + feign-jaxrs + + + io.github.openfeign + feign-gson + + + org.testng + testng + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + + + io.github.openfeign + feign-slf4j + + + org.wso2.orbit.com.fasterxml.jackson.core + jackson-databind + ${jackson-databind.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + true diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml index 76fdb6f92d9..b2068857a76 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml @@ -1,122 +1,115 @@ -# Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -################################################################################ -openapi: 3.0.1 + +swagger: '2.0' +###################################################### +# Prolog +###################################################### info: - title: WSO2 API Manager - Publisher API + version: "0.12.0" + title: "WSO2 API Manager - Publisher API" description: | - This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. - - # Authentication - Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking - the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps - that you will need to follow to obtain an access token. - First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types - in the payload. A Sample payload is shown below. - ``` - { - "callbackUrl":"www.google.lk", - "clientName":"rest_api_publisher", - "owner":"admin", - "grantType":"client_credentials password refresh_token", - "saasApp":true - } - ``` - Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the - base64 encoded admin username and password. - **Format of the request** - ``` - curl -X POST -H "Authorization: Basic Base64(admin_username:admin_password)" -H "Content-Type: application/json" - \ -d @payload.json https://:/client-registration/v0.17/register - ``` - **Sample request** - ``` - curl -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" - \ -d @payload.json https://localhost:9443/client-registration/v0.17/register - ``` - Following is a sample response after invoking the above curl. - ``` - { - "clientId": "fOCi4vNJ59PpHucC2CAYfYuADdMa", - "clientName": "rest_api_publisher", - "callBackURL": "www.google.lk", - "clientSecret": "a4FwHlq0iCIKVs2MPIIDnepZnYMa", - "isSaasApplication": true, - "appOwner": "admin", - "jsonString": "{\"grant_types\":\"client_credentials password refresh_token\",\"redirect_uris\":\"www.google.lk\",\"client_name\":\"rest_api123\"}", - "jsonAppAttribute": "{}", - "tokenType": null - } - ``` - Next you must use the above client id and secret to obtain the access token. - We will be using the password grant type for this, you can use any grant type you desire. - You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section - of this document and scope for each resource is given in **authorization** section of resource documentation. - Following is the format of the request if you are using the password grant type. - ``` - curl -k -d "grant_type=password&username=&password=" - \ -H "Authorization: Basic base64(cliet_id:client_secret)" - \ https://:/token - ``` - **Sample request** - ``` - curl https://localhost:8243/token -k \ - -H "Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h" \ - -d "grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create" - ``` - Shown below is a sample response to the above request. - ``` - { - "access_token": "e79bda48-3406-3178-acce-f6e4dbdcbb12", - "refresh_token": "a757795d-e69f-38b8-bd85-9aded677a97c", - "scope": "apim:api_create apim:api_view", - "token_type": "Bearer", - "expires_in": 3600 - } - ``` - Now you have a valid access token, which you can use to invoke an API. - Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. - If you use a different authentication mechanism, this process may change. - - # Try out in Postman - If you want to try-out the embedded postman collection with "Run in Postman" option, please follow the guidelines listed below. - * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. - * Make sure you have an API Manager instance up and running. - * Update the `basepath` parameter to match the hostname and port of the APIM instance. - - [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + This specifies a **RESTful API** for WSO2 **API Manager** - Publisher. + + Please see [full swagger definition](https://raw.githubusercontent.com/wso2/carbon-apimgt/v6.1.66/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher/src/main/resources/publisher-api.yaml) of the API which is written using [swagger 2.0](http://swagger.io/) specification. contact: - name: WSO2 - url: http://wso2.com/products/api-manager/ - email: architecture@wso2.com + name: "WSO2" + url: "http://wso2.com/products/api-manager/" + email: "architecture@wso2.com" license: - name: Apache 2.0 - url: http://www.apache.org/licenses/LICENSE-2.0.html - version: v2 -servers: - - url: https://apis.wso2.com/api/am/publisher/v2 -security: - - OAuth2Security: - - apim:api_view + name: "Apache 2.0" + url: "http://www.apache.org/licenses/LICENSE-2.0.html" + +###################################################### +# The fixed parts of the URLs of the API +###################################################### + +# The schemes supported by the API +schemes: + - https + +# The domain of the API. +# This is configured by the customer during deployment. +# The given host is just an example. +host: apis.wso2.com + +# The base path of the API. +# Will be prefixed to all paths. +basePath: /api/am/publisher/v0.12 + +# The following media types can be passed as input in message bodies of the API. +# The actual media type must be specified in the Content-Type header field of the request. +# The default is json, i.e. the Content-Type header is not needed to +# be set, but supporting it serves extensibility. +consumes: + - application/json + +# The following media types may be passed as output in message bodies of the API. +# The media type(s) consumable by the requestor is specified in the Accept header field +# of the corresponding request. +# The actual media type returned will be specfied in the Content-Type header field +# of the of the response. +# The default of the Accept header is json, i.e. there is not needed to +# set the value, but supporting it serves extensibility. +produces: + - application/json + + +x-wso2-security: + apim: + x-wso2-scopes: + - description: "" + roles: admin + name: apim:api_view + key: apim:api_view + - description: "" + roles: admin + name: apim:api_create + key: apim:api_create + - description: "" + roles: admin + name: apim:api_publish + key: apim:api_publish + - description: "" + roles: admin + name: apim:tier_view + key: apim:tier_view + - description: "" + roles: admin + name: apim:tier_manage + key: apim:tier_manage + - description: "" + roles: admin + name: apim:subscription_view + key: apim:subscription_view + - description: "" + roles: admin + name: apim:subscription_block + key: apim:subscription_block + - description: "" + roles: admin + name: apim:mediation_policy_view + key: apim:mediation_policy_view + - description: "" + roles: admin + name: apim:api_workflow + key: apim:api_workflow + + +###################################################### +# The "API Collection" resource APIs +###################################################### paths: - ###################################################### - # The "API Collection" resource APIs - ###################################################### /apis: + +#----------------------------------------------------- +# Retrieving the list of all APIs qualifying under a given search condition +#----------------------------------------------------- get: - tags: - - APIs + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/apis" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"previous\": \"\",\n \"list\": [\n {\n \"provider\": \"admin\",\n \"version\": \"1.0.0\",\n \"description\": \"This sample API provides Account Status Validation\",\n \"name\": \"AccountVal\",\n \"context\": \"/account\",\n \"id\": \"2e81f147-c8a8-4f68-b4f0-69e0e7510b01\",\n \"status\": \"PUBLISHED\"\n },\n {\n \"provider\": \"admin\",\n \"version\": \"1.0.0\",\n \"description\": null,\n \"name\": \"api1\",\n \"context\": \"/api1\",\n \"id\": \"3e22d2fb-277a-4e9e-8c7e-1c0f7f73960e\",\n \"status\": \"PUBLISHED\"\n }\n ],\n \"next\": \"\",\n \"count\": 2\n}" summary: | Retrieve/Search APIs description: | @@ -124,10 +117,9 @@ paths: Each retrieved API is represented with a minimal amount of attributes. If you want to get complete details of an API, you need to use **Get details of an API** operation. parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/requestedTenant' - - name: query + - $ref : '#/parameters/limit' + - $ref : '#/parameters/offset' + - name : query in: query description: | **Search condition**. @@ -135,11542 +127,3565 @@ paths: You can search in attributes by using an **":"** modifier. Eg. - "provider:wso2" will match an API if the provider of the API contains "wso2". - "provider:"wso2"" will match an API if the provider of the API is exactly "wso2". - "status:PUBLISHED" will match an API if the API is in PUBLISHED state. - "label:external" will match an API if it contains a Microgateway label called "external". + "provider:wso2" will match an API if the provider of the API is exactly "wso2". + + Additionally you can use wildcards. - Also you can use combined modifiers Eg. - name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. + "provider:wso2*" will match an API if the provider of the API starts with "wso2". - Supported attribute modifiers are [**version, context, name, status, - description, subcontext, doc, provider, label**] + Supported attribute modifiers are [**version, context, status, + description, subcontext, doc, provider**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. - Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl) - schema: - type: string - - $ref: '#/components/parameters/If-None-Match' - - $ref: '#/components/parameters/expand' - - $ref: '#/components/parameters/Accept' + type: string + - $ref : "#/parameters/Accept" + - $ref : "#/parameters/If-None-Match" + tags: + - API (Collection) responses: 200: description: | OK. List of qualifying APIs is returned. + schema: + $ref: '#/definitions/APIList' headers: + Content-Type: + description: The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/APIList' + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - - apim:api_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis"' - x-examples: - $ref: docs/examples/apis/apis_get.yaml - operationId: getAllAPIs + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' +#----------------------------------------------------- +# Create a new API -API (Individual) +#----------------------------------------------------- post: - tags: - - APIs - summary: Create a New API + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json https://localhost:9443/api/am/publisher/v0.12/apis" + x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/apis\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\n\n{\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"PUBLISHED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": false,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"http\",\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 5000,\r\n \"production\": 1000\r\n },\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\": \"in\"},{\"name\":\"log_out_message\",\"type\": \"out\"}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" + x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"integer\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"http\",\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 5000,\r\n \"production\": 1000\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\":\"in\",\"id\":\"142ece76-b208-4aab-b29a-f382045ed066\",\"shared\":false},{\"name\":\"log_out_message\",\"type\":\"out\",\"id\":\"b3527be8-95e6-41e0-8097-3276987b7d4b\",\"shared\":false}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" + summary: Create a new API description: | This operation can be used to create a new API specifying the details of the API in the payload. The new API will be in `CREATED` state. There is a special capability for a user who has `APIM Admin` permission such that he can create APIs on behalf of other users. For that he can to specify `"provider" : "some_other_user"` in the payload so that the API's creator will be shown as `some_other_user` in the UI. parameters: - - name: openAPIVersion - in: query - description: Open api version + - in: body + name: body + description: | + API object that needs to be added + required: true schema: - type: string - default: v3 - enum: - - v2 - - v3 - requestBody: - description: API object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/API' - required: true + $ref: '#/definitions/API' + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/Authorization' + tags: + - API (Individual) responses: 201: description: | Created. Successful response with the newly created object as entity in the body. Location header contains URL of newly created entity. + schema: + $ref: '#/definitions/API' headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string Location: description: | The URL of the newly created resource. - schema: - type: string + type: string Content-Type: description: | The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' + type: string + Authorization: + description: | + The brearer token. + type: string + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + type: string 400: - $ref: '#/components/responses/BadRequest' + description: | + Bad Request. + Invalid request or validation error. + schema: + $ref: '#/definitions/Error' 415: - $ref: '#/components/responses/UnsupportedMediaType' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis"' - x-examples: - $ref: docs/examples/apis/apis_post.yaml - operationId: createAPI - - ###################################################### - # The "Individual API" resource APIs - ###################################################### + description: | + Unsupported Media Type. + The entity of the request was in a not supported format. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Individual API" resource APIs +###################################################### /apis/{apiId}: + +#----------------------------------------------------- +# Retrieve the details of an API definition +#----------------------------------------------------- get: - tags: - - APIs - summary: Get Details of an API + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"http\",\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 5000,\r\n \"production\": 1000\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" + summary: Get details of an API description: | Using this operation, you can retrieve complete details of a single API. You need to provide the Id of the API to retrive it. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/requestedTenant' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - API (Individual) responses: 200: description: | OK. Requested API is returned headers: + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' + type: string + schema: + $ref: '#/definitions/API' 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested API does not exist. + schema: + $ref: '#/definitions/Error' 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - - apim:api_import_export - - apim:api_product_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f"' - x-examples: - $ref: docs/examples/apis/apis_id_get.yaml - operationId: getAPI + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' +#----------------------------------------------------- +# Update the definition of an API +#----------------------------------------------------- put: - tags: - - APIs + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X PUT -d @data.json https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f" + x-wso2-request: "PUT https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"integer\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\",\"chicken\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 500,\r\n \"production\": 100\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\": \"in\"},{\"name\":\"log_out_message\",\"type\": \"out\"}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\"https\"],\r\n \"tags\": [\r\n \"chicken\",\r\n \"pizza\"\r\n ],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 500,\r\n \"production\": 100\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\":\"in\",\"id\":\"142ece76-b208-4aab-b29a-f382045ed066\",\"shared\":false},{\"name\":\"log_out_message\",\"type\":\"out\",\"id\":\"b3527be8-95e6-41e0-8097-3276987b7d4b\",\"shared\":false}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" summary: Update an API description: | This operation can be used to update an existing API. But the properties `name`, `version`, `context`, `provider`, `state` will not be changed by this operation. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - description: API object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/API' - required: true + - $ref: '#/parameters/apiId' + - in: body + name: body + description: | + API object that needs to be added + required: true + schema: + $ref: '#/definitions/API' + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - API (Individual) responses: 200: description: | OK. Successful response with updated API object + schema: + $ref: '#/definitions/API' headers: + Location: + description: | + The URL of the newly created resource. + type: string + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' + type: string 400: - $ref: '#/components/responses/BadRequest' + description: | + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' 403: - $ref: '#/components/responses/Forbidden' + description: | + Forbidden. + The request must be conditional but no condition has been specified. + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' - 409: - $ref: '#/components/responses/Conflict' + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f"' - operationId: updateAPI + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' +#----------------------------------------------------- +# Delete the definition of an API +#----------------------------------------------------- delete: - tags: - - APIs + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE https://localhost:9443/api/am/publisher/v0.12/apis/6fb74674-4ab8-4b52-9886-f9a376985060" + x-wso2-request: | + DELETE https://localhost:9443/api/am/publisher/v0.12/apis/6fb74674-4ab8-4b52-9886-f9a376985060 + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK" summary: Delete an API description: | This operation can be used to delete an existing API proving the Id of the API. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - API (Individual) responses: 200: description: | OK. Resource successfully deleted. - content: {} 403: - $ref: '#/components/responses/Forbidden' + description: | + Forbidden. + The request must be conditional but no condition has been specified. + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' - 409: - $ref: '#/components/responses/Conflict' + description: | + Not Found. + Resource to be deleted does not exist. + schema: + $ref: '#/definitions/Error' 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_delete - - apim:api_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f"' - operationId: deleteAPI - - /apis/{apiId}/topics: - put: - tags: - - APIs - summary: Update Topics - description: This operation can be used to update topics of an existing API. - operationId: updateTopics - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - description: API object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/TopicList' - required: true - responses: - 200: description: | - OK. - Successful response with updated API object - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' - /apis/{apiId}/reimport-service: - put: - tags: - - APIs - summary: Update the Service that is used to create the API - description: This operation can be used to re-import the Service used to create the API - operationId: reimportServiceFromCatalog - parameters: - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - Successful response with updated API object - headers: - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' +################################################################ +# The swagger resource of "Individual API" resource APIs +################################################################ /apis/{apiId}/swagger: - get: - tags: - - APIs - summary: Get Swagger Definition +#----------------------------------------------------- +# Retrieve the API swagger definition +#----------------------------------------------------- + get: + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/swagger" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/swagger + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\nContent-Length: 329\n\n{\n \"paths\": {\"/*\": {\"get\": {\n \"x-auth-type\": \"Application\",\n \"x-throttling-tier\": \"Unlimited\",\n \"responses\": {\"200\": {\"description\": \"OK\"}}\n }}},\n \"x-wso2-security\": {\"apim\": {\"x-wso2-scopes\": []}},\n \"swagger\": \"2.0\",\n \"info\": {\n \"title\": \"PhoneVerification\",\n \"description\": \"Verify a phone number\",\n \"contact\": {\n \"email\": \"xx@ee.com\",\n \"name\": \"xx\"\n },\n \"version\": \"1.0.0\"\n }\n}" + summary: Get swagger definition description: | This operation can be used to retrieve the swagger definition of an API. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - API (Individual) responses: 200: description: | OK. Requested swagger document of the API is returned headers: + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - type: string - example: "" + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested API does not exist. + schema: + $ref: '#/definitions/Error' 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f/swagger"' - operationId: getAPISwagger + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' +#----------------------------------------------------- +# Update the API swagger definition +#----------------------------------------------------- put: - tags: - - APIs - summary: Update Swagger Definition + consumes: + - multipart/form-data + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013\" -F apiDefinition=\"{\\\"paths\\\":{\\\"\\/*\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"responses\\\":{\\\"200\\\":{\\\"description\\\":\\\"OK\\\"}}}}},\\\"x-wso2-security\\\":{\\\"apim\\\":{\\\"x-wso2-scopes\\\":[]}},\\\"swagger\\\":\\\"2.0\\\",\\\"info\\\":{\\\"title\\\":\\\"PhoneVerification\\\",\\\"description\\\":\\\"Verify a phone number\\\",\\\"contact\\\":{\\\"email\\\":\\\"xx@ee.com\\\",\\\"name\\\":\\\"xx\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\" -X PUT \"https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/swagger\"" + x-wso2-request: | + PUT https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/swagger + Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013 + Content-Length: 477 + Content-Type: multipart/form-data; boundary=------------------------4f51e636c0003d99 + + --------------------------4f51e636c0003d99 + Content-Disposition: form-data; name="apiDefinition" + + {"paths":{"\/*":{"get":{"x-auth-type":"Application","x-throttling-tier":"Unlimited","responses":{"200":{"description":"OK"}}}}},"x-wso2-security":{"apim":{"x-wso2-scopes":[]}},"swagger":"2.0","info":{"title":"PhoneVerification","description":"Verify a phone number","contact":{"email":"xx@ee.com","name":"xx"},"version":"1.0.0"}} + --------------------------4f51e636c0003d99-- + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"paths\": {\"/*\": {\"get\": {\n \"x-auth-type\": \"Application\",\n \"x-throttling-tier\": \"Unlimited\",\n \"responses\": {\"200\": {\"description\": \"OK\"}}\n }}},\n \"x-wso2-security\": {\"apim\": {\"x-wso2-scopes\": []}},\n \"swagger\": \"2.0\",\n \"info\": {\n \"title\": \"PhoneVerification\",\n \"description\": \"Verify a phone number\",\n \"contact\": {\n \"email\": \"xx@ee.com\",\n \"name\": \"xx\"\n },\n \"version\": \"1.0.0\"\n }\n}" + summary: Update swagger definition description: | This operation can be used to update the swagger definition of an existing API. Swagger definition to be updated is passed as a form data parameter `apiDefinition`. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - properties: - apiDefinition: - type: string - description: Swagger definition of the API - url: - type: string - description: Swagger definition URL of the API - file: - type: string - description: Swagger definitio as a file - format: binary + - $ref: '#/parameters/apiId' + - in: formData + name: apiDefinition + description: Swagger definition of the API + type: string + required: true + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - API (Individual) responses: 200: description: | OK. Successful response with updated Swagger definition headers: + Location: + description: | + The URL of the newly created resource. + type: string + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - type: string - example: "" + type: string 400: - $ref: '#/components/responses/BadRequest' + description: | + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' 403: - $ref: '#/components/responses/Forbidden' + description: | + Forbidden. + The request must be conditional but no condition has been specified. + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F apiDefinition=@swagger.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/swagger"' - operationId: updateAPISwagger - - /apis/{apiId}/generate-mock-scripts: - post: - tags: - - APIs - summary: Generate Mock Response Payloads + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +################################################################ +# The thumbnail resource of "Individual API" resource APIs +################################################################ + + /apis/{apiId}/thumbnail: +#------------------------------------------------------------------------------------------------- +# Downloads a thumbnail image of an API +#------------------------------------------------------------------------------------------------- + get: + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9\" https://localhost:9443/api/am/publisher/v0.12/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail > image.jpg" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail + Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9 + x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: image/jpeg\r\n\r\n[image content]" + summary: Get thumbnail image description: | - This operation can be used to generate mock responses from examples of swagger definition of an API. - operationId: generateMockScripts + This operation can be used to download a thumbnail image of an API. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - API (Individual) responses: 200: description: | OK. - Requested swagger document of the API is returned with example responses + Thumbnail image returned headers: + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - type: string - example: "" + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested Document does not exist. + schema: + $ref: '#/definitions/Error' 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f/generate-mock-scripts"' - - /apis/{apiId}/generated-mock-scripts: - get: - tags: - - APIs - summary: Get Generated Mock Response Payloads + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' + +#---------------------------------------------------------------------------- +# Upload a thumbnail image to a certain API +#---------------------------------------------------------------------------- + post: + consumes: + - multipart/form-data + x-scope: apim:api_create + x-wso2-curl: "curl -X POST -H \"Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9\" https://localhost:9443/api/am/publisher/v0.12/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail -F file=@image.jpg" + x-wso2-request: | + POST https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail + Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9 + Content-Type: multipart/form-data; boundary=------------------------5e542e0e5b50e1e4 + Content-Length: 18333 + + --------------------------5e542e0e5b50e1e4 + Content-Disposition: form-data; name="file"; filename="image.jpg" + Content-Type: image/jpeg + + [image content] + + --------------------------5e542e0e5b50e1e4-- + x-wso2-response: "HTTP/1.1 201 Created\r\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail\r\nContent-Type: application/json\r\n\r\n{\r\n \"relativePath\": \"/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail\",\r\n \"mediaType\": \"image/jpeg\"\r\n}" + summary: Upload a thumbnail image description: | - This operation can be used to get generated mock responses from examples of swagger definition of an API. - operationId: getGeneratedMockScriptsOfAPI + This operation can be used to upload a thumbnail image of an API. The thumbnail to be uploaded should be given as a form data parameter `file`. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId' + - in: formData + name: file + description: Image to upload + type: file + required: true + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - API (Individual) responses: 200: description: | OK. - Requested swagger document of the API is returned with example responses + Image updated + schema: + $ref : '#/definitions/FileInfo' headers: - ETag: + Location: description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + The URL of the uploaded thumbnail image of the API. + type: string Content-Type: description: | The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/MockResponsePayloadList' - 304: + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 400: description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} + Bad Request. + Invalid request or validation error. + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f/generated-mock-scripts"' - - /apis/{apiId}/resource-policies: - get: - tags: - - API Resource Policies - summary: Get the Resource Policy(inflow/outflow) Definitions + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Copy API" Processing Function resource API +###################################################### + /apis/copy-api: + +#----------------------------------------------------- +# Create a new API based on an already existing one +#----------------------------------------------------- + post: + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/apis/copy-api?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&newVersion=2.0.0\"" + x-wso2-request: | + POST https://localhost:9443/api/am/publisher/v0.12/apis/copy-api?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&newVersion=2.0.0 + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/25a84fc9-38c0-4578-95e8-29fb6b1c4771\nContent-Type: application/json\n\n{\r\n \"id\": \"25a84fc9-38c0-4578-95e8-29fb6b1c4771\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"2.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"\\\\/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#\\\\/definitions\\\\/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"schema\\\":{\\\"$ref\\\":\\\"#\\\\/definitions\\\\/Order\\\"},\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"description\\\":\\\"Created.\\\"}}}},\\\"\\\\/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#\\\\/definitions\\\\/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"headers\\\":{},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application\\\\/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application\\\\/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http:\\\\/\\\\/www.apache.org\\\\/licenses\\\\/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http:\\\\/\\\\/www.pizzashack.com\\\"},\\\"version\\\":\\\"2.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\"https\"],\r\n \"tags\": [\r\n \"chicken\",\r\n \"pizza\"\r\n ],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 500,\r\n \"production\": 100\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" + summary: Create a new API version description: | - This operation can be used to retrieve conversion policy resource definitions of an API. + This operation can be used to create a new version of an existing API. The new version is specified as `newVersion` query parameter. New API will be in `CREATED` state. parameters: - - $ref: '#/components/parameters/apiId' - - name: resourcePath + - name: newVersion + description: Version of the new API. + type: string in: query - description: Resource path of the resource policy definition + required: true + - $ref: '#/parameters/apiId-Q' + tags: + - API (Individual) + responses: + 201: + description: | + Created. + Successful response with the newly created API as entity in the body. Location header contains URL of newly created API. + headers: + Location: + description: | + The URL of the newly created API. + type: string + 400: + description: | + Bad Request. + Invalid request or validation error schema: - type: string - - name: verb - in: query - description: HTTP verb of the resource path of the resource policy definition + $ref: '#/definitions/Error' + 404: + description: | + Not Found. + API to copy does not exist. + 401: + description: | + Unauthenticated request. schema: - type: string - - name: sequenceType + $ref: '#/definitions/Error' + +###################################################### +# The "Change Lifecycle" Processing Function resource API +###################################################### + /apis/change-lifecycle: + +#----------------------------------------------------- +# Change the lifecycle of an API +#----------------------------------------------------- + post: + x-scope: apim:api_publish + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish\"" + x-wso2-request: | + POST https://localhost:9443/api/am/publisher/v0.12/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK" + summary: Change API Status + description: | + This operation is used to change the lifecycle of an API. Eg: Publish an API which is in `CREATED` state. In order to change the lifecycle, we need to provide the lifecycle `action` as a query parameter. + + For example, to Publish an API, `action` should be `Publish`. Note that the `Re-publish` action is available only after calling `Block`. + + Some actions supports providing additional paramters which should be provided as `lifecycleChecklist` parameter. Please see parameters table for more information. + parameters: + - name: action + description: | + The action to demote or promote the state of the API. + + Supported actions are [ **Publish, Deploy as a Prototype, Demote to Created, Demote to Prototyped, Block, Deprecate, Re-Publish, Retire **] + in: query - description: sequence type of the resource policy resource definition + type: string required: true - schema: - type: string - - $ref: '#/components/parameters/If-None-Match' + enum: + - Publish + - Deploy as a Prototype + - Demote to Created + - Demote to Prototyped + - Block + - Deprecate + - Re-Publish + - Retire + - name: lifecycleChecklist + description: | + + Supported checklist items are as follows. + 1. **Deprecate Old Versions**: Setting this to true will deprecate older versions of a particular API when it is promoted to Published state from Created state. + 2. **Require Re-Subscription**: If you set this to true, users need to re subscribe to the API although they may have subscribed to an older version. + + You can specify additional checklist items by using an **"attribute:"** modifier. + + Eg: "Deprecate Old Versions:true" will deprecate older versions of a particular API when it is promoted to Published state from Created state. Multiple checklist items can be given in "attribute1:true, attribute2:false" format. + + **Sample CURL :** curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -X POST "https://localhost:9443/api/am/publisher/v0.12/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish&lifecycleChecklist=Deprecate Old Versions:true,Require Re-Subscription:true" + + type: string + in: query + - $ref: '#/parameters/apiId-Q' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - API (Individual) responses: 200: description: | OK. - List of resource policy definitions of the API is returned + Lifecycle changed successfully. headers: ETag: description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + Entity Tag of the changed API. Used by caches, or in conditional requests (Will be supported in future). + type: string Last-Modified: description: | - Date and time the resource has been modifed the last time. + Date and time the API lifecycle has been modified the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ResourcePolicyList' - 304: + type: string + 400: description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/resource-policies?resourcePath=checkPhoneNumber&verb=post&sequenceType=in"' - operationId: getAPIResourcePolicies - - /apis/{apiId}/resource-policies/{resourcePolicyId}: + description: | + Not Found. + Requested API does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Document Collection" resource APIs +###################################################### + /apis/{apiId}/documents: + +#----------------------------------------------------- +# Retrieve the documents associated with an API that qualify under a search condition +#----------------------------------------------------- get: - tags: - - API Resource Policies - summary: Get the Resource Policy(inflow/outflow) Definition for a Given Resource - Identifier. + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents\"" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"previous\": \"\",\n \"list\": [\n {\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation for v1.0.0\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n },\n {\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"URL\",\n \"sourceUrl\": \"http://wiki.cdyne.com/index.php/Phone_Verification\",\n \"otherTypeName\": null,\n \"documentId\": \"4145df31-04f1-440c-8d08-68952874622c\",\n \"summary\": \"This is the URL for online documentation\",\n \"name\": \"Online Documentation\",\n \"type\": \"SAMPLES\"\n }\n ],\n \"next\": \"\",\n \"count\": 2\n}" + summary: Get a list of documents of an API description: | - This operation can be used to retrieve conversion policy resource definitions of an API given the resource identifier. + This operation can be used to retrive a list of documents belonging to an API by providing the id of the API. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/resourcePolicyId' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/limit' + - $ref: '#/parameters/offset' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + tags: + - Document (Collection) responses: 200: description: | OK. - Requested resource policy definition of the API is returned for the given resource identifier. + Document list is returned. + schema: + $ref: '#/definitions/DocumentList' headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string Content-Type: description: | The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ResourcePolicyInfo' + type: string + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 400: - $ref: '#/components/responses/BadRequest' 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested API does not exist. + schema: + $ref: '#/definitions/Error' 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/resource-policies/8efc32a4-c7f1-4bee-b860-b7566e2bc0d5"' - operationId: getAPIResourcePoliciesByPolicyId + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' - put: - tags: - - API Resource Policies - summary: Update the Resource Policy(inflow/outflow) Definition for the Given - Resource Identifier +#----------------------------------------------------- +# Add a document to a certain API +#----------------------------------------------------- + post: + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents\"" + x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"summary\": \"This is a sample documentation\",\n \"name\": \"Introduction to PhoneVerification API\",\n \"type\": \"HOWTO\"\n}" + x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058\",\n \"summary\": \"This is a sample documentation\",\n \"name\": \"Introduction to PhoneVerification API\",\n \"type\": \"HOWTO\"\n}" + summary: Add a new document to an API description: | - This operation can be used to update the resource policy(inflow/outflow) definition for the given resource identifier of an existing API. resource policy definition to be updated is passed as a body parameter `content`. + This operation can be used to add a new documentation to an API. This operation only adds the metadata of a document. To add the actual content we need to use **Upload the content of an API document ** API once we obtain a document Id by this operation. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/resourcePolicyId' - - $ref: '#/components/parameters/If-Match' - requestBody: - description: Content of the resource policy definition that needs to be updated - content: - application/json: - schema: - $ref: '#/components/schemas/ResourcePolicyInfo' - required: true + - $ref: '#/parameters/apiId' + - in: body + name: body + description: | + Document object that needs to be added + required: true + schema: + $ref: '#/definitions/Document' + - $ref: '#/parameters/Content-Type' + tags: + - Document (Collection) responses: - 200: + 201: description: | - OK. - Successful response with updated the resource policy definition + Created. + Successful response with the newly created Document object as entity in the body. + Location header contains URL of newly added document. + schema: + $ref: '#/definitions/Document' headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string Location: description: | - The URL of the newly created resource. - schema: - type: string + Location to the newly created Document. + type: string Content-Type: description: | The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ResourcePolicyInfo' + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string 400: - $ref: '#/components/responses/BadRequest' - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/resource-policies/8efc32a4-c7f1-4bee-b860-b7566e2bc0d5"' - operationId: updateAPIResourcePoliciesByPolicyId + description: | + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' + 415: + description: | + Unsupported media type. + The entity of the request was in a not supported format. - /apis/{apiId}/thumbnail: +###################################################### +# The "Individual Document" resource APIs +###################################################### + '/apis/{apiId}/documents/{documentId}': + +#----------------------------------------------------- +# Retrieve a particular document of a certain API +#----------------------------------------------------- get: - tags: - - APIs - summary: Get Thumbnail Image + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\"" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5 + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n}" + summary: Get a document of an API description: | - This operation can be used to download a thumbnail image of an API. + This operation can be used to retrieve a particular document's metadata associated with an API. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/documentId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - Document (Individual) responses: 200: description: | OK. - Thumbnail image returned + Document returned. + schema: + $ref: '#/definitions/Document' headers: + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested Document does not exist. + schema: + $ref: '#/definitions/Error' 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/thumbnail"' - operationId: getAPIThumbnail + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' +#----------------------------------------------------- +# Update a particular document of a certain API +#----------------------------------------------------- put: - tags: - - APIs - summary: Upload a Thumbnail Image + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\" -H \"Content-Type: application/json\" -X PUT -d data.json \"https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\"" + x-wso2-request: "PUT https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\nAuthorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation for v1.0.0\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n}" + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation for v1.0.0\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n}" + summary: Update a document of an API description: | - This operation can be used to upload a thumbnail image of an API. The thumbnail to be uploaded should be given as a form data parameter `file`. - operationId: updateAPIThumbnail + This operation can be used to update metadata of an API's document. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - required: - - file - properties: - file: - type: string - description: Image to upload - format: binary - required: true + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/documentId' + - in: body + name: body + description: | + Document object that needs to be added + required: true + schema: + $ref: '#/definitions/Document' + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Document (Individual) responses: 200: description: | OK. - Image updated + Document updated + schema: + $ref: '#/definitions/Document' headers: + Location: + description: | + The URL of the updated document. + type: string + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the uploaded thumbnail image of the API. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/FileInfo' + type: string 400: - $ref: '#/components/responses/BadRequest' + description: | + Bad Request. + Invalid request or validation error. + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=image.jpeg "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/thumbnail"' - - /apis/{apiId}/subscription-policies: - get: - tags: - - APIs - summary: | - Get Details of the Subscription Throttling Policies of an API - description: | - This operation can be used to retrieve details of the subscription throttling policy of an API by specifying the API Id. - - `X-WSO2-Tenant` header can be used to retrive API subscription throttling policies that belongs to a different tenant domain. If not specified super tenant will be used. If Authorization header is present in the request, the user's tenant associated with the access token will be used. + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +#----------------------------------------------------- +# Delete a particular document of a certain API +#----------------------------------------------------- + delete: + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058" + x-wso2-request: | + DELETE https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058 + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK" + summary: Delete a document of an API + description: | + This operation can be used to delete a document associated with an API. + parameters: + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/documentId' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Document (Individual) + responses: + 200: + description: | + OK. + Resource successfully deleted. + 404: + description: | + Not Found. + Resource to be deleted does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +################################################################ +# The content resource of "Individual Document" resource APIs +################################################################ + + '/apis/{apiId}/documents/{documentId}/content': + + #------------------------------------------------------------------------------------------------- + # Downloads a FILE type document/get the inline content or source url of a certain document + #------------------------------------------------------------------------------------------------- + get: + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\" \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content\" > sample.pdf" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content + Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a + x-wso2-response: "HTTP/1.1 200 OK\nContent-Disposition: attachment; filename=\"sample.pdf\"\nContent-Type: application/octet-stream\nContent-Length: 7802\n\n%PDF-1.4\n%äüöß\n2 0 obj\n<>\nstream\n..\n>>\nstartxref\n7279\n%%EOF" + summary: Get the content of an API document + description: | + This operation can be used to retrive the content of an API's document. + + The document can be of 3 types. In each cases responses are different. + + 1. **Inline type**: + The content of the document will be retrieved in `text/plain` content type + + _Sample cURL_ : `curl -k -H "Authorization:Bearer 579f0af4-37be-35c7-81a4-f1f1e9ee7c51" -F inlineContent=@"docs.txt" -X POST "https://localhost:9443/api/am/publisher/v0.12/apis/995a4972-3178-4b17-a374-756e0e19127c/documents/43c2bcce-60e7-405f-bc36-e39c0c5e189e/content` + 2. **FILE type**: + The file will be downloaded with the related content type (eg. `application/pdf`) + 3. **URL type**: + The client will recieve the URL of the document as the Location header with the response with - `303 See Other` + parameters: + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/documentId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - Document (Individual) + responses: + 200: + description: | + OK. + File or inline content returned. + headers: + Content-Type: + description: | + The content type of the body. + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 303: + description: | + See Other. + Source can be retrived from the URL specified at the Location header. + headers: + Location: + description: | + The Source URL of the document. + type: string + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + 404: + description: | + Not Found. + Requested Document does not exist. + schema: + $ref: '#/definitions/Error' + 406: + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' + + #---------------------------------------------------------------------------- + # Upload a file or add inline content to a document of a certain API + #---------------------------------------------------------------------------- + post: + consumes: + - multipart/form-data + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -F file=@\"sample.pdf\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content\"" + x-wso2-request: | + POST https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/documents/b3a79270-02bb-4e39-9ac1-90ce8f6c84af/content + Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + Content-Length: 8004 + Content-Type: multipart/form-data; boundary=------------------------7b9a53f1ffa452b9 + + --------------------------7b9a53f1ffa452b9 + Content-Disposition: form-data; name="file"; filename="sample.pdf" + Content-Type: application/octet-stream + + [file content] + + --------------------------7b9a53f1ffa452b9-- + x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/documents/b3a79270-02bb-4e39-9ac1-90ce8f6c84af/content\nContent-Type: application/json\n\n{\n \"visibility\":\"API_LEVEL\",\n \"sourceType\":\"FILE\",\n \"sourceUrl\":null,\n \"otherTypeName\":null,\n \"documentId\":\"daf732d3-bda2-46da-b381-2c39d901ea61\",\n \"summary\":\"This is a sample documentation pdf\",\n \"name\":\"Introduction to PhoneVerification API PDF\",\n \"type\":\"HOWTO\"\n}" + summary: Upload the content of an API document + description: | + Thid operation can be used to upload a file or add inline content to an API document. + + **IMPORTANT:** + * Either **file** or **inlineContent** form data parameters should be specified at one time. + * Document's source type should be **FILE** in order to upload a file to the document using **file** parameter. + * Document's source type should be **INLINE** in order to add inline content to the document using **inlineContent** parameter. + parameters: + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/documentId' + - in: formData + name: file + description: Document to upload + type: file + required: false + - in: formData + name: inlineContent + description: Inline content of the document + type: string + required: false + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Document (Individual) + responses: + 200: + description: | + OK. + Document updated + schema: + $ref: '#/definitions/Document' + headers: + Location: + description: | + The URL of the updated content of the document. + type: string + Content-Type: + description: | + The content type of the body. + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 400: + description: | + Bad Request. + Invalid request or validation error. + schema: + $ref: '#/definitions/Error' + 404: + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + + ##pp +###################################################### +# The "specific mediation policy" resource APIs +###################################################### + '/apis/{apiId}/policies/mediation': + + #----------------------------------------------------------------------------------------- + # Retrieving the list of all API specific mediation sequences under a given search condition + #----------------------------------------------------------------------------------------- + get: + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc\" https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation" + x-wso2-request: "GET https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation\r\nAuthorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc" + x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"count\": 1,\r\n \"next\": null,\r\n \"previous\": null,\r\n \"list\": [ {\r\n \"name\": \"add_custom_header_fault\",\r\n \"id\": \"6460d7e6-4272-4e3a-9879-437228d83123\",\r\n \"type\": \"fault\"\r\n }]\r\n}" + summary: | + Get all mediation policies of an API + description: | + This operation provides you a list of available mediation policies of an API. + parameters: + - $ref: '#/parameters/apiId' + - $ref : '#/parameters/limit' + - $ref : '#/parameters/offset' + - name : query + in: query + description: "-Not supported yet-" + type: string + - $ref : "#/parameters/Accept" + - $ref : "#/parameters/If-None-Match" + tags: + - Mediation Policy (Collection) + responses: + 200: + description: | + OK. + List of qualifying APIs is returned. + schema: + $ref: '#/definitions/mediationList' + headers: + Content-Type: + description: The content type of the body. + type: string + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + type: string + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + 406: + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' + +#---------------------------------------------------------------------------- +# Upload an API specific mediation policy +#---------------------------------------------------------------------------- + post: + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer 6cea3696-0151-3282-bf79-a0c4db6f308a\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation\"" + x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation\r\nContent-Type: application/json\r\nAuthorization: Bearer 6cea3696-0151-3282-bf79-a0c4db6f308a\r\n\r\n{\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}" + x-wso2-response: "HTTP/1.1 201 Created\r\nLocation: https://localhost:9443/api/am/publisher/v0.12/registry/resource/_system/governance/apimgt/applicationdata/provider/admin/hello/1.0.0/fault/add_custom_header_fault.xml\r\nContent-Type: application/json\r\n\r\n{ \r\n \"id\":\"624b9f7d-bfaf-484b-94cc-e84491f5d725\",\r\n \"name\":\"add_custom_header_fault\",\r\n \"type\":\"fault\",\r\n \"config\":\"\\n \\n\\n\"\r\n}" + summary: Add an API specific mediation policy + description: | + This operation can be used to add an API specifc mediation policy. + parameters: + - in: body + name: body + description: mediation policy to upload + required: true + schema: + $ref: '#/definitions/Mediation' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Mediation Policy (Collection) + responses: + 200: + description: | + OK. + mediation policy uploaded + schema: + $ref : '#/definitions/Mediation' + headers: + Location: + description: | + The URL of the uploaded thumbnail image of the API. + type: string + Content-Type: + description: | + The content type of the body. + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 400: + description: | + Bad Request. + Invalid request or validation error. + schema: + $ref: '#/definitions/Error' + 404: + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Individual API specific mediation sequence" resource +###################################################### + /apis/{apiId}/policies/mediation/{mediationPolicyId}: + +#----------------------------------------------------- +# Retrieve a particular API specific mediation squence +#----------------------------------------------------- + get: + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer 5aa0acc0-0ce3-3a0b-8cc8-db5ef696ee23\" https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/624b9f7d-bfaf-484b-94cc-e84491f5d725" + x-wso2-request: "GET https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/624b9f7d-bfaf-484b-94cc-e84491f5d725\r\nAuthorization: Bearer 5aa0acc0-0ce3-3a0b-8cc8-db5ef696ee23" + x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"id\": \"624b9f7d-bfaf-484b-94cc-e84491f5d725\",\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}" + summary: Get an API specific mediation policy + description: | + This operation can be used to retrieve a particular API specific mediation policy. + parameters: + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/mediationPolicyId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - Mediation Policy (Individual) + responses: + 200: + description: | + OK. + Mediation policy returned. + schema: + $ref: '#/definitions/Mediation' + headers: + Content-Type: + description: | + The content type of the body. + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + 404: + description: | + Not Found. + Requested Document does not exist. + schema: + $ref: '#/definitions/Error' + 406: + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' + +#----------------------------------------------------- +# Delete the mediation policy +#----------------------------------------------------- + delete: + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc\" -X DELETE https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/60f5146d-1774-405d-86b3-9b040ac266d5" + x-wso2-request: "DELETE https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/60f5146d-1774-405d-86b3-9b040ac266d5\r\nAuthorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc" + x-wso2-response: "HTTP/1.1 200 OK" + summary: Delete an API specific mediation policy + description: | + This operation can be used to delete an existing API specific mediation policy providing the Id of the API and the Id of the mediation policy. + parameters: + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/mediationPolicyId' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Mediation Policy (Individual) + responses: + 200: + description: | + OK. + Resource successfully deleted. + 403: + description: | + Forbidden. + The request must be conditional but no condition has been specified. + schema: + $ref: '#/definitions/Error' + 404: + description: | + Not Found. + Resource to be deleted does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +#----------------------------------------------------- +# Update the a mediation policy +#----------------------------------------------------- + put: + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer 9e41fae2-3ada-3dd1-8f12-2077202f4285\" -H \"Content-Type: application/json\" -X PUT -d @data.json https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/820fdcf7-7258-42b5-809e-674b893644d1" + x-wso2-request: "PUT https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/820fdcf7-7258-42b5-809e-674b893644d1\r\nContent-Type: application/json\r\nAuthorization: Bearer 9e41fae2-3ada-3dd1-8f12-2077202f4285\r\n\r\n{\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}" + x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"id\": \"a7365481-5b3f-463c-a646-a498895ac210\",\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}" + summary: Update an API specific mediation policy + description: | + This operation can be used to update an existing mediation policy of an API. + parameters: + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/mediationPolicyId' + - in: body + name: body + description: | + Mediation policy object that needs to be updated + required: true + schema: + $ref: '#/definitions/Mediation' + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Mediation Policy (Individual) + responses: + 200: + description: | + OK. + Successful response with updated API object + schema: + $ref: '#/definitions/Mediation' + headers: + Location: + description: | + The URL of the newly created resource. + type: string + Content-Type: + description: | + The content type of the body. + type: string + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 400: + description: | + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' + 403: + description: | + Forbidden. + The request must be conditional but no condition has been specified. + schema: + $ref: '#/definitions/Error' + 404: + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The wsdl Resource +###################################################### + /apis/{apiId}/wsdl: + +#----------------------------------------------------- +# Retrieve the details about a certain wsdl +#----------------------------------------------------- + get: + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/apis/7f82f6b0-2667-441e-af23-c0fc44cf3a17/wsdl\"" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis/7f82f6b0-2667-441e-af23-c0fc44cf3a17/wsdl + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"name\": \"admin--hello1.0.0.wsdl\",\r\n \"wsdlDefinition\": \"\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n \\n <\\/input>\\n \\n <\\/output>\\n <\\/operation>\\n <\\/portType>\\n \\n \\n \\n \\n \\n \\n <\\/input>\\n \\n \\n <\\/output>\\n <\\/operation>\\n <\\/binding>\\n \\nWSDL File for HelloService<\\/documentation>\\n \\n \\n <\\/port>\\n <\\/service>\\n<\\/definitions>\"\r\n}" + summary: Get the WSDL of an API + description: | + This operation can be used to retrieve the WSDL definition of an API. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/requestedTenant' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - Wsdl (Individual) responses: 200: description: | OK. - Throttling Policy returned + Requested WSDL DTO object belongs to the API + schema: + $ref: '#/definitions/Wsdl' 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. - schema: - type: string + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ThrottlingPolicy' + 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. - content: {} + Empty body because the client has already the latest version of the requested resource (Will be supported in future). 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested API does not exist. + schema: + $ref: '#/definitions/Error' 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/subscription-policies"' - operationId: getAPISubscriptionPolicies - - /apis/copy-api: - post: - 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 - in: query - description: Version of the new API. - required: true - schema: - maxLength: 30 - type: string - - 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: | - Created. - Successful response with the newly created API as entity in the body. Location header contains URL of newly created API. - headers: - Location: - description: | - The URL of the newly created API. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' - 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/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 - - /apis/change-lifecycle: + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' +#----------------------------------------------------- +# Add a wsdl to the registry +#----------------------------------------------------- post: - tags: - - API Lifecycle - summary: Change API Status + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/apis/af3f96da-9ccf-463f-8cee-13ec8530a9cd/wsdl\"" + x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/apis/af3f96da-9ccf-463f-8cee-13ec8530a9cd/wsdl\r\nContent-Type: application/json\r\nAuthorization: Bearer 7d237cab-7011-3f81-b384-24d03e750873\r\n\r\n{\r\n \"name\": \"admin--PizzaShackAPI1.0.0.wsdl\",\r\n \"wsdlDefinition\": \"\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n \\n <\\/input>\\n \\n <\\/output>\\n <\\/operation>\\n <\\/portType>\\n \\n \\n \\n \\n \\n \\n <\\/input>\\n \\n \\n <\\/output>\\n <\\/operation>\\n <\\/binding>\\n \\nWSDL File for HelloService<\\/documentation>\\n \\n \\n <\\/port>\\n <\\/service>\\n<\\/definitions>\"\r\n}" + x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"name\": \"admin--PizzaShackAPI1.0.0.wsdl\",\r\n \"wsdlDefinition\": \"\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n \\n <\\/input>\\n \\n <\\/output>\\n <\\/operation>\\n <\\/portType>\\n \\n \\n \\n \\n \\n \\n <\\/input>\\n \\n \\n <\\/output>\\n <\\/operation>\\n <\\/binding>\\n \\nWSDL File for HelloService<\\/documentation>\\n \\n \\n <\\/port>\\n <\\/service>\\n<\\/definitions>\"\r\n}" + summary: Add a WSDL to an API description: | - This operation is used to change the lifecycle of an API. Eg: Publish an API which is in `CREATED` state. In order to change the lifecycle, we need to provide the lifecycle `action` as a query parameter. - - For example, to Publish an API, `action` should be `Publish`. Note that the `Re-publish` action is available only after calling `Block`. - - Some actions supports providing additional paramters which should be provided as `lifecycleChecklist` parameter. Please see parameters table for more information. + This operation can be used to add a WSDL definition to an existing API. parameters: - - name: action - in: query + - $ref: '#/parameters/apiId' + - in: body + name: body description: | - The action to demote or promote the state of the API. - - Supported actions are [ **Publish**, **Deploy as a Prototype**, **Demote to Created**, **Block**, **Deprecate**, **Re-Publish**, **Retire** ] + JSON payload including WSDL definition that needs to be added required: true schema: - type: string - enum: - - Publish - - Deploy as a Prototype - - Demote to Created - - Block - - Deprecate - - Re-Publish - - Retire - - name: lifecycleChecklist - in: query - description: |2 - - Supported checklist items are as follows. - 1. **Deprecate old versions after publishing the API**: Setting this to true will deprecate older versions of a particular API when it is promoted to Published state from Created state. - 2. **Requires re-subscription when publishing the API**: If you set this to true, users need to re subscribe to the API although they may have subscribed to an older version. - You can specify additional checklist items by using an **"attribute:"** modifier. - Eg: "Deprecate old versions after publishing the API:true" will deprecate older versions of a particular API when it is promoted to Published state from Created state. Multiple checklist items can be given in "attribute1:true, attribute2:false" format. - **Sample CURL :** curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -X POST "https://localhost:9443/api/am/publisher/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' + $ref: '#/definitions/Wsdl' + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Wsdl (Individual) responses: 200: description: | OK. - Lifecycle changed successfully. + Successful response with updated wsdl 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 changed API. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + type: string Last-Modified: description: | - Date and time the API lifecycle has been modified the last time. + 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/WorkflowResponse' - 202: - description: | - Accepted. - The request has been accepted. - content: - application/json: - schema: - $ref: '#/components/schemas/WorkflowResponse' + type: string 400: - $ref: '#/components/responses/BadRequest' + 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: - $ref: '#/components/responses/NotFound' - 409: - $ref: '#/components/responses/Conflict' + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_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 - - /apis/{apiId}/lifecycle-history: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + + +###################################################### +# The "Individual Application" resource APIs +###################################################### + '/applications/{applicationId}': + +#----------------------------------------------------- +# Retrieve the details about a certain application +#----------------------------------------------------- get: - tags: - - API Lifecycle - summary: Get Lifecycle State Change History of the API. + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/applications/896658a0-b4ee-4535-bbfa-806c894a4015" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/applications/896658a0-b4ee-4535-bbfa-806c894a4015 + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"groupId\": \"\",\n \"subscriber\": \"admin\",\n \"throttlingTier\": \"Unlimited\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"description\": null,\n \"name\": \"DefaultApplication\"\n}" + summary: Get details of an application description: | - This operation can be used to retrieve Lifecycle state change history of the API. + This operation can be used to retrieve details of an individual application specifying the application id in the URI. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/applicationId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - Application (Individual) responses: 200: description: | OK. - Lifecycle state change history returned successfully. + Application returned. + schema: + $ref: '#/definitions/Application' headers: + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/LifecycleHistory' + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} 404: - $ref: '#/components/responses/NotFound' - 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: + description: | + Not Found. + Requested application does not exist. + schema: + $ref: '#/definitions/Error' + 406: + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Subscription Collection" resource APIs +###################################################### + /subscriptions: + +#----------------------------------------------------- +# Retrieve all subscriptions of a certain API +#----------------------------------------------------- get: - tags: - - API Lifecycle - summary: Get Lifecycle State Data of the API. + x-scope: apim:subscription_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/subscriptions?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b\"" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/subscriptions?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b + 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 \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"status\": \"UNBLOCKED\"\n },\n {\n \"subscriptionId\": \"7ac22c34-8745-4cfe-91e0-262c50b2f2e3\",\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n \"applicationId\": \"367a2361-8db5-4140-8133-c6c8dc7fa0c4\",\n \"status\": \"UNBLOCKED\"\n }\n ],\n \"next\": \"\",\n \"count\": 2\n}" + summary: Get all Subscriptions description: | - This operation can be used to retrieve Lifecycle state data of the API. + This operation can be used to retrieve a list of subscriptions of the user associated with the provided access token. This operation is capable of + + 1. Retrieving all subscriptions for the user's APIs. + `GET https://localhost:9443/api/am/publisher/v0.12/subscriptions` + + 2. Retrieving subscriptions for a specific API. + `GET https://localhost:9443/api/am/publisher/v0.12/subscriptions?apiId=c43a325c-260b-4302-81cb-768eafaa3aed` parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId-Q' + - $ref: '#/parameters/limit' + - $ref: '#/parameters/offset' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + tags: + - Subscription (Collection) responses: 200: description: | OK. - Lifecycle state data returned successfully. + Subscription list returned. + schema: + $ref: '#/definitions/SubscriptionList' 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' + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 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 + 406: + description: | + Not Acceptable. The requested media type is not supported + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Individual Subscription" resource APIs +###################################################### + '/subscriptions/{subscriptionId}': + +#----------------------------------------------------- +# Retrieve a certain subscription +#----------------------------------------------------- + get: + x-scope: apim:subscription_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/subscriptions/64eca60b-2e55-4c38-8603-e9e6bad7d809" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/subscriptions/64eca60b-2e55-4c38-8603-e9e6bad7d809 + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"status\": \"UNBLOCKED\"\n}" + summary: Get details of a subscription description: | - This operation can be used to remove pending lifecycle state change requests that are in pending state + This operation can be used to get details of a single subscription. parameters: - - $ref: '#/components/parameters/apiId' + - $ref: '#/parameters/subscriptionId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - Subscription (Individual) 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 + Subscription returned + schema: + $ref: '#/definitions/ExtendedSubscription' + 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 Subscription does not exist. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Block Subscription" Processing Function resource API +###################################################### + /subscriptions/block-subscription: + +#----------------------------------------------------- +# Block a certain subscription +#----------------------------------------------------- + post: + x-scope: apim:subscription_block + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/subscriptions/block-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809&blockState=PROD_ONLY_BLOCKED\"" + x-wso2-request: | + POST https://localhost:9443/api/am/publisher/v0.12/subscriptions/block-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809&blockState=PROD_ONLY_BLOCKED + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n \n{\n \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"status\": \"PROD_ONLY_BLOCKED\"\n}" + summary: Block a subscription description: | - List available revisions of an API - operationId: getAPIRevisions + This operation can be used to block a subscription. Along with the request, `blockState` must be specified as a query parameter. + + 1. `BLOCKED` : Subscription is completely blocked for both Production and Sandbox environments. + 2. `PROD_ONLY_BLOCKED` : Subscription is blocked for Production environment only. parameters: - - $ref: '#/components/parameters/apiId' - - name: query + - $ref: '#/parameters/subscriptionId-Q' + - name: blockState in: query - schema: - type: string + description: | + Subscription block state. + type: string + required: true + enum: + - BLOCKED + - PROD_ONLY_BLOCKED + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Subscription (Individual) 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: + Subscription was blocked successfully. + headers: + ETag: + description: | + Entity Tag of the blocked subscription. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the subscription has been blocked. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 400: description: | - Created. - Successful response with the newly created APIRevision object as the entity in the body. - content: - application/json: - schema: - $ref: '#/components/schemas/APIRevision' + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested subscription does not exist. + schema: + $ref: '#/definitions/Error' 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 + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Unblock Subscription" Processing Function resource API +###################################################### + /subscriptions/unblock-subscription: + +#----------------------------------------------------- +# Unblock a certain subscription +#----------------------------------------------------- + post: + x-scope: apim:subscription_block + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/subscriptions/unblock-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809\"" + x-wso2-request: | + POST https://localhost:9443/api/am/publisher/v0.12/subscriptions/unblock-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809 + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8` + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"status\": \"UNBLOCKED\"\n} " + summary: Unblock a Subscription parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/revisionId' + - $ref: '#/parameters/subscriptionId-Q' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + description: | + This operation can be used to unblock a subscription specifying the subscription Id. The subscription will be fully unblocked after performing this operation. + tags: + - Subscription (Individual) 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 + Subscription was unblocked successfully. + headers: + ETag: + description: | + Entity Tag of the unblocked subscription. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the subscription has been unblocked. + 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: - $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 - #-------------------------------------------- + description: | + Not Found. + Requested subscription 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 "Tier Collection" resource APIs +###################################################### + '/tiers/{tierLevel}': + +#----------------------------------------------------- +# Retrieve the list of all available tiers +#----------------------------------------------------- get: - tags: - - API Revisions - summary: List available deployed revision deployment details of an API + x-scope: apim:tier_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/tiers/api" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/tiers/api + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n\n{\n \"previous\": \"\",\n \"list\": [\n {\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 1,\n \"description\": \"Allows 1 request(s) per minute.\",\n \"name\": \"Bronze\",\n \"attributes\": {}\n },\n {\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 20,\n \"description\": \"Allows 20 request(s) per minute.\",\n \"name\": \"Gold\",\n \"attributes\": {}\n },\n {\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 5,\n \"description\": \"Allows 5 request(s) per minute.\",\n \"name\": \"Silver\",\n \"attributes\": {}\n },\n {\n \"unitTime\": 0,\n \"tierPlan\": null,\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 0,\n \"description\": \"Allows unlimited requests\",\n \"name\": \"Unlimited\",\n \"attributes\": {}\n }\n ],\n \"next\": \"\",\n \"count\": 4\n}" + summary: Get all tiers description: | - List available deployed revision deployment details of an API - operationId: getAPIRevisionDeployments + This operation can be used to list the available tiers for a given tier level. Tier level should be specified as a path parameter and should be one of `api`, `application` and `resource`. 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: + - $ref: '#/parameters/limit' + - $ref: '#/parameters/offset' + - $ref: '#/parameters/tierLevel' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' 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' + - Throttling Tier (Collection) 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 + List of tiers returned. 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: + $ref: '#/definitions/TierList' + 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: | - OK. - 201: + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + 406: 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 - #-------------------------------------------------------- + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' + +#----------------------------------------------------- +# Create a new tier +#----------------------------------------------------- post: - tags: - - API Revisions - summary: Restore a revision + x-scope: apim:tier_manage + 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/tiers/api\"" + x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/tiers/api\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 5,\n \"description\": \"Allows 5 request(s) per minute.\",\n \"name\": \"Low\",\n \"attributes\": {\n \"a\":10,\n \"b\":30\n }\n}" + x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/tiers/Low\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 5,\n \"description\": \"Allows 5 request(s) per minute.\",\n \"name\": \"Low\",\n \"attributes\": {\n \"b\": \"30\",\n \"a\": \"10\"\n }\n}" + summary: Create a Tier description: | - Restore a revision to the working copy of the API - operationId: restoreAPIRevision + This operation can be used to create a new throttling tier. The only supported tier level is `api` tiers. + `POST https://localhost:9443/api/am/publisher/v0.12/tiers/api` + + **IMPORTANT:** + * This is only effective when Advanced Throttling is disabled in the Server. If enabled, we need to use Admin REST API for throttling tiers modification related operations. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/revisionId-Q' - responses: - 201: + - in: body + name: body 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 + Tier object that should to be added 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' + $ref: '#/definitions/Tier' + - $ref: '#/parameters/tierLevel-A' + - $ref: '#/parameters/Content-Type' + tags: + - Throttling Tier (Collection) 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. + Location header contains URL of newly created entity. + schema: + $ref: '#/definitions/Tier' headers: Location: description: | - The URL of the newly created resource. - schema: - type: string + Location of the newly created tier. + 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: + type: string 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' + Entity Tag of the response resource. + Used by caches, or in conditional request' + type: string 400: - $ref: '#/components/responses/BadRequest' - 401: - $ref: '#/components/responses/Unauthorized' + description: | + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' 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}: + description: | + Unsupported media type. + The entity of the request was in a not supported format. + +###################################################### +# The "Individual Tier" resource APIs +###################################################### + '/tiers/{tierLevel}/{tierName}': + +#----------------------------------------------------- +# Retrieve a certain tier +#----------------------------------------------------- get: - tags: - - Comments - summary: Get Details of an API Comment + x-scope: apim:tier_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/tiers/api/Bronze" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/tiers/api/Bronze + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 1,\n \"description\": \"Allows 1 request(s) per minute.\",\n \"name\": \"Bronze\",\n \"attributes\": {}\n}" + summary: Get details of a tier description: | - Get the individual comment given by a username for a certain API. - operationId: getCommentOfAPI + This operation can be used to retrieve details of a single tier by specifying the tier level and tier name. + Note that the scope of the API is mandatory while retreiving the access token with the following cURL command : `curl -k -d \"grant_type=password&username=username&password=password&scope=apim:tier_view\" -H \"Authorization: Basic \" https://localhost:8243/token`. + You will receive the access token as the response, for example `"access_token":"8644c013-7ff1-3217-b150-d7b92cae6be7"`. 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' + - $ref: '#/parameters/tierName' + - $ref: '#/parameters/tierLevel' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - Throttling Tier (Individual) responses: 200: description: | OK. - Comment returned. + Tier returned + schema: + $ref: '#/definitions/Tier' 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. - schema: - type: string + 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. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Comment' + 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. - content: {} - 401: - $ref: '#/components/responses/Unauthorized' + Empty body because the client has already the latest version of the requested resource (Will be supported in future). 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested Tier does not exist. + schema: + $ref: '#/definitions/Error' 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: | + Not Acceptable. + The requested media type is not supported. + schema: + $ref: '#/definitions/Error' + +#----------------------------------------------------- +# Update a certain tier +#----------------------------------------------------- + put: + x-scope: apim:tier_manage + 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/tiers/api/Low\"" + x-wso2-request: "PUT https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 10,\n \"description\": \"Allows 10 request(s) per minute.\",\n \"name\": \"Low\",\n \"attributes\": {\n \"a\": \"30\",\n \"b\": \"10\",\n \"c\": \"20\"\n }\n}\n" + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 10,\n \"description\": \"Allows 10 request(s) per minute.\",\n \"name\": \"Low\",\n \"attributes\": {\n \"b\": \"10\",\n \"c\": \"20\",\n \"a\": \"30\"\n }\n}" + summary: Update a Tier description: | - Edit the individual comment - operationId: editCommentOfAPI + This operation can be used to update an existing tier. The only supported tier level is `api` tiers. + `PUT https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low` + + **IMPORTANT:** + * This is only effective when Advanced Throttling is disabled in the Server. If enabled, we need to use Admin REST API for throttling tiers modification related operations. 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 + - $ref: '#/parameters/tierName' + - in: body + name: body + description: | + Tier object that needs to be modified + required: true + schema: + $ref: '#/definitions/Tier' + - $ref: '#/parameters/tierLevel-A' + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Throttling Tier (Individual) responses: 200: description: | OK. - Comment updated. + Subscription updated. + schema: + $ref: '#/definitions/Tier' 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 request. - schema: - type: string - Location: #??? + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: description: | - Location to the newly created Comment. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Comment' + 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: - $ref: '#/components/responses/BadRequest' - 401: - $ref: '#/components/responses/Unauthorized' + description: | + Bad Request. + Invalid request or validation error. + schema: + $ref: '#/definitions/Error' 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"' + 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' +#----------------------------------------------------- +# Delete a certain tier +#----------------------------------------------------- delete: - tags: - - Comments - summary: Delete an API Comment + x-scope: apim:tier_manage + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE \"https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low\"" + x-wso2-request: | + DELETE https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK" + summary: Delete a Tier description: | - Remove a Comment - operationId: deleteComment + This operation can be used to delete an existing tier. The only supported tier level is `api` tiers. + `DELETE https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low` + + **IMPORTANT:** + * This is only effective when Advanced Throttling is disabled in the Server. If enabled, we need to use Admin REST API for throttling tiers modification related operations. parameters: - - $ref: '#/components/parameters/commentId' - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' + - $ref: '#/parameters/tierName' + - $ref: '#/parameters/tierLevel-A' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Throttling Tier (Individual) 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: | + Not Found. + Resource to be deleted does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Update Permission" Processing Function resource API +###################################################### + '/tiers/update-permission': + +#----------------------------------------------------- +# Update the permission of a certain tier +#----------------------------------------------------- + post: + x-scope: apim:tier_manage + 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/tiers/update-permission?tierName=Bronze&tierLevel=api\"" + x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/tiers/update-permission?tierName=Bronze&tierLevel=api\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"permissionType\":\"deny\",\n \"roles\": [\"Internal/everyone\",\"admin\"]\n}" + x-wso2-response: "HTTP/1.1 200 OK" + summary: Update tier permission description: | - Get replies of a comment - operationId: getRepliesOfComment + This operation can be used to update tier permissions which controls access for the particular tier based on the subscribers' roles. 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' + - $ref: '#/parameters/tierName-Q' + - $ref: '#/parameters/tierLevel-Q' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + - in: body + name: permissions + schema: + $ref: '#/definitions/TierPermission' + tags: + - Throttling Tier (Individual) responses: 200: description: | OK. - Comment returned. + Successfully updated tier permissions + schema: + type: array + items: + $ref: '#/definitions/Tier' headers: ETag: description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests. - schema: - type: string + Entity Tag of the modified tier. + 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. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/CommentList' - 304: + Date and time the tier has been modified. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 400: description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource. - 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. + Bad Request. + Invalid request or validation error. 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 + $ref: '#/definitions/Error' + 403: description: | - Specify whether to return the full content of the OpenAPI definition in the response. This is only - applicable when using url based validation + Forbidden. + The request must be conditional but no condition has been specified. 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' + $ref: '#/definitions/Error' 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 + Not Found. + Requested tier does not exist. + schema: + $ref: '#/definitions/Error' + 412: description: | - **Search condition**. - - You can search in attributes by using an **":"** modifier. + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' - Eg. - "name:wso2" will match an API if the provider of the API is exactly "wso2". - Supported attribute modifiers are [** version, context, name **] +###################################################### +# The "Environment Collection" resource API +###################################################### + /environments: - 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 +#----------------------------------------------------- +# Retrieve the list of environments configured for a certain API +#----------------------------------------------------- + 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/environments\"" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/environments + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"list\": [ {\n \"showInApiConsole\": true,\n \"serverUrl\": \"https://localhost:9443/services/\",\n \"endpoints\": {\n \"http\": \"http://localhost:8280\",\n \"https\": \"https://localhost:8243\"\n },\n \"name\": \"Production and Sandbox\",\n \"type\": \"hybrid\"\n }],\n \"count\": 1\n}" + summary: Get all gateway environments 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: + This operation can be used to retrieve the list of gateway environments available. + parameters: + - $ref: '#/parameters/apiId-Q' 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 + - Environment (Collection) responses: 200: description: | OK. - API definition validation information is returned + Environment list is returned. + schema: + $ref: '#/definitions/EnvironmentList' 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' + 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). 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: + description: | + Not Found. + Requested API does not exist. + schema: + $ref: '#/definitions/Error' + /policies/mediation: + +#----------------------------------------------------------------------------------------- +# Retrieving the list of all global mediation sequences under a given search condition +#----------------------------------------------------------------------------------------- get: - tags: - - GraphQL Schema (Individual) - summary: Get the Schema of a GraphQL API + x-scope: apim:mediation_policy_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/policies/mediation" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/policies/mediation + 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 \"count\": 10,\r\n \"next\": null,\r\n \"previous\": null,\r\n \"list\": [\r\n {\r\n \"name\": \"debug_json_fault\",\r\n \"id\": \"563de8f3-dd1d-4ec7-afc2-d158c663ed34\",\r\n \"type\": \"fault\"\r\n },\r\n {\r\n \"name\": \"json_fault\",\r\n \"id\": \"f9c36f4d-a2b6-41e7-b311-d358a47916be\",\r\n \"type\": \"fault\"\r\n },\r\n {\r\n \"name\": \"json_to_xml_in_message\",\r\n \"id\": \"3921225b-7918-4b95-a851-22c4e4e3e911\",\r\n \"type\": \"in\"\r\n },\r\n {\r\n \"name\": \"debug_in_flow\",\r\n \"id\": \"2bc15f93-4455-4763-89b8-83600fb9d731\",\r\n \"type\": \"in\"\r\n },\r\n {\r\n \"name\": \"log_in_message\",\r\n \"id\": \"4d287cca-76ab-44ca-b22e-919fc27c50e3\",\r\n \"type\": \"in\"\r\n },\r\n {\r\n \"name\": \"preserve_accept_header\",\r\n \"id\": \"3776b215-b3bc-40b6-bdcb-06efa7de64be\",\r\n \"type\": \"in\"\r\n },\r\n {\r\n \"name\": \"xml_to_json_in_message\",\r\n \"id\": \"50ac2002-769e-4f90-8549-6d0248dff7d2\",\r\n \"type\": \"in\"\r\n },\r\n {\r\n \"name\": \"xml_to_json_out_message\",\r\n \"id\": \"2af75853-ed75-4d25-81aa-0ebbeca691ea\",\r\n \"type\": \"out\"\r\n },\r\n {\r\n \"name\": \"json_to_xml_out_message\",\r\n \"id\": \"d9fa3ffc-f6b6-4171-ab97-eb44196cb66e\",\r\n \"type\": \"out\"\r\n },\r\n {\r\n \"name\": \"debug_out_flow\",\r\n \"id\": \"260b7701-4071-46bd-9b66-900ac6fffed6\",\r\n \"type\": \"out\"\r\n },\r\n {\r\n \"name\": \"apply_accept_header\",\r\n \"id\": \"15c17c2f-33e3-4c37-a262-04dfa49983a4\",\r\n \"type\": \"out\"\r\n },\r\n {\r\n \"name\": \"log_out_message\",\r\n \"id\": \"d37dca41-c048-492a-82cf-9a2292c6fff0\",\r\n \"type\": \"out\"\r\n }\r\n ]\r\n}" + summary: | + Get all global level mediation policies description: | - This operation can be used to retrieve the Schema definition of a GraphQL API. + This operation provides you a list of available all global level mediation policies. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' + - $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. - Requested GraphQL Schema DTO object belongs to the API + List of mediation policies 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). - 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' + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' 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 + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' - put: - tags: - - GraphQL Schema - summary: Add a Schema to a GraphQL API + + +###################################################### +# The "Workflow approval" resource API +###################################################### + /workflows/update-workflow-status: + +#------------------------------------------------------------------- +# Resume the workflow by approving or rejecting the workflow request +#------------------------------------------------------------------- + post: + x-scope: apim:api_workflow + 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/workflows/update-workflow-status?workflowReferenceId=56e3a170-a7a7-45f8-b051-7e43a58a67e1\"" + x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/workflows/update-workflow-status?workflowReferenceId=56e3a170-a7a7-45f8-b051-7e43a58a67e1\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"status\" : \"APPROVED\",\n \"attributes\" : {\n \"apiCurrentState\": \"Created\",\n \"apiLCAction\": \"Publish\",\n \"apiName\":\"APIname\",\n \"apiVersion\" : \"1.0.0\",\n \"apiProvider\" : \"admin\",\n \"invoker\": \"admin\"\n }\n}" + x-wso2-response: "HTTP/1.1 200 OK" + summary: Update workflow status description: | - This operation can be used to add a GraphQL Schema definition to an existing GraphQL API. + This operation can be used to approve or reject a workflow task. 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 + - $ref: '#/parameters/workflowReferenceId-Q' + - in: body + name: body + description: | + Workflow event that need to be updated + required: true + schema: + $ref: '#/definitions/Workflow' + tags: + - Workflows (Individual) responses: 200: description: | OK. - Successful response with updated schema definition + Workflow request information is returned. + schema: + $ref: '#/definitions/Workflow' 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: {} + type: string 400: - $ref: '#/components/responses/BadRequest' - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -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" - ] - } + Bad Request. + Invalid request or validation error. + schema: + $ref: '#/definitions/Error' 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. - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/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: - $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/documents"' - operationId: getAPIDocuments - - post: - 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: '#/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. - 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: | - 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: - $ref: '#/components/responses/BadRequest' - 415: - $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 - - /apis/{apiId}/documents/{documentId}: - get: - 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: '#/components/parameters/apiId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Document 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/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: - $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/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5"' - operationId: getAPIDocumentByDocumentId - - put: - 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: '#/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 - 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 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: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $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: - 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: '#/components/parameters/apiId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - Resource successfully deleted. - content: {} - 404: - $ref: '#/components/responses/NotFound' - 412: - $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 - - /apis/{apiId}/documents/{documentId}/content: - get: - tags: - - API Documents - 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/v2/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: '#/components/parameters/apiId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - File or inline content 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/octet-stream: - schema: - 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. - 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: - $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/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5/content"' - operationId: getAPIDocumentContentByDocumentId - - post: - tags: - - API Documents - 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: '#/components/parameters/apiId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - properties: - file: - type: string - description: Document to upload - format: binary - inlineContent: - type: string - description: Inline content of the document - responses: - 200: - description: | - OK. - Document updated - 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 updated content of the 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: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - - apim:document_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=@sample.pdf "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5/content"' - operationId: addAPIDocumentContent - - /apis/{apiId}/documents/validate: - post: - tags: - - API Documents - summary: Check Whether a Document with the Provided Name Exist - description: | - This operation can be used to verify the document name exists or not. - operationId: validateDocument - parameters: - - $ref: '#/components/parameters/apiId' - - name: name - in: query - description: | - The name of the document which needs to be checked for the existance. - required: true - schema: - type: string - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - Successful response if the document name exists. - 400: - $ref: '#/components/responses/BadRequest' - 404: - description: | - Not Found. - The specified resource does not exist. - 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" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/validate?name=CalculatorDoc"' - x-examples: - $ref: docs/examples/apis/apis_id_document_validate.yaml - - /apis/{apiId}/mediation-policies: - get: - tags: - - API Mediation Policies - summary: | - Get All Mediation Policies of an API - description: | - This operation provides you a list of available mediation policies of an API. - operationId: getAllAPIMediationPolicies - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - name: query - in: query - description: -Not supported yet- - schema: - type: string - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - List of qualifying APIs 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 - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/MediationList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - - apim:mediation_policy_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/mediation-policies"' - x-examples: - $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_get.yaml - - post: - tags: - - API Mediation Policies - summary: Add an API Specific Mediation Policy - description: | - This operation can be used to add an API specifc mediation policy. - operationId: addAPIMediationPolicy - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - required: - - type - properties: - mediationPolicyFile: - type: string - description: Mediation Policy to upload - format: binary - inlineContent: - type: string - description: Inline content of the Mediation Policy - type: - type: string - description: Type of the mediation sequence - required: true - responses: - 201: - description: | - OK. - mediation policy uploaded - 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 uploaded mediation policy 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/Mediation' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - - apim:mediation_policy_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: multipart/form-data" -F mediationPolicyFile=@TokenExchange.xml - -F type=in "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/mediation-policies"' - x-examples: - $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_post.yaml - - /apis/{apiId}/mediation-policies/{mediationPolicyId}: - get: - tags: - - API Mediation Policy - summary: Get an API Specific Mediation Policy - description: | - This operation can be used to retrieve a particular API specific mediation policy. - operationId: getAPIMediationPolicyByPolicyId - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/mediationPolicyId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Mediation policy 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/Mediation' - 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 - - apim:mediation_policy_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/mediation-policies/f56eb8b4-128c-45aa-ad35-9c87a546261a"' - x-examples: - $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_id_get.yaml - - delete: - tags: - - API Mediation Policy - 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. - operationId: deleteAPIMediationPolicyByPolicyId - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/mediationPolicyId' - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - Resource successfully deleted. - content: {} - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - - apim:mediation_policy_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/mediation-policies/f56eb8b4-128c-45aa-ad35-9c87a546261a"' - x-examples: - $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_id_delete.yaml - - /apis/{apiId}/mediation-policies/{mediationPolicyId}/content: - get: - tags: - - API Mediation Policy - summary: Download an API Specific Mediation Policy - description: | - This operation can be used to download a particular API specific mediation policy. - operationId: getAPIMediationPolicyContentByPolicyId - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/mediationPolicyId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Mediation policy 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: {} - 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_view - - apim:mediation_policy_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/mediation-policies/f56eb8b4-128c-45aa-ad35-9c87a546261a/content"' - x-examples: - $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_id_content_get.yaml - - put: - tags: - - API Mediation Policy - summary: Update an API Specific Mediation Policy - description: | - This operation can be used to update an existing mediation policy of an API. - operationId: updateAPIMediationPolicyContentByPolicyId - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/mediationPolicyId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - required: - - type - properties: - file: - type: string - description: Mediation Policy to upload - format: binary - inlineContent: - type: string - description: Inline content of the Mediation Policy - type: - type: string - description: Type of the mediation sequence(in/out/fault) - 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/Mediation' - 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 - - apim:mediation_policy_manage - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=@TokenExchange.xml -F type=@type.txt "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/mediation-policies/f56eb8b4-128c-45aa-ad35-9c87a546261a/content"' - x-examples: - $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_id_content_put.yaml - - /apis/{apiId}/wsdl-info: - get: - tags: - - APIs - summary: Get WSDL Meta Information - description: | - This operation can be used to retrieve the WSDL meta information of an API. It states whether the API is a SOAP - API. If the API is a SOAP API, it states whether it has a single WSDL or a WSDL archive. - operationId: getWSDLInfoOfAPI - parameters: - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - Requested WSDL meta information of the API is returned - content: - application/json: - schema: - $ref: '#/components/schemas/WSDLInfo' - 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/96077508-fd01-4fae-bc64-5de0e2baf43c/wsdl-info"' - x-examples: - $ref: docs/examples/apis/wsdl/apiId_wsdl_info_get.yaml - - /apis/{apiId}/wsdl: - get: - tags: - - APIs - summary: Get WSDL definition - description: | - This operation can be used to retrieve the WSDL definition of an API. It can be either a single WSDL file or a WSDL archive. - - The type of the WSDL of the API is indicated at the "wsdlInfo" element of the API payload definition. - operationId: getWSDLOfAPI - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Requested WSDL document 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: {} - 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/96077508-fd01-4fae-bc64-5de0e2baf43c/wsdl"' - x-examples: - $ref: docs/examples/apis/wsdl/apiId_wsdl_get.yaml - - put: - tags: - - APIs - summary: Update WSDL Definition - description: | - This operation can be used to update the WSDL definition of an existing API. WSDL to be updated can be passed as either "url" or "file". - Only one of "url" or "file" can be used at the same time. "file" can be specified as a single WSDL file or as a zip file which has a WSDL - and its dependencies (eg: XSDs) - operationId: updateWSDLOfAPI - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - properties: - file: - type: string - description: WSDL file or archive to upload - format: binary - url: - type: string - description: WSDL Definition url - responses: - 200: - description: | - OK. - Successful response with updated WSDL 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: {} - 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 file=@api.wsdl "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/wsdl"' - x-examples: - $ref: docs/examples/apis/wsdl/apiId_wsdl_put.yaml - - /apis/{apiId}/graphql-policies/complexity: - get: - tags: - - GraphQL Policies - summary: Get the Complexity Related Details of an API - description: | - This operation can be used to retrieve complexity related details belonging to an API by providing the API id. - parameters: - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - Requested complexity details returned. - headers: - Content-Type: - description: | - The content of the body. - schema: - type: string - default: application/json - content: - application/json: - schema: - $ref: '#/components/schemas/GraphQLQueryComplexityInfo' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - - 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/graphql-policies/complexity"' - operationId: getGraphQLPolicyComplexityOfAPI - - - put: - tags: - - GraphQL Policies - summary: Update Complexity Related Details of an API - description: | - This operation can be used to update complexity details belonging to an API by providing the id of the API. - parameters: - - $ref: '#/components/parameters/apiId' - requestBody: - description: Role-depth mapping that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/GraphQLQueryComplexityInfo' - responses: - 200: - description: | - Created. - Complexity details created successfully. - content: {} - 404: - $ref: '#/components/responses/NotFound' - 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/96077508-fd01-4fae-bc64-5de0e2baf43c/graphql-policies/complexity"' - operationId: updateGraphQLPolicyComplexityOfAPI - - /apis/{apiId}/graphql-policies/complexity/types: - get: - tags: - - GraphQL Policies - summary: Retrieve Types and Fields of a GraphQL Schema - description: | - This operation can be used to retrieve all types and fields of the GraphQL Schema by providing the API id. - parameters: - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - Types and fields returned successfully. - headers: - Content-Type: - description: | - The content of the body. - schema: - type: string - default: application/json - content: - application/json: - schema: - $ref: '#/components/schemas/GraphQLSchemaTypeList' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - - 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/graphql-policies/complexity/types"' - operationId: getGraphQLPolicyComplexityTypesOfAPI - - /apis/{apiId}/resource-paths: - get: - tags: - - APIs - summary: Get Resource Paths of an API - description: | - This operation can be used to retrieve resource paths defined for a specific api. - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - ResourcePaths 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/ResourcePathList' - 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/96077508-fd01-4fae-bc64-5de0e2baf43c/resource-paths"' - operationId: getAPIResourcePaths - - /apis/{apiId}/auditapi: - get: - tags: - - API Audit - summary: Retrieve the Security Audit Report of the Audit API - description: | - Retrieve the Security Audit Report of the Audit API - parameters: - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - The Security Audit Report has been returned. - headers: - Content-Type: - description: | - The content of the body. - schema: - type: string - default: application/json - content: - application/json: - schema: - $ref: '#/components/schemas/AuditReport' - 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/96077508-fd01-4fae-bc64-5de0e2baf43c/auditapi"' - x-examples: - $ref: "docs/examples/apis/apis_id_auditapi_get.yaml" - operationId: getAuditReportOfAPI - - /apis/{apiId}/external-stores: - get: - tags: - - External Stores - summary: Get the List of External Stores to which an API is Published - description: | - This operation can be used to retrieve a list of external stores which an API is published to by providing the id of the API. - operationId: getAllPublishedExternalStoresByAPI - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - External Store list 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 - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/APIExternalStoreList' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - 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/external-stores"' - x-examples: - $ref: docs/examples/external-stores/external_stores.yaml#/getPublishedExternalStoresByAPI - - /apis/{apiId}/publish-to-external-stores: - post: - tags: - - External Stores - summary: Publish an API to External Stores - description: | - This operation can be used to publish an API to a list of external stores. - operationId: publishAPIToExternalStores - parameters: - - $ref: '#/components/parameters/apiId' - - name: externalStoreIds - in: query - description: External Store Ids of stores which the API needs to be published - or updated. - required: true - schema: - type: string - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - API was successfully published to all the selected external stores. - headers: - ETag: - description: | - Entity Tag of the blocked subscription. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the subscription has been blocked. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/APIExternalStoreList' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - 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/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/publish-to-external-stores?externalStoreId=Store123#"' - x-examples: - $ref: docs/examples/external-stores/external_stores.yaml#/publishToExternalStore - - /apis/export: - get: - tags: - - Import Export - summary: Export an API - description: | - This operation can be used to export the details of a particular API as a zip file. - parameters: - - name: apiId - in: query - description: UUID of the API - schema: - type: string - - name: name - in: query - description: | - API Name - schema: - type: string - - name: version - in: query - description: | - Version of the API - schema: - type: string - - name: revisionNumber - in: query - description: | - Revision number of the API artifact - schema: - type: string - - name: providerName - in: query - description: | - Provider name of the API - schema: - type: string - - name: format - in: query - description: | - Format of output documents. Can be YAML or JSON. - schema: - type: string - enum: - - JSON - - YAML - - name: preserveStatus - in: query - description: | - Preserve API Status on export - schema: - type: boolean - - name: latestRevision - in: query - description: | - Export the latest revision of the API - schema: - type: boolean - default: false - responses: - 200: - description: | - OK. - Export Successful. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/zip: - schema: - type: string - format: binary - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_publish - - apim:api_create - - 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/export?apiId=96077508-fd01-4fae-bc64-5de0e2baf43c&name=PizzaShackAPI&version=1.0&provider=admin&format=YAML" - > exportAPI.zip' - operationId: exportAPI - - /apis/import: - post: - tags: - - Import Export - summary: Import an API - description: | - This operation can be used to import an API. - parameters: - - name: preserveProvider - in: query - description: | - Preserve Original Provider of the API. This is the user choice to keep or replace the API provider - required: false - schema: - type: boolean - - name: rotateRevision - in: query - description: | - Once the revision max limit reached, undeploy and delete the earliest revision and create a new revision - required: false - schema: - type: boolean - - name: overwrite - in: query - description: | - Whether to update the API or not. This is used when updating already existing APIs - required: false - schema: - type: boolean - requestBody: - content: - multipart/form-data: - schema: - required: - - file - properties: - file: - type: string - description: Zip archive consisting on exported api configuration - format: binary - responses: - 200: - description: | - Created. - API Imported Successfully. - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 409: - $ref: '#/components/responses/Conflict' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=@admin-PizzaShackAPI-1.0.0.zip "https://127.0.0.1:9443/api/am/publisher/v2/apis/import?preserveProvider=false&overwrite=false"' - operationId: importAPI - - ###################################################### - # The "Subscription Collection" resource APIs - ###################################################### - /subscriptions: - get: - tags: - - Subscriptions - summary: Get all Subscriptions - description: | - This operation can be used to retrieve a list of subscriptions of the user associated with the provided access token. This operation is capable of - - 1. Retrieving all subscriptions for the user's APIs. - `GET https://127.0.0.1:9443/api/am/publisher/v2/subscriptions` - - 2. Retrieving subscriptions for a specific API. - `GET https://127.0.0.1:9443/api/am/publisher/v2/subscriptions?apiId=c43a325c-260b-4302-81cb-768eafaa3aed` - parameters: - - $ref: '#/components/parameters/apiId-Q-Opt' - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/If-None-Match' - - name: query - in: query - description: | - Keywords to filter subscriptions - schema: - type: string - responses: - 200: - description: | - OK. - Subscription list 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 - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriptionList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:subscription_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/subscriptions?apiId=96077508-fd01-4fae-bc64-5de0e2baf43c"' - operationId: getSubscriptions - - ###################################################### - # The Individual Subscription resource APIs - ###################################################### - /subscriptions/{subscriptionId}/usage: - get: - tags: - - API Monetization - summary: Get Details of a Pending Invoice for a Monetized Subscription with Metered Billing. - description: | - This operation can be used to get details of a pending invoice for a monetized subscription with meterd billing. - parameters: - - $ref: '#/components/parameters/subscriptionId' - responses: - 200: - description: | - OK. - Details of a pending invoice 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/APIMonetizationUsage' - 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 Subscription does not exist. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - security: - - OAuth2Security: - - apim:subscription_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/subscriptions/64eca60b-2e55-4c38-8603-e9e6bad7d809/usage"' - operationId: getSubscriptionUsage - - /subscriptions/{subscriptionId}/subscriber-info: - get: - tags: - - Subscriber - summary: Get Details of a Subscriber - description: | - This operation can be used to get details of a user who subscribed to the API. - parameters: - - $ref: '#/components/parameters/subscriptionId' - responses: - 200: - description: | - OK. - Details of the subscriber are returned. - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriberInfo' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:subscription_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/subscriptions/64eca60b-2e55-4c38-8603-e9e6bad7d809/subscriber-info"' - operationId: getSubscriberInfoBySubscriptionId - - /subscriptions/block-subscription: - post: - tags: - - Subscriptions - summary: Block a Subscription - description: | - This operation can be used to block a subscription. Along with the request, `blockState` must be specified as a query parameter. - - 1. `BLOCKED` : Subscription is completely blocked for both Production and Sandbox environments. - 2. `PROD_ONLY_BLOCKED` : Subscription is blocked for Production environment only. - parameters: - - $ref: '#/components/parameters/subscriptionId-Q' - - name: blockState - in: query - description: | - Subscription block state. - required: true - schema: - type: string - enum: - - BLOCKED - - PROD_ONLY_BLOCKED - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - Subscription was blocked successfully. - headers: - ETag: - description: | - Entity Tag of the blocked subscription. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the subscription has been blocked. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:subscription_block - 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/subscriptions/block-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809&blockState=PROD_ONLY_BLOCKED"' - operationId: blockSubscription - - /subscriptions/unblock-subscription: - post: - tags: - - Subscriptions - summary: Unblock a Subscription - description: | - This operation can be used to unblock a subscription specifying the subscription Id. The subscription will be fully unblocked after performing this operation. - parameters: - - $ref: '#/components/parameters/subscriptionId-Q' - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - Subscription was unblocked successfully. - headers: - ETag: - description: | - Entity Tag of the unblocked subscription. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the subscription has been unblocked. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:subscription_block - 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/subscriptions/unblock-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809"' - operationId: unBlockSubscription - - - ###################################################### - # The "Thorttling Tier Collection" resource APIs - ###################################################### - /throttling-policies/{policyLevel}: - get: - tags: - - Throttling Policies - summary: Get All Throttling Policies for the Given Type - description: | - This operation can be used to list the available policies for a given policy level. Tier level should be specified as a path parameter and should be one of `subscription` and `api`. - `subscription` is for Subscription Level policies and `api` is for Resource Level policies - operationId: getAllThrottlingPolicies - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/policyLevel' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - List of policies 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 - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ThrottlingPolicyList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - 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/throttling-policies/api"' - - ###################################################### - # The "Subscription Throttling Based on Quota Type" resource APIs - ###################################################### - /throttling-policies/streaming/subscription: - get: - tags: - - Throttling Policies - summary: Get subscription throttling policies based on quota type - description: | - This operation can be used to list the available subscription policies for a given tenent ID based on the given quota type. - Quota Type should be provide as a query parameters and supported Quota types are "requestCount" ,"bandwidthVolume" and "eventCount" - operationId: getSubscriptionThrottlingPolicies - parameters: - - $ref: '#/components/parameters/tierQuotaType' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - List of subscription policies 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 - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ThrottlingPolicyList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - 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/throttling-policies/subscription?tierQuotaType=RequestCountLimit"' - - ###################################################### - # The "Individual Throttling Tier" resource APIs - ###################################################### - /throttling-policies/{policyLevel}/{policyName}: - get: - tags: - - Throttling Policies - summary: Get Details of a Policy - description: | - This operation can be used to retrieve details of a single policy by specifying the policy level and policy name. - operationId: getThrottlingPolicyByName - parameters: - - $ref: '#/components/parameters/policyName' - - $ref: '#/components/parameters/policyLevel' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Tier 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/ThrottlingPolicy' - 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/throttling-policies/api/Platinum"' - - ###################################################### - # The "Mediation Policy Collection" resource APIs - ###################################################### - /mediation-policies: - get: - tags: - - Global Mediation Policies - summary: | - Get all global level mediation policies - description: | - This operation provides you a list of available all global level mediation policies. - operationId: getAllGlobalMediationPolicies - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - name: query - in: query - description: -Not supported yet- - schema: - type: string - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - List of mediation policies 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 - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/MediationList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - - apim:mediation_policy_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/mediation-policies"' - x-examples: - $ref: docs/examples/mediation-policies/mediation_policies_get.yaml - - ################################################################### - # The "Individual Mediation Policy" resource - ################################################################### - /mediation-policies/{mediationPolicyId}/content: - get: - tags: - - Global Mediation Policy - summary: Download a Global Mediation Policy - description: | - This operation can be used to download a particular global mediation policy. - operationId: getGlobalMediationPolicyContent - parameters: - - $ref: '#/components/parameters/mediationPolicyId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Mediation policy 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: {} - 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_view - - apim:mediation_policy_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/mediation-policies/d48a3412-1b85-49be-99f4-b81a3722ae73/content" - > mediation.xml' - - /apis/{apiId}/client-certificates: - get: - tags: - - Client Certificates - summary: Retrieve/ Search Uploaded Client Certificates - description: | - This operation can be used to retrieve and search the uploaded client certificates. - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - name: alias - in: query - description: Alias for the client certificate - schema: - type: string - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. Successful response with the list of matching certificate information in the body. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ClientCertificates' - 400: - $ref: '#/components/responses/BadRequest' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - - apim:client_certificates_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/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates?alias=wso2carbon"' - operationId: getAPIClientCertificates - - post: - tags: - - Client Certificates - summary: Upload a New Certificate - description: | - This operation can be used to upload a new certificate for an endpoint. - parameters: - - $ref: '#/components/parameters/apiId' - requestBody: - content: - multipart/form-data: - schema: - required: - - alias - - certificate - - tier - properties: - certificate: - type: string - description: The certificate that needs to be uploaded. - format: binary - alias: - maxLength: 30 - minLength: 1 - type: string - description: Alias for the certificate - tier: - type: string - description: api tier to which the certificate should be applied. - required: true - responses: - 200: - description: | - OK. - The Certificate added successfully. - 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/ClientCertMetadata' - 400: - $ref: '#/components/responses/BadRequest' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_create - - apim:client_certificates_add - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: multipart/form-data" -F certificate=@test.crt -F alias=wso2carbon - -F apiId=fea749dd-d548-4a8b-b308-34903b39a34b -F tier=Gold "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates"' - operationId: addAPIClientCertificate - - /apis/{apiId}/client-certificates/{alias}: - get: - tags: - - Client Certificates - summary: Get the Certificate Information - description: | - This operation can be used to get the information about a certificate. - parameters: - - name: alias - in: path - required: true - schema: - type: string - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/CertificateInfo' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - - apim:client_certificates_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/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon"' - operationId: getAPIClientCertificateByAlias - - put: - tags: - - Client Certificates - summary: Update a Certificate - description: | - This operation can be used to update an uploaded certificate. - parameters: - - name: alias - in: path - description: Alias for the certificate - required: true - schema: - maxLength: 30 - minLength: 1 - type: string - - $ref: '#/components/parameters/apiId' - requestBody: - content: - multipart/form-data: - schema: - properties: - certificate: - type: string - description: The certificate that needs to be uploaded. - format: binary - tier: - type: string - description: The tier of the certificate - responses: - 200: - description: | - OK. - The Certificate updated successfully. - 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/ClientCertMetadata' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_create - - apim:client_certificates_update - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: multipart/form-data" -F certificate=@test.crt -F alias=wso2carbon - -F apiId=fea749dd-d548-4a8b-b308-34903b39a34b -F tier=Gold "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon"' - operationId: updateAPIClientCertificateByAlias - - delete: - tags: - - Client Certificates - summary: Delete a Certificate - description: | - This operation can be used to delete an uploaded certificate. - parameters: - - name: alias - in: path - description: | - The alias of the certificate that should be deleted. - required: true - schema: - type: string - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - The Certificate deleted successfully. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_create - - apim:client_certificates_update - 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/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon"' - operationId: deleteAPIClientCertificateByAlias - - /apis/{apiId}/client-certificates/{alias}/content: - get: - tags: - - Client Certificates - summary: Download a Certificate - description: | - This operation can be used to download a certificate which matches the given alias. - parameters: - - $ref: '#/components/parameters/apiId' - - name: alias - in: path - required: true - schema: - type: string - responses: - 200: - description: | - OK. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - - apim:client_certificates_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/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon/content"' - operationId: getAPIClientCertificateContentByAlias - - ###################################################### - # The "Certificate Management" resource APIs - ###################################################### - /endpoint-certificates: - get: - tags: - - Endpoint Certificates - summary: Retrieve/Search Uploaded Certificates - description: | - This operation can be used to retrieve and search the uploaded certificates. - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - name: alias - in: query - description: Alias for the certificate - schema: - maxLength: 30 - type: string - - name: endpoint - in: query - description: Endpoint of which the certificate is uploaded - schema: - type: string - responses: - 200: - description: | - OK. Successful response with the list of matching certificate information in the body. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Certificates' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - - apim:ep_certificates_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/endpoint-certificates?alias=wso2carbon&endpoint=www.abc.com"' - operationId: getEndpointCertificates - - post: - tags: - - Endpoint Certificates - summary: Upload a new Certificate. - description: | - This operation can be used to upload a new certificate for an endpoint. - requestBody: - content: - multipart/form-data: - schema: - required: - - alias - - certificate - - endpoint - properties: - certificate: - type: string - description: The certificate that needs to be uploaded. - format: binary - alias: - maxLength: 30 - minLength: 1 - type: string - description: Alias for the certificate - endpoint: - type: string - description: Endpoint to which the certificate should be applied. - required: true - responses: - 200: - description: | - OK. - The Certificate added successfully. - 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/CertMetadata' - 400: - $ref: '#/components/responses/BadRequest' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_create - - apim:ep_certificates_add - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: multipart/form-data" -F certificate=@test.crt -F alias=alias - -F "endpoint=endpoint=https://www.abc.com" "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/endpoint-certificates"' - operationId: addEndpointCertificate - - /endpoint-certificates/{alias}: - get: - tags: - - Endpoint Certificates - summary: Get the Certificate Information - description: | - This operation can be used to get the information about a certificate. - parameters: - - name: alias - in: path - required: true - schema: - type: string - responses: - 200: - description: | - OK. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/CertificateInfo' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - - apim:ep_certificates_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/endpoint-certificates/wso2carbon"' - operationId: getEndpointCertificateByAlias - - put: - tags: - - Endpoint Certificates - summary: Update a certificate. - description: | - This operation can be used to update an uploaded certificate. - parameters: - - name: alias - in: path - description: Alias for the certificate - required: true - schema: - maxLength: 30 - minLength: 1 - type: string - requestBody: - content: - multipart/form-data: - schema: - required: - - certificate - properties: - certificate: - type: string - description: The certificate that needs to be uploaded. - format: binary - required: true - responses: - 200: - description: | - OK. - The Certificate updated successfully. - 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/CertMetadata' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_create - - apim:ep_certificates_update - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: multipart/form-data" -F certificate=@test.crt "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/endpoint-certificates/wso2carbon"' - operationId: updateEndpointCertificateByAlias - - delete: - tags: - - Endpoint Certificates - summary: Delete a certificate. - description: | - This operation can be used to delete an uploaded certificate. - parameters: - - name: alias - in: path - description: | - The alias of the certificate that should be deleted. - required: true - schema: - type: string - responses: - 200: - description: | - OK. - The Certificate deleted successfully. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_create - - apim:ep_certificates_update - 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/endpoint-certificates/wso2carbon"' - operationId: deleteEndpointCertificateByAlias - - /endpoint-certificates/{alias}/content: - get: - tags: - - Endpoint Certificates - summary: Download a Certificate - description: | - This operation can be used to download a certificate which matches the given alias. - parameters: - - name: alias - in: path - required: true - schema: - type: string - responses: - 200: - description: | - OK. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - - apim:ep_certificates_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/endpoint-certificates/wso2carbon/content"' - operationId: getEndpointCertificateContentByAlias - - ###################################################### - # The "Content Search Results" resource APIs - ###################################################### - /search: - get: - tags: - - Unified Search - summary: | - Retrieve/Search APIs and API Documents by Content - description: | - This operation provides you a list of available APIs and API Documents qualifying the given keyword match. - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - name: query - in: query - description: | - **Search**. - - You can search by proving a keyword. - schema: - type: string - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - List of qualifying APIs and API documents 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 - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/SearchResultList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - - apim:api_import_export - - 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/search?query=pizza"' - x-examples: - $ref: docs/examples/apis/search_get.yaml - operationId: search - - ###################################################### - # The "API Product Collection" resource APIs - ###################################################### - /api-products: - get: - tags: - - API Products - summary: | - Retrieve/Search API Products - description: | - This operation provides you a list of available API Products qualifying under a given search condition. - - Each retrieved API Product is represented with a minimal amount of attributes. If you want to get complete details of an API Product, you need to use **Get details of an API Product** operation. - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - name: query - in: query - schema: - type: string - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - List of qualifying API Products 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 - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/APIProductList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - 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/api-products?query=PizzaAPIProduct"' - operationId: getAllAPIProducts - - post: - tags: - - API Products - summary: Create a New API Product - description: | - This operation can be used to create a new API Product specifying the details of the API Product in the payload. - requestBody: - description: API object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/APIProduct' - 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 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/APIProduct' - 400: - $ref: '#/components/responses/BadRequest' - 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://127.0.0.1:9443/api/am/publisher/v2/api-products"' - operationId: createAPIProduct - - ################################################################ - # The "Individual API Product" resource APIs - ################################################################ - /api-products/{apiProductId}: - get: - tags: - - API Products - summary: Get Details of an API Product - description: | - Using this operation, you can retrieve complete details of a single API Product. You need to provide the Id of the API to retrive it. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Requested API Product 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/APIProduct' - 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_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/api-products/5bca47e1-8233-46a5-9295-525dca337f33"' - operationId: getAPIProduct - - put: - tags: - - API Products - summary: Update an API Product - description: | - This operation can be used to update an existing API product. - But the properties `name`, `provider` and `version` cannot be changed. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/If-Match' - requestBody: - description: API object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/APIProduct' - required: true - responses: - 200: - description: | - OK. - Successful response with updated API product 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/APIProduct' - 400: - $ref: '#/components/responses/BadRequest' - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - 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://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33"' - operationId: updateAPIProduct - - - delete: - tags: - - API Products - summary: Delete an API Product - description: | - This operation can be used to delete an existing API Product proving the Id of the API Product. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - Resource successfully deleted. - content: {} - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_publish - - apim:api_product_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/api-products/5bca47e1-8233-46a5-9295-525dca337f33"' - operationId: deleteAPIProduct - - /api-products/{apiProductId}/thumbnail: - get: - tags: - - API Products - summary: Get Thumbnail Image - description: | - This operation can be used to download a thumbnail image of an API product. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Thumbnail image 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: {} - 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_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/api-products/5bca47e1-8233-46a5-9295-525dca337f33/thumbnail" - > image.jpeg' - operationId: getAPIProductThumbnail - - put: - tags: - - API Products - summary: Upload a Thumbnail Image - description: | - This operation can be used to upload a thumbnail image of an API Product. The thumbnail to be uploaded should be given as a form data parameter `file`. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $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 - 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 uploaded thumbnail image of the API Product. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/FileInfo' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - 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: multipart/form-data" -F file=@image.jpeg "https://127.0.0.1:9443/api/am/publisher/v2/api-products/d48a3412-1b85-49be-99f4-b81a3722ae73/thumbnail"' - operationId: updateAPIProductThumbnail - - /api-products/{apiProductId}/swagger: - get: - tags: - - API Products - summary: Get Swagger Definition - description: | - This operation can be used to retrieve the swagger definition of an API. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Requested swagger document 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: {} - 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_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/api-products/5bca47e1-8233-46a5-9295-525dca337f33/swagger"' - operationId: getAPIProductSwagger - - /api-products/{apiProductId}/is-outdated: - get: - tags: - - API Products - summary: Check Whether API Product is Outdated - description: | - This operation can be used to retrieve the status indicating if an API Product is outdated due to updating of dependent APIs (This resource is not supported at the moment) - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Requested swagger document 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/APIProductOutdatedStatus' - 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_publish - operationId: getIsAPIProductOutdated - - /api-products/{apiProductId}/documents: - get: - tags: - - API Product Documents - summary: Get a List of Documents of an API Product - description: | - This operation can be used to retrive a list of documents belonging to an API Product by providing the id of the API Product. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Document list 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 - 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: - $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/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents"' - operationId: getAPIProductDocuments - - post: - tags: - - API Product Documents - summary: Add a New Document to an API Product - description: | - This operation can be used to add a new documentation to an API Product. This operation only adds the metadata of a document. To add the actual content we need to use **Upload the content of an API Product document ** API once we obtain a document Id by this operation. - parameters: - - $ref: '#/components/parameters/apiProductId' - 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. - 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: | - 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: - $ref: '#/components/responses/BadRequest' - 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://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents"' - operationId: addAPIProductDocument - - /api-products/{apiProductId}/documents/{documentId}: - get: - tags: - - API Product Documents - summary: Get a Document of an API Product - description: | - This operation can be used to retrieve a particular document's metadata associated with an API. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Document 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/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: - $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/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents/83312daf-0d8a-427b-8f72-12755b7901d3"' - operationId: getAPIProductDocument - - put: - tags: - - API Product Documents - summary: Update a Document of an API Product - description: | - This operation can be used to update metadata of an API's document. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $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 - 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 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: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - 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://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents/83312daf-0d8a-427b-8f72-12755b7901d3"' - operationId: updateAPIProductDocument - - delete: - tags: - - API Product Documents - summary: Delete a Document of an API Product - description: | - This operation can be used to delete a document associated with an API Product. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - Resource successfully deleted. - 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/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents/83312daf-0d8a-427b-8f72-12755b7901d3"' - operationId: deleteAPIProductDocument - - /api-products/{apiProductId}/documents/{documentId}/content: - get: - tags: - - API Product Documents - summary: Get the Content of an API Product 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/v2/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: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - File or inline content 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: {} - 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. - 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: - $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/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents/83312daf-0d8a-427b-8f72-12755b7901d3/content"' - operationId: getAPIProductDocumentContent - - post: - tags: - - API Product Documents - summary: Upload the Content of an API Product Document - description: | - Thid operation can be used to upload a file or add inline content to an API Product 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: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - properties: - file: - type: string - description: Document to upload - format: binary - inlineContent: - type: string - description: Inline content of the document - responses: - 200: - description: | - OK. - Document updated - 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 updated content of the 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: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - 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: multipart/form-data" -F file=@sample.pdf "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents/83312daf-0d8a-427b-8f72-12755b7901d3/content"' - operationId: addAPIProductDocumentContent - - ###################################################### - # The "API Product Revisions" resource API - ###################################################### - /api-products/{apiProductId}/revisions: - - #-------------------------------------------- - # List available revisions of an API Product - #-------------------------------------------- - get: - tags: - - API Product Revisions - summary: List available revisions of an API Product - description: | - List available revisions of an API Product - operationId: getAPIProductRevisions - parameters: - - $ref: '#/components/parameters/apiProductId' - - name: query - in: query - schema: - type: string - responses: - 200: - description: | - OK. - List of API Product revisions are returned. - content: - application/json: - schema: - $ref: '#/components/schemas/APIRevisionList' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - - 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/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions?query=deployed:true"' - - #-------------------------------------------- - # Create a new API Product revision - #-------------------------------------------- - post: - tags: - - API Product Revisions - summary: Create a new API Product revision - description: | - Create a new API Product revision - operationId: createAPIProductRevision - parameters: - - $ref: '#/components/parameters/apiProductId' - requestBody: - description: API Product 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 - 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/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions"' - - ###################################################### - # The "API Revisions" individual resource API Product - ###################################################### - /api-products/{apiProductId}/revisions/{revisionId}: - - #-------------------------------------------- - # Get a revision - #-------------------------------------------- - get: - tags: - - API Product Revisions - summary: Retrieve a revision of an API Product - description: | - Retrieve a revision of an API Product - operationId: getAPIProductRevision - parameters: - - $ref: '#/components/parameters/apiProductId' - - $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/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' - - #-------------------------------------------- - # Delete a revision - #-------------------------------------------- - delete: - tags: - - API Product Revisions - summary: Delete a revision of an API Product - description: | - Delete a revision of an API Product - operationId: deleteAPIProductRevision - parameters: - - $ref: '#/components/parameters/apiProductId' - - $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 - 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/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' - - /api-products/{apiProductId}/deploy-revision: - - #-------------------------------------------- - # List available deployed revision deployment details of an API Product - #-------------------------------------------- - get: - tags: - - API Product Revisions - summary: List available deployed revision deployment details of an API Product - description: | - List available deployed revision deployment details of an API Product - operationId: getAPIProductRevisionDeployments - parameters: - - $ref: '#/components/parameters/apiProductId' - 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/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision"' - - #-------------------------------------------- - # Deploy a revision - #-------------------------------------------- - post: - tags: - - API Product Revisions - summary: Deploy a revision - description: | - Deploy a revision - operationId: deployAPIProductRevision - parameters: - - $ref: '#/components/parameters/apiProductId' - - $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/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' - - /api-products/{apiProductId}/undeploy-revision: - #-------------------------------------------- - # Un-Deploy a revision from deployed gateway - #-------------------------------------------- - post: - tags: - - API Product Revisions - summary: Un-Deploy a revision - description: | - Un-Deploy a revision - operationId: undeployAPIProductRevision - parameters: - - $ref: '#/components/parameters/apiProductId' - - $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_product_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/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/undeploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' - - /api-products/{apiProductId}/restore-revision: - - #-------------------------------------------------------- - # Restore a revision to the working copy of the API Product - #-------------------------------------------------------- - post: - tags: - - API Product Revisions - summary: Restore a revision - description: | - Restore a revision to the working copy of the API Product - operationId: restoreAPIProductRevision - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/revisionId-Q' - responses: - 201: - description: | - Restored. - Successful response with the newly restored API Product object as the entity in the body. - content: - application/json: - schema: - $ref: '#/components/schemas/APIProduct' - 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/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/restore-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' - - /api-products/export: - get: - tags: - - Import Export - summary: Export an API Product - description: | - This operation can be used to export the details of a particular API Product as a zip file. - parameters: - - name: name - in: query - description: | - API Product Name - schema: - type: string - - name: version - in: query - description: | - Version of the API Product - schema: - type: string - - name: providerName - in: query - description: | - Provider name of the API Product - schema: - type: string - - name: revisionNumber - in: query - description: | - Revision number of the API Product - schema: - type: string - - name: format - in: query - description: | - Format of output documents. Can be YAML or JSON. - schema: - type: string - enum: - - JSON - - YAML - - name: preserveStatus - in: query - description: | - Preserve API Product Status on export - schema: - type: boolean - - name: latestRevision - in: query - description: | - Export the latest revision of the API Product - schema: - type: boolean - default: false - responses: - 200: - description: | - OK. - Export Successful. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/zip: - schema: - type: string - format: binary - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - 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/api-products/export?name=LeasingAPIProduct&version=1.0.0&revisionNumber=2&provider=admin&format=YAML" - > exportAPIProduct.zip' - operationId: exportAPIProduct - - /api-products/import: - post: - tags: - - Import Export - summary: Import an API Product - description: | - This operation can be used to import an API Product. - parameters: - - name: preserveProvider - in: query - description: | - Preserve Original Provider of the API Product. This is the user choice to keep or replace the API Product provider - required: false - schema: - type: boolean - - name: rotateRevision - in: query - description: | - Once the revision max limit reached, undeploy and delete the earliest revision and create a new revision - required: false - schema: - type: boolean - - name: importAPIs - in: query - description: | - Whether to import the dependent APIs or not. - schema: - type: boolean - - name: overwriteAPIProduct - in: query - description: | - Whether to update the API Product or not. This is used when updating already existing API Products. - schema: - type: boolean - - name: overwriteAPIs - in: query - description: | - Whether to update the dependent APIs or not. This is used when updating already existing dependent APIs of an API Product. - schema: - type: boolean - requestBody: - content: - multipart/form-data: - schema: - required: - - file - properties: - file: - type: string - description: | - Zip archive consisting on exported API Product configuration - format: binary - responses: - 200: - description: | - Created. - API Product Imported Successfully. - content: {} - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 409: - $ref: '#/components/responses/Conflict' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_product_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=@admin-PizzaShackAPIProduct.zip "https://127.0.0.1:9443/api/am/admin/v2/api-products/importt?preserveProvider=false&overwriteAPIProduct=false&overwriteAPIs=false&importAPIs=false"' - operationId: importAPIProduct - - ###################################################### - # Roles resource APIs - ###################################################### - /roles/{roleId}: - head: - tags: - - Roles - summary: Check Whether Given Role Name already Exist - description: | - Using this operation, user can check a given role name exists or not. - operationId: validateSystemRole - parameters: - - $ref: '#/components/parameters/roleId' - responses: - 200: - description: OK. Requested role name exists. - content: {} - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -I -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/roles/SW50ZXJuYWwvcHVibGlzaGVyCQ"' - - /me/roles/{roleId}: - head: - tags: - - Roles - summary: Validate Whether the Logged-in User has the Given Role - description: | - Using this operation, logged-in user can check whether he has given role. - operationId: validateUserRole - parameters: - - $ref: '#/components/parameters/roleId' - responses: - 200: - description: OK. Requested user has the role. - content: {} - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -I -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/me/roles/SW50ZXJuYWwvcHVibGlzaGVyCQ"' - - ###################################################### - # The "ExternalStore Collection" resource APIs - ###################################################### - /external-stores: - get: - tags: - - External Stores - summary: Retrieve External Stores List to Publish an API - description: | - Retrieve external stores list configured to publish an API - operationId: getAllExternalStores - responses: - 200: - description: | - OK. - External Stores list returned - content: - application/json: - schema: - $ref: '#/components/schemas/ExternalStore' - 500: - $ref: '#/components/responses/InternalServerError' - 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/external-stores"' - - ###################################################### - # The Publisher settings resource APIs - ###################################################### - /settings: - get: - tags: - - Settings - summary: Retreive Publisher Settings - description: | - Retreive publisher settings - responses: - 200: - description: | - OK. - Settings returned - content: - application/json: - schema: - $ref: '#/components/schemas/Settings' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:publisher_settings - 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/settings"' - operationId: getSettings - - ###################################################### - # The tenant resource APIs - ###################################################### - /tenants: - get: - tags: - - Tenants - summary: | - Get Tenants by State - description: | - This operation is to get tenants by state - operationId: getTenantsByState - parameters: - - name: state - in: query - description: | - The state represents the current state of the tenant - - Supported states are [active, inactive] - schema: - type: string - default: active - enum: - - active - - inactive - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - responses: - 200: - description: | - OK. - Tenant names returned. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/TenantList' - 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/tenants?state=active"' - - /tenants/{tenantDomain}: - head: - tags: - - Tenants - summary: Check Whether the Given Tenant already Exists - description: | - Using this operation, user can check whether a given tenant exists or not. - operationId: getTenantExistence - parameters: - - $ref: '#/components/parameters/tenantDomain' - responses: - 200: - description: OK. Requested tenant exists. - content: {} - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -I -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/tenants/wso2.com"' - x-examples: - $ref: docs/examples/tenants/tenants.yaml - - #################################################### - # Publisher Alerts management REST API - #################################################### - /alert-types: - get: - tags: - - Alerts - summary: | - Get the list of API Publisher alert types. - description: | - This operation is used to get the list of supportd alert types for the 'publisher' agent. - operationId: getPublisherAlertTypes - responses: - 200: - description: | - OK. - The list of publisher alert types are returned. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/AlertTypesList' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - 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/alert-types"' - x-examples: - $ref: docs/examples/alerts/alerts.yaml#/get - - /alert-subscriptions: - get: - tags: - - Alert Subscriptions - summary: | - Get the List of API Publisher Alert Types Subscribed by the User - description: | - This operation is used to get the list of subscribed alert types by the user. - operationId: getSubscribedAlertTypes - responses: - 200: - description: | - OK. - The list of subscribed alert types are returned. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/AlertsInfo' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - 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/alert-subscriptions"' - x-examples: - $ref: docs/examples/alerts/alerts_subscriptions.yaml#/get - - put: - tags: - - Alert Subscriptions - summary: | - Subscribe to the Selected Tlert types by the User - description: | - This operation is used to get the list of subscribed alert types by the user. - operationId: subscribeToAlerts - requestBody: - description: The alerts list and the email list to subscribe. - content: - application/json: - schema: - $ref: '#/components/schemas/AlertsInfo' - required: true - responses: - 201: - description: | - OK. - Successful response with the newly subscribed alerts. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/AlertsInfoResponse' - 400: - $ref: '#/components/responses/BadRequest' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_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 @data.json "https://127.0.0.1:9443/api/am/publisher/v2/alert-subscriptions"' - x-examples: - $ref: docs/examples/alerts/alerts_subscriptions.yaml#/put - - delete: - tags: - - Alert Subscriptions - summary: | - Unsubscribe User from All the Alert Types - description: | - This operation is used to unsubscribe the respective user from all the alert types. - operationId: unsubscribeAllAlerts - responses: - 200: - description: | - OK. - The user is unsubscribed from the alerts successfully. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_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/alert-subscriptions"' - x-examples: - $ref: docs/examples/alerts/alerts_subscriptions.yaml#/delete - - /alerts/{alertType}/configurations: - get: - tags: - - Alert Configuration - summary: | - Get All AbnormalRequestsPerMin Alert Configurations - description: | - This operation is used to get all configurations of the AbnormalRequestsPerMin alert type. - operationId: getAllAlertConfigs - parameters: - - $ref: '#/components/parameters/alertType' - responses: - 200: - description: | - OK. - The Developer Portal alert configuration. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/AlertConfigList' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_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/alerts/{alertType}/configurations"' - x-examples: - $ref: docs/examples/alerts/alerts_config.yaml#/get - - /alerts/{alertType}/configurations/{configurationId}: - put: - tags: - - Alert Configuration - summary: | - Add AbnormalRequestsPerMin Alert Configurations. - description: | - This operation is used to add configuration for the AbnormalRequestsPerMin alert type. - operationId: addAlertConfig - parameters: - - $ref: '#/components/parameters/alertType' - - $ref: '#/components/parameters/configurationId' - requestBody: - description: Configuration for AbnormalRequestCount alert type - content: - application/json: - schema: - $ref: '#/components/schemas/AlertConfigInfo' - required: true - responses: - 201: - description: | - Created. - Successful response with newly created object as entity. - Location header contains URL of newly created entity. - headers: - Location: - description: | - The location of the newly created entity. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/AlertConfig' - 400: - $ref: '#/components/responses/BadRequest' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - x-examples: - $ref: docs/examples/alerts/alerts_config.yaml#/put - - delete: - tags: - - Alert Configuration - summary: | - Delete the Selected Configuration from AbnormalRequestsPerMin Alert Type. - description: | - This operation is used to delete configuration from the AbnormalRequestsPerMin alert type. - operationId: deleteAlertConfig - parameters: - - $ref: '#/components/parameters/alertType' - - $ref: '#/components/parameters/configurationId' - responses: - 200: - description: | - OK. - The alert config is deleted successfully. - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - x-examples: - $ref: docs/examples/alerts/alerts_config.yaml#/delete - - ###################################################### - # The "Label Collection" resource API - ###################################################### - /labels: - get: - tags: - - Label Collection - summary: Get all Registered Labels - description: | - Get all registered Labels - responses: - 200: - description: | - OK. - Labels returned - content: - application/json: - schema: - $ref: '#/components/schemas/LabelList' - 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/labels"' - operationId: getLabels - - ###################################################### - # The "API Category Collection" resource API - ###################################################### - /api-categories: - get: - tags: - - API Category (Collection) - summary: Get all API categories - description: | - Get all API categories - responses: - 200: - description: | - OK. - Categories returned - content: - application/json: - schema: - $ref: '#/components/schemas/APICategoryList' - 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/api-categories"' - operationId: getAllAPICategories - - ###################################################### - # The "Scopes" resource APIs - ###################################################### - /scopes: - get: - tags: - - Scopes - summary: Get All Available Shared Scopes - description: | - This operation can be used to get all the available Shared Scopes. - operationId: getSharedScopes - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - responses: - 200: - description: | - OK. - Shared Scope list is returned. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ScopeList' - 500: - $ref: '#/components/responses/InternalServerError' - 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/scopes"' - - post: - tags: - - Scopes - summary: Add a New Shared Scope - description: | - This operation can be used to add a new Shared Scope. - operationId: addSharedScope - requestBody: - description: Scope object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/Scope' - required: true - responses: - 201: - description: | - Created. - Successful response with the newly created Scope object as an entity in the body. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Scope' - 400: - $ref: '#/components/responses/BadRequest' - 415: - $ref: '#/components/responses/UnsupportedMediaType' - security: - - OAuth2Security: - - apim:shared_scope_manage - 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/scopes"' - - /scopes/{scopeId}: - get: - tags: - - Scopes - summary: Get a Shared Scope by Scope Id - description: | - This operation can be used to retrieve details of a Shared Scope by a given scope Id. - operationId: getSharedScope - parameters: - - $ref: '#/components/parameters/scopeId' - responses: - 200: - description: | - OK. - Requested Shared Scope is returned. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Scope' - 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/scopes/01234567-0123-0123-0123-012345678901"' - - put: - tags: - - Scopes - summary: Update a Shared Scope - description: | - This operation can be used to update a Shared Scope by a given scope Id. - operationId: updateSharedScope - parameters: - - $ref: '#/components/parameters/scopeId' - requestBody: - description: Scope object that needs to be updated - content: - application/json: - schema: - $ref: '#/components/schemas/Scope' - required: true - responses: - 200: - description: | - OK. - Successful response with updated Scope object - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Scope' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:shared_scope_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 @data.json "https://127.0.0.1:9443/api/am/publisher/v2/scopes/01234567-0123-0123-0123-012345678901"' - - delete: - tags: - - Scopes - summary: Delete a Shared Scope - description: | - This operation can be used to delete a Shared Scope proving the Id of the scope. - operationId: deleteSharedScope - parameters: - - $ref: '#/components/parameters/scopeId' - responses: - 200: - description: | - OK. - Resource successfully deleted. - content: {} - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:shared_scope_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/scopes/01234567-0123-0123-0123-012345678901"' - - head: - tags: - - Scopes - summary: Check Given Scope Name already Exists - description: | - Using this operation, user can check a given scope name exists or not. - operationId: validateScope - parameters: - - $ref: '#/components/parameters/scopeName' - responses: - 200: - description: OK. Requested scope name exists. - content: {} - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -I -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/scopes/YXBpbTphcGlfdmlldw"' - - /scopes/{scopeId}/usage: - get: - tags: - - Scopes - summary: Get usages of a Shared Scope by Scope Id - description: | - This operation can be used to retrieve usages of a Shared Scope by a given scope Id. - operationId: getSharedScopeUsages - parameters: - - $ref: '#/components/parameters/scopeId' - responses: - 200: - description: | - OK. - Usages of the shared scope is returned. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/SharedScopeUsage' - 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/scopes/01234567-0123-0123-0123-012345678901/usage"' - - ###################################################### - # The "Key Managers Collection" resource API - ###################################################### - /key-managers: - get: - tags: - - Key Managers (Collection) - summary: Get All Key Managers - description: | - Get all Key managers - responses: - 200: - description: | - OK. - Categories returned - content: - application/json: - schema: - $ref: '#/components/schemas/KeyManagerList' - 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/key-managers"' - operationId: getAllKeyManagers - - ###################################################### - # The "Deployments" resource APIs - ###################################################### - /deployments: - get: - tags: - - Deployments - summary: Retrieve Deployment Environments Details - description: | - This operation can be used to retrieve cloud clusters information defines in tenant-conf.json file. - - With that you can deploy an API to selected cloud environments. - operationId: deploymentsGet - responses: - 200: - description: | - OK. Successful response with the list of deployment environments information in the body. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/DeploymentList' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - 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/deployments"' - - /apis/{apiId}/deployments: - get: - tags: - - DeploymentStatus - summary: Retrieve Deployment Status Details - description: | - This operation can be used to retrieve the status of deployments in cloud clusters. - - With that you can get the status of the deployed APIs in cloud environments. - operationId: deploymentsGetStatus - parameters: - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. Successful response with the list of deployment environments information in the body. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/DeploymentStatusList' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - 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/92bc1330-1848-4fe8-b992-c792186c212e/deployments/"' - - /apis/validate-asyncapi: - post: - tags: - - Validation - summary: Validate an AsyncAPI Specification - description: - This operation can be used to validate and AsyncAPI Specification and retrieve a summary. Provide either 'url' - or 'file' to specify the definition. - operationId: validateAsyncAPISpecification - parameters: - - name: returnContent - in: query - description: - Specify whether to return the full content of the AsyncAPI specification 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: AsyncAPI definition url - file: - type: string - description: AsyncAPI 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/AsyncAPISpecificationValidationResponse' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - - /apis/import-asyncapi: - post: - tags: - - APIs - summary: import an AsyncAPI Specification - description: - This operation can be used to create and API from the AsyncAPI Specification. Provide either 'url' or 'file' - to specify the definition. - - Specify additionalProperties with **at least** API's name, version, context and endpointConfig. - operationId: importAsyncAPISpecification - 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 respons resource. Used by caches, or in conditional requests (Will be supported in the 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 - - /apis/{apiId}/asyncapi: - get: - tags: - - APIs - summary: Get AsyncAPI definition - description: | - This operation can be used to retrieve the AsyncAPI definition of an API. - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Requested AsyncAPI definition of the API is returned - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Willl= be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has beed modified the last time. - Used by caches, or in conditional request (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_view - - put: - tags: - - APIs - summary: Update AsyncAPI definition - description: | - This operation can be used to update the AsyncAPI definition of an existing API. AsyncAPI definition to be updated is passed as a form data parameter 'apiDefinition'. - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - properties: - apiDefinition: - type: string - description: AsyncAPI definition of the API - url: - type: string - description: AsyncAPI definition URL of the API - file: - type: string - description: AsyncAPI definition as a file - format: binary - responses: - 200: - description: | - OK. - Successful response with updated AsyncAPI 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 beed modified the last time. - Use =d by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - type: string - example: "" - 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 - -components: - schemas: - Comment: - title: Comment - required: - - content - type: object - properties: - id: - type: string - readOnly: true - example: 943d3002-000c-42d3-a1b9-d6559f8a4d49 - content: - maxLength: 512 - type: string - example: This is a comment - createdTime: - type: string - readOnly: true - example : 2021-02-11-09:57:25 - createdBy: - type: string - readOnly: true - example: admin - updatedTime: - type: string - readOnly: true - example : 2021-02-12-19:57:25 - category: - type: string - default: general - parentCommentId: - type: string - example: 6f38aea2-f41e-4ac9-b3f2-a9493d00ba97 - entryPoint: - type: string - enum: [devPortal, publisher] - commenterInfo: - $ref: '#/components/schemas/CommenterInfo' - replies: - $ref: '#/components/schemas/CommentList' - CommentList: - title: Comments List - type: object - properties: - count: - type: integer - description: | - Number of Comments returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Comment' - pagination: - $ref: '#/components/schemas/Pagination' - CommenterInfo: - type: object - properties: - firstName: - type: string - example: John - lastName: - type: string - example: David - fullName: - type: string - example: John David - APIList: - title: API List - type: object - properties: - count: - type: integer - description: | - Number of APIs returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/APIInfo' - pagination: - $ref: '#/components/schemas/Pagination' - APIListExpanded: - title: API List - type: object - properties: - count: - type: integer - description: | - Number of APIs returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/API' - pagination: - $ref: '#/components/schemas/Pagination' - - APIInfo: - title: API Info object with basic API details. - type: object - properties: - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: CalculatorAPI - description: - type: string - example: A calculator API that supports basic operations - context: - type: string - example: CalculatorAPI - version: - type: string - example: 1.0.0 - provider: - type: string - description: | - If the provider value is not given, the user invoking the API will be used as the provider. - example: admin - type: - type: string - example: HTTP - lifeCycleStatus: - type: string - example: CREATED - workflowStatus: - type: string - example: APPROVED - hasThumbnail: - type: boolean - example: true - securityScheme: - type: array - items: - type: string - - Topic: - title: Topic object - required: - - name - - mode - - description - type: object - properties: - id: - type: string - description: id - readOnly: true - example: 1222344 - name: - maxLength: 50 - minLength: 1 - pattern: '(^[^~!@#;:%^*()+={}|\\<>"'',&$\s+]*$)' - type: string - example: PizzaShackAPI - mode: - maxLength: 32766 - type: string - example: This is a simple API for Pizza Shack online pizza delivery store. - description: - maxLength: 32766 - type: string - example: This is a simple API for Pizza Shack online pizza delivery store. - TopicList: - title: Topic List - type: object - properties: - count: - type: integer - description: | - Number of Topics returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Topic' - pagination: - $ref: '#/components/schemas/Pagination' - API: - title: API object - required: - - context - - name - - version - type: object - properties: - id: - type: string - description: | - UUID of the api registry artifact - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - name: - maxLength: 50 - minLength: 1 - pattern: '(^[^~!@#;:%^*()+={}|\\<>"'',&$\s+]*$)' - type: string - example: PizzaShackAPI - description: - maxLength: 32766 - type: string - example: This is a simple API for Pizza Shack online pizza delivery store. - context: - maxLength: 82 - minLength: 1 - type: string - example: pizza - version: - maxLength: 30 - minLength: 1 - type: string - pattern: '^[^~!@#;:%^*()+={}|\\<>"'',&/$]+$' - example: 1.0.0 - provider: - maxLength: 50 - type: string - description: | - If the provider value is not given user invoking the api will be used as the provider. - example: admin - lifeCycleStatus: - type: string - example: CREATED - x-otherScopes: - - apim:api_publish - wsdlInfo: - $ref: '#/components/schemas/WSDLInfo' - wsdlUrl: - type: string - readOnly: true - example: /apimgt/applicationdata/wsdls/admin--soap1.wsdl - testKey: - type: string - readOnly: true - example: 8swdwj9080edejhj - responseCachingEnabled: - type: boolean - example: true - cacheTimeout: - type: integer - example: 300 - destinationStatsEnabled: - type: string - example: Disabled - hasThumbnail: - type: boolean - example: false - isDefaultVersion: - type: boolean - example: false - isRevision: - type: boolean - example: false - revisionedApiId: - type: string - description: | - UUID of the api registry artifact - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - revisionId: - type: integer - example: 1 - enableSchemaValidation: - type: boolean - example: false - enableStore: - type: boolean - example: true - x-otherScopes: - - apim:api_publish - type: - type: string - description: The api creation type to be used. Accepted values are HTTP, - WS, SOAPTOREST, GRAPHQL, WEBSUB, SSE - example: HTTP - default: HTTP - enum: - - HTTP - - WS - - SOAPTOREST - - SOAP - - GRAPHQL - - WEBSUB - - SSE - transport: - type: array - description: | - Supported transports for the API (http and/or https). - example: - - http - - https - items: - type: string - tags: - type: array - example: - - pizza - - food - items: - type: string - x-otherScopes: - - apim:api_publish - policies: - type: array - example: - - Unlimited - items: - type: string - x-otherScopes: - - apim:api_publish - apiThrottlingPolicy: - type: string - description: The API level throttling policy selected for the particular - API - example: Unlimited - x-otherScopes: - - apim:api_publish - authorizationHeader: - type: string - description: | - Name of the Authorization header used for invoking the API. If it is not set, Authorization header name specified - in tenant or system level will be used. - example: Authorization - securityScheme: - type: array - description: | - Types of API security, the current API secured with. It can be either OAuth2 or mutual SSL or both. If - it is not set OAuth2 will be set as the security for the current API. - example: - - oauth2 - items: - type: string - maxTps: - $ref: '#/components/schemas/APIMaxTps' - visibility: - type: string - description: The visibility level of the API. Accepts one of the following. - PUBLIC, PRIVATE, RESTRICTED. - example: PUBLIC - default: PUBLIC - enum: - - PUBLIC - - PRIVATE - - RESTRICTED - x-otherScopes: - - apim:api_publish - visibleRoles: - type: array - description: The user roles that are able to access the API in Developer Portal - example: [] - items: - type: string - x-otherScopes: - - apim:api_publish - visibleTenants: - type: array - example: [] - items: - type: string - endpointSecurity: - $ref: '#/components/schemas/APIEndpointSecurity' - gatewayEnvironments: - type: array - description: | - List of gateway environments the API is available - example: - - Production and Sandbox - items: - type: string - x-otherScopes: - - apim:api_publish - deploymentEnvironments: - type: array - description: | - List of selected deployment environments and clusters - items: - $ref: '#/components/schemas/DeploymentEnvironments' - x-otherScopes: - - apim:api_publish - labels: - type: array - description: | - Labels of micro-gateway environments attached to the API. - example: [] - items: - type: string - mediationPolicies: - type: array - example: - - name: json_to_xml_in_message - type: in - - name: xml_to_json_out_message - type: out - - name: json_fault - type: fault - items: - $ref: '#/components/schemas/MediationPolicy' - subscriptionAvailability: - type: string - description: The subscription availability. Accepts one of the following. - CURRENT_TENANT, ALL_TENANTS or SPECIFIC_TENANTS. - example: CURRENT_TENANT - default: CURRENT_TENANT - enum: - - CURRENT_TENANT - - ALL_TENANTS - - SPECIFIC_TENANTS - x-otherScopes: - - apim:api_publish - subscriptionAvailableTenants: - type: array - example: [] - items: - type: string - additionalProperties: - type: object - additionalProperties: - type: string - description: Map of custom properties of API - x-otherScopes: - - apim:api_publish - monetization: - $ref: '#/components/schemas/APIMonetizationInfo' - accessControl: - type: string - description: | - Is the API is restricted to certain set of publishers or creators or is it visible to all the - publishers and creators. If the accessControl restriction is none, this API can be modified by all the - publishers and creators, if not it can only be viewable/modifiable by certain set of publishers and creators, - based on the restriction. - default: NONE - enum: - - NONE - - RESTRICTED - accessControlRoles: - type: array - description: The user roles that are able to view/modify as API publisher - or creator. - example: [] - items: - type: string - businessInformation: - $ref: '#/components/schemas/APIBusinessInformation' - x-otherScopes: - - apim:api_publish - corsConfiguration: - $ref: '#/components/schemas/APICorsConfiguration' - websubSubscriptionConfiguration: - $ref: '#/components/schemas/WebsubSubscriptionConfiguration' - workflowStatus: - type: string - example: APPROVED - createdTime: - type: string - lastUpdatedTime: - type: string - x-otherScopes: - - apim:api_publish - endpointConfig: - type: object - properties: {} - description: | - Endpoint configuration of the API. This can be used to provide different types of endpoints including Simple REST Endpoints, Loadbalanced and Failover. - - `Simple REST Endpoint` - { - "endpoint_type": "http", - "sandbox_endpoints": { - "url": "https://localhost:9443/am/sample/pizzashack/v1/api/" - }, - "production_endpoints": { - "url": "https://localhost:9443/am/sample/pizzashack/v1/api/" - } - } - - `Loadbalanced Endpoint` - - { - "endpoint_type": "load_balance", - "algoCombo": "org.apache.synapse.endpoints.algorithms.RoundRobin", - "sessionManagement": "", - "sandbox_endpoints": [ - { - "url": "https://localhost:9443/am/sample/pizzashack/v1/api/1" - }, - { - "endpoint_type": "http", - "template_not_supported": false, - "url": "https://localhost:9443/am/sample/pizzashack/v1/api/2" - } - ], - "production_endpoints": [ - { - "url": "https://localhost:9443/am/sample/pizzashack/v1/api/3" - }, - { - "endpoint_type": "http", - "template_not_supported": false, - "url": "https://localhost:9443/am/sample/pizzashack/v1/api/4" - } - ], - "sessionTimeOut": "", - "algoClassName": "org.apache.synapse.endpoints.algorithms.RoundRobin" - } - - `Failover Endpoint` - - { - "production_failovers":[ - { - "endpoint_type":"http", - "template_not_supported":false, - "url":"https://localhost:9443/am/sample/pizzashack/v1/api/1" - } - ], - "endpoint_type":"failover", - "sandbox_endpoints":{ - "url":"https://localhost:9443/am/sample/pizzashack/v1/api/2" - }, - "production_endpoints":{ - "url":"https://localhost:9443/am/sample/pizzashack/v1/api/3" - }, - "sandbox_failovers":[ - { - "endpoint_type":"http", - "template_not_supported":false, - "url":"https://localhost:9443/am/sample/pizzashack/v1/api/4" - } - ] - } - - `Default Endpoint` - - { - "endpoint_type":"default", - "sandbox_endpoints":{ - "url":"default" - }, - "production_endpoints":{ - "url":"default" - } - } - - `Endpoint from Endpoint Registry` - { - "endpoint_type": "Registry", - "endpoint_id": "{registry-name:entry-name:version}", - } - example: - endpoint_type: http - sandbox_endpoints: - url: https://localhost:9443/am/sample/pizzashack/v1/api/ - production_endpoints: - url: https://localhost:9443/am/sample/pizzashack/v1/api/ - endpointImplementationType: - type: string - example: INLINE - default: ENDPOINT - enum: - - INLINE - - ENDPOINT - scopes: - type: array - items: - $ref: '#/components/schemas/APIScope' - operations: - type: array - example: - - target: /order/{orderId} - verb: POST - authType: Application & Application User - throttlingPolicy: Unlimited - - target: /menu - verb: GET - authType: Application & Application User - throttlingPolicy: Unlimited - items: - $ref: '#/components/schemas/APIOperations' - threatProtectionPolicies: - type: object - properties: - list: - type: array - items: - type: object - properties: - policyId: - type: string - priority: - type: integer - categories: - type: array - description: | - API categories - items: - type: string - example: "" - x-otherScopes: - - apim:api_publish - keyManagers: - type: object - properties: {} - description: | - API Key Managers - readOnly: true - serviceInfo: - type: object - properties: - key: - type: string - example: PetStore-1.0.0 - name: - type: string - example: PetStore - version: - type: string - example: 1.0.0 - outdated: - type: boolean - example: false - x-scopes: - - apim:api_create - - apim:api_import_export - - #----------------------------------------------------- - # The API Revision resource - #----------------------------------------------------- - APIRevision: - title: API Info object with basic API details - properties: - displayName: - type: string - example: REVISION 1 - id: - type: string - example: c26b2b9b-4632-4ca4-b6f3-521c8863990c - description: - type: string - example: removed a post resource - createdTime: - type: string - format: date-time - apiInfo: - $ref: '#/components/schemas/APIRevisionAPIInfo' - deploymentInfo: - type: array - items: - $ref: '#/components/schemas/APIRevisionDeployment' - - #----------------------------------------------------- - # The API Revision - API Info resource - #----------------------------------------------------- - APIRevisionAPIInfo: - title: API Info object with basic Revisioned API details - readOnly: true - properties: - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - - #----------------------------------------------------- - # The API Revision List resource - #----------------------------------------------------- - APIRevisionList: - title: API Revisions List - properties: - count: - type: integer - description: | - Number of API revisions returned - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/APIRevision' - #----------------------------------------------------- - # The API Revision Deployment List resource - #----------------------------------------------------- - APIRevisionDeploymentList: - title: API Revision to Deployment mapped object with basic API deployment details - properties: - list: - type: array - items: - $ref: '#/components/schemas/APIRevisionDeployment' - #----------------------------------------------------- - # The API Revision Deployment resource - #----------------------------------------------------- - APIRevisionDeployment: - title: APIRevisionDeployment Info object with basic API deployment details - properties: - revisionUuid: - type: string - example: c26b2b9b-4632-4ca4-b6f3-521c8863990c - name: - type: string - example: default - vhost: - maxLength: 255 - minLength: 1 - # hostname regex as per RFC 1123 (http://tools.ietf.org/html/rfc1123) and appended * - pattern: '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$' - type: string - example: mg.wso2.com - displayOnDevportal: - type: boolean - example: true - deployedTime: - type: string - format: date-time - - AuditReport: - title: Resource for Audit Report - type: object - properties: - report: - type: string - description: | - The API Security Audit Report - grade: - type: string - description: | - The overall grade of the Security Audit - example: "27.95" - numErrors: - type: integer - description: | - The number of errors in the API Definition - example: 20 - externalApiId: - type: string - description: | - The External API ID - example: fd21f9f7-3674-49cf-8a83-dca401f635de - APIProductList: - title: API Product List - type: object - properties: - count: - type: integer - description: | - Number of API Products returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/APIProductInfo' - pagination: - $ref: '#/components/schemas/Pagination' - APIProductInfo: - title: API Info object with basic API details. - type: object - properties: - id: - type: string - description: | - UUID of the api product - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - description: Name of the API Product - example: PizzaShackAPIProduct - context: - type: string - example: pizzaproduct - description: - type: string - description: A brief description about the API - example: This is a simple API for Pizza Shack online pizza delivery store - provider: - type: string - description: | - If the provider value is not given, the user invoking the API will be used as the provider. - example: admin - hasThumbnail: - type: boolean - example: true - state: - type: string - description: | - State of the API product. Only published api products are visible on the Developer Portal - enum: - - CREATED - - PUBLISHED - securityScheme: - type: array - description: | - Types of API security, the current API secured with. It can be either OAuth2 or mutual SSL or both. If - it is not set OAuth2 will be set as the security for the current API. - example: - - oauth2 - items: - type: string - APIProduct: - title: API Product object - required: - - name - type: object - properties: - id: - type: string - description: | - UUID of the api product - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - name: - maxLength: 50 - minLength: 1 - type: string - description: Name of the API Product - example: PizzaShackAPIProduct - context: - maxLength: 60 - minLength: 1 - type: string - example: pizzaproduct - description: - type: string - description: A brief description about the API - example: This is a simple API for Pizza Shack online pizza delivery store - provider: - maxLength: 50 - type: string - description: | - If the provider value is not given, the user invoking the API will be used as the provider. - example: admin - hasThumbnail: - type: boolean - example: false - state: - type: string - description: | - State of the API product. Only published api products are visible on the Developer Portal - enum: - - CREATED - - PUBLISHED - enableSchemaValidation: - type: boolean - example: false - enableStore: - type: boolean - example: true - testKey: - type: string - readOnly: true - example: 8swdwj9080edejhj - isRevision: - type: boolean - example: false - revisionedApiProductId: - type: string - description: | - UUID of the api product registry artifact - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - revisionId: - type: integer - example: 1 - responseCachingEnabled: - type: boolean - example: true - cacheTimeout: - type: integer - example: 300 - visibility: - type: string - description: The visibility level of the API. Accepts one of the following. - PUBLIC, PRIVATE, RESTRICTED. - example: PUBLIC - default: PUBLIC - enum: - - PUBLIC - - PRIVATE - - RESTRICTED - visibleRoles: - type: array - description: The user roles that are able to access the API - example: [] - items: - type: string - visibleTenants: - type: array - example: [] - items: - type: string - accessControl: - type: string - description: | - Defines whether the API Product is restricted to certain set of publishers or creators or is it visible to all the - publishers and creators. If the accessControl restriction is none, this API Product can be modified by all the - publishers and creators, if not it can only be viewable/modifiable by certain set of publishers and creators, - based on the restriction. - default: NONE - enum: - - NONE - - RESTRICTED - accessControlRoles: - type: array - description: The user roles that are able to view/modify as API Product - publisher or creator. - example: [] - items: - type: string - gatewayEnvironments: - type: array - description: | - List of gateway environments the API Product is available - example: - - Production and Sandbox - items: - type: string - apiType: - type: string - description: The API type to be used. Accepted values are API, APIPRODUCT - example: APIPRODUCT - enum: - - API - - APIPRODUCT - transport: - type: array - description: | - Supported transports for the API (http and/or https). - example: - - http - - https - items: - type: string - tags: - type: array - example: - - pizza - - food - items: - type: string - policies: - type: array - example: - - Unlimited - items: - type: string - apiThrottlingPolicy: - type: string - description: The API level throttling policy selected for the particular - API Product - example: Unlimited - authorizationHeader: - type: string - description: | - Name of the Authorization header used for invoking the API. If it is not set, Authorization header name specified - in tenant or system level will be used. - example: Authorization - securityScheme: - type: array - description: | - Types of API security, the current API secured with. It can be either OAuth2 or mutual SSL or both. If - it is not set OAuth2 will be set as the security for the current API. - example: - - oauth2 - items: - type: string - subscriptionAvailability: - type: string - description: The subscription availability. Accepts one of the following. - CURRENT_TENANT, ALL_TENANTS or SPECIFIC_TENANTS. - example: CURRENT_TENANT - default: ALL_TENANTS - enum: - - CURRENT_TENANT - - ALL_TENANTS - - SPECIFIC_TENANTS - subscriptionAvailableTenants: - type: array - example: [] - items: - type: string - x-otherScopes: - - apim:api_publish - additionalProperties: - type: object - additionalProperties: - type: string - description: Map of custom properties of API - monetization: - $ref: '#/components/schemas/APIMonetizationInfo' - businessInformation: - $ref: '#/components/schemas/APIProductBusinessInformation' - corsConfiguration: - $ref: '#/components/schemas/APICorsConfiguration' - createdTime: - type: string - lastUpdatedTime: - type: string - apis: - type: array - description: | - APIs and resources in the API Product. - example: - - name: PizzaShackAPI - apiId: 01234567-0123-0123-0123-012345678901 - version: "1.0" - operations: - - target: /order/{orderId} - verb: POST - authType: Application & Application User - throttlingPolicy: Unlimited - - target: /menu - verb: GET - authType: Application & Application User - throttlingPolicy: Unlimited - items: - $ref: '#/components/schemas/ProductAPI' - scopes: - type: array - example: [] - items: - $ref: '#/components/schemas/APIScope' - categories: - type: array - description: | - API categories - example: [] - items: - type: string - ProductAPI: - title: ProductAPI - required: - - apiId - type: object - properties: - name: - type: string - example: PizzaShackAPI - apiId: - type: string - example: 01234567-0123-0123-0123-012345678901 - version: - type: string - example: "1.0" - operations: - type: array - items: - $ref: '#/components/schemas/APIOperations' - ResourcePath: - title: ResourcePath - required: - - id - type: object - properties: - id: - type: integer - example: 1 - resourcePath: - type: string - example: /menu - httpVerb: - type: string - example: GET - ResourcePathList: - title: ResourcePath List - type: object - properties: - count: - type: integer - description: | - Number of API Resource Paths returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/ResourcePath' - pagination: - $ref: '#/components/schemas/Pagination' - APIProductOutdatedStatus: - title: APIProduct is outdated status - type: object - properties: - isOutdated: - type: boolean - description: | - Indicates if an API Product is outdated - example: true - APIProductBusinessInformation: - type: object - properties: - businessOwner: - maxLength: 120 - type: string - example: businessowner - businessOwnerEmail: - type: string - example: businessowner@wso2.com - technicalOwner: - maxLength: 120 - type: string - example: technicalowner - technicalOwnerEmail: - type: string - example: technicalowner@wso2.com - Claim: - title: Claim - type: object - properties: - name: - type: string - example: email - URI: - type: string - example: http://wso2.org/claims/emailaddress - value: - type: string - example: admin@wso2.com - SubscriberInfo: - title: SubscriberInfo - type: object - properties: - name: - type: string - example: admin - claims: - type: array - items: - $ref: '#/components/schemas/Claim' - Application: - title: Application - required: - - name - - throttlingTier - type: object - properties: - applicationId: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: CalculatorApp - subscriber: - type: string - example: admin - throttlingTier: - type: string - example: Unlimited - description: - type: string - example: Sample calculator application - groupId: - type: string - example: "" - ApplicationInfo: - title: Application info object with basic application details - type: object - properties: - applicationId: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: CalculatorApp - subscriber: - type: string - example: admin - description: - type: string - example: Sample calculator application - subscriptionCount: - type: integer - DocumentList: - title: Document List - type: object - properties: - count: - type: integer - description: | - Number of Documents returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Document' - pagination: - $ref: '#/components/schemas/Pagination' - Document: - title: Document - required: - - name - - sourceType - - type - - visibility - type: object - properties: - documentId: - type: string - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - name: - maxLength: 60 - minLength: 1 - type: string - example: PizzaShackDoc - type: - type: string - example: HOWTO - enum: - - HOWTO - - SAMPLES - - PUBLIC_FORUM - - SUPPORT_FORUM - - API_MESSAGE_FORMAT - - SWAGGER_DOC - - OTHER - summary: - maxLength: 32766 - minLength: 1 - type: string - example: Summary of PizzaShackAPI Documentation - sourceType: - type: string - example: INLINE - enum: - - INLINE - - MARKDOWN - - URL - - FILE - sourceUrl: - type: string - readOnly: true - example: "" - fileName: - type: string - readOnly: true - example: "" - inlineContent: - type: string - example: This is doc content. This can have many lines. - otherTypeName: - type: string - readOnly: true - example: "" - visibility: - type: string - example: API_LEVEL - enum: - - OWNER_ONLY - - PRIVATE - - API_LEVEL - createdTime: - type: string - readOnly: true - createdBy: - type: string - example: admin - lastUpdatedTime: - type: string - readOnly: true - lastUpdatedBy: - type: string - readOnly: true - example: admin - GraphQLSchema: - title: GraphQL Schema - required: - - name - type: object - properties: - name: - type: string - example: admin--HackerNewsAPI.graphql - schemaDefinition: - type: string - GraphQLQueryComplexityInfo: - title: GraphQL Query Complexity Info - type: object - properties: - list: - type: array - items: - $ref: '#/components/schemas/GraphQLCustomComplexityInfo' - GraphQLCustomComplexityInfo: - title: GraphQL Custom Complexity Info - required: - - complexityValue - - field - - type - type: object - properties: - type: - type: string - description: | - The type found within the schema of the API - example: Country - field: - type: string - description: | - The field which is found under the type within the schema of the API - example: name - complexityValue: - type: integer - description: | - The complexity value allocated for the associated field under the specified type - example: 1 - GraphQLSchemaTypeList: - title: List of types and corresponding fields of the GraphQL Schema - type: object - properties: - typeList: - type: array - items: - $ref: '#/components/schemas/GraphQLSchemaType' - GraphQLSchemaType: - title: Single type and corresponding fields found within the GraphQL Schema - type: object - properties: - type: - type: string - description: | - Type found within the GraphQL Schema - example: Country - fieldList: - type: array - description: | - Array of fields under current type - example: - - code - - name - items: - type: string - MediationList: - title: Mediation List - type: object - properties: - count: - type: integer - description: | - Number of mediation sequences returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/MediationInfo' - pagination: - $ref: '#/components/schemas/Pagination' - MediationInfo: - title: MediationInfo - required: - - id - - name - - type - type: object - properties: - name: - type: string - example: json_fault.xml - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - type: - type: string - example: in - enum: - - in - - out - - fault - Mediation: - title: Mediation - required: - - name - - type - type: object - properties: - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: json_fault.xml - type: - type: string - example: in - enum: - - in - - out - - fault - ThrottlingPolicyList: - title: Throttling policy list - type: object - properties: - count: - type: integer - description: | - Number of Tiers returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/ThrottlingPolicy' - pagination: - $ref: '#/components/schemas/Pagination' - ThrottlingPolicy: - title: Tier - required: - - name - - requestCount - - stopOnQuotaReach - - tierPlan - - unitTime - type: object - properties: - name: - type: string - example: Platinum - description: - type: string - example: Allows 50 request(s) per minute. - policyLevel: - type: string - example: api - enum: - - subscription - - api - displayName: - type: string - example: Platinum - attributes: - type: object - additionalProperties: - type: string - description: | - Custom attributes added to the policy policy - example: {} - requestCount: - type: integer - description: | - Maximum number of requests which can be sent within a provided unit time - format: int64 - example: 50 - dataUnit: - description: | - Unit of data allowed to be transfered. Allowed values are "KB", "MB" and "GB" - type: string - example: KB - unitTime: - type: integer - format: int64 - example: 60000 - timeUnit: - type: string - example: min - rateLimitCount: - type: integer - default: 0 - description: Burst control request count - example: 10 - rateLimitTimeUnit: - type: string - description: Burst control time unit - example: min - quotaPolicyType: - type: string - description: Default quota limit type - enum: - - REQUESTCOUNT - - BANDWIDTHVOLUME - example: REQUESTCOUNT - tierPlan: - type: string - description: | - This attribute declares whether this policy is available under commercial or free - example: FREE - enum: - - FREE - - COMMERCIAL - stopOnQuotaReach: - type: boolean - description: | - By making this attribute to false, you are capabale of sending requests - even if the request count exceeded within a unit time - example: true - monetizationProperties: - type: object - additionalProperties: - type: string - description: Properties of a tier plan which are related to monetization - example: {} - SubscriptionList: - title: Subscription List - type: object - properties: - count: - type: integer - description: | - Number of Subscriptions returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Subscription' - pagination: - $ref: '#/components/schemas/Pagination' - Subscription: - title: Subscription - required: - - applicationInfo - - subscriptionId - - subscriptionStatus - - throttlingPolicy - type: object - properties: - subscriptionId: - type: string - example: 01234567-0123-0123-0123-012345678901 - applicationInfo: - $ref: '#/components/schemas/ApplicationInfo' - throttlingPolicy: - type: string - example: Unlimited - subscriptionStatus: - type: string - example: BLOCKED - enum: - - BLOCKED - - PROD_ONLY_BLOCKED - - UNBLOCKED - - ON_HOLD - - REJECTED - - TIER_UPDATE_PENDING - APIMonetizationUsage: - title: API monetization usage object - type: object - properties: - properties: - type: object - additionalProperties: - type: string - description: Map of custom properties related to monetization usage - APIRevenue: - title: API revenue data object - type: object - properties: - properties: - type: object - additionalProperties: - type: string - description: Map of custom properties related to API revenue - MediationPolicy: - title: Mediation Policy - required: - - name - type: object - properties: - id: - type: string - example: 69ea3fa6-55c6-472e-896d-e449dd34a824 - name: - type: string - example: log_in_message - type: - type: string - example: in - shared: - type: boolean - example: true - Error: - title: Error object returned with 4XX HTTP Status - required: - - code - - message - type: object - properties: - code: - type: integer - format: int64 - message: - type: string - description: Error message. - description: - type: string - description: | - A detail description about the error message. - moreInfo: - type: string - description: | - Preferably an url with more details about the error. - error: - type: array - description: | - If there are more than one error list them out. - For example, list out validation errors by each field. - items: - $ref: '#/components/schemas/ErrorListItem' - ErrorListItem: - title: Description of individual errors that may have occurred during a request. - required: - - code - - message - type: object - properties: - code: - type: string - message: - type: string - description: | - Description about individual errors occurred - description: - type: string - description: | - A detail description about the error message. - Environment: - title: Environment - required: - - endpoints - - name - - serverUrl - - showInApiConsole - - type - type: object - properties: - name: - type: string - example: default - displayName: - type: string - example: Default - type: - type: string - example: hybrid - serverUrl: - type: string - example: https://localhost:9443/services/ - showInApiConsole: - type: boolean - example: true - endpoints: - $ref: '#/components/schemas/EnvironmentEndpoints' - vhosts: - type: array - items: - $ref: '#/components/schemas/VHost' - EnvironmentList: - title: Environment List - type: object - properties: - count: - type: integer - description: | - Number of Environments returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Environment' - EnvironmentEndpoints: - title: Environment Endpoints - type: object - properties: - http: - type: string - description: HTTP environment URL - example: http://localhost:8280 - https: - type: string - description: HTTPS environment URL - example: https://localhost:8243 - ws: - type: string - description: WS environment URL - example: http://localhost:9099 - wss: - type: string - description: WSS environment URL - example: https://localhost:8099 - VHost: - title: Virtual Host - type: object - properties: - host: - type: string - example: mg.wso2.com - httpContext: - type: string - example: pets - httpPort: - type: integer - example: 80 - httpsPort: - type: integer - example: 443 - wsPort: - type: integer - example: 9099 - wssPort: - type: integer - example: 8099 - FileInfo: - title: File Information including meta data - type: object - properties: - relativePath: - type: string - description: relative location of the file (excluding the base context and - host of the Publisher API) - example: apis/01234567-0123-0123-0123-012345678901/thumbnail - mediaType: - type: string - description: media-type of the file - example: image/jpeg - APIMaxTps: - type: object - properties: - production: - type: integer - format: int64 - example: 1000 - sandbox: - type: integer - format: int64 - example: 1000 - APIEndpointSecurity: - type: object - properties: - type: - type: string - description: Accepts one of the following, basic or digest. - example: BASIC - enum: - - BASIC - - DIGEST - username: - type: string - example: admin - password: - type: string - example: password - APIBusinessInformation: - type: object - properties: - businessOwner: - maxLength: 120 - type: string - example: businessowner - businessOwnerEmail: - type: string - example: businessowner@wso2.com - pattern: '^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$' - technicalOwner: - maxLength: 120 - type: string - example: technicalowner - technicalOwnerEmail: - type: string - example: technicalowner@wso2.com - - WebsubSubscriptionConfiguration: - type: object - properties: - secret: - type: string - description: Secret key to be used for subscription - signingAlgorithm: - type: string - description: The algorithm used for signing - signatureHeader: - type: string - description: The header uses to send the signature - - APICorsConfiguration: - type: object - properties: - corsConfigurationEnabled: - type: boolean - default: false - accessControlAllowOrigins: - type: array - items: - type: string - accessControlAllowCredentials: - type: boolean - default: false - accessControlAllowHeaders: - type: array - items: - type: string - accessControlAllowMethods: - type: array - items: - type: string - description: | - CORS configuration for the API - Endpoint: - title: Endpoints - type: object - properties: - id: - type: string - description: | - UUID of the Endpoint entry - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - description: | - name of the Endpoint entry - example: Endpoint 1 - endpointConfig: - type: object - properties: - endpointType: - type: string - example: FAIL_OVER - enum: - - SINGLE - - LOAD_BALANCED - - FAIL_OVER - list: - type: array - items: - $ref: '#/components/schemas/EndpointConfig' - endpointSecurity: - type: object - properties: - enabled: - type: boolean - example: false - type: - type: string - example: basic - username: - type: string - example: basic - password: - type: string - example: basic - maxTps: - type: integer - description: Endpoint max tps - format: int64 - example: 1000 - type: - type: string - example: http - EndpointConfig: - title: Endpoint Configuration - type: object - properties: - url: - type: string - description: | - Service url of the endpoint - example: http://localhost:8280 - timeout: - type: string - description: | - Time out of the endpoint - example: "1000" - attributes: - type: array - items: - type: object - properties: - name: - type: string - example: Suspension time - value: - type: string - example: 2s - EndpointList: - title: Endpoint List - type: object - properties: - count: - type: integer - description: | - Number of Endpoints returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Endpoint' - Scope: - title: Scope - required: - - name - type: object - properties: - id: - type: string - description: | - UUID of the Scope. Valid only for shared scopes. - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - name: - maxLength: 255 - minLength: 1 - type: string - description: | - name of Scope - example: apim:api_view - displayName: - maxLength: 255 - type: string - description: | - display name of Scope - example: api_view - description: - maxLength: 512 - type: string - description: | - description of Scope - example: This Scope can used to view Apis - bindings: - type: array - description: | - role bindings list of the Scope - example: - - admin - - Internal/creator - - Internal/publisher - items: - type: string - usageCount: - type: integer - description: | - usage count of Scope - readOnly: true - example: 3 - SharedScopeUsage: - title: SharedScopeUsage - required: - - id - - name - type: object - properties: - id: - type: string - description: | - UUID of the Scope. Valid only for shared scopes. - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - description: | - name of Scope - example: apim:api_view - usedApiList: - type: array - description: | - API list which have used the shared scope - items: - $ref: '#/components/schemas/SharedScopeUsedAPIInfo' - SharedScopeUsedAPIInfo: - title: API object using shared scope - required: - - context - - name - - version - type: object - properties: - name: - type: string - example: CalculatorAPI - context: - type: string - example: CalculatorAPI - version: - type: string - example: 1.0.0 - provider: - type: string - description: | - If the provider value is not given user invoking the api will be used as the provider. - example: admin - usedResourceList: - type: array - description: | - Resource list which have used the shared scope within this API - items: - $ref: '#/components/schemas/SharedScopeUsedAPIResourceInfo' - SharedScopeUsedAPIResourceInfo: - title: API resource object using shared scope - type: object - properties: - target: - type: string - example: /add - verb: - type: string - example: POST - APIScope: - title: APIScope - required: - - scope - type: object - properties: - scope: - $ref: '#/components/schemas/Scope' - shared: - type: boolean - description: | - States whether scope is shared. This will not be honored when updating/adding scopes to APIs or when - adding/updating Shared Scopes. - example: true - APIOperations: - title: Operation - type: object - properties: - id: - type: string - example: postapiresource - target: - type: string - example: /order/{orderId} - verb: - type: string - example: POST - authType: - type: string - example: Application & Application User - default: Any - throttlingPolicy: - type: string - example: Unlimited - scopes: - type: array - example: [] - items: - type: string - usedProductIds: - type: array - example: [] - items: - type: string - amznResourceName: - type: string - example: "" - amznResourceTimeout: - type: integer - payloadSchema: - type: string - example: "" - uriMapping: - type: string - example: "" - ScopeList: - title: Scope List - type: object - properties: - count: - type: integer - description: | - Number of Scopes returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Scope' - pagination: - $ref: '#/components/schemas/Pagination' - ExternalStore: - title: External Store - type: object - properties: - id: - type: string - description: | - The external store identifier, which is a unique value. - example: Store123# - displayName: - type: string - description: | - The name of the external API Store that is displayed in the Publisher UI. - example: UKStore - type: - type: string - description: | - The type of the Store. This can be a WSO2-specific API Store or an external one. - example: wso2 - endpoint: - type: string - description: | - The endpoint URL of the external store - example: http://localhost:9764/store - APIExternalStore: - title: API External Store - type: object - properties: - id: - type: string - description: | - The external store identifier, which is a unique value. - example: Store123# - lastUpdatedTime: - type: string - description: | - The recent timestamp which a given API is updated in the external store. - example: 2019-09-09T13:57:16.229 - APIExternalStoreList: - title: API External Store List - type: object - properties: - count: - type: integer - description: | - Number of external stores returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/APIExternalStore' - ExternalStoreList: - title: External Store List - type: object - properties: - count: - type: integer - description: | - Number of external stores returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/ExternalStore' - Certificates: - title: Certificates - type: object - properties: - count: - type: integer - example: 1 - certificates: - type: array - items: - $ref: '#/components/schemas/CertMetadata' - pagination: - $ref: '#/components/schemas/Pagination' - description: Representation of a list of certificates - CertMetadata: - title: Certificate - type: object - properties: - alias: - type: string - example: wso2carbon - endpoint: - type: string - example: www.abc.com - description: Representation of the details of a certificate - CertificateInfo: - title: Certificate information - type: object - properties: - status: - type: string - example: Active - validity: - $ref: '#/components/schemas/CertificateValidity' - version: - type: string - example: V3 - subject: - type: string - example: CN=wso2.com, OU=wso2, O=wso2, L=Colombo, ST=Western, C=LK - CertificateValidity: - title: Certificate Valid period - type: object - properties: - from: - type: string - example: 12-12-2017 - to: - type: string - example: 01-01-2019 - ClientCertificates: - title: Client Certificates - type: object - properties: - count: - type: integer - example: 1 - certificates: - type: array - items: - $ref: '#/components/schemas/ClientCertMetadata' - pagination: - $ref: '#/components/schemas/Pagination' - description: Representation of a list of client certificates - ClientCertMetadata: - title: Client certificate meta data - type: object - properties: - alias: - type: string - example: wso2carbon - apiId: - type: string - example: 64eca60b-2e55-4c38-8603-e9e6bad7d809 - tier: - type: string - example: Gold - description: Meta data of certificate - Label: - title: Label - required: - - name - type: object - properties: - name: - type: string - example: marketing_store - description: - type: string - example: Public microgateway for marketing - access_urls: - type: array - example: https://localhost:9095 - items: - type: string - LabelList: - title: Label List - type: object - properties: - count: - type: integer - description: | - Number of Labels returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Label' - pagination: - $ref: '#/components/schemas/Pagination' - LifecycleState: - title: Lifecycle State - type: object - properties: - state: - type: string - example: Created - checkItems: - type: array - items: - type: object - properties: - name: - type: string - example: Deprecate old versions after publishing the API - value: - type: boolean - example: false - requiredStates: - type: array - example: [] - items: - type: string - availableTransitions: - type: array - items: - type: object - properties: - event: - type: string - example: Publish - targetState: - type: string - example: Published - LifecycleHistory: - title: Lifecycle history item list - type: object - properties: - count: - type: integer - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/LifecycleHistoryItem' - LifecycleHistoryItem: - title: Lifecycle history item - type: object - properties: - previousState: - type: string - example: Created - postState: - type: string - example: Published - user: - type: string - example: admin - updatedTime: - type: string - format: dateTime - example: 2019-02-31T23:59:60Z - WorkflowResponse: - title: workflow Response - required: - - workflowStatus - type: object - properties: - workflowStatus: - type: string - description: | - This attribute declares whether this workflow task is approved or rejected. - example: APPROVED - enum: - - CREATED - - APPROVED - - REJECTED - - REGISTERED - jsonPayload: - type: string - description: | - Attributes that returned after the workflow execution - example: null - lifecycleState: - $ref: '#/components/schemas/LifecycleState' - OpenAPIDefinitionValidationResponse: - title: OpenAPI Definition Validation Response - required: - - isValid - type: object - properties: - isValid: - type: boolean - description: | - This attribute declares whether this definition is valid or not. - example: true - content: - type: string - description: | - OpenAPI definition content. - info: - type: object - properties: - name: - type: string - example: PetStore - version: - type: string - example: 1.0.0 - context: - type: string - example: /petstore - description: - type: string - example: A sample API that uses a petstore as an example to demonstrate - swagger-2.0 specification - openAPIVersion: - type: string - example: 3.0.0 - endpoints: - type: array - description: | - contains host/servers specified in the OpenAPI file/URL - items: - type: string - example: https://localhost:9443/am/sample/pizzashack/v1/api/ - description: | - API definition information - errors: - type: array - description: | - If there are more than one error list them out. - For example, list out validation errors by each field. - items: - $ref: '#/components/schemas/ErrorListItem' - WSDLValidationResponse: - title: WSDL Definition Validation Response - required: - - isValid - type: object - properties: - isValid: - type: boolean - description: | - This attribute declares whether this definition is valid or not. - example: true - errors: - type: array - description: | - If there are more than one error list them out. - For example, list out validation errors by each field. - items: - $ref: '#/components/schemas/ErrorListItem' - wsdlInfo: - type: object - properties: - version: - type: string - description: | - WSDL version - example: "1.1" - endpoints: - type: array - description: | - A list of endpoints the service exposes - items: - type: object - properties: - name: - type: string - description: Name of the endpoint - example: StockQuoteSoap - location: - type: string - description: Endpoint URL - example: http://www.webservicex.net/stockquote.asmx - description: Summary of the WSDL including the basic information - GraphQLValidationResponse: - title: GraphQL API definition validation Response - required: - - errorMessage - - isValid - type: object - properties: - isValid: - type: boolean - description: | - This attribute declares whether this definition is valid or not. - example: true - errorMessage: - type: string description: | - This attribute declares the validation error message - graphQLInfo: - type: object - properties: - operations: - type: array - items: - $ref: '#/components/schemas/APIOperations' - graphQLSchema: - $ref: '#/components/schemas/GraphQLSchema' - description: Summary of the GraphQL including the basic information - ApiEndpointValidationResponse: - title: API Endpoint url validation response - required: - - statusCode - - statusMessage - type: object - properties: - statusCode: - type: integer - description: HTTP status code - example: 200 - statusMessage: - type: string - description: string - example: OK - error: - type: string - description: | - If an error occurs, the error message will be set to this property. - If not, this will remain null. - example: null - ThreatProtectionPolicyList: - title: Threat Protection Policy List - type: object - properties: - list: - type: array - items: - $ref: '#/components/schemas/ThreatProtectionPolicy' - ThreatProtectionPolicy: - title: Threat Protection Policy Schema - required: - - name - - policy - - type - type: object - properties: - uuid: - type: string - description: Policy ID - name: - type: string - description: Name of the policy - type: - type: string - description: Type of the policy - policy: - type: string - description: policy as a json string - SearchResultList: - title: Unified Search Result List - type: object - properties: - count: - type: integer - description: | - Number of results returned. - example: 1 - list: - type: array - items: - type: object - pagination: - $ref: '#/components/schemas/Pagination' - SearchResult: - title: Search Result - required: - - name - type: object - properties: - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: TestAPI - type: - type: string - example: API - enum: - - DOC - - API - - APIProduct - transportType: - type: string - description: Accepted values are HTTP, WS, SOAPTOREST, GRAPHQL - discriminator: - propertyName: name - APISearchResult: - title: API Result - allOf: - - $ref: '#/components/schemas/SearchResult' - - type: object - properties: - description: - type: string - description: A brief description about the API - example: A calculator API that supports basic operations - context: - type: string - description: A string that represents the context of the user's request - example: CalculatorAPI - version: - type: string - description: The version of the API - example: 1.0.0 - provider: - type: string - description: | - If the provider value is not given, the user invoking the API will be used as the provider. - example: admin - status: - type: string - description: This describes in which status of the lifecycle the API is - example: CREATED - thumbnailUri: - type: string - example: /apis/01234567-0123-0123-0123-012345678901/thumbnail - APIProductSearchResult: - title: API Result - allOf: - - $ref: '#/components/schemas/SearchResult' - - type: object - properties: - description: - type: string - description: A brief description about the API - example: A calculator API that supports basic operations - context: - type: string - description: A string that represents the context of the user's request - example: CalculatorAPI - version: - type: string - description: The version of the API Product - example: 1.0.0 - provider: - type: string - description: | - If the provider value is not given, the user invoking the API will be used as the provider. - example: admin - status: - type: string - description: This describes in which status of the lifecycle the APIPRODUCT - is - example: PUBLISHED - thumbnailUri: - type: string - example: /apis/01234567-0123-0123-0123-012345678901/thumbnail - APIMonetizationInfo: - title: API monetization object - required: - - enabled - type: object - properties: - enabled: - type: boolean - description: Flag to indicate the monetization status - example: true + Not Found. + Workflow for the given reference in not found. + schema: + $ref: '#/definitions/Error' +###################################################### +# Parameters - required by some of the APIs above +###################################################### +parameters: + +# API Identifier +# Specified as part of the path expression + apiId: + name: apiId + in: path + description: | + **API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. + The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. + Should be formatted as **provider-name-version**. + required: true + type: string + x-encoded: true + +# API Identifier +# Specified as part of the query string + apiId-Q: + name: apiId + in: query + description: | + **API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. + The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. + Should be formatted as **provider-name-version**. + required: true + type: string + x-encoded: true + + +# Document Identifier +# Specified as part of the path expression + documentId: + name: documentId + in: path + description: | + Document Identifier + required: true + type: string + +# Application Identifier +# Specified as part of the path expression + applicationId: + name: applicationId + in: path + description: | + **Application Identifier** consisting of the UUID of the Application. + required: true + type: string + +# Subscription Identifier +# Specified as part of the path expression + subscriptionId: + name: subscriptionId + in: path + description: | + Subscription Id + required: true + type: string + +# Mediation policy identifier +# Specified as part of the path expression + mediationPolicyId: + name: mediationPolicyId + in: path + description: | + Mediation policy Id + required: true + type: string + + + +# Subscription Identifier +# Specified as part of the query string + subscriptionId-Q: + name: subscriptionId + in: query + description: | + Subscription Id + required: true + type: string + +# Tier Name +# Specified as part of the path expression + tierName: + name: tierName + in: path + description: | + Tier name + required: true + type: string + +# Tier Name +# Specified as part of the query string + tierName-Q: + name: tierName + in: query + description: | + Name of the tier + required: true + type: string + +# Tier Type +# Specified as part of the path expression + tierLevel: + name: tierLevel + in: path + description: | + List API or Application or Resource type tiers. + type: string + enum: + - api + - application + - resource + required: true + +# Tier Type +# Specified as part of the path expression + tierLevel-A: + name: tierLevel + in: path + description: | + List API or Application or Resource type tiers. + type: string + enum: + - api + required: true + +# Tier Type +# Specified as part of the query string + tierLevel-Q: + name: tierLevel + in: query + description: | + List API or Application or Resource type tiers. + type: string + enum: + - api + - application + - resource + required: true + +# Used for pagination: +# The maximum number of resoures to be returned by a GET + limit: + name: limit + in: query + description: | + Maximum length of resource array to return. + default: 25 + type: integer + +# Used for pagination: +# The order number of an instance in a qualified set of resoures +# at which to start to return the next batch of qualified resources + offset: + name: offset + in: query + description: | + Starting point within the complete list of items qualified. + default: 0 + type: integer + +# The HTTP Accept header + Accept: + name: Accept + in: header + description: | + Media types acceptable for the response. Default is application/json. + default: application/json + type: string + +# The HTTP Content-Type header + Content-Type: + name: Content-Type + in: header + description: | + Media type of the entity in the body. Default is application/json. + default: application/json + required: true + type : string + +# The HTTP Authorization header + Authorization: + name: Authorization + in: header + description: | + Holds the bearer token for apis that require authentication. + required: true + type : string + +# The HTTP If-None-Match header +# Used to avoid retrieving data that are already cached + If-None-Match: + name: If-None-Match + in: header + description: | + Validator for conditional requests; based on the ETag of the formerly retrieved + variant of the resource (Will be supported in future). + type : string + +# The HTTP If-Modified-Since header +# Used to avoid retrieving data that are already cached + If-Modified-Since: + name: If-Modified-Since + in: header + description: | + Validator for conditional requests; based on Last Modified header of the + formerly retrieved variant of the resource (Will be supported in future). + type: string + +# The HTTP If-Match header +# Used to avoid concurrent updates + If-Match: + name: If-Match + in: header + description: | + Validator for conditional requests; based on ETag (Will be supported in future). + type: string + +# The HTTP If-Unmodified-Since header +# Used to avoid concurrent updates + If-Unmodified-Since: + name: If-Unmodified-Since + in: header + description: | + Validator for conditional requests; based on Last Modified header (Will be supported in future). + type: string + + +# Workflow reference ID +# Specified as part of the path expression + workflowReferenceId-Q: + name: workflowReferenceId + in: query + description: | + Workflow reference id + required: true + type: string + +###################################################### +# The resources used by some of the APIs above within the message body +###################################################### +definitions: + +#----------------------------------------------------- +# The API List resource +#----------------------------------------------------- + APIList: + title: API List + properties: + count: + type: integer + description: | + Number of APIs returned. + example: 1 + next: + type: string + description: | + Link to the next subset of resources qualified. + Empty if no more resources are to be returned. + example: "/apis?limit=1&offset=2&query=" + previous: + type: string + description: | + Link to the previous subset of resources qualified. + Empty if current subset is the first subset returned. + example: "/apis?limit=1&offset=0&query=" + list: + type: array + items: + $ref: '#/definitions/APIInfo' + pagination: properties: - type: object - additionalProperties: - type: string - description: Map of custom properties related to monetization - DocumentSearchResult: - title: Document Result - allOf: - - $ref: '#/components/schemas/SearchResult' - - type: object - properties: - docType: - type: string - example: HOWTO - enum: - - HOWTO - - SAMPLES - - PUBLIC_FORUM - - SUPPORT_FORUM - - API_MESSAGE_FORMAT - - SWAGGER_DOC - - OTHER - summary: - type: string - example: Summary of Calculator Documentation - sourceType: - type: string - example: INLINE - enum: - - INLINE - - URL - - FILE - sourceUrl: - type: string - example: "" - otherTypeName: - type: string - example: "" - visibility: - type: string - example: API_LEVEL - enum: - - OWNER_ONLY - - PRIVATE - - API_LEVEL - apiName: - type: string - description: The name of the associated API - example: TestAPI - apiVersion: - type: string - description: The version of the associated API - example: 1.0.0 - apiProvider: - type: string - example: admin - apiUUID: - type: string - associatedType: - type: string - MockResponsePayloadList: - title: Mock Response Payload list - type: object - properties: - list: - type: array - items: - $ref: '#/components/schemas/MockResponsePayloadInfo' - MockResponsePayloadInfo: - title: Mock Response Payload info object - type: object - properties: - path: - type: string - description: path of the resource - example: /menu - content: - type: string - description: new modified code - example: "var accept = \"\\\"\"+mc.getProperty('AcceptHeader')+\"\\\"\"\ - ;\nvar responseCode = mc.getProperty('query.param.responseCode');\nvar\ - \ responseCodeStr = \"\\\"\"+responseCode+\"\\\"\";\nvar responses = [];\n\ - \nif (!responses[200]) {\n responses [200] = [];\n}\nresponses[200][\"\ - application/json\"] = \n[ {\n \"price\" : \"string\",\n \"description\"\ - \ : \"string\",\n \"name\" : \"string\",\n \"image\" : \"string\"\n\ - } ]\n\n/*if (!responses[304]) {\n responses[304] = [];\n}\nresponses[304][\"\ - application/(json or xml)\"] = {}/<>*/\n\nif (!responses[406]) {\n responses\ - \ [406] = [];\n}\nresponses[406][\"application/json\"] = \n{\n \"message\"\ - \ : \"string\",\n \"error\" : [ {\n \"message\" : \"string\",\n \ - \ \"code\" : 0\n } ],\n \"description\" : \"string\",\n \"code\" :\ - \ 0,\n \"moreInfo\" : \"string\"\n}\n\nresponses[501] = [];\nresponses[501][\"\ - application/json\"] = {\n\"code\" : 501,\n\"description\" : \"Not Implemented\"\ - }\nresponses[501][\"application/xml\"] = 501Not\ - \ Implemented;\n\nif (!responses[responseCode])\ - \ {\n responseCode = 501;\n}\n\nif (responseCode == null) {\n responseCode\ - \ = 200;\n responseCodeStr = \"200\";\n}\n\nif (accept == null || !responses[responseCode][accept])\ - \ {\n accept = \"application/json\";\n}\n\nif (accept === \"application/json\"\ - ) {\n mc.setProperty('CONTENT_TYPE', 'application/json');\n mc.setProperty('HTTP_SC',\ - \ responseCodeStr);\n mc.setPayloadJSON(responses[responseCode][\"application/json\"\ - ]);\n} else if (accept === \"application/xml\") {\n mc.setProperty('CONTENT_TYPE',\ - \ 'application/xml');\n mc.setProperty('HTTP_SC', responseCodeStr);\n\ - \ mc.setPayloadXML(responses[responseCode][\"application/xml\"]);\n}" - verb: - type: string - example: POST - ResourcePolicyList: - title: Resource policy List - type: object - properties: - list: - type: array - items: - $ref: '#/components/schemas/ResourcePolicyInfo' - count: - type: integer - description: | - Number of policy resources returned. - example: 1 - ResourcePolicyInfo: - title: Resource policy Info object with conversion policy resource details. - type: object - properties: - id: - type: string - description: | - UUID of the resource policy registry artifact - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - httpVerb: - type: string - description: HTTP verb used for the resource path - example: get - resourcePath: - type: string - description: A string that represents the resource path of the api for the - related resource policy - example: checkPhoneNumber - content: - type: string - description: The resource policy content - example:
- Settings: - title: SettingsDTO - type: object - properties: - devportalUrl: - type: string - description: The Developer Portal URL - example: https://localhost:9443/devportal - environment: - type: array - items: - $ref: '#/components/schemas/Environment' - scopes: - type: array - example: - - apim:api_create - - apim:api_publish - items: - type: string - monetizationAttributes: - type: array - example: [] - items: - $ref: '#/components/schemas/MonetizationAttribute' - securityAuditProperties: - type: object - properties: {} - externalStoresEnabled: - type: boolean - description: | - Is External Stores configuration enabled - example: true - docVisibilityEnabled: - type: boolean - description: | - Is Document Visibility configuration enabled - example: false - crossTenantSubscriptionEnabled: - type: boolean - description: | - Is Cross Tenant Subscriptions Enabled - example: false - default: false - deployments: - type: array - items: - $ref: '#/components/schemas/Deployments' - SecurityAuditAttribute: - title: SecurityAuditAttributeDTO - type: object - properties: - isGlobal: - type: boolean - example: false - overrideGlobal: - type: boolean - example: false - apiToken: - type: string - example: b1267ytf-b7gc-4aee-924d-ece81241efec - collectionId: - type: string - example: 456ef957-5a79-449f-83y3-9027945d3c60 - baseUrl: - type: string - WSDLInfo: - title: WSDL information of the API. This is only available if the API is a SOAP - API. - type: object - properties: - type: - type: string - description: Indicates whether the WSDL is a single WSDL or an archive in - ZIP format - enum: - - WSDL - - ZIP - Pagination: - title: Pagination - type: object - properties: - offset: - type: integer - example: 0 - limit: - type: integer - example: 1 - total: - type: integer - example: 10 - next: - type: string - description: | - Link to the next subset of resources qualified. - Empty if no more resources are to be returned. - previous: - type: string - description: | - Link to the previous subset of resources qualified. - Empty if current subset is the first subset returned. - MonetizationAttribute: - title: Monetization attribute object - type: object - properties: - required: - type: boolean - description: | - Is attribute required - example: true - name: - type: string - description: | - Name of the attribute - displayName: - type: string - description: | - Display name of the attribute - description: - type: string - description: | - Description of the attribute - hidden: - type: boolean - description: | - Is attribute hidden - default: - type: string - description: | - Default value of the attribute - Tenant: - title: Tenant - type: object - properties: - domain: - type: string - description: tenant domain - example: wso2.com - status: + offset: + type: integer + example: 12 + limit: + type: integer + example: 25 + total: + type: integer + example: 1290 + +#----------------------------------------------------- +# The API Info resource +#----------------------------------------------------- + APIInfo: + title: API Info object with basic API details. + properties: + id: + type: string + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + example: CalculatorAPI + description: + type: string + example: A calculator API that supports basic operations + context: + type: string + example: CalculatorAPI + version: + type: string + example: 1.0.0 + provider: + description: | + If the provider value is not given, the user invoking the API will be used as the provider. + type: string + example: admin + status: + type: string + example: CREATED + thumbnailUri: + type: string + example: /apis/01234567-0123-0123-0123-012345678901/thumbnail + +#----------------------------------------------------- +# The API resource +#----------------------------------------------------- + API: + title: API object + required: + - name + - context + - version + - tiers + - isDefaultVersion + - transport + - endpointConfig + - visibility + - type + properties: + id: + type: string + description: | + UUID of the api registry artifact + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + description: Name of the API + example: CalculatorAPI + description: + type: string + description: A brief description about the API + example: A calculator API that supports basic operations + context: + type: string + description: A string that represents the context of the user's request + example: CalculatorAPI + version: + type: string + description: The version of the API + example: 1.0.0 + provider: + description: | + If the provider value is not given user invoking the api will be used as the provider. + type: string + example: admin + apiDefinition: + description: | + Swagger definition of the API which contains details about URI templates and scopes + type: string + example: "{\"paths\":{\"/substract\":{\"get\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"parameters\":[{\"name\":\"x\",\"required\":true,\"type\":\"string\",\"in\":\"query\"},{\"name\":\"y\",\"required\":true,\"type\":\"string\",\"in\":\"query\"}],\"responses\":{\"200\":{}}}},\"/add\":{\"get\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"parameters\":[{\"name\":\"x\",\"required\":true,\"type\":\"string\",\"in\":\"query\"},{\"name\":\"y\",\"required\":true,\"type\":\"string\",\"in\":\"query\"}],\"responses\":{\"200\":{}}}}},\"swagger\":\"2.0\",\"info\":{\"title\":\"CalculatorAPI\",\"version\":\"1.0.0\"}}" + wsdlUri: + description: | + WSDL URL if the API is based on a WSDL endpoint + type: string + example: "http://www.webservicex.com/globalweather.asmx?wsdl" + status: + type: string + description: This describes in which status of the lifecycle the API is + example: CREATED + responseCaching: + type: string + example: Disabled + cacheTimeout: + type: integer + example: 300 + destinationStatsEnabled: + type: string + example: Disabled + isDefaultVersion: + type: boolean + example: false + type: + type: string + description: The transport to be set. Accepted values are HTTP, WS + enum: + - HTTP + - WS + example: HTTP + default: HTTP + transport: + description: | + Supported transports for the API (http and/or https). + type: array + items: type: string - description: current status of the tenant active/inactive - example: active - TenantList: - title: Tenant list - type: object - properties: - count: - type: integer - description: | - Number of tenants returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Tenant' - pagination: - $ref: '#/components/schemas/Pagination' - AlertTypesList: - title: Alert Types List - type: object - properties: - count: - type: integer - description: The number of alerts - example: 3 - alerts: - type: array - items: - $ref: '#/components/schemas/AlertType' - AlertType: - title: Alert Type - type: object - properties: - id: - type: integer - description: The alert Id - example: 1 - name: + example: ["http","https"] + tags: + type: array + description: Search keywords related to the API + items: type: string - description: The name of the alert. - example: AbnormalRequestTime - requireConfiguration: - type: boolean - description: Whether the alert type require additional configurations. - example: true - Alert: - title: Alert - type: object - properties: - id: - type: integer - description: The alert Id - example: 1 - name: + example: ["substract","add"] + tiers: + type: array + description: The subscription tiers selected for the particular API + items: type: string - description: The name of the alert. - example: AbnormalRequestsPerMin - configuration: - type: array - items: - $ref: '#/components/schemas/AlertConfig' - AlertsInfo: - title: Alerts Info - type: object - properties: - alerts: - type: array - items: - $ref: '#/components/schemas/Alert' - emailList: - type: array - items: + example: ["Unlimited"] + apiLevelPolicy: + description: The policy selected for the particular API + type: string + example: "Unlimited" + maxTps: + properties: + production: + type: integer + format: int64 + example: 1000 + sandbox: + type: integer + format: int64 + example: 1000 + thumbnailUri: + type: string + example: "/apis/01234567-0123-0123-0123-012345678901/thumbnail" + visibility: + type: string + description: The visibility level of the API. Accepts one of the following. PUBLIC, PRIVATE, RESTRICTED OR CONTROLLED. + enum: + - PUBLIC + - PRIVATE + - RESTRICTED + - CONTROLLED + example: PUBLIC + visibleRoles: + type: array + description: The user roles that are able to access the API + items: + type: string + example: [] + endpointConfig: + type: string + example: "{\"production_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":{\"suspendErrorCode\":\"101000\",\"suspendDuration\":\"2000\",\"suspendMaxDuration\":\"3\",\"factor\":\"2\",\"retryErroCode\":\"101000\",\"retryTimeOut\":\"4\",\"retryDelay\":\"1000\",\"actionSelect\":\"fault\",\"actionDuration\":\"3000\"}},\"sandbox_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"endpoint_type\":\"http\"}" + endpointSecurity: + properties: + type: type: string - AlertsInfoResponse: - title: Alerts Info Response - type: object - properties: - alerts: - type: array - items: - $ref: '#/components/schemas/Alert' - emailList: - type: array - items: + example: basic + description: Accepts one of the following, basic or digest. + enum: + - basic + - digest + username: type: string - failedConfigurations: - type: array - items: - $ref: '#/components/schemas/AlertConfig' - AlertConfigList: - title: Alert Configuration List - type: object - properties: - count: - type: integer - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/AlertConfig' - AlertConfig: - title: Alert Configuration - type: object - properties: - configurationId: - type: string - description: The alert config subscription id. - example: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - configuration: - type: object - additionalProperties: + example: admin + password: type: string - description: The config parameters. - example: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - AlertConfigInfo: - title: Alert Configuration Info - type: object + example: password + gatewayEnvironments: + description: | + Comma separated list of gateway environments. + type: string + example: Production and Sandbox + sequences: + type: array + items: + $ref: '#/definitions/Sequence' + example: [] + subscriptionAvailability: + type: string + description: The subscription availability. Accepts one of the following. current_tenant, all_tenants or specific_tenants. + enum: + - current_tenant + - all_tenants + - specific_tenants + example: current_tenant + subscriptionAvailableTenants: + type: array + items: + type: string + example: ["tenant1", "tenant2"] additionalProperties: + type: object + description : Map of custom properties of API + accessControl: type: string - description: The config parameters. - example: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - APICategory: - title: API Category - required: - - name - type: object - properties: - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: Finance - description: - type: string - example: Finance related APIs - APICategoryList: - title: API Category List - type: object - properties: - count: - type: integer - description: | - Number of API categories returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/APICategory' - KeyManagerInfo: - title: Key Manager Info - required: - - name - - type - type: object - properties: - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: WSO2 IS - displayName: - type: string - description: | - display name of Keymanager - example: Keymanager1 - type: - type: string - example: IS - description: - type: string - example: This is a key manager for Developers - enabled: - type: boolean - example: true - additionalProperties: - type: array - items: - type: object - properties: {} - KeyManagerList: - title: Key Manager List - type: object - properties: - count: - type: integer - description: | - Number of Key managers returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/KeyManagerInfo' - DeploymentList: - title: Deployment List - type: object - properties: - count: - type: integer - description: | - Number of deployment clusters returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Deployments' - Deployments: - title: Deployments - required: - - clusters - - name - type: object - properties: - name: - type: string - example: Kubernetes - clusters: - type: array - items: - $ref: '#/components/schemas/DeploymentClusterInfo' - DeploymentClusterInfo: - title: DeploymentClusterInfo - required: - - accessURL - - clusterName - - displayName - - properties - type: object - properties: - clusterName: - type: string - example: minikube - accessURL: - type: string - example: https://api.com - displayName: - type: string - example: kubernetes-minikube + description: | + Is the API is restricted to certain set of publishers or creators or is it visible to all the + publishers and creators. If the accessControl restriction is none, this API can be modified by all the + publishers and creators, if not it can only be viewable/modifiable by certain set of publishers and creators, + based on the restriction. enum: + - NONE + - RESTRICTED + accessControlRoles: + type: array + description: The user roles that are able to view/modify as API publisher or creator. + items: + type: string + example: [admin] + businessInformation: properties: - type: object - additionalProperties: + businessOwner: type: string - DeploymentStatusList: - title: DeploymentStatus List - type: object - properties: - count: - type: integer - description: | - Status of the deployments returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/DeploymentStatus' - DeploymentStatus: - title: DeploymentStatus - required: - - clusters - - type - type: object - properties: - type: - type: string - example: Kubernetes - clusters: - type: array - items: - $ref: '#/components/schemas/DeploymentClusterStatus' - DeploymentClusterStatus: - title: DeploymentClusterStatus - required: - - clusterName - - healthStatus - - podsRunning - type: object - properties: - clusterName: - type: string - example: Minikube - podsRunning: - type: integer - healthStatus: - type: array - items: - $ref: '#/components/schemas/PodStatus' - DeploymentEnvironments: - title: DeploymentEnvironments - required: - - clusterName - - type - type: object - properties: - type: - type: string - example: Kubernetes - clusterName: - type: array - example: - - minikube - items: + example: businessowner + businessOwnerEmail: type: string - PodStatus: - title: PodStatus - required: - - name - - ready - - status - type: object - properties: - name: - type: string - example: petStore-677bb7cc65-shb2f - ready: - type: string - example: 1/1 - status: - type: string - example: running - creationTimestamp: - type: string - example: 2020-05-12T06:12:00Z - AsyncAPISpecificationValidationResponse: - title: AsyncAPI Specification Validation Response - required: - - isValid - type: object - properties: - isValid: - type: boolean - description: - This attribute declares whether this definition is valid or not. - example: true - content: - type: string - description: - AsyncAPI specification content - info: - type: object - properties: - name: - type: string - example: Streetlights - version: - type: string - example: 1.0.0 - context: - type: string - example: /streetlights - description: + example: businessowner@wso2.com + technicalOwner: + type: string + example: technicalowner + technicalOwnerEmail: + type: string + example: technicalowner@wso2.com + corsConfiguration: + description: | + CORS configuration for the API + properties: + corsConfigurationEnabled: + type: boolean + default: false + accessControlAllowOrigins: + type: array + items: + type: string + accessControlAllowCredentials: + type: boolean + default: false + accessControlAllowHeaders: + type: array + items: type: string - example: A sample API that uses a streetlights as an example to demonstrate AsyncAPI specifications - asyncAPIVersion: + accessControlAllowMethods: + type: array + items: type: string - example: 2.0 - endpoints: - type: array - description: - contains host/servers specified in the AsyncAPI file/URL - items: - type: string - example: "https://localhost:9443/am/sample/pizzashack/v1/api/" - description: - API definition information - errors: - type: array - description: - If there are more than one error list them out. - For example, list out validation error by each field. - items: - $ref: '#/components/schemas/ErrorListItem' - responses: - BadRequest: - description: Bad Request. Invalid request or validation error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 400 - message: Bad Request - description: Invalid request or validation error - moreInfo: "" - error: [] - Conflict: - description: Conflict. Specified resource already exists. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 409 - message: Conflict - description: Specified resource already exists - moreInfo: "" - error: [] - Forbidden: - description: Forbidden. The request must be conditional but no condition has - been specified. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 403 - message: Forbidden - description: The request must be conditional but no condition has been - specified - moreInfo: "" - error: [] - InternalServerError: - description: Internal Server Error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 500 - message: Internal Server Error - description: The server encountered an internal error. Please contact - administrator. - moreInfo: "" - error: [] - NotAcceptable: - description: Not Acceptable. The requested media type is not supported. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 406 - message: Not Acceptable - description: The requested media type is not supported - moreInfo: "" - error: [] - NotFound: - description: Not Found. The specified resource does not exist. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 404 - message: Not Found - description: The specified resource does not exist - moreInfo: "" - error: [] - PreconditionFailed: - description: Precondition Failed. The request has not been performed because - one of the preconditions is not met. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 412 - message: Precondition Failed - description: The request has not been performed because one of the preconditions - is not met - moreInfo: "" - error: [] - Unauthorized: - description: Unauthorized. The user is not authorized. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 401 - message: Unauthorized - description: The user is not authorized - moreInfo: "" - error: [] - UnsupportedMediaType: - description: Unsupported Media Type. The entity of the request was not in a - supported format. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 415 - message: Unsupported media type - description: The entity of the request was not in a supported format - moreInfo: "" - error: [] - parameters: - replyLimit: - name: replyLimit - in: query - description: | - Maximum size of replies array to return. - schema: - type: integer - default: 25 - replyOffset: - name: replyOffset - in: query - description: | - Starting point within the complete list of replies. - schema: + +#----------------------------------------------------- +# The Application resource +#----------------------------------------------------- + Application: + title: Application + required: + - name + - throttlingTier + properties: + applicationId: + type: string + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + example: CalculatorApp + subscriber: + type: string + example: admin + throttlingTier: + type: string + example: Unlimited + description: + type: string + example: Sample calculator application + groupId: + type: string + example: "" + +#----------------------------------------------------- +# The Document List resource +#----------------------------------------------------- + DocumentList: + title: Document List + properties: + count: type: integer - default: 0 - commentId: - name: commentId - in: path - description: | - Comment Id - required: true - schema: + description: | + Number of Documents returned. + example: 1 + next: type: string - parentCommentID: - name: replyTo - in: query - description: | - ID of the perent comment. - schema: + description: | + Link to the next subset of resources qualified. + Empty if no more resources are to be returned. + example: "/apis/01234567-0123-0123-0123-012345678901/documents?limit=1&offset=2" + previous: type: string - includeCommenterInfo: - name: includeCommenterInfo - in: query - description: | - Whether we need to display commentor details. - schema: - type: boolean - default : false - apiId: - name: apiId - in: path - description: | - **API ID** consisting of the **UUID** of the API. - required: true - schema: + description: | + Link to the previous subset of resources qualified. + Empty if current subset is the first subset returned. + example: "/apis/01234567-0123-0123-0123-012345678901/documents?limit=1&offset=0" + list: + type: array + items: + $ref: '#/definitions/Document' + +#----------------------------------------------------- +# The Document resource +#----------------------------------------------------- + Document: + title: Document + required: + - name + - type + - sourceType + - visibility + properties: + documentId: type: string - endpointId: - name: endpointId - in: path - description: | - **Endpoint ID** consisting of the **UUID** of the Endpoint**. - required: true - schema: + example: 01234567-0123-0123-0123-012345678901 + name: type: string - apiId-Q: - name: apiId - in: query - description: | - **API ID** consisting of the **UUID** of the API. - The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. - Should be formatted as **provider-name-version**. - required: true - schema: + example: CalculatorDoc + type: type: string - apiId-Q-Opt: - name: apiId - in: query - description: | - **API ID** consisting of the **UUID** of the API. - The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. - Should be formatted as **provider-name-version**. - schema: + enum: + - HOWTO + - SAMPLES + - PUBLIC_FORUM + - SUPPORT_FORUM + - API_MESSAGE_FORMAT + - SWAGGER_DOC + - OTHER + example: HOWTO + summary: type: string - labelType-Q: - name: labelType - in: query - description: | - **API ID** consisting of the **UUID** of the API. - The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. - Should be formatted as **provider-name-version**. - schema: + example: "Summary of Calculator Documentation" + sourceType: type: string - name: - name: name - in: path - description: | - Name of the API - required: true - schema: + enum: + - INLINE + - URL + - FILE + example: INLINE + sourceUrl: type: string - version: - name: version - in: path - description: | - Version of the API - required: true - schema: + example: "" + otherTypeName: type: string - apiName-Q: - name: name - in: query - description: | - Name of the API - schema: + example: "" + visibility: type: string - apiVersion-Q: - name: version - in: query - description: | - Version of the API - schema: + enum: + - OWNER_ONLY + - PRIVATE + - API_LEVEL + example: API_LEVEL + +#----------------------------------------------------- +# The Mediation List resource +#----------------------------------------------------- + mediationList: + title: Mediation List + properties: + count: + type: integer + description: | + Number of mediation sequences returned. + example: 1 + next: type: string - apiProvider-Q: - name: providerName - in: query - description: | - Provider name of the API - schema: + description: | + Link to the next subset of sequences qualified. + Empty if no more sequences are to be returned. + example: "" + previous: type: string - documentId: - name: documentId - in: path - description: | - Document Identifier - required: true - schema: + description: | + Link to the previous subset of sequences qualified. + Empty if current subset is the first subset returned. + example: "" + list: + type: array + items: + $ref: '#/definitions/MediationInfo' + +#----------------------------------------------------- +# The MediationInfo resource +#----------------------------------------------------- + MediationInfo: + title: MediationInfo + required: + - name + - type + - id + properties: + name: type: string - applicationId: - name: applicationId - in: path - description: | - **Application Identifier** consisting of the UUID of the Application. - required: true - schema: + example: json_fault.xml + id: type: string - subscriptionId: - name: subscriptionId - in: path - description: | - Subscription Id - required: true - schema: + example: 01234567-0123-0123-0123-012345678901 + type: type: string - mediationPolicyId: - name: mediationPolicyId - in: path - description: | - Mediation policy Id - required: true - schema: + enum: + - in + - out + - fault + example: in +#----------------------------------------------------- +# The Mediation resource +#----------------------------------------------------- + Mediation: + title: Mediation + required: + - name + - type + - config + properties: + id: type: string - resourcePolicyId: - name: resourcePolicyId - in: path - description: | - registry resource Id - required: true - schema: + example: 01234567-0123-0123-0123-012345678901 + name: type: string - subscriptionId-Q: - name: subscriptionId - in: query - description: | - Subscription Id - required: true - schema: + example: json_fault.xml + type: type: string - - # API Revision Identifier - # Specified as part of the path expression - revisionId: - name: revisionId - in: path - description: | - Revision ID of an API - required: true - schema: + enum: + - in + - out + - fault + example: in + config: type: string + example: ' + + + + ' + +#----------------------------------------------------- +# The MediationInfo resource +#----------------------------------------------------- + Wsdl: + title: Wsdl + required: + - name + properties: + name: + type: string + example: admin--calculatorAPI2.0.wsdl + wsdlDefinition: + type: string - # API Revision Identifier - # Specified as part of the query string - revisionId-Q: - name: revisionId - in: query - description: | - Revision ID of an API - schema: + +# The Tier List resource +#----------------------------------------------------- + TierList: + title: Tier List + properties: + count: + type: integer + description: | + Number of Tiers returned. + example: 1 + next: type: string - revisionNum-Q: - name: revisionNumber - in: query - description: | - Revision Number of an API - schema: + description: | + Link to the next subset of resources qualified. + Empty if no more resources are to be returned. + example: "/tiers/api?limit=1&offset=2" + previous: type: string - policyName: - name: policyName - in: path - description: | - Tier name - required: true - schema: + description: | + Link to the previous subset of resources qualified. + Empty if current subset is the first subset returned. + example: "/tiers/api?limit=1&offset=0" + list: + type: array + items: + $ref: '#/definitions/Tier' + +#----------------------------------------------------- +# The Tier resource +#----------------------------------------------------- + Tier: + title: Tier + required: + - name + - tierPlan + - requestCount + - unitTime + - stopOnQuotaReach + properties: + name: type: string - policyName-Q: - name: policyName - in: query - description: | - Name of the policy - required: true - schema: + example: Platinum + description: type: string - policyLevel: - name: policyLevel - in: path - description: | - List API or Application or Resource type policies. - required: true - schema: + example: "Allows 50 request(s) per minute." + tierLevel: type: string enum: - api - - subcription - policyLevel-Q: - name: policyLevel - in: query - description: | - List API or Application or Resource type policies. - required: true - schema: + - application + - resource + example: api + attributes: + description: | + Custom attributes added to the tier policy + type: object + additionalProperties: + type: string + example: {} + requestCount: + description: | + Maximum number of requests which can be sent within a provided unit time + type: integer + format: int64 + example: 50 + unitTime: + type: integer + format: int64 + example: 60000 + timeUnit: + type: string + example: "min" + tierPlan: + description: | + This attribute declares whether this tier is available under commercial or free type: string enum: - - api - - subcription - limit: - name: limit - in: query - description: | - Maximum size of resource array to return. - schema: - type: integer - default: 25 - Accept: - name: Accept - in: header - description: | - Media types acceptable for the response. Default is application/json. - schema: + - FREE + - COMMERCIAL + example: FREE + stopOnQuotaReach: + description: | + By making this attribute to false, you are capabale of sending requests + even if the request count exceeded within a unit time + type: boolean + example: true + +#----------------------------------------------------- +# The Tier Permission resource +#----------------------------------------------------- + TierPermission: + title: tierPermission + required: + - permissionType + - roles + properties: + permissionType: type: string - default: application/json - offset: - name: offset - in: query - description: | - Starting point within the complete list of items qualified. - schema: + enum: + - allow + - deny + example: deny + roles: + type: array + items: + type: string + example: ["Internal/everyone"] + +#----------------------------------------------------- +# The Subscription List resource +#----------------------------------------------------- + SubscriptionList: + title: Subscription List + properties: + count: type: integer - default: 0 - If-None-Match: - name: If-None-Match - in: header - description: | - Validator for conditional requests; based on the ETag of the formerly retrieved - variant of the resource. - schema: + description: | + Number of Subscriptions returned. + example: 1 + next: type: string - If-Match: - name: If-Match - in: header - description: | - Validator for conditional requests; based on ETag. - schema: + description: | + Link to the next subset of resources qualified. + Empty if no more resources are to be returned. + example: "/subscriptions?limit=1&offset=2&apiId=01234567-0123-0123-0123-012345678901&groupId=" + previous: type: string - scopeName: - name: scopeId - in: path - description: | - Scope name - required: true - schema: + description: | + Link to the previous subset of resources qualified. + Empty if current subset is the first subset returned. + example: "/subscriptions?limit=1&offset=0&apiId=01234567-0123-0123-0123-012345678901&groupId=" + list: + type: array + items: + $ref: '#/definitions/Subscription' + +#----------------------------------------------------- +# The Subscription resource +#----------------------------------------------------- + Subscription: + title: Subscription + required: + - applicationId + - apiIdentifier + - tier + properties: + subscriptionId: type: string - scopeId: - name: scopeId - in: path - description: | - Scope Id consisting the UUID of the shared scope - required: true - schema: + example: 01234567-0123-0123-0123-012345678901 + applicationId: type: string - expand: - name: expand - in: query - description: | - Defines whether the returned response should contain full details of API - schema: + example: 01234567-0123-0123-0123-012345678901 + apiIdentifier: + type: string + example: 01234567-0123-0123-0123-012345678901 + tier: + type: string + example: Unlimited + status: + type: string + enum: + - BLOCKED + - PROD_ONLY_BLOCKED + - UNBLOCKED + - ON_HOLD + - REJECTED + example: UNBLOCKED + +#----------------------------------------------------- +# The Extended Subscription resource +#----------------------------------------------------- + ExtendedSubscription: + title: Subscription with Ext. Workflow Reference + required: + - workflowId + allOf: + - $ref: '#/definitions/Subscription' + - properties: + workflowId: + type: string + example: 01234567-0123-0123-0123-012345678901 + +#----------------------------------------------------- +# The Sequence resource +#----------------------------------------------------- + Sequence: + title: Sequence + required: + - name + properties: + name: + type: string + example: log_in_message + type: + type: string + example: in + id: + type: string + example: 69ea3fa6-55c6-472e-896d-e449dd34a824 + shared: type: boolean - threatProtectionPolicyId: - name: policyId - in: path - description: | - The UUID of a Policy - required: true - schema: + example: true + +#----------------------------------------------------- +# The Error resource +#----------------------------------------------------- + Error: + title: Error object returned with 4XX HTTP status + required: + - code + - message + properties: + code: + type: integer + format: int64 + message: type: string - roleId: - name: roleId - in: path - description: | - The Base 64 URL encoded role name with domain. If the given role is in secondary user-store, role ID should be - derived as Base64URLEncode({user-store-name}/{role-name}). If the given role is in PRIMARY user-store, role ID - can be derived as Base64URLEncode(role-name) - required: true - schema: + description: Error message. + description: type: string - requestedTenant: - name: X-WSO2-Tenant - in: header - description: | - For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be - retirieved from. - schema: + description: | + A detail description about the error message. + moreInfo: type: string - apiProductId: - name: apiProductId - in: path - description: | - **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. - required: true - schema: + description: | + Preferably an url with more details about the error. + error: + type: array + description: | + If there are more than one error list them out. + For example, list out validation errors by each field. + items: + $ref: '#/definitions/ErrorListItem' + +#----------------------------------------------------- +# The Error List Item resource +#----------------------------------------------------- + ErrorListItem: + title: Description of individual errors that may have occurred during a request. + required: + - code + - message + properties: + code: type: string - x-encoded: true - x-encoded: true - tenantDomain: - name: tenantDomain - in: path - description: | - The domain of a specific tenant - required: true - schema: + message: type: string - alertType: - name: alertType - in: path - description: The alert type. - required: true - schema: + description: | + Description about individual errors occurred + +#----------------------------------------------------- +# The Environment resource +#----------------------------------------------------- + Environment: + title: Environment + required: + - name + - type + - serverUrl + - endpoints + - showInApiConsole + properties: + name: type: string - configurationId: - name: configurationId - in: path - description: The alert configuration id. - required: true - schema: + example: Production and Sandbox + type: type: string - tierQuotaType: - name: tierQuotaType - description: Filter the subscription base on tier quota type - in: query - schema: + example: hybrid + serverUrl: type: string - requestBodies: - threatProtectionPolicy: - description: | - Threat protection policy request parameter - content: - application/json: - schema: - $ref: '#/components/schemas/ThreatProtectionPolicy' - required: true - securitySchemes: - OAuth2Security: - type: oauth2 - flows: - password: - tokenUrl: https://localhost:9443/oauth2/token - scopes: - openid: Authorize access to user details - apim:api_view: View API - apim:api_create: Create API - apim:api_delete: Delete API - apim:api_publish: Publish API - apim:subscription_view: View Subscription - apim:subscription_block: Block Subscription - apim:external_services_discover: Discover External Services - apim:threat_protection_policy_create: Create threat protection policies - apim:threat_protection_policy_manage: Update and delete threat protection policies - apim:document_create: Create API documents - apim:document_manage: Update and delete API documents - apim:mediation_policy_view: View mediation policies - apim:mediation_policy_create: Create mediation policies - apim:mediation_policy_manage: Update and delete mediation policies - apim:client_certificates_view: View client certificates - apim:client_certificates_add: Add client certificates - apim:client_certificates_update: Update and delete client certificates - apim:ep_certificates_view: View backend endpoint certificates - apim:ep_certificates_add: Add backend endpoint certificates - apim:ep_certificates_update: Update and delete backend endpoint certificates - apim:publisher_settings: Retrieve store settings - apim:pub_alert_manage: Get/ subscribe/ configure publisher alerts - apim:shared_scope_manage: Manage shared scopes - apim:app_import_export: Import and export applications related operations - apim:api_import_export: Import and export APIs related operations - apim:api_product_import_export: Import and export API Products related operations + example: "https://localhost:9443/services/" + showInApiConsole: + type: boolean + example: true + endpoints: + $ref: '#/definitions/EnvironmentEndpoints' + +#----------------------------------------------------- +# The Environment List resource +#----------------------------------------------------- + EnvironmentList: + title: Environment List + properties: + count: + type: integer + description: | + Number of Environments returned. + example: 1 + list: + type: array + items: + $ref: '#/definitions/Environment' + + +#----------------------------------------------------- +# The Environment Endpoint resource +#----------------------------------------------------- + EnvironmentEndpoints : + title: Environment Endpoints + properties: + http: + type: string + description: HTTP environment URL + example: "http://localhost:8280" + https: + type: string + description: HTTPS environment URL + example: "https://localhost:8243" + +#----------------------------------------------------- +# The File Information resource +#----------------------------------------------------- + FileInfo : + title: File Information including meta data + properties: + relativePath: + type: string + description: relative location of the file (excluding the base context and host of the Publisher API) + example: "apis/01234567-0123-0123-0123-012345678901/thumbnail" + mediaType: + type: string + description: media-type of the file + example: "image/jpeg" + + +#----------------------------------------------------- +# The workflow response resource +#----------------------------------------------------- + Workflow: + title: workflow + required: + - status + properties: + status: + description: | + This attribute declares whether this workflow task is approved or rejected. + type: string + enum: + - APPROVED + - REJECTED + example: APPROVED + attributes: + description: | + Custom attributes to complete the workflow task + type: object + additionalProperties: + type: string + example: {} + description: + type: string + example: "Approve workflow request." \ No newline at end of file diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml index ce938982e96..b2b587bcd13 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml @@ -43,22 +43,10 @@ org.eclipse.osgi org.eclipse.osgi - - - javax.ws.rs - javax.ws.rs - - org.eclipse.osgi org.eclipse.osgi.services - - - javax.ws.rs - javax.ws.rs - - org.testng @@ -67,166 +55,68 @@ org.wso2.tomcat tomcat - - - javax.ws.rs - javax.ws.rs - - org.wso2.tomcat tomcat-servlet-api - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon org.wso2.carbon.core - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon org.wso2.carbon.logging - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon org.wso2.carbon.utils - - - javax.ws.rs - javax.ws.rs - - org.apache.axis2.wso2 axis2 - - - javax.ws.rs - javax.ws.rs - - com.google.code.gson gson - - - javax.ws.rs - javax.ws.rs - - org.wso2.orbit.org.scannotation scannotation - - - javax.ws.rs - javax.ws.rs - - javax.ws.rs jsr311-api - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon.devicemgt org.wso2.carbon.apimgt.annotations - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon.governance org.wso2.carbon.governance.api - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon.governance org.wso2.carbon.governance.lcm - - - javax.ws.rs - javax.ws.rs - - javax.ws.rs javax.ws.rs-api - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.common - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon.apimgt org.wso2.carbon.apimgt.api provided - 9.0.5 - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon.apimgt org.wso2.carbon.apimgt.impl - 9.0.5 provided - - - javax.ws.rs - javax.ws.rs - - com.h2database.wso2 @@ -260,61 +150,75 @@ org.wso2.carbon.apimgt.webapp.publisher.* - com.google.gson;version="2.3",com.google.gson.reflect; - version="2.3",io.swagger.annotations,javax.servlet;version="2.6",javax.xml,javax.xml.bind,javax.xml.bind.annotat - ion,javax.xml.parsers,org.apache.catalina;version="9.0",org.apache.ca - talina.core;version="9.0",org.apache.commons.logging;version="1.2",org.osgi.framework.*;version="${imp.package.version.osgi.framework}", - org.osgi.service.*;version="${imp.package.version.osgi.service}",org.scannotation;version="1.0",org.scannotation.archiveiterator;ve - rsion="1.0",org.w3c.dom,org.wso2.carbon.apimgt.annotations.api,org.ws - o2.carbon.apimgt.api,org.wso2.carbon.apimgt.api.model,org.wso2.carbon - .apimgt.impl,org.wso2.carbon.apimgt.webapp.publisher,org.wso2.carbon. - apimgt.webapp.publisher.config,org.wso2.carbon.apimgt.webapp.publishe - r.dto,org.wso2.carbon.apimgt.webapp.publisher.exception,org.wso2.carb - on.apimgt.webapp.publisher.lifecycle.listener,org.wso2.carbon.apimgt. - webapp.publisher.lifecycle.util,org.wso2.carbon.base;version="1.0",or - g.wso2.carbon.context;version="4.6",org.wso2.carbon.core;version="4.6 - ",org.wso2.carbon.core.util;version="4.6",org.wso2.carbon.registry.co - re.service;version="1.0",org.wso2.carbon.user.api;version="1.0",org.w - so2.carbon.user.core.service;version="4.6",org.wso2.carbon.user.core. - tenant;version="4.6",org.wso2.carbon.utils;version="4.6",org.wso2.car - bon.utils.multitenancy;version="4.6" + com.google.gson;version="2.3", + com.google.gson.reflect;version="2.3", + io.swagger.annotations, + javax.servlet;version="2.6", + javax.xml, + javax.xml.bind, + javax.xml.bind.annotation, + javax.xml.parsers, + org.apache.catalina;version="9.0", + org.apache.catalina.core;version="9.0", + org.apache.commons.logging;version="1.2", + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", + org.scannotation;version="1.0", + org.scannotation.archiveiterator;version="1.0", + org.w3c.dom, + org.wso2.carbon.apimgt.annotations.api, + org.wso2.carbon.apimgt.api, + org.wso2.carbon.apimgt.api.model, + org.wso2.carbon.apimgt.impl, + org.wso2.carbon.apimgt.webapp.publisher, + org.wso2.carbon.apimgt.webapp.publisher.config, + org.wso2.carbon.apimgt.webapp.publisher.dto, + org.wso2.carbon.apimgt.webapp.publisher.exception, + org.wso2.carbon.apimgt.webapp.publisher.lifecycle.listener, + org.wso2.carbon.apimgt.webapp.publisher.lifecycle.util, + org.wso2.carbon.base;version="1.0", + org.wso2.carbon.context;version="4.6", + org.wso2.carbon.core;version="4.6", + org.wso2.carbon.core.util;version="4.6", + org.wso2.carbon.registry.core.service;version="1.0", + org.wso2.carbon.user.api;version="1.0", + org.wso2.carbon.user.core.service;version="4.6", + org.wso2.carbon.user.core.tenant;version="4.6", + org.wso2.carbon.utils;version="4.6", + org.wso2.carbon.utils.multitenancy;version="4.6" - jsr311-api;scope=compile|runtime;inline=false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java index a6b98ad438e..d1312714c15 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java @@ -44,9 +44,6 @@ import java.util.Iterator; import java.util.List; import java.util.Set; -//import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.*; -//import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient; - /** * This class represents the concrete implementation of the APIPublisherService that corresponds to providing all * API publishing related operations. @@ -54,8 +51,6 @@ import java.util.Set; public class APIPublisherServiceImpl implements APIPublisherService { private static final String UNLIMITED_TIER = "Unlimited"; private static final String API_PUBLISH_ENVIRONMENT = "Production and Sandbox"; - private static final String CONTENT_TYPE = "application/json"; - private static final String PUBLISHED_STATUS = "PUBLISHED"; private static final String CREATED_STATUS = "CREATED"; private static final String PUBLISH_ACTION = "Publish"; public static final APIManagerFactory API_MANAGER_FACTORY = APIManagerFactory.getInstance(); @@ -118,7 +113,6 @@ public class APIPublisherServiceImpl implements APIPublisherService { String context = config.getContext(); context = context.startsWith("/") ? context : ("/" + context); api.setContext(context + "/" + config.getVersion()); -// api.setContext(context); api.setStatus(CREATED_STATUS); api.setWsdlUrl(null); api.setResponseCache("Disabled"); @@ -172,8 +166,6 @@ public class APIPublisherServiceImpl implements APIPublisherService { api.setSubscriptionAvailability(APIConstants.SUBSCRIPTION_TO_CURRENT_TENANT); api.setVisibility(APIConstants.API_PRIVATE_VISIBILITY); } - // String endpointConfig = "{\"production_endpoints\":{\"url\":\"" + config.getEndpoint() + - // "\",\"config\":null},\"endpoint_type\":\"http\"}"; String endpointConfig = "{ \"endpoint_type\": \"http\", \"sandbox_endpoints\": { \"url\": \" " + config.getEndpoint() + "\" }, \"production_endpoints\": { \"url\": \" "+ config.getEndpoint()+"\" } }"; diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java index 9acc17232fe..afc5ec69985 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java @@ -18,7 +18,6 @@ */ package org.wso2.carbon.apimgt.webapp.publisher.internal; -//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.apimgt.webapp.publisher.APIConfig; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherService; import org.wso2.carbon.registry.core.service.RegistryService; @@ -37,8 +36,6 @@ public class APIPublisherDataHolder { private RegistryService registryService; private boolean isServerStarted; private Stack unpublishedApis = new Stack<>(); - // private IntegrationClientService integrationClientService; - private static APIPublisherDataHolder thisInstance = new APIPublisherDataHolder(); private APIPublisherDataHolder() { @@ -117,12 +114,4 @@ public class APIPublisherDataHolder { this.unpublishedApis = unpublishedApis; } - // public IntegrationClientService getIntegrationClientService() { - // return integrationClientService; - // } - - // public void setIntegrationClientService( - // IntegrationClientService integrationClientService) { - // this.integrationClientService = integrationClientService; - // } } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java index a714d97aa83..dbdd8748105 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java @@ -22,7 +22,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; -//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherService; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherServiceImpl; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherStartupHandler; @@ -45,7 +44,6 @@ import org.wso2.carbon.user.core.service.RealmService; * policy="dynamic" * bind="setRegistryService" * unbind="unsetRegistryService" - */ public class APIPublisherServiceComponent { @@ -116,14 +114,4 @@ public class APIPublisherServiceComponent { APIPublisherDataHolder.getInstance().setRegistryService(null); } - // protected void setIntegrationClientService(IntegrationClientService integrationClientService) { - // if (integrationClientService != null && log.isDebugEnabled()) { - // log.debug("integrationClientService initialized"); - // } - // APIPublisherDataHolder.getInstance().setIntegrationClientService(integrationClientService); - // } - // - // protected void unsetIntegrationClientService(IntegrationClientService integrationClientService) { - // APIPublisherDataHolder.getInstance().setIntegrationClientService(null); - // } } diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml index fca4d2100aa..eea40219af5 100644 --- a/components/apimgt-extensions/pom.xml +++ b/components/apimgt-extensions/pom.xml @@ -34,13 +34,10 @@ http://wso2.org - - org.wso2.carbon.apimgt.webapp.publisher org.wso2.carbon.apimgt.application.extension org.wso2.carbon.apimgt.application.extension.api org.wso2.carbon.apimgt.annotations - diff --git a/pom.xml b/pom.xml index bfa525b9df8..4f443c2add7 100644 --- a/pom.xml +++ b/pom.xml @@ -912,6 +912,16 @@ org.wso2.carbon.apimgt.keymgt ${carbon.api.mgt.version} + + org.wso2.carbon.apimgt + org.wso2.carbon.apimgt.api + ${carbon.api.mgt.version} + + + org.wso2.carbon.apimgt + org.wso2.carbon.apimgt.impl + ${carbon.api.mgt.version} +