serverless-wso2-apim-integartion
v0.2.0
Published
Serverless Framework plugin for WSO2 API Manager
Downloads
3
Maintainers
Readme
serverless-wso2-apim
Serverless Framework plugin to manage APIs in WSO2 API Manager.
Compatible with
- serverlessˆ1.75
- WSO2 API Manager 2.6.0
Features
- Create or Update your API definitions (including backend certificates) seamlessly with one command -
sls deploy
. - Manage your API definitions via
sls info
andsls remove
. - Automatically uploads backend certificates (including CAs) to enable HTTP/S based connectivity with backends.
- Backend certificates can be supplied using
file://
(relative to whereserverless.yml
file is located) orarn:aws:acm:..
(AWS ACM Certificate ARN). - Automatically publish / re-publish APIs to WSO2 API Store on every deploy.
Install Plugin
Discover it on npmjs.com @ here
yarn add -D serverless-wso2-apim
ornpm install --save serverless-wso2-apim
Then in
serverless.yml
add following entry to the plugins array:plugins: - serverless-wso2-apim
Using the Plugin
Make sure you have a Serverless project set up as described here.
Add configuration options to your Serverless configuration, as below.
custom: wso2apim: enabled: true host: 'wso2-apimanager.com' # WSO2 API Manager Host port: 443 # WSO2 API Manager Port versionSlug: 'v0.14' # WSO2 API Manager's Management API version user: 'user@tenant' # Username, with tenant symbol pass: 'pass' # Password gatewayEnv: 'Production' # Target Gateway Environment
Add one or more API definitions to your Serverless configuration, as below.
custom: wso2apim: enabled: true apidefs: - myAwesomeAPI: # Identifier of your API definition name: 'MyAwesomeAPI' # (CANNOT BE UPDATED LATER) Name of API that shows up in WSO2 API Console version: 'v1' # (CANNOT BE UPDATED LATER) Version, which also forms a part of the API URL ultimately rootContext: '/myawesomeapi' # (CANNOT BE UPDATED LATER) Runtime context of API which will be exposed by WSO2 API Gateway. Must be unique across the Gateway Environment. description: 'My Awesome API' visibility: 'PUBLIC' # Accessible from Public Internet, Visible to everyone backend: http: # HTTP-based Backends baseUrl: 'https://backend:port/123' # Backend RESTful base URL certChain: 'file://certs/backend.cer' # Optional, certificate chain in PEM (base64) format. # Alternatively, you can also supply AWS ACM Certificate ARN (e.g. arn:aws:acm:...) too. maxTps: 100 # Throttling, Transactions per second tags: - my-awesome-api - awesomeness swaggerSpec: # Swagger specification in YML, currently supports 2.0 swagger: '2.0' ... info: ... paths: ...
Run
sls deploy
to create-and-publish (or) update-and-republish API definitions (and associated backend certificates, if supplied) in WSO2 API Manager.Run
sls info
to view the status of API deployment on WSO2 API Manager.Run
sls remove
to delete API definitions (and associated backend certificates, if exists) when there are no active subscriptions exist on those APIs.** COMING SOON **
Runsls remove --force
(** USE WITH CAUTION **) to forcefully delete API definitions (and associated backend certificates) despite any active subscriptions that may exist. API definitions will be retired and deprecated before removing it completely from WSO2 API Manager.
Limitations and Backlog items
- Limited to creation of RESTful APIs using Swagger 2.0 on WSO2 API Manager.
- Limited to WSO2 API Manager 2.6.0 which uses v0.14 as management API version.
- For a full list of backlog items, refer to what's coming up?
Need Help?
- Join us on Slack here