Reputation: 16831
I am trying to manually write a log entry using Google Cloud Logging API.
Before doing this via code, I am first trying to do it using the Google APIs Explorer. Here is a screen shot of the request I've built using this tool:
projectsId
I have the Google Project Id that I've copied from the
Google Developer Console.metadata.projectId
. metadata.userId
I have the Client Id of the same Service account that I'm using to authenticate (OAuth2) against the Google Logging API. When I execute this request, I get the following response:
{
"error":
{
"code": 400,
"message": "Unsupported service specified",
"status": "INVALID_ARGUMENT"
}
}
Why? and how can I fix this?
Upvotes: 1
Views: 755
Reputation: 16831
The error message was actually telling me exactly which argument was invalid - The serviceName
I supplied was bogus ("test").
As soon as I set the serviceName to be "compute.googleapis.com", the problem went away and I received a 200 status code indicating success.
Upvotes: 1