Created
August 18, 2017 14:24
-
-
Save PaulusTM/d2cb62aa74bae8ba47f14e4ec423d943 to your computer and use it in GitHub Desktop.
Get Octopus projects
This file contains hidden or 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
import requests | |
root_url = "<root_uri>" | |
api = "/api/projectgroups/all" | |
headers = {'X-Octopus-ApiKey':'<key>'} | |
response = requests.get(root_url+api, headers=headers) | |
projectgroups = response.json() | |
for group in projectgroups: | |
print group['Name'] | |
api = "/api/projectgroups/"+group['Id']+"/projects" | |
response = requests.get(root_url+api, headers=headers) | |
projects = response.json() | |
for project in projects['Items']: | |
print project['Name'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment