Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
92a67a9
bump version number to 5.0.0b10
tedchamb Jun 19, 2019
f7daec5
Merge pull request #229 from microsoft/users/tedchamb/dev5
tedchamb Jun 21, 2019
6f07554
fix model comments.
tedchamb Jul 1, 2019
c798941
Merge pull request #235 from microsoft/users/tedchamb/dev5
tedchamb Jul 1, 2019
f0c7d46
fix some camel casing
tedchamb Jul 1, 2019
1ce580b
Wrong class name in v5_1.test_results.__init__.py
SirPownzalot Jul 3, 2019
ff08865
fix a bunch of misspellings
tedchamb Jul 10, 2019
7c38fce
Merge pull request #239 from microsoft/users/tedchamb/dev5
tedchamb Jul 10, 2019
5538ecd
add some missing models
tedchamb Jul 10, 2019
55b4156
fix casing on TestResultsClient import
tedchamb Jul 16, 2019
42c4e41
Merge pull request #240 from microsoft/users/tedchamb/dev5
tedchamb Jul 16, 2019
03bf22a
Merge pull request #236 from SirPownzalot/patch-1
tedchamb Jul 16, 2019
21f891a
Update for M153 - includes released 5.1 clients
tedchamb Jul 23, 2019
4b63dba
Merge pull request #242 from microsoft/users/tedchamb/dev5
tedchamb Jul 23, 2019
b1a20a7
Add Search clients
tedchamb Jul 25, 2019
0804c52
Merge pull request #244 from microsoft/users/tedchamb/dev5
tedchamb Jul 25, 2019
3458ee0
Add audit and token clients. update resource area id on search client
tedchamb Jul 25, 2019
ab2f380
Merge pull request #245 from microsoft/users/tedchamb/dev5
tedchamb Jul 25, 2019
c6ec475
regen after spelling fixes
tedchamb Jul 25, 2019
ea6c073
One more spelling fix
tedchamb Jul 25, 2019
9ca0779
Merge pull request #246 from microsoft/users/tedchamb/dev5
tedchamb Jul 25, 2019
d0b5a07
Move back to beta, until I can look at the two open issues.
tedchamb Jul 25, 2019
143e245
update version
tedchamb Jul 25, 2019
f708734
Merge pull request #247 from microsoft/users/tedchamb/dev5
tedchamb Jul 25, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ for project in projects:

## API documentation

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/vsts/?view=vsts-rest-5.0) for details on calling different APIs.
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.

## Samples

Expand Down
15 changes: 7 additions & 8 deletions azure-devops/azure/devops/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,23 @@ def _create_request_message(self, http_method, location_id, route_values=None,
route_values = {}
route_values['area'] = location.area
route_values['resource'] = location.resource_name
route_template = self._remove_optional_route_parameters(location.route_template,
route_values)
url = self._transform_route_template(location.route_template, route_values)
logger.debug('Route template: %s', location.route_template)
url = self._client.format_url(route_template, **route_values)
request = ClientRequest(method=http_method, url=self._client.format_url(url))
if query_parameters:
request.format_parameters(query_parameters)
return request

@staticmethod
def _remove_optional_route_parameters(route_template, route_values):
def _transform_route_template(route_template, route_values):
new_template = ''
route_template = route_template.replace('{*', '{')
for path_segment in route_template.split('/'):
if (len(path_segment) <= 2 or not path_segment[0] == '{'
or not path_segment[len(path_segment) - 1] == '}'
or path_segment[1:len(path_segment) - 1] in route_values):
or not path_segment[len(path_segment) - 1] == '}'):
new_template = new_template + '/' + path_segment
elif path_segment[1:len(path_segment) - 1] in route_values:
new_template = new_template + '/' + route_values[path_segment[1:len(path_segment) - 1]]
return new_template

def _get_resource_location(self, location_id):
Expand Down Expand Up @@ -222,7 +221,7 @@ def _negotiate_request_version(location, version):
else:
# We can send at the requested api version. Make sure the resource version
# is not bigger than what the server supports
negotiated_version = str(requested_api_version)
negotiated_version = match.group(1)
is_preview = match.group(3) is not None
if is_preview:
negotiated_version += '-preview'
Expand Down Expand Up @@ -267,7 +266,7 @@ def _handle_error(self, request, response):
raise AzureDevOpsAuthenticationError(full_message_format.format(error_message=error_message,
url=request.url))
else:
full_message_format = '{error_message}Operation returned an invalid status code of {status_code}.'
full_message_format = '{error_message}Operation returned a {status_code} status code.'
raise AzureDevOpsClientRequestError(full_message_format.format(error_message=error_message,
status_code=response.status_code))

Expand Down
2 changes: 1 addition & 1 deletion azure-devops/azure/devops/released/accounts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------------------------

from ...v5_0.accounts.models import *
from ...v5_1.accounts.models import *
from .accounts_client import AccountsClient

__all__ = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from msrest import Serializer, Deserializer
from ...client import Client
from ...v5_0.accounts import models
from ...v5_1.accounts import models


class AccountsClient(Client):
Expand Down Expand Up @@ -42,7 +42,7 @@ def get_accounts(self, owner_id=None, member_id=None, properties=None):
query_parameters['properties'] = self._serialize.query('properties', properties, 'str')
response = self._send(http_method='GET',
location_id='229a6a53-b428-4ffb-a835-e8f36b5b4b1e',
version='5.0',
version='5.1',
query_parameters=query_parameters)
return self._deserialize('[Account]', self._unwrap_collection(response))

3 changes: 2 additions & 1 deletion azure-devops/azure/devops/released/build/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------------------------

from ...v5_0.build.models import *
from ...v5_1.build.models import *
from .build_client import BuildClient

__all__ = [
'AgentPoolQueue',
'AgentSpecification',
'AggregatedResultsAnalysis',
'AggregatedResultsByOutcome',
'AggregatedResultsDifference',
Expand Down
Loading