Created
June 20, 2016 20:45
-
-
Save elibixby/40c07cd47df15f7b0f1db0f575518058 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from googleapiclient.discovery import build | |
from oauth2client.client import GoogleCredentials | |
from oauth2client.contrib.gce import AppAssertionCredentials | |
def main(): | |
creds = GoogleCredentials.get_application_default() | |
client = build('compute', 'v1', credentials=creds) | |
print(client.instances().list(project='project-id', zone='zone').execute()) | |
creds = AppAssertionCredentials() | |
client = build('compute', 'v1', credentials=creds) | |
print(client.instances().list(project='project-id', zone='zone').execute()) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment