Menu
  • HOME
  • TAGS

Google Logging API - What service name to use when writing entries from non-Google application?

Tag: google-api,google-cloud-platform,google-cloud-logging

I am trying to use Google Cloud Logging API to write log entries from a web application I'm developing (happens to be .net).

To do this, I must use the logging.projects.logs.entries.write request. This request dictates that I provide a serviceName argument:

{
  "entries": [
  {
    "textPayload": "test",
    "metadata": 
    {
      "serviceName": "compute.googleapis.com"
      "projectId": "...",
      "region": "us-central1",
      "zone": "us-central1-a",
      "severity": "DEFAULT",
      "timestamp": "2015-01-13T19:17:01Z",
      "userId": "",
    }
  }]
}

Unless I specify "compute.googleapis.com" as the serviceName I get an error 400 response:

{
  "error": 
  {
    "code": 400,
    "message": "Unsupported service specified",
    "status": "INVALID_ARGUMENT"
  }
}

For now using "compute.googleapis.com" seems to work but I'm asking - what service name should I give, given that I'm not using Google Compute Engine or Google App Engine here?

Best How To :

The Cloud Logging API currently only officially supports Google resources, so the best course of action is to continue to use "compute.googleapis.com" as the service and supply the labels "compute.googleapis.com/resource_type" and "compute.googleapis.com/resource_id", which are used for indexing and visible in the UI drop-downs.

We also currently permit the service name "custom.googleapis.com" with index labels "custom.googleapis.com/primary_key" and "custom.googleapis.com/secondary_key" but that is not officially supported and subject to change in a future release.

How do I add a startup script to an existing VM from the developer console?

google-compute-engine,google-cloud-platform

You can add a startup script to an already created VM by creating a new custom metadata field. Follow these steps: Get to your VM's configuration page: Navigate to https://console.developers.google.com Click your project. Go to Compute -> Compute Engine -> VM Instances. Click the name of your VM. Scroll down...

unable to add callback: cannot be converted to ConnectionCallbacks

android,google-api

