/v2/entries:tail always returns "INVALID_ARGUMENT"

93 Views Asked by At

I am trying to use this API endpoint here: https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/tail

But it does not seem to work as documented:

curl -s \
    -H 'authorization: Bearer x' \
    -H 'accept: application/json' \
    -H 'content-type: application/json' \
    --data-binary '{"resourceNames":["projects/del-test-x"]}' \
    --compressed 'https://logging.googleapis.com/v2/entries:tail'
[{
  "error": {
    "code": 400,
    "message": "Invalid value (Object), ",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "description": "Invalid value (Object), "
          }
        ]
      }
    ]
  }
}
]

Is there an issue with the API?

1

There are 1 best solutions below

1
On

Im not sure but try it like this let me know if it works or not.

curl --request POST \
  'https://logging.googleapis.com/v2/entries:tail' \
  --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"resourceNames":["projects/del-test-x"]}' \
  --compressed

its just the --data-binary vs --data that i think is off.