When searching using Google's data catalog, a scope
parameter is required and one of its fields is includeProjectIds
. According to the documentation, this parameter represents:
The list of project IDs to search within.
However, the results returned are not limited to that projectid. Am I understanding the parameter incorrectly? I can limit the results using projectid=myproject
in the query, but I am trying to understand the includeProjectIds
field.
Example request body:
{
"scope": {
"includeProjectIds": [
"MY-PROJECT"
]
},
"query": "type=dataset"
}
Example response:
{
"results": [
# I expect this result:
{
"searchResultType": "ENTRY",
"searchResultSubtype": "entry.dataset",
"relativeResourceName": "projects/MY-PROJECT/locations/us/entryGroups/@bigquery/entries/....",
"linkedResource": "//bigquery.googleapis.com/projects/MY-PROJECT/datasets/dataset_name",
"modifyTime": "2000-01-01T00:00:00Z",
"integratedSystem": "BIGQUERY",
"description": "My description"
},
# But I don't expect this:
{
"searchResultType": "ENTRY",
"searchResultSubtype": "entry.dataset",
"relativeResourceName": "projects/NOT-MY-PROJECT/locations/us/entryGroups/@bigquery/entries/....",
"linkedResource": "//bigquery.googleapis.com/projects/NOT-MY-PROJECT/datasets/dataset_name",
"modifyTime": "2000-01-01T00:00:00Z",
"integratedSystem": "BIGQUERY",
"description": "My description"
},
...
]
}
You may try using curl method instead because it uses the service account key of your service account. For service account and keys creation you can refer to this documentation. I tried this and the output was correct having only my project datasets displayed in the results.
Command:
Inside request.json:
Output: