Skip to content

Commit a7cf63c

Browse files
committed
removed 5.1 and release clients
removed scripts folder added 'DetailedResponse class for response with pagination token (bug fix) and updated some endpoints
1 parent 451cade commit a7cf63c

File tree

191 files changed

+110
-90216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+110
-90216
lines changed

Makefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
SHELL=/bin/bash
2+
3+
BRANCH := $(shell git branch | grep \\* | cut -d ' ' -f2)
4+
DEV_CONTAINER := sensors-dev
5+
DEV_IMAGE := sensors_sensors
6+
7+
# COLORS
8+
GREEN := $(shell tput -Txterm setaf 2)
9+
YELLOW := $(shell tput -Txterm setaf 3)
10+
WHITE := $(shell tput -Txterm setaf 7)
11+
RESET := $(shell tput -Txterm sgr0)
12+
13+
TARGET_MAX_CHAR_NUM=40
14+
## prints help dialog
15+
help:
16+
@echo ''
17+
@echo 'Usage:'
18+
@echo ' ${YELLOW}make${RESET} ${GREEN}<target>${RESET}'
19+
@echo ''
20+
@echo 'Targets:'
21+
@awk '/^[a-zA-Z\-\_0-9]+:/ { \
22+
helpMessage = match(lastLine, /^## (.*)/); \
23+
if (helpMessage) { \
24+
helpCommand = substr($$1, 0, index($$1, ":")-1); \
25+
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
26+
printf " ${YELLOW}%-$(TARGET_MAX_CHAR_NUM)s${RESET} ${GREEN}%s${RESET}\n", helpCommand, helpMessage; \
27+
} \
28+
} \
29+
{ lastLine = $$0 }' $(MAKEFILE_LIST)
30+
31+
## executes flake8
32+
flake8:
33+
flake8 azure-devops
34+
35+
## executes bandit security check tool
36+
bandit:
37+
./run_bandit.sh

README.md

Lines changed: 13 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,20 @@
1-
[![Python package](https://github.com/microsoft/azure-devops-python-api/workflows/Python%20package/badge.svg)](https://github.com/microsoft/azure-devops-python-api/actions)
2-
[![Build Status](https://dev.azure.com/mseng/vsts-cli/_apis/build/status/vsts-python-api?branchName=dev)](https://dev.azure.com/mseng/vsts-cli/_build/latest?definitionId=5904&branchName=dev)
3-
[![Python](https://img.shields.io/pypi/pyversions/azure-devops.svg)](https://pypi.python.org/pypi/azure-devops)
1+
# This is a public forked repo of microsoft's [azure-devops-python-api](https://github.com/microsoft/azure-devops-python-api)!
42

5-
# Azure DevOps Python API
3+
This repository contains Python APIs for interacting with and managing Azure DevOps.
64

7-
This repository contains Python APIs for interacting with and managing Azure DevOps. These APIs power the Azure DevOps Extension for Azure CLI. To learn more about the Azure DevOps Extension for Azure CLI, visit the [Microsoft/azure-devops-cli-extension](https://github.com/Microsoft/azure-devops-cli-extension) repo.
5+
## Changes, Fixes & Enhancements
86

9-
## Install
7+
following is a list of changes on top of original repository
108

11-
```
12-
pip install azure-devops
13-
```
14-
15-
## Get started
16-
17-
18-
To use the API, establish a connection using a [personal access token](https://docs.microsoft.com/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=vsts) and the URL to your Azure DevOps organization. Then get a client from the connection and make API calls.
19-
20-
```python
21-
from azure.devops.connection import Connection
22-
from msrest.authentication import BasicAuthentication
23-
import pprint
24-
25-
# Fill in with your personal access token and org URL
26-
personal_access_token = 'YOURPAT'
27-
organization_url = 'https://dev.azure.com/YOURORG'
28-
29-
# Create a connection to the org
30-
credentials = BasicAuthentication('', personal_access_token)
31-
connection = Connection(base_url=organization_url, creds=credentials)
9+
1. update setup.py file
10+
2. deleted scripts directory
11+
3. removed v5_1 clients package`
12+
4. added 'DetailedResponse' class to return end point returned values and pagination token (bug fix for 6.0 clients)
3213

33-
# Get a client (the "core" client provides access to projects, teams, etc)
34-
core_client = connection.clients.get_core_client()
3514

36-
# Get the first page of projects
37-
get_projects_response = core_client.get_projects()
38-
index = 0
39-
while get_projects_response is not None:
40-
for project in get_projects_response.value:
41-
pprint.pprint("[" + str(index) + "] " + project.name)
42-
index += 1
43-
if get_projects_response.continuation_token is not None and get_projects_response.continuation_token != "":
44-
# Get the next page of projects
45-
get_projects_response = core_client.get_projects(continuation_token=get_projects_response.continuation_token)
46-
else:
47-
# All projects have been retrieved
48-
get_projects_response = None
15+
## installation and packaging
16+
change version inside setup.py file <br>
17+
execute the following from setup.py directory:
4918
```
50-
51-
## API documentation
52-
53-
This Python library provides a thin wrapper around the Azure DevOps REST APIs. See the [Azure DevOps REST API reference](https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-5.1) for details on calling different APIs.
54-
55-
## Samples
56-
57-
Learn how to call different APIs by viewing the samples in the [Microsoft/azure-devops-python-samples](https://github.com/Microsoft/azure-devops-python-samples) repo.
58-
59-
## Contributing
60-
61-
This project welcomes contributions and suggestions. Most contributions require you to agree to a
62-
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
63-
the rights to use your contribution. For details, visit https://cla.microsoft.com.
64-
65-
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
66-
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
67-
provided by the bot. You will only need to do this once across all repos using our CLA.
68-
69-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
70-
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
71-
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
19+
python setup.py sdist upload -r local
20+
```

azure-devops/azure/devops/connection.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from .exceptions import AzureDevOpsClientRequestError
1212
from .released.client_factory import ClientFactory
1313
from .v5_1.location.location_client import LocationClient
14-
from .v5_1.client_factory import ClientFactoryV5_1
1514
from .v6_0.client_factory import ClientFactoryV6_0
1615

1716
logger = logging.getLogger(__name__)
@@ -33,7 +32,6 @@ def __init__(self, base_url=None, creds=None, user_agent=None):
3332
self._creds = creds
3433
self._resource_areas = None
3534
self.clients = ClientFactory(self)
36-
self.clients_v5_1 = ClientFactoryV5_1(self)
3735
self.clients_v6_0 = ClientFactoryV6_0(self)
3836
self.use_fiddler = False
3937

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class DetailedResponse:
2+
"""
3+
this class provides api response value and continuation token for paginated responses
4+
"""
5+
def __init__(self, response_value, continuation_token):
6+
self.response_value = response_value
7+
self.continuation_token = continuation_token

azure-devops/azure/devops/v5_1/accounts/__init__.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

azure-devops/azure/devops/v5_1/accounts/accounts_client.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

azure-devops/azure/devops/v5_1/accounts/models.py

Lines changed: 0 additions & 149 deletions
This file was deleted.

azure-devops/azure/devops/v5_1/audit/__init__.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)