Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1e458da
Automatic PR of restapi_auto_lmazuel_automationpy into master (#1801)
AutorestCI Feb 12, 2018
997f37b
Generated from da610400a1306f1ab50c7c796746b9938d5f40e7 (#1947)
AutorestCI Feb 12, 2018
70f7099
[AutoPR automation/resource-manager] Fixing the resource definitions …
AutorestCI Feb 15, 2018
39e5e3e
Generated from 9f22184d852d3d5b2728466cd034f5adadc0cb05 (#1984)
AutorestCI Feb 15, 2018
97256b1
Generated from 3ee5a3b33c6b37c2198e58470ae309f1cfbdedbc (#2012)
AutorestCI Feb 21, 2018
e5b3bed
Generated from 7c8ecc676f97292a87b1373623ac6235ac14082e (#2231)
AutorestCI Mar 20, 2018
93626e1
Generated from 39c2f9a4855320ed80fe45f847bf2c3d0c25f70e (#2261)
AutorestCI Mar 23, 2018
77b9bed
[AutoPR automation/resource-manager] Adding patch API for Configurati…
AutorestCI Mar 23, 2018
c4b5ada
[AutoPR automation/resource-manager] Add new HybridWorkerGroup update…
AutorestCI Mar 26, 2018
8f571f7
[AutoPR automation/resource-manager] Adding ListKeys support for Auto…
AutorestCI Mar 26, 2018
1b5515d
Generated from 51e53725da6e2fcb29836f63c34d629ce31dafeb (#2281)
AutorestCI Mar 26, 2018
f8a8c75
[AutoPR automation/resource-manager] Runbook Linting issues fixed (#2…
AutorestCI Mar 27, 2018
05cd4f5
Generated from c79ea034321a4ca0bd8c055821a4901d20f7c6a0 (#2333)
AutorestCI Apr 4, 2018
a4e89aa
Generated from a4b37e767f42cdc45542216ed43704aecb4222c0 (#2360)
AutorestCI Apr 6, 2018
badb0aa
Generated from 78e336d893321f6a2537f044aea283bbaf987203 (#2366)
AutorestCI Apr 9, 2018
4a90c49
Generated from dbe5e9ac34b138b0e23c58ded24526d0b27e9854 (#2397)
AutorestCI Apr 14, 2018
e87a05d
Generated from ab35ac5d163cb8818771763a66fa1f720954f760 (#2430)
AutorestCI Apr 20, 2018
f16d521
[AutoPR automation/resource-manager] [UpdateManagement] SoftwareUpdat…
AutorestCI Apr 26, 2018
111abfd
[AutoPR automation/resource-manager] Dsc paging changes (#2454)
AutorestCI May 2, 2018
ebaca2f
Generated from 3969ccd29b11be74beb11be597e6ec60a2b10fcc (#2528)
AutorestCI May 4, 2018
af8bc7e
Generated from ff4ef35bec35df647ad4e2f0d73f2f94f549df21 (#2582)
AutorestCI May 21, 2018
f5c0f38
[AutoPR automation/resource-manager] [Automation] Refactoring Automat…
AutorestCI Jun 22, 2018
751d7f2
Generated from 4427304dc57f73fbeb012d11bffca3038ea2bf99 (#2813)
AutorestCI Jun 27, 2018
cb78c52
[AutoPR automation/resource-manager] Reverting the schedule.json resp…
AutorestCI Jun 28, 2018
1d089ac
Generated from d393fcd982df8339a966bf6a6bf3ba58099f3b28 (#2853)
AutorestCI Jul 2, 2018
de8f510
Generated from ad46e205e322a7981412bb3b79ce29bcb757e175 (#2916)
AutorestCI Jul 11, 2018
4e5ca91
[AutoPR automation/resource-manager] Remove 4xx responses and change …
AutorestCI Jul 12, 2018
93d15da
Generated from bc2ab8179aa738ee9686eb95816ab74917b0d8d1 (#2933)
AutorestCI Jul 18, 2018
d634926
[AutoPR automation/resource-manager] [UpdateManagement] SoftwareUpdat…
AutorestCI Jul 19, 2018
5d366a0
[AutoPR automation/resource-manager] Updating PUT operation requireme…
AutorestCI Aug 6, 2018
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
Prev Previous commit
Next Next commit
Generated from 78e336d893321f6a2537f044aea283bbaf987203 (#2366)
Fixing swagger issues breaking SDK and blocking cmdlet work
  • Loading branch information
AutorestCI authored Apr 9, 2018
commit badb0aaab26a32ec989685dfa4dc4f0b93c74e68
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
from .source_control import SourceControl
from .source_control_update_parameters import SourceControlUpdateParameters
from .source_control_sync_job import SourceControlSyncJob
from .source_control_sync_job_create_parameters import SourceControlSyncJobCreateParameters
from .source_control_sync_job_by_id_errors import SourceControlSyncJobByIdErrors
from .source_control_sync_job_by_id import SourceControlSyncJobById
from .dsc_node import DscNode
Expand Down Expand Up @@ -298,6 +299,7 @@
'SourceControl',
'SourceControlUpdateParameters',
'SourceControlSyncJob',
'SourceControlSyncJobCreateParameters',
'SourceControlSyncJobByIdErrors',
'SourceControlSyncJobById',
'DscNode',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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 SourceControlSyncJobCreateParameters(Model):
"""The parameters supplied to the create source control sync job operation.

:param commit_id: Sets the commit id of the source control sync job.
:type commit_id: str
"""

_attribute_map = {
'commit_id': {'key': 'properties.commitId', 'type': 'str'},
}

def __init__(self, commit_id=None):
super(SourceControlSyncJobCreateParameters, self).__init__()
self.commit_id = commit_id
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,28 @@ def _replace_content_initial(
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)

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

if raw:
client_raw_response = ClientRawResponse(None, response)
deserialized = None
header_dict = {}

if response.status_code == 200:
deserialized = self._deserialize('str', response)
header_dict = {
'location': 'str',
}
client_raw_response.add_headers(header_dict)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
try:
client_raw_response.add_headers(header_dict)
except DeserializationError:
pass # Deserialization of Headers here can fail
return client_raw_response

return deserialized

def replace_content(
self, resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, **operation_config):
"""Replaces the runbook draft content.
Expand All @@ -164,9 +175,9 @@ def replace_content(
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:return: An instance of AzureOperationPoller that returns None or
:return: An instance of AzureOperationPoller that returns str or
ClientRawResponse if raw=true
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
Expand Down Expand Up @@ -199,16 +210,21 @@ def get_long_running_status(status_link, headers=None):

def get_long_running_output(response):

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

header_dict = {
'location': 'str',
}
deserialized = self._deserialize('str', response)

if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response.add_headers({
'location': 'str',
})
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response.add_headers(header_dict)
return client_raw_response

return deserialized

long_running_operation_timeout = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
Expand Down Expand Up @@ -312,17 +328,28 @@ def _publish_initial(
request = self._client.post(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)

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

if raw:
client_raw_response = ClientRawResponse(None, response)
deserialized = None
header_dict = {}

if response.status_code == 200:
deserialized = self._deserialize('str', response)
header_dict = {
'location': 'str',
}
client_raw_response.add_headers(header_dict)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
try:
client_raw_response.add_headers(header_dict)
except DeserializationError:
pass # Deserialization of Headers here can fail
return client_raw_response

return deserialized

def publish(
self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config):
"""Publish runbook draft.
Expand All @@ -337,9 +364,9 @@ def publish(
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:return: An instance of AzureOperationPoller that returns None or
:return: An instance of AzureOperationPoller that returns str or
ClientRawResponse if raw=true
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
Expand Down Expand Up @@ -371,16 +398,21 @@ def get_long_running_status(status_link, headers=None):

def get_long_running_output(response):

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

header_dict = {
'location': 'str',
}
deserialized = self._deserialize('str', response)

if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response.add_headers({
'location': 'str',
})
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response.add_headers(header_dict)
return client_raw_response

return deserialized

long_running_operation_timeout = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer):
self.config = config

def create(
self, resource_group_name, automation_account_name, source_control_name, source_control_sync_job_id, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, source_control_name, source_control_sync_job_id, commit_id=None, custom_headers=None, raw=False, **operation_config):
"""Creates the sync job for a source control.

:param resource_group_name: Name of an Azure Resource group.
Expand All @@ -48,6 +48,8 @@ def create(
:type source_control_name: str
:param source_control_sync_job_id: The source control sync job id.
:type source_control_sync_job_id: str
:param commit_id: Sets the commit id of the source control sync job.
:type commit_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -59,6 +61,8 @@ def create(
:raises:
:class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
"""
parameters = models.SourceControlSyncJobCreateParameters(commit_id=commit_id)

# Construct URL
url = self.create.metadata['url']
path_format_arguments = {
Expand All @@ -84,9 +88,13 @@ def create(
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 body
body_content = self._serialize.body(parameters, 'SourceControlSyncJobCreateParameters')

# Construct and send request
request = self._client.put(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)

if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
Expand Down