banty01

Node.JS Command Line Utility for Live API Creator

Blog Post created by banty01 Employee on Dec 18, 2015

A Node.js command-line tool to access CA Live API Creator REST API and Logic services. Refer to online documentation of creating and using  REST API

Locate the source from here.

  1. Make sure node.js is installed
  2. Install using npm by running the following:

$ npm install -g liveapicreator-cli

 

$ liveapicreator --help

 

  Usage: liveapicreator \[options] [command]

 

  Commands:

 

    login [options]               Login to an API server

    logout [options]              Logout from the current server, or a specific server

    use <alias>                   Use the specified server by default

    status                        Show the current server, and any defined server aliases

    get <resource> [options]      Retrieve some data for the given resource/table/view

    post <resource> [options]     Insert some data

    put <resource> [options]      Update some data

    delete <resource> [options]   Delete some data

    describe <resource> [options] Describe the specified resource, can be: tables[/tablename], views[/viewname], procedures, resources, license, serverinfo

 

  Options:

 

    -h, --help     output usage information

    -V, --version  output the version number

 

$ liveapicreator login http://localhost:8080/rest/default/demo/v1 -u username -p mypassword

Logging in...

This server licensed to: Live API Creator

Login successful, API key will expire on: 2015-11-18T15:03:37.342Z

 

$ liveapicreator get employee

 

demo:employee/1 employee_id:1 login:sam name:Sam Yosemite

demo:employee/2 employee_id:2 login:mlittlelamb name:Mary Little-Lamb

demo:employee/3 employee_id:3 login:sconnor name:Sarah Connor

demo:employee/4 employee_id:4 login:jkim name:John Kim

demo:employee/5 employee_id:5 login:bmcmanus name:Becky McManus

etc...

Outcomes