SourceImage เป็นลิงก์ที่เก็บข้อมูลของ Google ขณะแทรกรูปภาพใหม่

รูปแบบที่เหมาะสมในการจัดเตรียมลิงก์รูปภาพที่เก็บข้อมูลของ Google ในขณะที่ images.insert ควรเป็นรูปแบบใด ไฟล์รูปภาพอยู่ที่ GS Bucket เป็น *.tar.gz การสร้างภาพใหม่ด้วยไลบรารีไคลเอนต์ Google ใน python ด้วย api images.insert(body=body,project=project)

การกำหนดค่าร่างกายของฉันดูเหมือนว่า:

body = { "name":"test", "sourceImage":"https://console.cloud.google.com/storage/browser/[BUCKET]/[IMAGEFILE]",}

ขั้นตอนล้มเหลวโดยมีข้อผิดพลาดดังต่อไปนี้:

googleapiclient.errors.HttpError: <HttpError 400 when requesting  returned "Invalid value for field 'resource.sourceImage': 'https://storag
e.cloud.google.com/[BUCKET]/[IMAGEFILE]'. The URL is malformed.">

person NITIN K SHARMA    schedule 30.07.2018    source แหล่งที่มา
comment
stackoverflow.com/users/9741888/temu สวัสดี Temu ขอบคุณที่ตอบภารกิจก่อนหน้านี้ คุณรู้ไหมว่าฉันผิดพลาดตรงไหน?   -  person NITIN K SHARMA    schedule 30.07.2018


คำตอบ (1)


ในการเข้าถึงรูปภาพจากพื้นที่เก็บข้อมูลของ Google โปรดใช้ “rawDisk ” แทน นี่คือตัวอย่าง:

"name": "image-1",
  "rawDisk": {
    "source": "https://storage.googleapis.com/[bucket]/[imagefile]"
  }

โดยที่ [bucket] คือชื่อของบัคเก็ตของคุณและ [imagefile] = *.tar.gz

person dany L    schedule 01.08.2018