I have uploaded a couple of photos in Street View and I want to use the Python client library to update its metadata. Find below a snippet of my code:
from google.proto.streetview.publish.v1 import resources_pb2
from google.streetview.publish.v1 import street_view_publish_service_client as client
from google.protobuf import field_mask_pb2
streetview_client = client.StreetViewPublishServiceClient(credentials=credentials)
for photo in streetview_client.list_photos(0, ''):
con = resources_pb2.Connection()
target_id = resources_pb2.PhotoId()
target_id.id = "photo_id"
con.target.id = target_id.id
photo.connections.extend([con])
update_mask = field_mask_pb2.FieldMask()
update_mask.FromJsonString("connections")
response = streetview_client.update_photo(photo, update_mask)
break
I want to connect both photos so I add the target id to the query photo and the field "connections" to the update_mask.
The result after the update_photo call is the following error message:
google.gax.errors.RetryError: RetryError(Exception occurred in retry method that was not classified as transient, caused by <_Rendezvous of RPC that terminated with (StatusCode.INVALID_ARGUMENT, Empty level name is not accepted.)>)
Any hint?
In order to do a connections between two photos, you need to use
Method: photos.batchUpdate.Connectionsshould be set right underPhoto. Also, be noted of the metadata of thePhotothat you need to implement.Here's a sample code snippet.