Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR] batch/data-plane #2883

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions azure-batch/azure/batch/batch_service_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import ServiceClient
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
Expand Down Expand Up @@ -46,13 +46,13 @@ def __init__(

super(BatchServiceClientConfiguration, self).__init__(base_url)

self.add_user_agent('batchserviceclient/{}'.format(VERSION))
self.add_user_agent('azure-batch/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials


class BatchServiceClient(object):
class BatchServiceClient(SDKClient):
"""A client for issuing REST requests to the Azure Batch service.

:ivar config: Configuration for client.
Expand Down Expand Up @@ -87,10 +87,10 @@ def __init__(
self, credentials, base_url=None):

self.config = BatchServiceClientConfiguration(credentials, base_url)
self._client = ServiceClient(self.config.credentials, self.config)
super(BatchServiceClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2018-03-01.6.1'
self.api_version = '2018-08-01.7.0'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
607 changes: 405 additions & 202 deletions azure-batch/azure/batch/models/__init__.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,20 @@ class AccountListNodeAgentSkusOptions(Model):
:type ocp_date: datetime
"""

def __init__(self, filter=None, max_results=1000, timeout=30, client_request_id=None, return_client_request_id=False, ocp_date=None):
super(AccountListNodeAgentSkusOptions, self).__init__()
self.filter = filter
self.max_results = max_results
self.timeout = timeout
self.client_request_id = client_request_id
self.return_client_request_id = return_client_request_id
self.ocp_date = ocp_date
_attribute_map = {
'filter': {'key': '', 'type': 'str'},
'max_results': {'key': '', 'type': 'int'},
'timeout': {'key': '', 'type': 'int'},
'client_request_id': {'key': '', 'type': 'str'},
'return_client_request_id': {'key': '', 'type': 'bool'},
'ocp_date': {'key': '', 'type': 'rfc-1123'},
}

def __init__(self, **kwargs):
super(AccountListNodeAgentSkusOptions, self).__init__(**kwargs)
self.filter = kwargs.get('filter', None)
self.max_results = kwargs.get('max_results', 1000)
self.timeout = kwargs.get('timeout', 30)
self.client_request_id = kwargs.get('client_request_id', None)
self.return_client_request_id = kwargs.get('return_client_request_id', False)
self.ocp_date = kwargs.get('ocp_date', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class AccountListNodeAgentSkusOptions(Model):
"""Additional parameters for list_node_agent_skus operation.

:param filter: An OData $filter clause. For more information on
constructing this filter, see
https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-node-agent-skus.
:type filter: str
:param max_results: The maximum number of items to return in the response.
A maximum of 1000 results will be returned. Default value: 1000 .
:type max_results: int
:param timeout: The maximum time that the server can spend processing the
request, in seconds. The default is 30 seconds. Default value: 30 .
:type timeout: int
:param client_request_id: The caller-generated request identity, in the
form of a GUID with no decoration such as curly braces, e.g.
9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
:type client_request_id: str
:param return_client_request_id: Whether the server should return the
client-request-id in the response. Default value: False .
:type return_client_request_id: bool
:param ocp_date: The time the request was issued. Client libraries
typically set this to the current system clock time; set it explicitly if
you are calling the REST API directly.
:type ocp_date: datetime
"""

_attribute_map = {
'filter': {'key': '', 'type': 'str'},
'max_results': {'key': '', 'type': 'int'},
'timeout': {'key': '', 'type': 'int'},
'client_request_id': {'key': '', 'type': 'str'},
'return_client_request_id': {'key': '', 'type': 'bool'},
'ocp_date': {'key': '', 'type': 'rfc-1123'},
}

def __init__(self, *, filter: str=None, max_results: int=1000, timeout: int=30, client_request_id: str=None, return_client_request_id: bool=False, ocp_date=None, **kwargs) -> None:
super(AccountListNodeAgentSkusOptions, self).__init__(**kwargs)
self.filter = filter
self.max_results = max_results
self.timeout = timeout
self.client_request_id = client_request_id
self.return_client_request_id = return_client_request_id
self.ocp_date = ocp_date
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
class AccountListPoolNodeCountsOptions(Model):
"""Additional parameters for list_pool_node_counts operation.

:param filter: An OData $filter clause.
:param filter: An OData $filter clause. For more information on
constructing this filter, see
https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch.
:type filter: str
:param max_results: The maximum number of items to return in the response.
Default value: 10 .
Expand All @@ -36,11 +38,20 @@ class AccountListPoolNodeCountsOptions(Model):
:type ocp_date: datetime
"""

def __init__(self, filter=None, max_results=10, timeout=30, client_request_id=None, return_client_request_id=False, ocp_date=None):
super(AccountListPoolNodeCountsOptions, self).__init__()
self.filter = filter
self.max_results = max_results
self.timeout = timeout
self.client_request_id = client_request_id
self.return_client_request_id = return_client_request_id
self.ocp_date = ocp_date
_attribute_map = {
'filter': {'key': '', 'type': 'str'},
'max_results': {'key': '', 'type': 'int'},
'timeout': {'key': '', 'type': 'int'},
'client_request_id': {'key': '', 'type': 'str'},
'return_client_request_id': {'key': '', 'type': 'bool'},
'ocp_date': {'key': '', 'type': 'rfc-1123'},
}

def __init__(self, **kwargs):
super(AccountListPoolNodeCountsOptions, self).__init__(**kwargs)
self.filter = kwargs.get('filter', None)
self.max_results = kwargs.get('max_results', 10)
self.timeout = kwargs.get('timeout', 30)
self.client_request_id = kwargs.get('client_request_id', None)
self.return_client_request_id = kwargs.get('return_client_request_id', False)
self.ocp_date = kwargs.get('ocp_date', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class AccountListPoolNodeCountsOptions(Model):
"""Additional parameters for list_pool_node_counts operation.

:param filter: An OData $filter clause. For more information on
constructing this filter, see
https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch.
:type filter: str
:param max_results: The maximum number of items to return in the response.
Default value: 10 .
:type max_results: int
:param timeout: The maximum time that the server can spend processing the
request, in seconds. The default is 30 seconds. Default value: 30 .
:type timeout: int
:param client_request_id: The caller-generated request identity, in the
form of a GUID with no decoration such as curly braces, e.g.
9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
:type client_request_id: str
:param return_client_request_id: Whether the server should return the
client-request-id in the response. Default value: False .
:type return_client_request_id: bool
:param ocp_date: The time the request was issued. Client libraries
typically set this to the current system clock time; set it explicitly if
you are calling the REST API directly.
:type ocp_date: datetime
"""

_attribute_map = {
'filter': {'key': '', 'type': 'str'},
'max_results': {'key': '', 'type': 'int'},
'timeout': {'key': '', 'type': 'int'},
'client_request_id': {'key': '', 'type': 'str'},
'return_client_request_id': {'key': '', 'type': 'bool'},
'ocp_date': {'key': '', 'type': 'rfc-1123'},
}

def __init__(self, *, filter: str=None, max_results: int=10, timeout: int=30, client_request_id: str=None, return_client_request_id: bool=False, ocp_date=None, **kwargs) -> None:
super(AccountListPoolNodeCountsOptions, self).__init__(**kwargs)
self.filter = filter
self.max_results = max_results
self.timeout = timeout
self.client_request_id = client_request_id
self.return_client_request_id = return_client_request_id
self.ocp_date = ocp_date
12 changes: 7 additions & 5 deletions azure-batch/azure/batch/models/affinity_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ class AffinityInformation(Model):
"""A locality hint that can be used by the Batch service to select a compute
node on which to start a task.

:param affinity_id: An opaque string representing the location of a
compute node or a task that has run previously. You can pass the
All required parameters must be populated in order to send to Azure.

:param affinity_id: Required. An opaque string representing the location
of a compute node or a task that has run previously. You can pass the
affinityId of a compute node to indicate that this task needs to run on
that compute node. Note that this is just a soft affinity. If the target
node is busy or unavailable at the time the task is scheduled, then the
Expand All @@ -33,6 +35,6 @@ class AffinityInformation(Model):
'affinity_id': {'key': 'affinityId', 'type': 'str'},
}

def __init__(self, affinity_id):
super(AffinityInformation, self).__init__()
self.affinity_id = affinity_id
def __init__(self, **kwargs):
super(AffinityInformation, self).__init__(**kwargs)
self.affinity_id = kwargs.get('affinity_id', None)
40 changes: 40 additions & 0 deletions azure-batch/azure/batch/models/affinity_information_py3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class AffinityInformation(Model):
"""A locality hint that can be used by the Batch service to select a compute
node on which to start a task.

All required parameters must be populated in order to send to Azure.

:param affinity_id: Required. An opaque string representing the location
of a compute node or a task that has run previously. You can pass the
affinityId of a compute node to indicate that this task needs to run on
that compute node. Note that this is just a soft affinity. If the target
node is busy or unavailable at the time the task is scheduled, then the
task will be scheduled elsewhere.
:type affinity_id: str
"""

_validation = {
'affinity_id': {'required': True},
}

_attribute_map = {
'affinity_id': {'key': 'affinityId', 'type': 'str'},
}

def __init__(self, *, affinity_id: str, **kwargs) -> None:
super(AffinityInformation, self).__init__(**kwargs)
self.affinity_id = affinity_id
19 changes: 13 additions & 6 deletions azure-batch/azure/batch/models/application_get_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@ class ApplicationGetOptions(Model):
:type ocp_date: datetime
"""

def __init__(self, timeout=30, client_request_id=None, return_client_request_id=False, ocp_date=None):
super(ApplicationGetOptions, self).__init__()
self.timeout = timeout
self.client_request_id = client_request_id
self.return_client_request_id = return_client_request_id
self.ocp_date = ocp_date
_attribute_map = {
'timeout': {'key': '', 'type': 'int'},
'client_request_id': {'key': '', 'type': 'str'},
'return_client_request_id': {'key': '', 'type': 'bool'},
'ocp_date': {'key': '', 'type': 'rfc-1123'},
}

def __init__(self, **kwargs):
super(ApplicationGetOptions, self).__init__(**kwargs)
self.timeout = kwargs.get('timeout', 30)
self.client_request_id = kwargs.get('client_request_id', None)
self.return_client_request_id = kwargs.get('return_client_request_id', False)
self.ocp_date = kwargs.get('ocp_date', None)
46 changes: 46 additions & 0 deletions azure-batch/azure/batch/models/application_get_options_py3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class ApplicationGetOptions(Model):
"""Additional parameters for get operation.

:param timeout: The maximum time that the server can spend processing the
request, in seconds. The default is 30 seconds. Default value: 30 .
:type timeout: int
:param client_request_id: The caller-generated request identity, in the
form of a GUID with no decoration such as curly braces, e.g.
9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
:type client_request_id: str
:param return_client_request_id: Whether the server should return the
client-request-id in the response. Default value: False .
:type return_client_request_id: bool
:param ocp_date: The time the request was issued. Client libraries
typically set this to the current system clock time; set it explicitly if
you are calling the REST API directly.
:type ocp_date: datetime
"""

_attribute_map = {
'timeout': {'key': '', 'type': 'int'},
'client_request_id': {'key': '', 'type': 'str'},
'return_client_request_id': {'key': '', 'type': 'bool'},
'ocp_date': {'key': '', 'type': 'rfc-1123'},
}

def __init__(self, *, timeout: int=30, client_request_id: str=None, return_client_request_id: bool=False, ocp_date=None, **kwargs) -> None:
super(ApplicationGetOptions, self).__init__(**kwargs)
self.timeout = timeout
self.client_request_id = client_request_id
self.return_client_request_id = return_client_request_id
self.ocp_date = ocp_date
22 changes: 15 additions & 7 deletions azure-batch/azure/batch/models/application_list_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,18 @@ class ApplicationListOptions(Model):
:type ocp_date: datetime
"""

def __init__(self, max_results=1000, timeout=30, client_request_id=None, return_client_request_id=False, ocp_date=None):
super(ApplicationListOptions, self).__init__()
self.max_results = max_results
self.timeout = timeout
self.client_request_id = client_request_id
self.return_client_request_id = return_client_request_id
self.ocp_date = ocp_date
_attribute_map = {
'max_results': {'key': '', 'type': 'int'},
'timeout': {'key': '', 'type': 'int'},
'client_request_id': {'key': '', 'type': 'str'},
'return_client_request_id': {'key': '', 'type': 'bool'},
'ocp_date': {'key': '', 'type': 'rfc-1123'},
}

def __init__(self, **kwargs):
super(ApplicationListOptions, self).__init__(**kwargs)
self.max_results = kwargs.get('max_results', 1000)
self.timeout = kwargs.get('timeout', 30)
self.client_request_id = kwargs.get('client_request_id', None)
self.return_client_request_id = kwargs.get('return_client_request_id', False)
self.ocp_date = kwargs.get('ocp_date', None)
Loading