I do not have any experience with what you are doing, but might it be the case that the PlusBaseActivity class has to implement ConnectionCallbacks in order to 'be' a callback? Like: public class PlusBaseActivity extends Activity implements ConnectionCallbacks{ // add ConnectionCallBack methods } ...

Annotation chart google function after rangechange

javascript,google-api,google-visualization

I find a solution to my question, i just post it here if someone else try to do the same. Maybe there's better solution but this one do what i want so that's ok. Instead of using google.visualization.events.addListener(chart, 'rangechange', feed_with_chartMap); I use $('#chart_AnnotationChart_rangeControlContainer g[transform]').click(feed_with_chartMap); It calls my function when the...

Retrieve project id from Google Compute Engine machine?

google-compute-engine,google-cloud-platform

You can query the metadata server programmatically for a variety of information, including the project id. For the project id: $ curl "http://metadata.google.internal/computeMetadata/v1/project/project-id" -H "Metadata-Flavor: Google" This will return your project id, eg: my-gcp-project Or if you need the numeric project id: $ curl "http://metadata.google.internal/computeMetadata/v1/project/numeric-project-id" -H "Metadata-Flavor: Google" This will...

Google Identity Toolkit returns INVALID_CREDENTIALS

php,google-api,google-api-php-client,google-identity-toolkit

This documentation on the Google API PHP client shows you how to get an OAuth token for your app. However, you will probably find it easier to use the Identity Toolkit specific PHP client. To generate the forgot-password link, all you need to do is call the getOobResults() method on...

Does Google Container Registry undergo issues?

docker,google-cloud-platform,google-container-engine,google-container-registry

The latest container vm image doesn't support the v1beta2 kubernetes API. You will need to update your manifest to use v1beta3 or v1 (with the corresponding yaml changes). The latest version of the container vm documentation shows a yaml example using the v1 API. ...

Why this google font is not working?

html,css,google-api

If you're using SSL, you won't be able to call the non-encrypted version of Google Fonts. To fix, locate this line on your HTML page (or template): <link href='http://fonts.googleapis.com/css?family=Whatever:400,600' rel='stylesheet' type='text/css'> and change it to this: <link href='//fonts.googleapis.com/css?family=Whatever:400,600' rel='stylesheet' type='text/css'> This will allow the browser to choose the appropriate page....

ERROR: (gcloud.preview) Invalid choice: 'docker'. Did you mean 'dm-v2'?

docker,google-cloud-platform,gcloud

From the release notes 0.9.65 (2015/06/17): gcloud preview docker moved to gcloud docker. The command was moved out of preview in the latest version of gcloud. You can run it with: gcloud docker push gcr.io/<my-project-xxx>/<my-image-yyy> ...

Google Developer API V3 for video upload in YouTube C#.net

c#,youtube,google-api,youtube-api,google-api-dotnet-client

You cant use Login and password anymore. You need to use Oauth2 to authenticate a user. The code is the same if it is a web or a console application. /// <summary> /// Authenticate to Google Using Oauth2 /// Documentation https://developers.google.com/accounts/docs/OAuth2 /// </summary> /// <param name="clientId">From Google Developer console https://console.developers.google.com</param>...

Gmail API: How to get access token?

php,google-api,google-oauth,google-api-php-client,gmail-api

Ok, basically i was approaching wrongly. Following this instructions is enough to get the tokens: https://developers.google.com/gmail/api/quickstart/php The main point is to access the file from the command line and not from the app....

How to know if a machine is an Google Compute Engine instance

google-compute-engine,google-cloud-platform

Per the metadata docs: You can easily detect if your applications or scripts are running within a Compute Engine instance by using the metadata server. When you make a request to the server, any response from the metadata server will contain the Metadata-Flavor: Google header. You can look for this...

Limited number of rows returned from Google spreadsheet and the Sheets Api

c#,google-api

Turned out that I had an empty row in the sheet and the API won't read new rows after that.

What is the difference between an Instance and an Instance group

google-compute-engine,google-cloud-platform

In GCE, An instance is a single virtual machine that you can customise (CPU, network, endpoint, disk, etc) and manage by you (shutdown, run, build with new image, etc) https://cloud.google.com/compute/docs/instances/ An instance is a virtual machine hosted on Google's infrastructure. Instances can run the Linux images provided by Google, or...

Setting up freeswitch server on Google cloud compute

google-cloud-platform,freeswitch,telecommunication

I found answer for this myself at http://lists.freeswitch.org/mailman/listinfo/freeswitch-users So this issue is related to ipv6. Since google didn't provide ipv6, I had to disable ipv6 in freeswitch In conf/sip_profiles directory you will find files regarding ipv6, [email protected]:/usr/local/freeswitch/conf/sip_profiles$ ls external external-ipv6 external-ipv6.xml external.xml internal-ipv6.xml internal.xml In order to disable ipv6 in...

How to create a script to query Google Browserlocation

json,google-api

Here's how you can accomplish this transformation using a (slightly non-optimal :)) Perl oneliner: perl -ne "if(s/^(.+?)\s+(..:..:..:..:..:..)\s+(.+?)\s*$/https:\/\/maps.googleapis.com\/maps\/api\/browserlocation\/json?browser=firefox&sensor=true&wifi=mac:\2|ssid:\1|ss:\3&\n/g){print;}" ...

Google Cloud Datastore PropertyFilter Error

php,google-app-engine,google-api,google-cloud-datastore,google-php-sdk

Solution: I did need to use the $query->setKinds() method as Ed Davisson suggested, however it cannot just take a string. You need to give it the Google_Service_Datastore_KindExpression Object Example: $views_kind= new Google_Service_Datastore_KindExpression; $views_kind->setName("views"); $query->setKinds(array($views_kind)); ...

I want to upload video on youtube using client side login. without open web page permission

c#,.net,google-api,youtube-api,google-api-dotnet-client

Your code is doing is doing everything correctly. The YouTube API doesn't allow for pure server authentication (Service Account). The only option available to you to upload files will be to use Oauth2 and authenticate your code the first time. I just sugest you make one small change add filedatastore....

Google Cloud and Bizspark licenses

windows-server-2012,google-cloud-platform,windows-server

I found answer for my question: you are generally not eligible to run Windows Server in a shared compute environment such as GCE or any other public cloud http://stackoverflow.com/a/30720911/1850880...

Google HTTP load balancing enforce HTTPS

load-balancing,google-cloud-platform,gcloud

Not at the load balancer as of June 2015. As an alternative, you can configure your web servers to return 301 for all HTTP requests redirecting to the HTTPS version. For Apache (from https://wiki.apache.org/httpd/RedirectSSL): NameVirtualHost *:80 <VirtualHost *:80> ServerName www.example.com Redirect permanent / https://www.example.com/ </VirtualHost> <VirtualHost _default_:443> ServerName www.example.com DocumentRoot...

Freebase Search API - Get All Results

java,google-api,resultset,freebase

Without specifics it's a little difficult to say what the problem is, but the Search API is definitely not intended to return complete results. The MQLRead API should return complete results, although I'd consider 6K results to be towards the upper end of its intended usage. If you're not going...

Google Calendar: How to check guest is not busy and available to book through google calendar

google-apps-script,google-api,google-calendar

I did this in google script using freebusy api like this var resource = { timeMin: timeMin, timeMax: timeMax, items: [ { id: calendarId } ] }; var response = Calendar.Freebusy.query(resource); return response.calendars[calendarId]['busy'].length == 0; ...

Google Logging API - What service name to use when writing entries from non-Google application?

google-api,google-cloud-platform,google-cloud-logging

The Cloud Logging API currently only officially supports Google resources, so the best course of action is to continue to use "compute.googleapis.com" as the service and supply the labels "compute.googleapis.com/resource_type" and "compute.googleapis.com/resource_id", which are used for indexing and visible in the UI drop-downs. We also currently permit the service name...

How to get public link for the uploaded file on google cloud storage in local dev server(Google App engine+JAVA)

java,google-app-engine,file-upload,google-cloud-platform

You can use the Images service on the local devserver. For that you need a blobkey: BlobstoreService blobStore = BlobstoreServiceFactory.getBlobstoreService(); BlobKey blobKey = blobStore.createGsBlobKey("/gs/" + filename.getBucketName() + "/" + filename.getObjectName())); // blobKey can be persisted ImagesService imagesService = ImagesServiceFactory.getImagesService(); String url = imagesService.getServingUrl(ServingUrlOptions.Builder.withBlobKey(image)); Resizing also works on the local devserver...

Value cannot be null. Parameter name: baseUri

c#,google-api,google-bigquery,google-api-dotnet-client,service-accounts

I manage to found the root cause and solution for my problem. Actual Error: Table Schema getting Mismatched. Reason: In Big Query table Field Mode is REQUIRED. I am getting table schema from Response of this query "Select * From Table-name Limit 1" because not able to build new schema....

What is the difference between Android API and Google API?

android,google-api

Answer for your question is below The google API includes ->Maps and other Google-specific libraries. The Android one only includes ->core android libraries. ...

Making an iOS authorised Google API call

ios,google-api,access-token

After you have logged in and acquired tokens, you create service instances and then attach an "authorizer." Google's Objective-C client supports quite a few services: https://code.google.com/p/google-api-objectivec-client/ Here is a sample using Google+: Obj-C (with ARC enabled) GTLServicePlus* plusService = [[GTLServicePlus alloc] init]; plusService.retryEnabled = YES; # set an authorizer with...

Access spreadsheet via Google API invalid_grant

java,google-api,google-spreadsheet,gmail-api

Try adding access_type with the value offline to your auth request. I had a very similar error to this not 2 days ago and this fixed the problem. Also, just to confirm the clientID value should be similar to @developer.gserviceaccount.com They basically expect the email_address value from the console api...

.\key.p12: open failed: ENOENT (No such file or directory)

java,android,google-cloud-storage,assets,google-cloud-platform

After some struggle I have got my answer, Thanks a lot for your support. Thumbs up! File can be retrieved using using AssetManager and also we can get it as a raw resource Using AssetManager AssetManager am = getAssets(); InputStream inputStream = am.open("xxxxxxxxxxKey.p12"); File file = createFileFromInputStream(inputStream); As a raw...

How to mount volume for docker container via yaml manifest?

docker,google-cloud-platform,google-container-engine

Try replacing hostDir with hostPath as mentioned in v1beta3-conversion-tips-from-v1beta12. Try replacing volumes: - name: string source: # Either emptyDir for an empty directory # emptyDir: {} # Or hostDir for a pre-existing directory on the host hostDir: path: /home with volumes: - name: string hostPath: path: /home at the bottom...

Unable to implement Google API 'Search using a specific app'

android,google-api

Figured out from this post, that the app has to be published first for the functionality to work. However, we can emulate this with the following adb shell command adb shell am start -a com.google.android.gms.actions.SEARCH_ACTION -e query 'search for xyz on..' packagename ...

finished with non-zero exit value 2 when I use google login api

java,android,google-api,google-api-java-client,google-login

play-services-identity:7.5.0, play-services-plus:7.5.0 and google-play-services.jar may cause the multiply libs conflict

Failed sending mail through google api with javascript

javascript,email,google-api,google-api-client

After days i had found the answer by my own. The problem was that the 'message' in the body only can be used when you send an attachment in the email. If you have no attachment the query looks like I wrote down here var mail= base64EncodedEmail; console.log(mail); var request...

Getting user credentials using Google+ API

android,google-app-engine,google-api,google-api-java-client

I have tried same code and its working fine! So, just ensure two things: 1)Register your digitally signed .apk file's public certificate in the Google APIs Console.Link below: https://developers.google.com/+/mobile/android/getting-started#step_1_enable_the_google_api 2)Make sure you have added the google+ api access and have client key created with SHA1. Rest is fine....

How to by pass authentication in google analytics script?

google-api,google-analytics-api

I found this option Embed API - Component Reference from this link which solved my issue: I just needed to set the access_token: gapi.analytics.auth.authorize({ serverAuth: { access_token: 'XXXXXX' } }); ...

Advanced gmail search for received emails only

email,google-api,gmail,gmail-api,incoming-mail

You could specify that you don't want mails coming from you, or mails having your sent label etc. q = CompanyName filename:pdf AND -from:me AND -in:sent AND -is:chat AND -in:draft AND -in:trash Which would result in the following request: GET https://www.googleapis.com/gmail/v1/users/me/messages?q=CompanyName+filename%3Apdf+AND+-from%3Ame+AND+-in%3Asent+AND+-is%3Achat+AND+-in%3Adraft+AND+-in%3Atrash&key={YOUR_API_KEY} ...

Gmail API: example of a request to the API

php,google-api,google-oauth,google-api-php-client,gmail-api

I think you are close! Try assigning the access token to the client like this: $client = new Google_Client(); $client->setApplicationName('Gmail API test'); $client->setDeveloperKey('MY_KEY'); $client->setClientSecret('MY_CLIENT_SECRET'); $client->SetClientId('MY_CLIENT_ID'); $client->setScopes(array('https://www.googleapis.com/auth/gmail.readonly')); $client->setAccessToken('{"access_token":"MY_ACCESS_TOKEN", "token_type":"Bearer"‌​,"expires_in":3600, "refresh_token":"MY_REFRESH...

Google Drive API: I have to fetch only files in that folder without trashed files

c#,c#-4.0,google-api,google-drive-sdk

I don't think you are seeing deleted files. Deleted files are permanently deleted. I think you are seeing trashed files which are like putting files in the trash can on windows, they are removed but not really gone. You want to add a search parameter to your files.list request. you...

Google Container Engine (GKE): “Hello Wordpress” tutorial not working (ERR_CONNECTION_REFUSED)

google-cloud-platform,kubernetes,google-container-engine

If you want to access the container directly using the node VM's IP address, you need to specify a host port in addition to a container port, e.g. kubectl run-container wordpress --image=tutum/wordpress --port=80 --hostport=80 Alternatively, you can access wordpress via the proxy running on the master by running kubectl proxy...

Hide referrer header in API request

javascript,api,google-api,cross-domain,referrer

Why your PHP script is failing: If you take a look at your error response from PHP: PHP Warning: file_get_contents(https://translate.google.com/translate_tts?ie=utf-8&q=the+brown+fox+jumped+over+the+lazy+dog) You'll notice that the url file_get_contents is requesting does not contain a tl parameter. This is causing a 404 to be returned. You can visit the page directly in your...

Google Weather API

api,google-api,weather,weather-api

This is too broad to answer you should better check the tutorial or documentation present online. EDIT : Your script can look like this: import pywapi import string weather_com_result = pywapi.get_weather_from_weather_com('10001') yahoo_result = pywapi.get_weather_from_yahoo('10001') noaa_result = pywapi.get_weather_from_noaa('KJFK') print "Weather.com says: It is " + string.lower(weather_com_result['current_conditions']['text']) + " and " +...

Providing login_hint option for Google Oauth2 redirect

oauth,google-api,google-oauth

You should pass the variable to state. In the callback argument, you can parse your variable from state argument. For example, https://accounts.google.com/o/oauth2/auth?scope=email profile&state={"user_id": 1}&redirect_uri=http://localhost&response_type=code&client_id=xxxxxxxx.apps.googleusercontent.com&approval_prompt=force The callback url will be http://localhost/code?state={"user_id": 1}&code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7...

Are there google apis to update a google sheet

google-api,google-spreadsheet

You can use the Google Sheets API. But you are probably better off using Apps Script to access Calendar and Sheets.

Google Translate API text-to-speech: http requests forbidden

javascript,google-api,text-to-speech,http-status-code-403,google-translate

That resource is dated. Google deprecated free access to the language translate api. Now an API key is needed. The api is also now in V2. Without an api key you will receive the 403 forbidden error. More information here: https://cloud.google.com/translate/docs...

Google Scripts + Google API PHP

php,google-apps-script,google-api,google-apps,google-api-php-client

I ended up using CURL request directly passing the "Authorization" header with the token_type and the access_token and it worked as expected. I didn't find any way to do this using the Google APIs Client Library for PHP POST Authorization: Bearer [your_auth_token] Content-Length: 0 ...

How to use nextPageToken in Google Apps Reseller API?

google-api,google-admin-sdk,google-reseller-api

This should work. When you implement the real thing, make sure you have retry with exponential back off. public void retrieveAll() throws IOException, InterruptedException { GoogleCredential credentials = GoogleApiUtil.getCredentials(); Reseller service = new Reseller.Builder(HTTP_TRANSPORT, JSON_FACTORY, credentials) .setApplicationName("ResellerDemo").build(); String nextPageToken = null; do { Subscriptions subsList = service.subscriptions().list().setMaxResults(Long.valueOf(100)).setPageToken(nextPageToken) .execute();...

Gmail API: Insufficient Permission

php,email,google-api,gmail,gmail-api

You need 'https://www.googleapis.com/auth/gmail.compose' to create a draft. So what happens if you $client->setScopes(array( 'https://mail.google.com/', 'https://www.googleapis.com/auth/gmail.compose' )); or if you want to get more formal define('SCOPES', implode(' ', array( Google_Service_Gmail::MAIL_GOOGLE_COM, Google_Service_Gmail::GMAIL_COMPOSE) )); $client->setScopes(SCOPES) or whatever the valid php might be (I haven't done php for a while). Note that if you...

Google Cloud Bigtable Durability/Availability Guarantees

high-availability,google-cloud-platform,google-cloud-bigtable

On replication: The answer you referenced is referring to replication of data across Bigtable Clusters, which is not supported at this time. (For example, a Bigtable Cluster in the United States replicating its writes to a second Cluster in Europe) This concept is separate from replication of data within a...

How to access gmail API?

javascript,google-api,gmail-api,vertx.io

In case of GMail, you are accessing a particular user's data, so when creating the JWT, you need to specify the user whom you are trying to impersonate, i.e. the user whose mailbox you want to access. You can do this using the sub:"User's email address parameter" when forming the...

Google Drive API 500 null errors when copying

google-api,google-drive-sdk,google-api-php-client,google-api-client

This error was due to a bug in the Drive API. Here's the canonical issue report: https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3862 In the future please file issues there instead of posting on Stack Overflow. The bug should now be fixed....