--apiUrl=<string>
Using Intelligence Cloud CLI
The Intelligence Cloud CLI tool provides different functions, each with their own parameters.
Generic Parameters
All tools provided by the CLI support these generic parameters:
Parameter |
Description |
URL of the public API of your Intelligence Cloud instance. |
|
--apiKey=<string> |
Key for your Intelligence Cloud instance API. |
-v, --version |
Show the version of the CLI tool. |
-h, --help |
Show full help message and exit. |
Note
|
The API URL and key can also be set with environment variables, see Configuring the CLI. |
Retrieving Reports
-
Lists reports of a specified type, including their metadata, but no report content.
-
The output is printed to the screen by default.
-
You can save the output to a file by using redirection:
ic <options> > output.json
. -
If invalid parameters are provided or other error occure, the API error message is printed.
Usage
ic report <type> list \
[-u=<userId>] \
[-n=<name>] \
[-s=<state>] \
[--from=<from>] \
[--to=<to>]
Parameters
Parameter |
Description |
Example |
<type> |
Report type (required): |
|
-u, --userId=<userId> |
Filter by user ID. |
|
-n, --name=<name> |
Filter by full or partial report name. |
|
-s, --state=<state> |
Filter by report state. |
|
-f, --from=<from> |
Filter by request time start in absolute ( |
|
-t, --to=<to> |
Filter by request time end in absolute ( |
|
Example
// Input
ic report codeInventory list \
--userId test@azul.com \
--name "my report" \
--state SUCCEEDED \
--from 7d \
--to 0d
// Output
[
{
"reportName": "Report name",
"reportId": "1cc40ee6-87a7-4147-b02d-7d26ce0387d0",
"state": "SUCCEEDED",
"userId": "[email protected]",
"params": {
"filter": [
"sourceName CONTAINS 'myapp.jar'",
"className CONTAINS 'com/company/firstclass'",
"methodName CONTAINS 'mymethod'",
"AppEnv CONTAINS 'forwarder'"
],
"use": "USED",
"from": "3d",
"to": "3d",
"resolvedFrom": "2023-07-13T16:42:37.268",
"resolvedTo": "2023-07-13T16:42:37.268"
},
"stateMessages": null,
"requestTime": "2023-07-13T16:42:37.268",
"startTime": "2023-07-13T16:42:37.268",
"finishTime": "2023-07-13T16:42:47.231",
"data": null,
"totalCount": 35352,
"totalPages": 10,
"afterToken": "2"
}
]
Retrieve Report by ID
-
Retrieves a report by ID, including metadata and content.
-
Saves to
<reportType>-<reportId>.json
or the provided filename. -
Pagination is handled automatically.
-
The maximum output file size is 500MB (this is configurable via the settings file).
-
If the file size exceeds the maximum allowed value, the report download stops (only a partial report is downloaded) and an error code is returned with this message:
Report size exceeded maximum allowed file size, only 40% of report has been downloaded. Increase the maxOutputFileSize settings value to download the entire report.The generated file will be called
<reportType>-<reportId>-incomplete-40pct.json
. -
Only reports in a final state are retrievable.
-
If the report is in the processing state,
report <reportId> is processing
is returned unless--wait
is used. -
Use
--print
to output the result to console. If output file and print are used together, output is saved into a file and also printed to the console.
Parameters
Parameter |
Description |
Example |
<type> |
Report type (required): |
|
-i, --id=<id> |
Report ID (required). |
|
-o, --output=<string> |
Path to the output file. If the report exceeds the maximum allowed size, a partial file with |
|
-p, --print |
Output the report content to the console. If used together with an output file, the report will be both saved to the file and printed. |
|
-w, --wait |
If the report is in processing state, waits for its completion. |
Example
// Input
ic report codeInventory get --id 1cc40ee6-87a7-4147-b02d-7d26ce0387d0 --print
// Output
{
"reportName": "Report name",
"reportId": "1cc40ee6-87a7-4147-b02d-7d26ce0387d0",
"state": "PROCESSING",
"userId": "[email protected]",
"params": {
"filter": [
"sourceName CONTAINS 'myapp.jar'",
"className CONTAINS 'com/company/firstclass'",
"methodName CONTAINS 'mymethod'",
"AppEnv CONTAINS 'forwarder'"
],
"use": "USED",
"from": "3d",
"to": "3d",
"resolvedFrom": "2023-07-13T16:42:37.268",
"resolvedTo": "2023-07-13T16:42:37.268"
},
"stateMessages": [
"1st message",
"2nd message"
],
"requestTime": "2023-07-13T16:42:37.268",
"startTime": "2023-07-13T16:42:37.268",
"finishTime": "2023-07-13T16:42:47.231",
"data": [
{
"sourceName": "myapp.jar",
"className": "com/company/firstclass",
"methodName": "getHost(java/lang/String)",
"firstSeen": "2023-07-13T16:12:51.181",
"lastSeen": "2023-07-14T11:10:01.112",
"AppEnv": "abc",
"tags": [
"app:credit-service,",
"owner:finance-team"
],
"used": true
}
]
}
Generate Report
-
Schedules report generation and waits for its completion.
-
Polls every 30 seconds for up to 20 minutes (this is configurable via the settings file).
-
The output is identical to retrieving a report by ID. The only difference is if the report is processing, the tool will wait.
-
If saving to file, the CLI outputs only the report ID.
-
If report generation times out on the server or the polling timeouts, the message
report <reportId> state: TIME_OUT
is shown and no files are created. -
If report generation fails (e.g., invalid input), an API error message is displayed along with the report id.
Usage
ic report <type> generate \
[-dhpV] \
[--noWait] \
[--apiKey=<apiKey>] \
[--apiUrl=<apiUrl>] \
[-f=<from>] \
[--filter=<filter>] \
[--groupBy=<groupBy>] \
[-i=<inputFile>] \
[-n=<name>] \
[-o=<outputFile>] \
[--sortBy=<sortBy>] \
[-t=<to>] \
[-u=<use>] \
[-p]
Parameters
<type> |
Report type (required): |
|
-d, --details |
Include extra details (JVM reports only). |
|
-f, --from=<from> |
Start of time range in absolute ( |
|
-t, --to=<to> |
End of time range in absolute ( |
|
-n, --name=<name> |
Custom report name. |
|
--noWait |
Return immediately after scheduling; prints report ID only. |
|
--filter=<filter> |
Filter conditions separated by |
|
--sortBy=<fields> |
Sort fields separated by |
|
--groupBy=<fields> |
Grouping fields (JVM reports only). |
|
-p, --print |
Print the report to console instead of saving to file. |
|
-u, --use=<string> |
Usage filter (codeInventory only). Allows specifing |
-u |
-o, --output=<string> |
Output file path. |
|
-i, --input=<string> |
Input JSON file that specifies Report parameters based on our API documentation. Allows specifying |
|
Delete Report by ID
-
Deletes a report by ID if it exists.
-
Silent if the report doesn’t exist (no error).