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 39c2f9a4855320ed80fe45f847bf2c3d0c25f70e (#2261)
Move automation parameters to method
  • Loading branch information
AutorestCI authored Mar 23, 2018
commit 93626e12b416c6fe203b9ef4fe6f93d1f030664f
25 changes: 3 additions & 22 deletions azure-mgmt-automation/azure/mgmt/automation/automation_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,16 @@ class AutomationClientConfiguration(AzureConfiguration):
identify Microsoft Azure subscription. The subscription ID forms part of
the URI for every service call.
:type subscription_id: str
:param resource_group_name: The resource group name.
:type resource_group_name: str
:param client_request_id: Identifies this specific client request.
:type client_request_id: str
:param automation_account_name: The name of the automation account.
:type automation_account_name: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, resource_group_name, automation_account_name, client_request_id=None, base_url=None):
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if resource_group_name is None:
raise ValueError("Parameter 'resource_group_name' must not be None.")
if automation_account_name is None:
raise ValueError("Parameter 'automation_account_name' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

Expand All @@ -94,9 +84,6 @@ def __init__(

self.credentials = credentials
self.subscription_id = subscription_id
self.resource_group_name = resource_group_name
self.client_request_id = client_request_id
self.automation_account_name = automation_account_name


class AutomationClient(object):
Expand Down Expand Up @@ -185,19 +172,13 @@ class AutomationClient(object):
identify Microsoft Azure subscription. The subscription ID forms part of
the URI for every service call.
:type subscription_id: str
:param resource_group_name: The resource group name.
:type resource_group_name: str
:param client_request_id: Identifies this specific client request.
:type client_request_id: str
:param automation_account_name: The name of the automation account.
:type automation_account_name: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, resource_group_name, automation_account_name, client_request_id=None, base_url=None):
self, credentials, subscription_id, base_url=None):

self.config = AutomationClientConfiguration(credentials, subscription_id, resource_group_name, automation_account_name, client_request_id, base_url)
self.config = AutomationClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ def __init__(self, client, config, serializer, deserializer):
self.config = config

def get(
self, automation_account_name, module_name, activity_name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, module_name, activity_name, custom_headers=None, raw=False, **operation_config):
"""Retrieve the activity in the module identified by module name and
activity name.

:param resource_group_name: The resource group name.
:type resource_group_name: str
:param automation_account_name: The automation account name.
:type automation_account_name: str
:param module_name: The name of module.
Expand All @@ -61,7 +63,7 @@ def get(
# Construct URL
url = self.get.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'),
'moduleName': self._serialize.url("module_name", module_name, 'str'),
'activityName': self._serialize.url("activity_name", activity_name, 'str'),
Expand Down Expand Up @@ -103,9 +105,11 @@ def get(
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities/{activityName}'}

def list_by_module(
self, automation_account_name, module_name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, module_name, custom_headers=None, raw=False, **operation_config):
"""Retrieve a list of activities in the module identified by module name.

:param resource_group_name: The resource group name.
:type resource_group_name: str
:param automation_account_name: The automation account name.
:type automation_account_name: str
:param module_name: The name of module.
Expand All @@ -127,7 +131,7 @@ def internal_paging(next_link=None, raw=False):
# Construct URL
url = self.list_by_module.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'),
'moduleName': self._serialize.url("module_name", module_name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ def __init__(self, client, config, serializer, deserializer):
self.config = config

def get(
self, automation_account_name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config):
"""Retrieve the automation agent registration information.

:param resource_group_name: The resource group name.
:type resource_group_name: str
:param automation_account_name: The automation account name.
:type automation_account_name: str
:param dict custom_headers: headers that will be added to the request
Expand All @@ -56,7 +58,7 @@ def get(
# Construct URL
url = self.get.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
Expand Down Expand Up @@ -96,9 +98,11 @@ def get(
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation'}

def regenerate_key(
self, automation_account_name, parameters, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, parameters, custom_headers=None, raw=False, **operation_config):
"""Regenerate a primary or secondary agent registration key.

:param resource_group_name: The resource group name.
:type resource_group_name: str
:param automation_account_name: The automation account name.
:type automation_account_name: str
:param parameters: The name of the agent registration key to be
Expand All @@ -119,7 +123,7 @@ def regenerate_key(
# Construct URL
url = self.regenerate_key.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ def __init__(self, client, config, serializer, deserializer):
self.config = config

def delete(
self, automation_account_name, certificate_name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, certificate_name, custom_headers=None, raw=False, **operation_config):
"""Delete the certificate.

:param resource_group_name: The resource group name.
:type resource_group_name: str
:param automation_account_name: The automation account name.
:type automation_account_name: str
:param certificate_name: The name of certificate.
Expand All @@ -57,7 +59,7 @@ def delete(
# Construct URL
url = self.delete.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'),
'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
Expand Down Expand Up @@ -91,9 +93,11 @@ def delete(
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'}

def get(
self, automation_account_name, certificate_name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, certificate_name, custom_headers=None, raw=False, **operation_config):
"""Retrieve the certificate identified by certificate name.

:param resource_group_name: The resource group name.
:type resource_group_name: str
:param automation_account_name: The automation account name.
:type automation_account_name: str
:param certificate_name: The name of certificate.
Expand All @@ -112,7 +116,7 @@ def get(
# Construct URL
url = self.get.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'),
'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
Expand Down Expand Up @@ -153,9 +157,11 @@ def get(
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'}

def create_or_update(
self, automation_account_name, certificate_name, parameters, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, certificate_name, parameters, custom_headers=None, raw=False, **operation_config):
"""Create a certificate.

:param resource_group_name: The resource group name.
:type resource_group_name: str
:param automation_account_name: The automation account name.
:type automation_account_name: str
:param certificate_name: The parameters supplied to the create or
Expand All @@ -179,7 +185,7 @@ def create_or_update(
# Construct URL
url = self.create_or_update.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'),
'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
Expand Down Expand Up @@ -226,9 +232,11 @@ def create_or_update(
create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'}

def update(
self, automation_account_name, certificate_name, name=None, description=None, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, certificate_name, name=None, description=None, custom_headers=None, raw=False, **operation_config):
"""Update a certificate.

:param resource_group_name: The resource group name.
:type resource_group_name: str
:param automation_account_name: The automation account name.
:type automation_account_name: str
:param certificate_name: The parameters supplied to the update
Expand All @@ -254,7 +262,7 @@ def update(
# Construct URL
url = self.update.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'),
'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
Expand Down Expand Up @@ -299,9 +307,11 @@ def update(
update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'}

def list_by_automation_account(
self, automation_account_name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config):
"""Retrieve a list of certificates.

:param resource_group_name: The resource group name.
:type resource_group_name: str
:param automation_account_name: The automation account name.
:type automation_account_name: str
:param dict custom_headers: headers that will be added to the request
Expand All @@ -321,7 +331,7 @@ def internal_paging(next_link=None, raw=False):
# Construct URL
url = self.list_by_automation_account.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'),
'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
Expand Down
Loading