I am trying to update my Google Compute Engine instance group using API explorer here: https://cloud.google.com/compute/docs/reference/latest/autoscalers/update?authuser=2
I want to update min and max num of replicas using this API. The body part has
{
"autoscalingPolicy": {
"minNumReplicas": 2,
"maxNumReplicas": 5,
"coolDownPeriodSec": 60,
"cpuUtilization": {
"utilizationTarget": 1.5
}
}
}
This gives error below:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "The resource 'projects/<my-proj-name>/zones/us-central1-a/autoscalers' was not found"
}
],
"code": 404,
"message": "The resource 'projects/<my-proj-name>/zones/us-central1-a/autoscalers' was not found"
}
}
I confirmed the autoscaler configuration for the managed instance group by clicking the tiny "Equivalent REST" link at bottom of instance group landing page.
Is there I am missing to get it working on API explorer?
Got this sorted by trying different parameters in body part.
Looks like "name" and "target" are mandatory fields to be provided under autoscaling policy. Without these, the api could not process the request and returns error.
working body formation for me:
{
"autoscalingPolicy": {
"coolDownPeriodSec": 60,
"maxNumReplicas": 2,
"minNumReplicas": 1
},
"name": "<my-autoscaler-name>",
"target": "https://www.googleapis.com/compute/v1/projects/<my-project-name>/zones/us-central1-a/instanceGroupManagers/<my-instancegroup-name>"
}
Note: that the target and name values are picked from the page that shows up by clicking the tiny "Equivalent REST" link at bottom of instance group landing page. As an observation, both strings are same for new instance groups in my case.
Related
Question: how to remove an application logo.
Solution: previous solution from this answer, https://stackoverflow.com/a/57168008/1992004, is no longer working.
Google changed the format of "iconUrl" to "icon", and uses now the Base64-encoded data stream, like "icon":"iVBORw0KGgoAAAAN..., instead of the image URL, previously written as "iconUrl":"https://...".
I've tried "icon":"" and many Base64-encoded values like "icon":"IA", "icon":"Lw", and some of other - no success. I get console messages like
for "icon":""
{
"error": {
"code": 400,
"message": "The request failed because one of the field of the resource is invalid.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.rpc.PreconditionFailure",
"violations": [
{
"type": "client_auth_config",
"subject": "?error_code=9&error_field_name=UpdateIconRequest.icon&error_field_value=%3CByteString#3eeee81e+size%3D0+contents%3D%22%22%3E"
}
]
}
]
}
}
or
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.identity.clientauthconfig.v1.ClientAuthConfigError",
"code": "ICON_STORAGE_FAILURE"
},
{
"#type": "type.googleapis.com/google.identity.clientauthconfig.v1.IconStorageError",
"reason": "INVALID_IMAGE"
}
]
}
}
or
{
"error": {
"code": 400,
"message": "Invalid value at 'icon' (TYPE_BYTES), Base64 decoding failed for \" \"",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "icon",
"description": "Invalid value at 'icon' (TYPE_BYTES), Base64 decoding failed for \" \""
}
]
}
]
}
}
Does somebody know, what should be inserted here to remove the logo image from the app?
Answer:
Unfortunately, there is no way for this to be done.
More Information:
Once an OAuth Application Logo has been uploaded there isn't a supported way of removing it - in the question that you linked the way that this was done is a bit hacky, inspecting the network requests and building a new request from the previous JSON object sent via the UI really shows this.
As the icon URL has changed to need a Base-64 encoded value this has been deprecated. Whether this was intentional by Google or not is hard to say, but now an empty value will always return INVALID_ARGUMENT. Any data in the value for icon will also just replace the image data and so this isn't a viable workaround, as as far as the validation process goes, image data exists and so will need to be verified.
If it's not too much of a arduous process, the only workaround here is to create a new GCP project with a new OAuth consent screen without uploading an image. Of course, you will need to reactivate all the relevant APIs and link the relevant scripts and projects to the new set-up.
Feature Request:
You can however let Google know that this is a feature that is important and that you would like to request they implement it. Google's Issue Tracker is a place for developers to report issues and make feature requests for their development services. I would suggest using the feature request template for G Suite Add-ons as this is a component for which GCP Projects could be used.
Update: The feature request for this is viewable here, to increase visibility on this, hit the ☆ at the top of the page.
Relevant Questions:
OAuth consent screen - ability to remove application logo [Obsolete]
May 2021 - It is still possible to completely delete the consent screen (and thus allowing to create it again). See my updated answer in https://stackoverflow.com/a/57168008/1992004
I'd like to retrieve all the resources (files and folder) via the Files: list
API call with the createdTime attribute included.
Standard response doesn't include the createdTime key described in the resource representation so I've added the fields query parameter with the value createdTime (there's an open issue related which says so but referring to API v2 while I'm using API v3).
API call I'm doing is the following:
https://www.googleapis.com/drive/v3/files?fields=createdTime
with proper authentication.
A 400 status code response is returned with the following body:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidParameter",
"message": "Invalid field selection createdTime",
"locationType": "parameter",
"location": "fields"
}
],
"code": 400,
"message": "Invalid field selection createdTime"
}
}
What's the correct way of using the fields query parameter?
If you want to see the full response you can do the following test here
https://www.googleapis.com/drive/v3/files?fields=*
If you just want the create date you can also do test here
https://www.googleapis.com/drive/v3/files?fields=files(createdTime)
You can read more about this in Partial response
I've got several links by google shortener and I am unable to access the analytics for one of them.
When I click on the first two analytics links it shows a 200 http status and the analytics show but with the last one there's a 500 error in my firefox console and the message Short URL goo.gl/6PL9Fx not found appears in a little message box.
Same thing with the Google URL Shortener api reference. Whenever I try this api it gives me this as a response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": "Backend Error"
}
],
"code": 500,
"message": "Backend Error"
}
}
These are my links:
goo.gl/SBGshX
goo.gl/ExkDyv
goo.gl/6PL9Fx
I actually have more links than just these and there's another broken one but I didn't want to overload the question.
I've been working with the Google Drive API for a bit, accessing the list of revisions for two sheets as part of a job with service.revisions().list(fileId=FILE_ID).execute(). Everything was fine until earlier this morning, when one of the requests (but not the other) started returning a 500 error. This isn't intermittent - it's returning this error on every request so an exponential backoff just hits the cap I've set (5).
There's nothing of value in the response but here it is:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "internalError",
"message": "Internal Error"
}
],
"code": 500,
"message": "Internal Error"
}
}
I get the same error when querying with the API explorer, so this seems to be an issue with the sheet itself as opposed to a coding problem. Here's the request URL:
https://www.googleapis.com/drive/v3/files/1KYDm4gqaCLipQTskbqQbesq8ON7CmV_4IscF8V0FZrs/revisions?key=YOUR_API_KEY
What could suddenly cause this change in behavior?
I am developing a Fuel chatbot that gets file's content from Google drive to build gallery.
I am using JSON API (Fuel chatbot) to get the JSON response.
My file in drive: https://drive.google.com/file/d/0Bx79Tkj95Q3iNmVHOFN0Q3BITE0/view
I want to get JSON response like:
{
"messages": [
{
"attachment":{
"type":"template",
"payload":{
"template_type":"generic",
"elements":[
{
"title":"Classic White T-Shirt",
"image_url":"http://petersapparel.parseapp.com/img/item100-thumb.png",
"subtitle":"Soft white cotton t-shirt is back in style",
"buttons":[
{
"type":"web_url",
"url":"https://petersapparel.parseapp.com/view_item?item_id=100",
"title":"View Item"
},
{
"type":"web_url",
"url":"https://petersapparel.parseapp.com/buy_item?item_id=100",
"title":"Buy Item"
}
]
},
{
"title":"Classic Grey T-Shirt",
"image_url":"http://petersapparel.parseapp.com/img/item101-thumb.png",
"subtitle":"Soft gray cotton t-shirt is back in style",
"buttons":[
{
"type":"web_url",
"url":"https://petersapparel.parseapp.com/view_item?item_id=101",
"title":"View Item"
},
{
"type":"web_url",
"url":"https://petersapparel.parseapp.com/buy_item?item_id=101",
"title":"Buy Item"
}
]
}
]
}
}
}
]
}
I tried to get the content of the file by URL:
https://www.googleapis.com/drive/v3/files/0Bx79Tkj95Q3iNmVHOFN0Q3BITE0/export?mimeType=application/vnd.google-apps.file
But I got the response
Do you have any suggestion to get the JSON response ?
Consider this documentation and test again.
Your error is:
403: Daily Limit Exceeded
The Courtesy API limit for your project has been reached.
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceeded",
"message": "Daily Limit Exceeded"
}
],
"code": 403,
"message": "Daily Limit Exceeded"
}
}
Suggested action: Request additional quota.
Based from the SO post, you may do the following to get rid of your error.
Create a Google APIs Console project
On the Services pane, enable all of the APIs that your project requires.
On the API Access pane, click Create an OAuth 2.0 client ID. A dialog opens. Fill in your project's information. Click
Next
Choose the appropriate application type. Based on the tags you used for this post, I am guessing this is an iOS project so select
Installed application.
Enter your bundle ID. You don't need to enter an App Store ID until your app is listed there.
Click Create Client ID.
You will see the client ID and client secret values. You will use
these values to enable communication with your project and the Google
APIs.
If you aren't already using it, see the Google+ iOS SDK and
documentation for a full walk through. The task called "write
moments" is similar in implementation and demonstrates how to connect
to and use the Google+ REST APIs from within an iOS project that uses
the SDK.
You'll need to specify the scope of plus.me to get the profile
information.
Hope this helps.