list_aliases
Use the list_aliases command to show some or all of the current aliases for a specified object.
Use list_aliases to show any aliases that meet the specified criteria.
Note: Some special rules apply to the syntax for the API parameters:
- The groupTypeDescLike parameter always evaluates as
Like. For example, if you pass in the value
IP
, the API evaluates the value as %IP%. - The ampersand (&) character is required between each parameter and must have an escape,
Enter it as
&&
. - For the values of dbValueLike and aliasValueLike, use
the Like operator (%) to return partial matches. However,
%
is a special character that is passed as%25
(25 is the ASCII representation of %).
Therefore, the parameters in a curl command must appear as shown in the following
example:
...aliasListing/?groupTypeDescLike=IP&&dbValueLike=%25&&aliasValueLike=%25
This API is available in Guardium V11.0 and later.
REST API syntax
This API is available as a REST service with the
GET
method. Call this API as
follows:GET https://[Guardium hostname or IP address]:8443/restAPI/alias
GuardAPI syntax
list_aliases parameter=value
Parameters
Parameter | Value type | Description |
---|---|---|
aliasValueLike | String | All or part of an alias name. |
dbValueLike | String | All or part of a database name. |
groupTypeDescLike | String | Required. All or part of the Group Type description (such as ClientIP or Service Name) for an alias. |
Examples
The following example returns all of the aliases from IP objects (such as client or server IP) where the alias ends with the number one.
test.usma.ibm.com> grdapi list_aliases groupTypeDescLike="IP" aliasValueLike="%1" dbValueLike="%"
This command provides the following
output:
ID=0 ERR=0 Group Type: Client IP DB Value: 1.2.3.4 Alias Value: A1 Group Type: Client IP DB Value: 2.3.3.6 Alias Value: B1 Group Type: Server IP DB Value: 5.6.7.8 Alias Value: C1 ok
The following example returns all of the aliases from IP objects (such as client or server IP)
where the alias contains the letter "C".
[tester@oc3843647344 ~]$ curl \
-k --header "Authorization:Bearer 395fea0f-4cbf-487d-90ef-d2241c5843c6" \
-i -H "Content-Type:application/json"
-X GET "https://test.usma.ibm.com:8443/restAPI/aliasListing/?groupTypeDescLike=IP \
&&aliasValueLike=%25%C%25"
This command provides the following JSON output:
HTTP/1.1 200 OK X-FRAME-OPTIONS: SAMEORIGIN X-Permitted-Cross-Domain-Policies: none X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block . . . Date: Fri, 18 Jan 2019 20:02:59 GMT Server: SQL Guard [ , { "groupType": "Server IP", "DbValue": "5.6.7.8", "AliasValue": "C1" } , { "groupType": "Server IP", "DbValue": "5.6.7.7", "AliasValue": "C2" } , { "groupType": "Server IP", "DbValue": "5.6.7.6", "AliasValue": "C3" } ]