API commands
Figure: API commands
Guardium Data Protection: Getting Started 81
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Figure: GuardAPI and REST API commands
What is GuardAPI (grdapi)? GuardAPI commands provide access to Guardium functions from the command line
or from scripted files.
While you can accomplish many tasks by using the GUI, for a large installation, a scripting method can save time.
The CLI scripting function not only saves time, but it is also easy to create scripts for it. The functions are exposed
through the SSH CLI and in GUI reports:
• The GUI uses GuardAPI internally.
• You can run GuardAPI on the CLI, like other CLI commands.
GuardAPI can help you automate repetitive tasks, which is especially valuable in larger implementations. Calling
these GuardAPI functions enables a user to quickly perform operations such as creating datasources,
maintaining user hierarchies, or maintaining Guardium features such as S-TAP.
• GuardAPI helps you speed up repetitive tasks and automate them by using a script.
• Many GuardAPI commands also have REST API equivalents (resource specified on the URL: GET, PUT,
POST, DELETE), which serve as a wrapper for the set of Guardium API (GuardAPI) command line
interface functions anywhere that a REST API is useful.
Note: REST API commands are described along with the GuardAPI commands. Use the Guardium API A- Z
Reference ([Link] to find
information about individual GuardAPI and REST API commands).
Guardium Data Protection: Getting Started 82
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Figure: GuardAPI functions
GuardAPI covers the following functions:
• CAS
• Catalog Entry
• Datasource
• Datasource reference
• Group
• Role
• S-TAP
• Process control
Note: Before you can call any GuardAPI commands, you must log in to the CLI with one of the default CLI
accounts (guardcli1, guardcli2...guardcli9), and then run the set guiuser CLI command. This
authentication is required to prevent users with limited roles in the GUI from gaining unauthorized access to
GuardAPI commands. For more information about the GuardAPI commands, see Using GuardAPI
commands ([Link]
Guardium Data Protection: Getting Started 83
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Figure: GuardAPI simple example
The slide shows an example of using grdapi, which gets a list of running S-TAPs that are connected to the
collector.
The grdapi list_staps command shows the list of all S-TAPs that are connected to the collector. You can
check the same result in the Guardium user interface.
Guardium Data Protection: Getting Started 84
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.