Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions azure-batch/azure/batch/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
from .task_update_options import TaskUpdateOptions
from .task_list_subtasks_options import TaskListSubtasksOptions
from .task_terminate_options import TaskTerminateOptions
from .task_reactivate_options import TaskReactivateOptions
from .compute_node_add_user_options import ComputeNodeAddUserOptions
from .compute_node_delete_user_options import ComputeNodeDeleteUserOptions
from .compute_node_update_user_options import ComputeNodeUpdateUserOptions
Expand Down Expand Up @@ -382,6 +383,7 @@
'TaskUpdateOptions',
'TaskListSubtasksOptions',
'TaskTerminateOptions',
'TaskReactivateOptions',
'ComputeNodeAddUserOptions',
'ComputeNodeDeleteUserOptions',
'ComputeNodeUpdateUserOptions',
Expand Down
55 changes: 55 additions & 0 deletions azure-batch/azure/batch/models/task_reactivate_options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 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 TaskReactivateOptions(Model):
"""Additional parameters for the Task_Reactivate 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 identifier in the response.
:type return_client_request_id: bool
:param ocp_date: The time the request was issued. If not specified, this
header will be automatically populated with the current system clock
time.
:type ocp_date: datetime
:param if_match: An ETag is specified. Specify this header to perform the
operation only if the resource's ETag is an exact match as specified.
:type if_match: str
:param if_none_match: An ETag is specified. Specify this header to
perform the operation only if the resource's ETag does not match the
specified ETag.
:type if_none_match: str
:param if_modified_since: Specify this header to perform the operation
only if the resource has been modified since the specified date/time.
:type if_modified_since: datetime
:param if_unmodified_since: Specify this header to perform the operation
only if the resource has not been modified since the specified date/time.
:type if_unmodified_since: datetime
"""

def __init__(self, timeout=30, client_request_id=None, return_client_request_id=None, ocp_date=None, if_match=None, if_none_match=None, if_modified_since=None, if_unmodified_since=None):
self.timeout = timeout
self.client_request_id = client_request_id
self.return_client_request_id = return_client_request_id
self.ocp_date = ocp_date
self.if_match = if_match
self.if_none_match = if_none_match
self.if_modified_since = if_modified_since
self.if_unmodified_since = if_unmodified_since
108 changes: 108 additions & 0 deletions azure-batch/azure/batch/operations/task_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,3 +842,111 @@ def terminate(
'DataServiceId': 'str',
})
return client_raw_response

def reactivate(
self, job_id, task_id, task_reactivate_options=None, custom_headers=None, raw=False, **operation_config):
"""Reactivates the specified task.

Reactivation makes a task eligible to be retried again up to its
maximum retry count. This will fail for tasks that are not completed
or that previously completed successfully (with an exit code of 0).
Additionally, this will fail if the job has completed (or is
terminating or deleting).

:param job_id: The id of the job containing the task.
:type job_id: str
:param task_id: The id of the task to reactivate.
:type task_id: str
:param task_reactivate_options: Additional parameters for the
operation
:type task_reactivate_options: :class:`TaskReactivateOptions
<azure.batch.models.TaskReactivateOptions>`
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:rtype: None
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
"""
timeout = None
if task_reactivate_options is not None:
timeout = task_reactivate_options.timeout
client_request_id = None
if task_reactivate_options is not None:
client_request_id = task_reactivate_options.client_request_id
return_client_request_id = None
if task_reactivate_options is not None:
return_client_request_id = task_reactivate_options.return_client_request_id
ocp_date = None
if task_reactivate_options is not None:
ocp_date = task_reactivate_options.ocp_date
if_match = None
if task_reactivate_options is not None:
if_match = task_reactivate_options.if_match
if_none_match = None
if task_reactivate_options is not None:
if_none_match = task_reactivate_options.if_none_match
if_modified_since = None
if task_reactivate_options is not None:
if_modified_since = task_reactivate_options.if_modified_since
if_unmodified_since = None
if task_reactivate_options is not None:
if_unmodified_since = task_reactivate_options.if_unmodified_since

# Construct URL
url = '/jobs/{jobId}/tasks/{taskId}/reactivate'
path_format_arguments = {
'jobId': self._serialize.url("job_id", job_id, 'str'),
'taskId': self._serialize.url("task_id", task_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')
if timeout is not None:
query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int')

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; odata=minimalmetadata; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
if client_request_id is not None:
header_parameters['client-request-id'] = self._serialize.header("client_request_id", client_request_id, 'str')
if return_client_request_id is not None:
header_parameters['return-client-request-id'] = self._serialize.header("return_client_request_id", return_client_request_id, 'bool')
if ocp_date is not None:
header_parameters['ocp-date'] = self._serialize.header("ocp_date", ocp_date, 'rfc-1123')
if if_match is not None:
header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
if if_none_match is not None:
header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str')
if if_modified_since is not None:
header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123')
if if_unmodified_since is not None:
header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)

if response.status_code not in [204]:
raise models.BatchErrorException(self._deserialize, response)

if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response.add_headers({
'client-request-id': 'str',
'request-id': 'str',
'ETag': 'str',
'Last-Modified': 'rfc-1123',
'DataServiceId': 'str',
})
return client_raw_response
141 changes: 14 additions & 127 deletions azure-graphrbac/azure/graphrbac/operations/groups_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,14 @@ def internal_paging(next_link=None, raw=False):
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

else:
url = next_link
url = '/{tenantID}/{nextLink}'
path_format_arguments = {
'nextLink': self._serialize.url("next_link", next_link, 'str', skip_quote=True),
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
header_parameters = {}
Expand Down Expand Up @@ -417,8 +423,14 @@ def internal_paging(next_link=None, raw=False):
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

else:
url = next_link
url = '/{tenantID}/{nextLink}'
path_format_arguments = {
'nextLink': self._serialize.url("next_link", next_link, 'str', skip_quote=True),
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
header_parameters = {}
Expand Down Expand Up @@ -576,128 +588,3 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized

def list_next(
self, next_link, custom_headers=None, raw=False, **operation_config):
"""Gets list of groups for the current tenant.

:param next_link: Next link for list operation.
:type next_link: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:rtype: :class:`ADGroupPaged <azure.graphrbac.models.ADGroupPaged>`
"""
def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/{tenantID}/{nextLink}'
path_format_arguments = {
'nextLink': self._serialize.url("next_link", next_link, 'str', skip_quote=True),
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

else:
url = next_link
query_parameters = {}

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, **operation_config)

if response.status_code not in [200]:
raise models.GraphErrorException(self._deserialize, response)

return response

# Deserialize response
deserialized = models.ADGroupPaged(internal_paging, self._deserialize.dependencies)

if raw:
header_dict = {}
client_raw_response = models.ADGroupPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response

return deserialized

def get_group_members_next(
self, next_link, custom_headers=None, raw=False, **operation_config):
"""Gets the members of a group.

:param next_link: Next link for list operation.
:type next_link: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:rtype: :class:`AADObjectPaged
<azure.graphrbac.models.AADObjectPaged>`
"""
def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/{tenantID}/{nextLink}'
path_format_arguments = {
'nextLink': self._serialize.url("next_link", next_link, 'str', skip_quote=True),
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

else:
url = next_link
query_parameters = {}

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, **operation_config)

if response.status_code not in [200]:
raise models.GraphErrorException(self._deserialize, response)

return response

# Deserialize response
deserialized = models.AADObjectPaged(internal_paging, self._deserialize.dependencies)

if raw:
header_dict = {}
client_raw_response = models.AADObjectPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response

return deserialized
Loading