Is the filtering working correctly in v1beta1?

23 views
Skip to first unread message

Juan David Gómez

unread,
Aug 13, 2019, 12:37:57 PM8/13/19
to Grafeas Developers

Hello Grafeas team!

I have been playing with the filtering capabilities of the API but not successfully. For example doing this call :  


Returns :

{
    "name": "projects/user1/occurrences/gdx5526",
    "resource": {
        "name": "",
        "uri": "www",
        "contentHash": null
    },
    "noteName": "projects/user1/notes/commonrfq",
    "kind": "DEPLOYMENT",
    "remediation": "",
    "createTime": "2019-08-13T14:20:46.399156301Z",
    "updateTime": null,
    "deployment": {
        "deployment": {
            "userEmail": "pe...@potato.com",
            "deployTime": "2019-08-13T15:01:23.045123456Z",
            "undeployTime": null,
            "config": "N/A",
            "address": "",
            "resourceUri": [],
            "platform": "CUSTOM"
        }
    }
}

Now if I try to get the occurrences for the note commonrfq

GET https://mygrafeas.com/v1beta1/projects/user1/notes/commonrfq/occurrences

Returns:

{
    "occurrences": [],
    "nextPageToken": "gAAAAABdUtslyKzswJF7Q1r_AE_gSeZUBCGMRelrp0yR9qX6QEKh8RcJjqIK3fr-Xux6m1uE4tQVN0YY1ujzz2CvWRQvSS0lgg=="
}


It becomes more interesting if I do:


Returns: 

{
    "occurrences": [
        {
            "name": "projects/user1/occurrences/spx5047",
            "resource": {
                "name": "",
                "uri": "Admin",
                "contentHash": null
            },
            "noteName": "projects/user1/notes/commonrfq",
            "kind": "NOTE_KIND_UNSPECIFIED",
            "remediation": "",
            "createTime": "2019-08-13T14:01:48.747150497Z",
            "updateTime": null,
            "deployment": {
                "deployment": {
                    "userEmail": "pe...@potato.com",
                    "deployTime": "2019-08-13T15:01:23.045123456Z",
                    "undeployTime": null,
                    "config": "N/A",
                    "address": "",
                    "resourceUri": [],
                    "platform": "CUSTOM"
                }
            }
        },
        {
            "name": "projects/user1/occurrences/gdx5526",
            "resource": {
                "name": "",
                "uri": "Admin",
                "contentHash": null
            },
            "noteName": "projects/user1/notes/commonrfq",
            "kind": "DEPLOYMENT",
            "remediation": "",
            "createTime": "2019-08-13T14:20:46.399156301Z",
            "updateTime": null,
            "deployment": {
                "deployment": {
                    "userEmail": "l...@onion.com",
                    "deployTime": "2019-08-13T15:01:23.045123456Z",
                    "undeployTime": null,
                    "config": "N/A",
                    "address": "",
                    "resourceUri": [],
                    "platform": "CUSTOM"
                }
            }
        }
    ],
    "nextPageToken": "gAAAAABdUttiTOw6Bwcc5WrAm-YrfsXU7wgDXrKI0BYImeUiIiqQkRqQ2YLDRnF722KGroQDAASEIzK1cCR0_dbTf2eKIjkKkQ=="
}

Which means I have occurrences for the specific note.

Also for example, not talking about the filters:


{
    "occurrences": [
        {
            "name": "projects/user1/occurrences/spx5047",
            "resource": {
                "name": "",
                "uri": "Admin",
                "contentHash": null
            },
            "noteName": "projects/user1/notes/commonrfq",
            "kind": "NOTE_KIND_UNSPECIFIED",
            "remediation": "",
            "createTime": "2019-08-13T14:01:48.747150497Z",
            "updateTime": null,
            "deployment": {
                "deployment": {
                    "userEmail": "pe...@potato.com",
                    "deployTime": "2019-08-13T15:01:23.045123456Z",
                    "undeployTime": null,
                    "config": "N/A",
                    "address": "",
                    "resourceUri": [],
                    "platform": "CUSTOM"
                }
            }
        },
        {
            "name": "projects/user1/occurrences/gdx5526",
            "resource": {
                "name": "",
                "uri": "Admin",
                "contentHash": null
            },
            "noteName": "projects/user1/notes/commonrfq",
            "kind": "DEPLOYMENT",
            "remediation": "",
            "createTime": "2019-08-13T14:20:46.399156301Z",
            "updateTime": null,
            "deployment": {
                "deployment": {
                    "userEmail": "l...@onion.com",
                    "deployTime": "2019-08-13T15:01:23.045123456Z",
                    "undeployTime": null,
                    "config": "N/A",
                    "address": "",
                    "resourceUri": [],
                    "platform": "CUSTOM"
                }
            }
        }
    ],
    "nextPageToken": "gAAAAABdUttiTOw6Bwcc5WrAm-YrfsXU7wgDXrKI0BYImeUiIiqQkRqQ2YLDRnF722KGroQDAASEIzK1cCR0_dbTf2eKIjkKkQ=="
}

So in this case is not applying the filter. Some one has a similar issue? Any suggestion about what I'm doing wrong with the API calls? 

I really appreciate your help and feedback. Thanks!





Colin Rice

unread,
Aug 19, 2019, 9:34:27 AM8/19/19
to Juan David Gómez, Grafeas Developers
AFAIK - we there isn't intended support for you to list occurrences via the note path - /notes/NOTEID/occurrences shouldn't be a valid path. I think we have a bug in the routing logic that I'll take a look at. I think the idea is to find an occurrence for a note you would call ListOccurrences with a filter specifying the note (although I don't know if we have implemented this yet).

--
You received this message because you are subscribed to the Google Groups "Grafeas Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grafeas-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grafeas-dev/0ce0b5aa-4a89-4bc0-ab8f-bbca9200dbcd%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages