Install and Use the Command Line Utilities for DevOps

Install and Use the Command Line Utilities for DevOps
lac42
You can install and use the 
CA Live API Creator
 DevOps utilities for DevOps scripting, such as deploying your APIs. The following command-line interfaces (CLIs) are available for download and installation:
  • The 
    CA Live API Creator
     CLI
    Use the 
    CA Live API Creator
     CLI for command-line access to your API and your data.
  • The 
    CA Live API Creator
     Admin CLI (Admin CLI)
    Use the Admin CLI for command-line access to your admin repository. You can manage your APIs, resources, and rules using this CLI.
In this article:
2
Install the Command Line Utilities
Create the
CA Live API Creator
 CLI and the Admin CLI as Windows command files or as Unix shell scripts.
Verify the Prerequisite
Ensure that you have downloaded the CLIs from GitHub. For more information about how to download the CLIs, see the liveapicreator-devops site on GitHub.
Install the CLIs
Copy the CLIs to the directory where you plan to create your DevOps scripts based on your operating system.
(Windows)
As Windows command files:
<liveapicreator-devops>/windows/lac.exe
<liveapicreator-devops>/windows/lacadmin.exe
(Mac/Linux)
As Unix shell scripts:
<liveapicreator-devops>/linux|macos/lac
<liveapicreator-devops>/linux|macos/lacadmin
The
lac
and
lacadmin
 CLIs are installed.
Use the 
CA Live API Creator
 Command Line Interface
Access the CLI as 
lac
 (or the alias 
liveapicreator
) commands. The following code snippet shows an example of how to log in to the 
lac
 CLI and use the AuthID for multiple commands:
#! /bin/bash
lac 
login
-u admin -p Password1 http://localhost:8080/rest/default/b2bderbynw/v1 -a b2b
# Post and read order to b2b Partner
lac 
post
PartnerOrder -j '{ "CustomerNumber": "VINET","Items": [ {"ProductNumber": 16, "Quantity": 1 },{"ProductNumber": 7,"Quantity": 2}, {"ProductNumber": 14, "Quantity": 3}, {"ProductNumber": 10, "Quantity": 4}, {"ProductNumber": 13, "Quantity": 5} ] }'
lac
get
nw:Orders -f 'equal(OrderID: 2000, AmountTotal: 301.20)' --format json
Use the
CA Live API Creator
 Admin Command Line Interface
Access the Admin CLI as 
lacadmin
 (or the alias 
liveapicreatoradmin
) commands. The following code snippet shows how to log in and how to import a file using the 
api import
 command in the Admin CLI command:
lacadmin 
login <url>
 -u <user name> - <password> [-a <alias>]
lacadmin 
api import
--file MyAPI.json  --namecollion rename_new
Other DevOps Sample Scripts
For sample DevOps scripts, see the
<liveapicreator-devops>/sample-scripts/basic-devops
directory.