Search GCP Connector 3.0

POST /qps/rest/3.0/search/am/gcpassetdataconnector

We will now deprecate the API endpoint to return a list of GCP connectors that match the provided criteria from the CloudView application and introduce an alternative in the Asset Management application.

Limit your results- Narrow down your search results using the parameters listed below.

Pagination - A maximum of 100 instances are returned by default. To customize this

specify a "preferences" tag in the POST body of your request.

Input ParametersInput Parameters

Parameter

Mandatory

/Optional

Data Type

Description

id

   

The ID of the connector that you want to search.

name

   

Name is the name for the connector you want to search.

description

   

Description of the connector you want to search.

lastSync

   

Last sync date of the connector.

Type

   

Type of connector - GCP.

authRecord.projectId 

  text

Unique identifier of project in Google cloud.

Sample: Search GCP Connector by project IDSample: Search GCP Connector by project ID

API request

curl -u "USERNAME:PASSWORD" -H "Content-type: text/xml" -X "POST" --
data-binary @-
"<qualys_base_url>/qps/rest/3.0/search/am/gcpassetdataconnector/1xxxxx"      
    

Request POST data (XML)

 <?xml version="1.0" encoding="UTF-8" ?>
<ServiceRequest>
    <filters>
        <Criteria>
            <field>id</field>
            <operator>EQUALS</operator>
            <value>xxxxx</value>
        </Criteria>
        <Criteria>
            <field>name</field>
            <operator>EQUALS</operator>
            <value>GCP connector API Updated</value>
        </Criteria>
        <Criteria>
            <field>description</field>
            <operator>EQUALS</operator>
            <value>Connector Created from API</value>
        </Criteria>
        <Criteria>
            <field>lastSync</field>
            <operator>EQUALS</operator>
            <value>2022-05-09T16:21:57Z</value>
        </Criteria>
        <Criteria>
            <field>type</field>
            <operator>EQUALS</operator>
            <value>GCP</value>
        </Criteria>
        <Criteria>
            <field>authRecord.projectId</field>
            <operator>EQUALS</operator>
            <value>my-project-xxxxxxxxx</value>
        </Criteria>
        <Criteria>
            <field>connectorState</field>
            <operator>EQUALS</operator>
            <value>FINISHED_SUCCESS</value>
        </Criteria>
        <Criteria>
            <field>appCapability.name</field>
            <operator>EQUALS</operator>
            <value>CSA</value>
        </Criteria>
        <Criteria>
            <field>appCapability.tag.name</field>
            <operator>EQUALS</operator>
            <value>QATag</value>
        </Criteria>
        <Criteria>
            <field>disabled</field>
            <operator>EQUALS</operator>
            <value>false</value>
        </Criteria>
    </filters>
</ServiceRequest>     
    

Response (XML)

 <?xml version="1.0" encoding="UTF-8" ?>
<ServiceResponse>
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <GcpAssetDataConnector>
            <nextSync>2022-06-30T16:38:21Z</nextSync>
            <connectorAppInfos>
                <list>
                    <ConnectorAppInfoQList>
                        <list>
                            <ConnectorAppInfo>
                                <name>CSA</name>
                                <identifier>my-project-1513669048551</identifier>
                            </ConnectorAppInfo>
                        </list>
                    </ConnectorAppInfoQList>
                </list>
                <list>
                    <ConnectorAppInfoQList>
                        <list>
                            <ConnectorAppInfo>
                                <name>CI</name>
                                <identifier>my-project-1513669048551</identifier>
                            </ConnectorAppInfo>
                        </list>
                    </ConnectorAppInfoQList>
                </list>
            </connectorAppInfos>
            <disabled>false</disabled>
            <id>842873</id>
            <connectorState>FINISHED_SUCCESS</connectorState>
            <name>Test GCP connector API UPDATED</name>
            <isRemediationEnabled>true</isRemediationEnabled>
            <authRecord>
                <projectId>my-project-1513669048551</projectId>
            </authRecord>
            <lastSync>2022-06-30T16:11:28Z</lastSync>
            <runFrequency>240</runFrequency>
            <cloudviewUuid>a8014b65-2007-3ad0-adab-9db19bd5fdb9</cloudviewUuid>
            <isDeleted>false</isDeleted>
            <isGovCloudConfigured>false</isGovCloudConfigured>
            <description>testing</description>
        </GcpAssetDataConnector>
    </data>
    <hasMoreRecords>false</hasMoreRecords>
</ServiceResponse>     
    

API Request (JSON)

"curl -u""USERNAME:PASSWORD""-X""POST""--data-binary @-""<qualys_base_url>/qps/rest/3.0/search/am/gcpassetdataconnector/1xxxxx""--header""Accept: application/json""--header""Content-Type: application/json"      
    

Request POST Data (JSON)

{
   "ServiceRequest":{
      "filters":{
         "Criteria":[
            {
               "field":"id",
               "operator":"EQUALS",
               "value":"842873"
            },
            {
               "field":"name",
               "operator":"EQUALS",
               "value":"GCP connector API Updated"
            },
            {
               "field":"description",
               "operator":"EQUALS",
               "value":"Connector Created from API"
            },
            {
               "field":"lastSync",
               "operator":"EQUALS",
               "value":"2022-05-09T16:21:57Z"
            },
            {
               "field":"type",
               "operator":"EQUALS",
               "value":"GCP"
            },
            {
               "field":"authRecord.projectId",
               "operator":"EQUALS",
               "value":"my-project-1513669048551"
            },
            {
               "field":"connectorState",
               "operator":"EQUALS",
               "value":"FINISHED_SUCCESS"
            },
            {
               "field":"appCapability.name",
               "operator":"EQUALS",
               "value":"CSA"
            },
            {
               "field":"appCapability.tag.name",
               "operator":"EQUALS",
               "value":"QATag"
            },
            {
               "field":"disabled",
               "operator":"EQUALS",
               "value":"false"
            }
         ]
      }
   }
}      
    

Response (JSON)

{
   "ServiceResponse":{
      "responseCode":"SUCCESS",
      "count":1,
      "data":[
         {
            "GcpAssetDataConnector":{
               "nextSync":"2022-06-30T16:38:21Z",
               "connectorAppInfos":{
                  "list":[
                     {
                        "ConnectorAppInfoQList":{
                           "list":[
                              {
                                 "ConnectorAppInfo":{
                                    "name":"CSA",
                                    "identifier":"my-project-1513669048551"
                                 }
                              }
                           ]
                        }
                     },
                     {
                        "ConnectorAppInfoQList":{
                           "list":[
                              {
                                 "ConnectorAppInfo":{
                                    "name":"CI",
                                    "identifier":"my-project-1513669048551"
                                 }
                              }
                           ]
                        }
                     }
                  ]
               },
               "disabled":"false",
               "id":842873,
               "connectorState":"FINISHED_SUCCESS",
               "name":"Test GCP connector API UPDATED",
               "isRemediationEnabled":"true",
               "authRecord":{
                  "projectId":"my-project-1513669048551"
               },
               "lastSync":"2022-06-30T16:11:28Z",
               "runFrequency":240,
               "cloudviewUuid":"a8014b65-2007-3ad0-adab-9db19bd5fdb9",
               "isDeleted":"false",
               "isGovCloudConfigured":"false",
               "description":"testing"
            }
         }
      ],
      "hasMoreRecords":"false"
   }
}