Added Project class.
This commit is contained in:
		
							
								
								
									
										15
									
								
								harvester.py
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								harvester.py
									
									
									
									
									
								
							@@ -1,14 +1,13 @@
 | 
			
		||||
#!/usr/bin/env python3
 | 
			
		||||
 | 
			
		||||
from devops import Client, DEVOPS_SCOPE
 | 
			
		||||
from devops import Organization, Project, DEVOPS_SCOPE
 | 
			
		||||
from azure.identity import DefaultAzureCredential
 | 
			
		||||
from json import dumps
 | 
			
		||||
 | 
			
		||||
def main():
 | 
			
		||||
    token = DefaultAzureCredential().get_token(DEVOPS_SCOPE).token
 | 
			
		||||
    client = Client("https://dev.azure.com/mcovsandbox", token)
 | 
			
		||||
    projects = client.get_projects()
 | 
			
		||||
    print(dumps(projects, indent=2))
 | 
			
		||||
org = Organization("https://dev.azure.com/mcovsandbox", DefaultAzureCredential().get_token(DEVOPS_SCOPE).token)
 | 
			
		||||
projects = org.projects
 | 
			
		||||
print([str(p) for p in projects])
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    main()
 | 
			
		||||
ado_sandbox = Project(org, id="bafe0cf1-6c97-4088-864a-ea6dc02b2727")
 | 
			
		||||
 | 
			
		||||
print(ado_sandbox)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user