GithubHelp home page GithubHelp logo

go-wso2am's Introduction

go-wso2am

Build Status Docker Build Status Docker Automated build

WSO2 API Manager product api client.

CLI

Install

Binary Releases

Download from release page and extract the archive.

Docker

$ docker run -t --rm uphy/wso2am-cli --help

Build latest binary

You can build the latest source by the following command.

$ go get -u github.com/uphy/go-wso2am/wso2am-cli

Usage

See command help.

$ wso2am-cli --help

Examples

List APIs:

$ WSO2_USERNAME=user1 WSO2_PASSWORD=user1 wso2am-cli api listID
Name                Version             Description                                                       Status90ad3d5b-e535-4cb7-abfe-608e28de16b6 PizzaShackAPI       1.0.0               This is a simple API for Pizza Shack online pizza delivery store. PUBLISHED

Inspect API:

$ WSO2_USERNAME=user1 WSO2_PASSWORD=user1 wso2am-cli api inspect 90ad3d5b-e535-4cb7-abfe-608e28de16b6
{
  "id": "90ad3d5b-e535-4cb7-abfe-608e28de16b6",
  "name": "PizzaShackAPI",
  "description": "This is a simple API for Pizza Shack online pizza delivery store.",
  "context": "/pizzashack",
  "version": "1.0.0",
  "provider": "admin",
  "status": "PUBLISHED",
  "thumbnailUri": "/apis/90ad3d5b-e535-4cb7-abfe-608e28de16b6/thumbnail",
...
}

Create and publish API:

$ WSO2_USERNAME=user1 WSO2_PASSWORD=user1 wso2am-cli api create \
    --name myapi \
    --context myapi \
    --version 1.0 \
    --definition ./swagger.json \
    --production-url http://localhost/ \
    --sandbox-url http://localhost/ \
    --gateway-env "Production and Sandbox" \
    --publish
f9b058f7-af45-4973-91c9-5de510b71f39

Update the published API(change the gateway environment):

$ WSO2_USERNAME=user1 WSO2_PASSWORD=user1 wso2am-cli api update \
    --gateway-env "Production" \
    f9b058f7-af45-4973-91c9-5de510b71f39

Update or create API:

$ WSO2_USERNAME=user1 WSO2_PASSWORD=user1 wso2am-cli api create \
    --name myapi \
    --context myapi \
    --version 1.0 \
    --definition ./swagger.json \
    --production-url http://localhost/ \
    --sandbox-url http://localhost/ \
    --gateway-env "Production and Sandbox" \
    --publish \
    --update

Update the swagger definition:

$ WSO2_USERNAME=user1 WSO2_PASSWORD=user1 wso2am-cli api update-swagger f9b058f7-af45-4973-91c9-5de510b71f39 ./swagger.json

Upload the thumbnail:

$ WSO2_USERNAME=user1 WSO2_PASSWORD=user1 wso2am-cli api upload-thumbnail f9b058f7-af45-4973-91c9-5de510b71f39 ./icon.jpeg

Download the thumbnail

$ WSO2_USERNAME=user1 WSO2_PASSWORD=user1 wso2am-cli api thumbnail f9b058f7-af45-4973-91c9-5de510b71f39 > icon.jpeg

Delete the API:

$ WSO2_USERNAME=user1 WSO2_PASSWORD=user1 wso2am-cli api delete f9b058f7-af45-4973-91c9-5de510b71f39

go-wso2am's People

Contributors

uphy avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.