Search Asset Group
Use this API to retrieve the list of asset groups (https://help.symantec.com/cs/CCS12.0/CCS12_0/v123248409_v120691527/Asset-groups?locale=EN_US) in the
Control Compliance Suite
12.5 asset system.Authentication
To grant access to users to view or execute
Control Compliance Suite
RESTful APIs, you must generate an authentication token.Authorization requirements
You must have permissions to execute the following https://help.symantec.com/cs/ccs12.0/CCS12_0/v123262255_v120691527/About-tasks?locale=EN_US to use the Search Asset Group API:
- View Assets
To use the Search Asset Group API, you must have https://help.symantec.com/cs/CCS12.0/CCS12_0/v122981946_v120691527/Configuring-roles-and-permissions?locale=EN_US to access sub-folders in the Asset System folder. You may not require permissions on the entire asset system.
Request method
To retrieve the list of asset groups in your
Control Compliance Suite
environment, create a GET
request. HTTPS request components for Search Asset Group API
Create a GET request by using the following components:
Request component | Value |
|---|---|
URL |
You can also use the Fully Qualified Domain Name (FQDN) as the hostname. You can configure the port number from the Integration Services Endpoint Configuration dialog box from Settings > Deployment View on the Control Compliance Suite console. You must restart the Symantec Application Server Service after you configure the port. If you do not configure the port, the default port is considered in the request. The default port is 12431. |
Content type | application/json |
HTTPS request parameters for Search Asset Group API
The following table contains the description of the HTTPS request parameters for the Search Asset Group API:
Field name | Filed type | Data type | Description |
|---|---|---|---|
Attributes | Mandatory | String | This is a comma-separated list of asset attributes and their respective values joined by an operator. The ‘OP’ placeholder in the HTTPS request components for Search Asset Group API section indicates a query operator, which can be any of the following:
All these query operators are case-sensitive. Comma used in the list of attributes is treated as 'AND.' Wildcard character asterisk (*) is supported in values to be specified. The Search Asset Group API returns a list of asset groups along with their total count.The following are some attributes that are commonly used in an HTTPS request for the Search Asset Group API:
|
Container path | Optional | String | This is the folder in which the search operation is executed. The default value of this parameter is Asset System, which is the default root folder in the Control Compliance Suite asset hierarchy. |
SearchSubtree | Optional | Boolean | By using this parameter, you can decide whether to search for the asset groups in the sub-folders recursively. The default value of this parameter is ‘True.’ |
Response body for Search Asset Group API
The GET request for the Search Asset Group API returns the response body in the following structure:
{ "TotalCount": {Int}, "AssetGroupType": {String}, "AssetGroup": [ { "DisplayName": {String}, "ID": {String}, } ] }
Sample HTTPS request for Search Asset Group API
The following is a sample HTTPS request for your reference. We have used display name of an asset group as an attribute in the sample:
Request component | Value |
|---|---|
URL |
|
Content type | application/json |
Sample HTTPS response for Search Asset Group API
The sample HTTPS request that you created earlier returns the following response:
{"TotalCount":1, "AssetGroupType":"symc-csm-AssetSystem-AssetGroup", "AssetGroups":[{"DisplayName":"All Windows Machines", "Id":"8265ee65-8614-429b-bfc4-0da8224df09c"}]}
HTTPS response codes for Search Asset Group API
Depending on the success or the failure of your API request, you see the following response codes for the Search Asset Group API:
Response Code | Response Type | Description |
|---|---|---|
200 | OK | The list of asset groups with their total and asset group type is available. Asset group details include display names of asset groups and their IDs. |
200 (with Total Count: 0 in response body)
| OK | The request is completed successfully. However, there are no records matching the request parameters. In this case, the following response is returned. The total count of asset groups in this case is zero:
|
403 | Forbidden | The following error message is displayed: You are not authorized to perform this task. Access is denied. |
401 | Unauthorized | This may be because of an invalid or expired access token in an API request. |
400 | Bad Request (Client Error) | One of the following error messages is displayed:
|
500 | Internal Server Error (Server Error) | The following error message is displayed:
|
Sample Python script for Search Asset Group API
Refer to the sample python script, which is available at the following GitHub location: