google-cloud-storage

What is the alternative to the deprecated 'GoogleCredential'?

巧了我就是萌 提交于 2020-07-18 18:36:07
问题 I'd been employing the following Java method to set a bucket notification in GCS. private void setBucketNotification(String bucketName, String topicId) { List<String> eventType = new ArrayList<>(); eventType.add("OBJECT_FINALIZE"); try { Notification notification = new Notification(); notification.setTopic(topicId); notification.setEventTypes(eventType); notification.setPayloadFormat("JSON_API_V1"); final GoogleCredential googleCredential = GoogleCredential .fromStream(Objects.requireNonNull

Save Pandas data frame to Google Cloud bucket

拟墨画扇 提交于 2020-07-18 06:30:48
问题 I want to save pandas data frame directly to Google Cloud Storage. I tried different ways using write-a-pandas-dataframe-to-google-cloud-storage-or-bigquery. But I am not able to save. Note: I can use google.cloud package only Below is the code I tried from google.cloud import storage import pandas as pd input_dict = [{'Name': 'A', 'Id': 100}, {'Name': 'B', 'Id': 110}, {'Name': 'C', 'Id': 120}] df = pd.DataFrame(input_dict) Try:1 destination = f'gs://bucket_name/test.csv' df.to_csv

Image from Cloud Storage is not redendring in .map list

别等时光非礼了梦想. 提交于 2020-07-13 15:44:03
问题 I am making a list of posts in a .map fetching from my Firebase Cloud Firestore. I also have photos connecting to each post, and I fetch them by using the post.title + '.jpg' from Cloud Storage. The post title is fetching great, but when using the fetchImage it is not showing in the post. It is showing in the console.log. I can also access the url from the console, so nothing wrong there. Any ideas? {this.state.posts.map((post, i) => { let fetchImage firebase .storage() .ref(post.title + '

Image from Cloud Storage is not redendring in .map list

蹲街弑〆低调 提交于 2020-07-13 15:41:02
问题 I am making a list of posts in a .map fetching from my Firebase Cloud Firestore. I also have photos connecting to each post, and I fetch them by using the post.title + '.jpg' from Cloud Storage. The post title is fetching great, but when using the fetchImage it is not showing in the post. It is showing in the console.log. I can also access the url from the console, so nothing wrong there. Any ideas? {this.state.posts.map((post, i) => { let fetchImage firebase .storage() .ref(post.title + '

How can I specify a region for the Cloud Storage buckets used by Cloud Build for a Cloud Run deployment?

 ̄綄美尐妖づ 提交于 2020-07-08 05:49:48
问题 When deploying a docker container image to Cloud Run, I can choose a region, which is fine. Cloud Run delegates the build to Cloud Build, which apparently creates two buckets to make this happen. The unexpected behavior is that buckets aren't created in the region of the Cloud Run deployment, and instead default to multi-region US. How do I specify the region as "us-east1" so the cost of storage is absorbed by the "always free" tier? (Apparently US multi-region storage buckets store data in

How can I specify a region for the Cloud Storage buckets used by Cloud Build for a Cloud Run deployment?

点点圈 提交于 2020-07-08 05:48:47
问题 When deploying a docker container image to Cloud Run, I can choose a region, which is fine. Cloud Run delegates the build to Cloud Build, which apparently creates two buckets to make this happen. The unexpected behavior is that buckets aren't created in the region of the Cloud Run deployment, and instead default to multi-region US. How do I specify the region as "us-east1" so the cost of storage is absorbed by the "always free" tier? (Apparently US multi-region storage buckets store data in

Cloud Pub/Sub Notifications for Cloud Storage on sub directory

本秂侑毒 提交于 2020-07-06 19:48:06
问题 I want to listen to changes on GCS in sub bucket I tried this gsutil notification create -t my-topic -f json gs://my-bucket but it gives me notification for changes in all objects is there a way to get only from sub directory, something like this: gsutil notification create -t my-topic -f json gs://my-bucket/sub-dir 回答1: There is indeed a way to limit the notifications to a "directory" inside a bucket. Bear in mind that Cloud Storage is a "flat" storage system, where the concept of directory

Change kubernetes stroge class mounted value from another pod

孤者浪人 提交于 2020-06-29 04:06:45
问题 I want to publish sonarqube with kubernetes. I did successfully with official packages. But i want to use some plugins old version and some custom plugins. In local with docker-compose files, i created a fly-away container that fills the plugins directory(/opt/sonarqube/extensions/plugins) with plugins. And use that volume with sonarqube container. As a conclusion : Sonarqube extensions volume directory is created (or filled) from different container(do the job and die). I want to use the

Google Cloud Storage - ListObjects, folder are not shown.

帅比萌擦擦* 提交于 2020-06-27 23:11:03
问题 I am trying out Google Cloud Storage, and have a problem with its C# SDK. Specifically, I have created a bucket with folder a/, b/, c/ (with files in folder). When I use: gsutil ls gs://<mybucket>/root/ The folders correctly show up as: gs://<mybucket>/root/a gs://<mybucket>/root/b gs://<mybucket>/root/c However, when I use C# SDK to list the folder, var client = StorageClient.Create(); var opt = new ListObjectsOptions() { Delimiter = "/" }; var ret = client.ListObjects("<mybucket>", "root/",

Google Cloud Storage - ListObjects, folder are not shown.

孤者浪人 提交于 2020-06-27 23:10:09
问题 I am trying out Google Cloud Storage, and have a problem with its C# SDK. Specifically, I have created a bucket with folder a/, b/, c/ (with files in folder). When I use: gsutil ls gs://<mybucket>/root/ The folders correctly show up as: gs://<mybucket>/root/a gs://<mybucket>/root/b gs://<mybucket>/root/c However, when I use C# SDK to list the folder, var client = StorageClient.Create(); var opt = new ListObjectsOptions() { Delimiter = "/" }; var ret = client.ListObjects("<mybucket>", "root/",