I know https://status.cloud.google.com/ will fetch status from all google cloud services. Is there anyway I can pull status only for google pubsub in json format?
And also is configuring 'uptime check' in stackdriver monitoring with this url https://console.cloud.google.com/home/dashboard?project=project_id url valid?
Thanks,
Santosh
I tried the obvious curl -H 'Accept: application/json' https://status.cloud.google.com/, but I still received an HTML response.
They do have https://status.cloud.google.com/incidents.json. Does that produce what you're after?
Related
I have seen a log in Kibana where the http request and response was displayed in a single line/record.
My Kibana setup currently displays the request and response in separate lines/records.
How do i customize and ultimately achieve this?
"Multiline" codec is the tool for this.
I am very new to this kind of stuff. This is my setup. enter image description here
Any suggestion is appreciated.
Hi The issue is in Authorization, API key needs to be provided under Authorization tab, I would suggest to cross check API key via IBM console
Here is steps to convert text to speech using IBM watson with postman
I assume you have ApiKey value, If you do not have Go to, IBM watson, create text-to-speech resource, -> Go to Manage -> You will have the API Key
Go to Postman, create new Post request
Now you need to add URL, Authorization using Basic Method, Headers & data refer
Click on Send and you will receive audio under response -> Body tab
If you want to do quick check then you can use curl for the same
curl -X POST \
https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize \
-H 'Accept: audio/wav' \
-H 'Authorization: Basic REPLACE_API_KEY' \
-H 'Content-Type: application/json' \
-H 'Postman-Token: 3c147726-2f1e-4531-abca-0898127e8644' \
-H 'cache-control: no-cache' \
-d '{"text": "hello world"}'
A 401 http error code typically means you are not able to authenticate. That means your token is either not valid or you've misconfigured how the token is given to the API. I believe the later is your problem. Based on these docs, you need to pass the token as the value to the X-Watson-Authorization-Token header not as a query parameter.
Let us assume that there is an app engine standard python app hosted at https://xyz.appspot.com and that its URLs are protected with:
login: admin
secure: always
How can I exercise the APIs using curl? I guess the real question is how can I authenticate to the app using curl. If the app is used from a browser, one is redirected to Google login but I am wondering how I can simulate the same from curl.
Any help is greatly appreciated.
Thanks,
Raghu
One way would be to do the authentication in browser first, and then copy the cookie from there to curl. For example in Chrome, you can open the devtools (F12) and select the Network tab.
When you access your secure resource it will appear there. Then you can right click -> Copy -> Copy as cURL (bash).
This will give you a cURL command that is authorized to call your secure resource.
Based on the suggestion from #Erfa, I visited the site in Chrome while keeping the dev tools open.
The browser takes you through login procedure and the site appears. At this point, right click on the GET request in "Network" tab and select "Save as HAR with Content" which saves the API information in a text file.
In the file, you will find a cookie that is being sent with the GET request. You can now use this same cookie with curl as follows:
$ curl --cookie "NAME=VALUE" <URL>
You can use a combination of Cloud Endpoints and API Key.
In this article https://cloud.google.com/endpoints/docs/frameworks/python/restricting-api-access-with-api-keys-frameworks from Google Cloud Platform you have an example of how to use curl authentication with this combination:
If an API or API method requires an API key, supply the key using a
query parameter named key, as shown in this cURL example:
curl \
-H "Content-Type: application/json" \
-X POST \
-d '{"message": "echo"}' \
"${HOST}/_ah/api/echo/v1/echo_api_key?key=${API_KEY}
where HOST and API_KEY are variables containing your API host name and API key,
respectively. Replace echo with the name of your API, and v1 with the
version of your API.
I'm implementing sending push notifications from my google-app-engine server to client apps.
I'm receiving response 401 when sending post message to Firebase cloud messaging server (https://fcm.googleapis.com/fcm/send). I've followed instructions in https://firebase.google.com/docs/cloud-messaging/server, so I'm sending "Authorization" header with my server key. When I'm checking for validity of the key with curl:
curl --header "Authorization: key=$api_key" \
--header Content-Type:"application/json" \
https://fcm.googleapis.com/fcm/send \
-d "{\"registration_ids\":[\"ABC\"]}"
I'm getting response:
{"multicast_id":6193339963814546500,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"InvalidRegistration"}]}
Which should mean that my server key is valid.
I followed "Recommended Actions" for 401 described in: https://firebase.google.com/docs/cloud-messaging/http-server-ref
Apart from the last one: "Request originated from a server not whitelisted in the Server key IPs."
Can that be the cause? How to check that?
I solved the issue. It was my mistake. I wasn't truncating json to string properly and my server key wasn't in fact a correct one.
Sorry for bother.
How to tell if instance specific Salesforce URL is from Sandbox or Production, if I have the URL and Session Id only?
If you know the instance & sessionId, then you can call the REST api's discovery service at {instance}/services/data/v25.0 passing the sessionId in a Authorization header, e.g. using curl this would be
curl -v -H "Authorization: OAuth {sessionId}" https://{instance}/services/data/v25.0/
This returns you the discovery data, including the users Identity Id, e.g.
"id": "https://login.salesforce.com/id/00D300000000QSfEAM/00530000000dImzAAE"
If the host is login.salesforce.com its production, if its test.salesforce.com its sandbox.