Documentation or feature request for dereferencing URIs in API responses #12741
Labels
api: compute
Issues related to the Compute Engine API.
status: investigating
The issue is under investigation, which is determined to be non-trivial.
I use the Python Client Library to automate some tasks in Google Cloud. One issue I run into somewhat regularly is that the API returns URIs as references to other objects and I don't know how to use those to get the object itself.
For example: If I get an instance and want to pull one of the disk objects:
I'm not sure how to actually get the disk. I asked on StackOverflow about this and was told to treat the URIs as opaque identifiers. If that is the case, it seems there is no way to get the disk object itself. I have the disk's name and I think I can assume it is in the same zone as the instance, but I would still need the project. I don't think there is any guarantee that the disk is in the same project as the instance, right?
Anyway, I don't want to get too hung up on this specific example. I'd like to know--in general--what is the recommendation for accessing a referenced object when all you have is a URI. If this is working as expected, I'd like for the documentation to explain how such a situation should be handled. If this is not expected, I'd like the SDK or the API to make it possible to dereference the URIs.
For reference, I am currently using these versions:
google-api-core==2.19.0
google-cloud-compute==1.18.0
The text was updated successfully, but these errors were encountered: