Umgebung für die Anwendungsentwicklung in Google Cloud einrichten: Challenge-Lab Rezensionen
323043 Rezensionen
DANABOYINA P. · Vor 3 Tage überprüft
满意
Ying Q. · Vor 3 Tage überprüft
Marwa K. · Vor 3 Tage überprüft
ANANTA S. · Vor 3 Tage überprüft
Ranjith E. · Vor 3 Tage überprüft
rez c. · Vor 3 Tage überprüft
Pankaja M. · Vor 3 Tage überprüft
Tawanda M. · Vor 3 Tage überprüft
Sasin N. · Vor 3 Tage überprüft
kohei s. · Vor 3 Tage überprüft
Aakash P. · Vor 3 Tage überprüft
must update flow test, and index.js failed create for fail parsing bucket name, etc const functions = require('@google-cloud/functions-framework'); const { Storage } = require('@google-cloud/storage'); const { PubSub } = require('@google-cloud/pubsub'); const sharp = require('sharp'); functions.cloudEvent('memories-thumbnail-generator', async (cloudEvent) => { console.log('FULL EVENT:', JSON.stringify(cloudEvent)); const data = cloudEvent.data || {}; // fallback parsing const bucketName = data.bucket || data.data?.bucket; const fileName = data.name || data.data?.name; console.log(`Bucket: ${bucketName}`); console.log(`File: ${fileName}`); if (!bucketName || !fileName) { console.error('Missing bucket or filename'); return; } if (fileName.includes('64x64_thumbnail')) { console.log('Thumbnail already exists'); return; } const ext = fileName.split('.').pop().toLowerCase(); if (!['jpg', 'jpeg', 'png'].includes(ext)) { console.log('Unsupported file type'); return; } const storage = new Storage(); const bucket = storage.bucket(bucketName); const filenameWithoutExt = fileName.substring( 0, fileName.length - ext.length - 1 ); const newFilename = `${filenameWithoutExt}_64x64_thumbnail.${ext}`; try { const [buffer] = await bucket.file(fileName).download(); const resizedBuffer = await sharp(buffer) .resize(64, 64, { fit: 'inside', withoutEnlargement: true, }) .toFormat(ext) .toBuffer(); await bucket.file(newFilename).save(resizedBuffer, { metadata: { contentType: `image/${ext}`, }, }); console.log(`Created ${newFilename}`); const pubsub = new PubSub(); await pubsub .topic('topic-memories-423') .publishMessage({ data: Buffer.from(newFilename), }); console.log('Pub/Sub message published'); } catch (err) { console.error(err); } });
Randi S. · Vor 3 Tage überprüft
Ranjith E. · Vor 3 Tage überprüft
Takatoshi K. · Vor 3 Tage überprüft
MS.LOVELY S. · Vor 3 Tage überprüft
Shiva Shankar Prakash M. · Vor 3 Tage überprüft
Pallavi S. · Vor 3 Tage überprüft
Ngoc P. · Vor 3 Tage überprüft
good
Gopi T. · Vor 3 Tage überprüft
Bernal Esteban S. · Vor 3 Tage überprüft
Piotr K. · Vor 3 Tage überprüft
Ruddhi B. · Vor 3 Tage überprüft
I could not start the lab. I got the error: Unable to create your bucket at this time. Try again or contact your administrator.
Luis A. · Vor 3 Tage überprüft
Liz W. · Vor 3 Tage überprüft
Satisfeito
Carlos T. · Vor 3 Tage überprüft
Wir können nicht garantieren, dass die veröffentlichten Rezensionen von Verbrauchern stammen, die die Produkte gekauft oder genutzt haben. Die Rezensionen werden von Google nicht überprüft.