google-cloud-storage

Is there a way to use an http proxy for google-cloud-cpp?

杀马特。学长 韩版系。学妹 提交于 2020-05-17 06:01:40
问题 I am using google-cloud-cpp (C++ API for Google Cloud Platform functions) to create/read/write to buckets. When I am working from within the organization's firewall, I have to use a proxy to be able to connect to google cloud. I see that we can configure a proxy using the gcloud command line: gcloud config set proxy/type http gcloud config set proxy/address x.x.x.x gcloud config set proxy/port Can I do something similar when I use google-cloud-cpp? 回答1: If we look at the source code of the

How do I use cv2.imread on a file stored in Google Cloud Storage?

喜欢而已 提交于 2020-05-15 19:06:50
问题 Say I have a picture titled sunset.jpg stored at the following URL on google cloud storage gs://example-bucket/testing_data so the full URL for the image is: gs://example-bucket/testing_data/sunset.jpg If I then do something like: image = cv2.imread('gs://example-bucket/testing_data/sunset.jpg') But while this doesn't crash or fail no image is loaded. How do I access/provide the right URL to cv2.imread to do this?? 回答1: import cv2 import numpy as np import urllib url = "https://i.stack.imgur

Firebase Storage: Using Download Url Instead of Storage Ref

谁说我不能喝 提交于 2020-05-15 04:59:20
问题 I have an iOS app that uses Firebase Storage for storing images. After an image is uploaded I save its storage reference in my Firebase Database . When the app loads, it fetches various storage references from the database and uses the FirebaseUI method to display their corresponding images like so: let storageRef = Storage.storage().reference(forURL: imageUrl) imageView.sd_setImage(with: storageRef, placeholderImage: nil) This works great... but its very slow. While looking for solutions to

BigQuery check if table exists or not

ぃ、小莉子 提交于 2020-05-14 18:23:06
问题 I'm using C# to dynamically construct a query based on a response from the bigquery api tables endpoint. I'm trying to calculate active users which works, but only if I select every table with .* . My question is quite simple really, is there a way to check if a table exists within BigQuery SQL? 回答1: There are metatables called __TABLES__ and __TABLES_SUMMARY__ You can run a query like: SELECT size_bytes FROM <dataset>.__TABLES__ WHERE table_id='mytablename' The __TABLES__ portion of that

Need help understanding the Firebase Storage CDN

主宰稳场 提交于 2020-05-12 11:00:45
问题 I'm building an audiobook app and have uploaded the audio files on Firebase Storage. My problem is that I experience different performances in San Francisco vs Toronto. I am under the impression that Firebase Storage has built-in CDN. if so, Do I need to enable it somewhere? if not, how do I add GCP CDN to my Firebase Storage files behind Firebase Auth?? Checking the domain storage.googleapis.com which is where my Firebase Storage files are hosted shows that it is using the Google CDN. Here

How to import data from Google Cloud Storage to Google Colab

北慕城南 提交于 2020-05-10 18:41:18
问题 Currently I am working on a data set that is of 10 GB. I have uploaded it on google cloud storage but I don't know how to import it in google colab. 回答1: from google.colab import auth auth.authenticate_user() Once you run this, a link will be generated, you can click on it and get the signing in done. !echo "deb http://packages.cloud.google.com/apt gcsfuse-bionic main" > /etc/apt/sources.list.d/gcsfuse.list !curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - !apt -qq

How to import data from Google Cloud Storage to Google Colab

半世苍凉 提交于 2020-05-10 18:40:00
问题 Currently I am working on a data set that is of 10 GB. I have uploaded it on google cloud storage but I don't know how to import it in google colab. 回答1: from google.colab import auth auth.authenticate_user() Once you run this, a link will be generated, you can click on it and get the signing in done. !echo "deb http://packages.cloud.google.com/apt gcsfuse-bionic main" > /etc/apt/sources.list.d/gcsfuse.list !curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - !apt -qq

Folders not showing up in Bucket storage

╄→尐↘猪︶ㄣ 提交于 2020-05-10 07:30:07
问题 So my problem is that a have a few files not showing up in gcsfuse when mounted. I see them in the online console and if I 'ls' with gsutils. Also, if If I manually create the folder in the bucket, i then can see the files inside it, but I need to create it first. Any suggestions? gs://mybucket/ dir1/ ok.txt dir2 lafu.txt If I mount mybucket with gcsfuse and do 'ls' it only returns dir1/ok.txt. Then I'll create the folder dir2 inside dir1 at the root of the mounting point, and suddenly 'lafu

How could I import google analytics data to Google Cloud Platform?

烈酒焚心 提交于 2020-05-02 04:43:37
问题 I need to import data from Google Analytics to Google Cloud Platform (Cloud Storage maybe) and then process this information and exported to google cloud SQL. I have not a clear idea what Google Cloud Service I can use to run the process of importing the data. I was thinking to use Google DataFlow to do the Extraction Transformation and Load into Cloud SQL . 回答1: As @jkff mentioned in the comments if you have Google Analytics 360 you can enable the bigQuery integration and your raw data will

Frontend Authenticated request Google Cloud Storage

微笑、不失礼 提交于 2020-04-18 03:58:43
问题 I am using a Google Cloud Storage bucket to upload some of my users files. I do not want them to appear as public, so I created a service account representing my frontend app. I want to know how to make Authenticated Request to Google Cloud Storage, without using the @google-cloud/storage npm package from my frontend app. I know I need to include Auhtorization: Bearer <token> in my request headers but, how do I get this token ? I'm using React on my frontend app. 回答1: Google has a number of