-
Notifications
You must be signed in to change notification settings - Fork 781
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '1.9.x' of https://github.com/wso2/product-apim into 1.9.x
- Loading branch information
Showing
111 changed files
with
14,056 additions
and
694 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
API Import Export | ||
================= | ||
|
||
This tool is used to import and export APIs from WSO2 API Manager. | ||
|
||
Main functionality of API Export is to retrieve all the required meta information and registry | ||
resources for the requested API and generate a zipped archive. | ||
|
||
Zipped archive consists of the following structure | ||
|
||
<APIName>-<version> | ||
|_ Meta Information | ||
|_ api.json | ||
|_ swagger.json | ||
|_ Documents | ||
|_ docs.json | ||
|_ documents with type 'file' | ||
|_ Image | ||
|_ icon.<extension> | ||
|_ WSDL | ||
|_ <ApiName>-<version>.wsdl | ||
|_ Sequences | ||
|_ In Sequence | ||
|_<Sequence Name>.xml | ||
|_ Out Sequence | ||
|_<Sequence Name>.xml | ||
|_ Fault Sequence | ||
|_<Sequence Name>.xml | ||
|
||
API Import accepts the exported zipped archive and creates an API in the imported environment. | ||
|
||
This feature has been implemented as a RESTful API. | ||
|
||
RESTful API is protected with basic authentication. | ||
|
||
Usage | ||
----- | ||
|
||
|
||
A WAR(Web Archive) can be generated by building this source. | ||
|
||
### API Import Export among cross tenants | ||
|
||
|
||
Place the api-import-export.war under repository -> deployment -> server -> webapps in WSO2 APi Manager 1.9.0 . | ||
|
||
### API Import Export for a single tenant | ||
|
||
|
||
Log in to API Management console for the required tenant domain and deploy the WAR file. | ||
|
||
* Once the web archive is deployed, API Import and Export can be done via invoking RESTful apis. | ||
|
||
Samples | ||
------- | ||
|
||
### Sample cURL command for API export with super tenant | ||
|
||
|
||
curl -H "Authorization:Basic YWRtaW46YWRtaW4=" -X GET "https://10.100.7.39:9443/api-import-export/export-api?name=test&version=1.0.0&provider=admin" -k > exportedApi.zip | ||
|
||
### Sample cURL command for API export with a tenant | ||
|
||
curl -H "Authorization:Basic YWRtaW46YWRtaW4taWSt34=" -X GET "https://10.100.7.39:9443/api-import-export/export-api?name=test&version=1.0.0&provider=admin@tenantdomain.com" -k > exportedApi.zip | ||
|
||
|
||
### Sample cURL command for API import | ||
|
||
curl -H "Authorization:Basic YWRtaW46YWRtaW4=" -F file=@"full/path/to/the/zip/file" -k -X POST "https://10.100.7.40:9443/api-import-export/import-api" | ||
|
||
The above command will keep the original provider of the API. | ||
|
||
curl -H "Authorization:Basic YWRtaW46YWRtaW4=" -F file=@"full/path/to/the/zip/file" -k -X POST "https://10.100.7.40:9443/api-import-export/import-api?preserveProvider=false" | ||
|
||
If there is a need to change the provider as the current logged in user, please use the above format. | ||
|
||
Important Note : | ||
When importing APIs across different tenants (Eg - API has been exported in super tenant and imported to another tenant domain), | ||
value of the "preserveProvider" query parameter must always set to "false". | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ /* | ||
~ * Copyright (c) 2015, 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. | ||
~ */ | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.wso2.carbon.apimgt</groupId> | ||
<artifactId>api-import-export</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<description>JAX-RS API Import Export</description> | ||
<packaging>war</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>1.5</source> | ||
<target>1.5</target> | ||
</configuration> | ||
<version>2.3.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>2.2</version> | ||
<configuration> | ||
<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes> | ||
<warName>${project.artifactId}</warName> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-eclipse-plugin</artifactId> | ||
<version>2.9</version> | ||
<configuration> | ||
<buildcommands> | ||
<buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand> | ||
</buildcommands> | ||
<projectnatures> | ||
<projectnature>org.wso2.developerstudio.eclipse.jaxrs.project.nature</projectnature> | ||
<projectnature>org.eclipse.jdt.core.javanature</projectnature> | ||
</projectnatures> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>deploy</id> | ||
<build> | ||
<defaultGoal>compile</defaultGoal> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-antrun-plugin</artifactId> | ||
<version>1.7</version> | ||
<executions> | ||
<execution> | ||
<phase>compile</phase> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
<configuration> | ||
<tasks> | ||
<copy todir="${basedir}/../../../repository/deployment/server/webapps" overwrite="true"> | ||
<fileset dir="${basedir}/target"> | ||
<include name="${project.artifactId}.war"/> | ||
</fileset> | ||
</copy> | ||
</tasks> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
|
||
<profile> | ||
<id>client</id> | ||
<build> | ||
<defaultGoal>test</defaultGoal> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>1.2.1</version> | ||
<executions> | ||
<execution> | ||
<phase>test</phase> | ||
<goals> | ||
<goal>java</goal> | ||
</goals> | ||
<configuration> | ||
<mainClass>demo.jaxrs.client.Client</mainClass> | ||
<!--send the EPR as an argument--> | ||
<arguments> | ||
<argument>http://localhost:9763/services</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>commons-httpclient</groupId> | ||
<artifactId>commons-httpclient</artifactId> | ||
<version>3.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.cxf</groupId> | ||
<artifactId>cxf-rt-transports-http</artifactId> | ||
<version>2.6.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.cxf</groupId> | ||
<artifactId>cxf-rt-frontend-jaxrs</artifactId> | ||
<version>2.6.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.ws.rs</groupId> | ||
<artifactId>jsr311-api</artifactId> | ||
<version>1.1.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.wso2.carbon.apimgt</groupId> | ||
<artifactId>org.wso2.carbon.apimgt.impl</artifactId> | ||
<version>1.2.4-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.wso2.carbon.apimgt</groupId> | ||
<artifactId>org.wso2.carbon.apimgt.api</artifactId> | ||
<version>1.2.4-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.codehaus.jackson</groupId> | ||
<artifactId>jackson-mapper-asl</artifactId> | ||
<version>1.8.5</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.code.gson</groupId> | ||
<artifactId>gson</artifactId> | ||
<version>1.7.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.guava</groupId> | ||
<artifactId>guava</artifactId> | ||
<version>18.0</version> | ||
</dependency> | ||
</dependencies> | ||
<repositories> | ||
<repository> | ||
<id>codehaus</id> | ||
<url>http://repository.codehaus.org/org/codehaus</url> | ||
</repository> | ||
<repository> | ||
<id>wso2-nexus</id> | ||
<name>WSO2 internal Repository</name> | ||
<url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
<updatePolicy>daily</updatePolicy> | ||
<checksumPolicy>warn</checksumPolicy> | ||
</releases> | ||
</repository> | ||
<repository> | ||
<id>wso2.releases</id> | ||
<name>WSO2 internal Repository</name> | ||
<url>http://maven.wso2.org/nexus/content/repositories/releases/</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
<updatePolicy>daily</updatePolicy> | ||
<checksumPolicy>ignore</checksumPolicy> | ||
</releases> | ||
</repository> | ||
</repositories> | ||
</project> |
Oops, something went wrong.