Prashanth
Prashanth

Reputation: 141

Python API response - GCP

I'm calling google API from python requests, I'm able to get response from the API also able to extract status code if request is failing like 404. But how do I get success response as 200? I do not see any attribute with that status.

For example:

request = service.disks().get(project=project, zone=zone, disk=disk).execute()

response.status or response.status_code does not help.

Upvotes: 0

Views: 463

Answers (1)

Vikram Shinde
Vikram Shinde

Reputation: 1028

The service.disks().get(project=project, zone=zone, disk=disk).execute() returns the dictionary.

Check the request['status'], it will return READY.

Document reference

Upvotes: 2

Related Questions