VMware Support Community
BBletz
Contributor
Contributor

Skyline Public API - GraphQL query

Hi everyone,

I want to get vulnerabilities from the VMWare Skyline API.

My problem is that I am not able to return the parameters for each finding individually.

I use the "VMware Skyline Public
API Guide" to create a Python script that returned the vulnerabilities from this query:

curl -s -X POST 'https://skyline.vmware.com/public/api/data' \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"query":
"{
activeFindings(limit: 200)
{
findings {
findingId
accountId
findingDisplayName
severity
findingDescription
findingImpact
recommendations
kbLinkURLs
recommendationsVCF
kbLinkURLsVCF
categoryName

findingTypes

firstObserved
totalAffectedObjectsCount
}
totalRecords
timeTaken
}
}"
}' | jq .

It worked fine and returned the results as expected. Now I tried this query:

curl -s -X POST 'https://skyline.vmware.com/public/api/data' \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '
{"query":
"{
activeFindings(
filter: {

findingId: "Horizon-enableDMA-KB#2144475",
product: "brm-prod-vc.brmstorage.com",
}
limit: 200) {
findings {
findingId
accountId
products
findingDisplayName
severity
findingDescription
findingImpact
recommendations
kbLinkURLs
recommendationsVCF
kbLinkURLsVCF
categoryName
findingTypes
firstObserved
totalAffectedObjectsCount
affectedObjects(start: 0, limit: 200) {
sourceName
objectName
objectType
version
buildNumber
solutionTags {
type
version
}
firstObserved
}
}
totalRecords
timeTaken
}
}"
}' | jq .

and it failed. I also tried the online GraphiQL environment, but the query failed there as well. This is the error message: "No data was found for the given filter combination(s). Please change the filter criteria and try a new query." I tried different filters but I do not really know where to find the right one or if that is even the problem.

Thank you for reading this, I am looking forward to your thoughts on the subject!

0 Kudos
1 Reply
mkakeeh
Contributor
Contributor

You want to use a filter for your Skyline API query to find specific results. However, you see an error message because the filter criteria do not match any data. You can try these steps to fix the problem:

- Verify the filter parameters: Check that the findingId and product values in your filter are correct and match your data.

- Look for hidden findings: The Skyline Advisor UI lets you hide some findings. If you do that, the API query will not include them1. Make sure the findings you want are not hidden.

- Use the GraphiQL interface: The GraphiQL interface is a tool for testing your queries2. You can find it on the Skyline Advisor Pro dashboard2.

- Contact VMware Support: If none of these steps work, you should contact VMware Support. They can assist you with more troubleshooting3.

0 Kudos