0.2.1 • Published 4 years ago

serverless-wso2-apim2 v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

serverless-wso2-apim

License: MIT

Serverless Framework plugin to manage APIs in WSO2 API Manager.

img

Compatible with

Features

  • Create or Update your API definitions (including backend certificates) seamlessly with one command - sls deploy.
  • Manage your API definitions via sls info and sls remove.
  • Automatically uploads backend certificates (including CAs) to enable HTTP/S based connectivity with backends.
  • Backend certificates can be supplied using file:// (relative to where serverless.yml file is located) or arn: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
    or
    npm 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
    Run sls 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

License

MIT

0.2.10

4 years ago

0.2.9

4 years ago

0.2.8

4 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.1

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.0

4 years ago