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
[AutoPR automation/resource-manager] Adding ListKeys support for Auto…
…mation Account (#2172)

* Generated from abfc032aef83b71f309886f919737886a66eb1b3

Adding ListKeys support for Account

* Generated from 6d72ca973e5de84066a6a22502c9db18c11a112d

Adding ListKeys support for Account
  • Loading branch information
AutorestCI authored Mar 26, 2018
commit 8f571f70b4751ddc80bbf4ddae5351df372b8cb2
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .operations.operations import Operations
from .operations.statistics_operations import StatisticsOperations
from .operations.usages_operations import UsagesOperations
from .operations.keys_operations import KeysOperations
from .operations.certificate_operations import CertificateOperations
from .operations.connection_operations import ConnectionOperations
from .operations.connection_type_operations import ConnectionTypeOperations
Expand Down Expand Up @@ -113,6 +114,8 @@ class AutomationClient(object):
:vartype statistics: azure.mgmt.automation.operations.StatisticsOperations
:ivar usages: Usages operations
:vartype usages: azure.mgmt.automation.operations.UsagesOperations
:ivar keys: Keys operations
:vartype keys: azure.mgmt.automation.operations.KeysOperations
:ivar certificate: Certificate operations
:vartype certificate: azure.mgmt.automation.operations.CertificateOperations
:ivar connection: Connection operations
Expand Down Expand Up @@ -212,6 +215,8 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.usages = UsagesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.keys = KeysOperations(
self._client, self.config, self._serialize, self._deserialize)
self.certificate = CertificateOperations(
self._client, self.config, self._serialize, self._deserialize)
self.connection = ConnectionOperations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# --------------------------------------------------------------------------

from .error_response import ErrorResponse, ErrorResponseException
from .key import Key
from .usage_counter_name import UsageCounterName
from .usage import Usage
from .statistics import Statistics
Expand Down Expand Up @@ -128,6 +129,7 @@
from .operation_paged import OperationPaged
from .statistics_paged import StatisticsPaged
from .usage_paged import UsagePaged
from .key_paged import KeyPaged
from .certificate_paged import CertificatePaged
from .connection_paged import ConnectionPaged
from .connection_type_paged import ConnectionTypePaged
Expand All @@ -151,6 +153,8 @@
from .source_control_sync_job_paged import SourceControlSyncJobPaged
from .job_collection_item_paged import JobCollectionItemPaged
from .automation_client_enums import (
AutomationKeyName,
AutomationKeyPermissions,
RunbookTypeEnum,
RunbookState,
RunbookProvisioningState,
Expand All @@ -176,6 +180,7 @@

__all__ = [
'ErrorResponse', 'ErrorResponseException',
'Key',
'UsageCounterName',
'Usage',
'Statistics',
Expand Down Expand Up @@ -294,6 +299,7 @@
'OperationPaged',
'StatisticsPaged',
'UsagePaged',
'KeyPaged',
'CertificatePaged',
'ConnectionPaged',
'ConnectionTypePaged',
Expand All @@ -316,6 +322,8 @@
'SourceControlPaged',
'SourceControlSyncJobPaged',
'JobCollectionItemPaged',
'AutomationKeyName',
'AutomationKeyPermissions',
'RunbookTypeEnum',
'RunbookState',
'RunbookProvisioningState',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
from enum import Enum


class AutomationKeyName(Enum):

primary = "primary"
secondary = "secondary"


class AutomationKeyPermissions(Enum):

full = "Full"


class RunbookTypeEnum(Enum):

script = "Script"
Expand Down
39 changes: 39 additions & 0 deletions azure-mgmt-automation/azure/mgmt/automation/models/key.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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 Key(Model):
"""Automation key which is used to register a DSC Node.

:param key_name: Automation key name. Possible values include: 'primary',
'secondary'
:type key_name: str or ~azure.mgmt.automation.models.AutomationKeyName
:param permissions: Automation key permissions. Possible values include:
'Full'
:type permissions: str or
~azure.mgmt.automation.models.AutomationKeyPermissions
:param value: Value of the Automation Key used for registration.
:type value: str
"""

_attribute_map = {
'key_name': {'key': 'keyName', 'type': 'str'},
'permissions': {'key': 'permissions', 'type': 'str'},
'value': {'key': 'value', 'type': 'str'},
}

def __init__(self, key_name=None, permissions=None, value=None):
super(Key, self).__init__()
self.key_name = key_name
self.permissions = permissions
self.value = value
27 changes: 27 additions & 0 deletions azure-mgmt-automation/azure/mgmt/automation/models/key_paged.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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.paging import Paged


class KeyPaged(Paged):
"""
A paging container for iterating over a list of :class:`Key <azure.mgmt.automation.models.Key>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[Key]'}
}

def __init__(self, *args, **kwargs):

super(KeyPaged, self).__init__(*args, **kwargs)
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from .operations import Operations
from .statistics_operations import StatisticsOperations
from .usages_operations import UsagesOperations
from .keys_operations import KeysOperations
from .certificate_operations import CertificateOperations
from .connection_operations import ConnectionOperations
from .connection_type_operations import ConnectionTypeOperations
Expand Down Expand Up @@ -51,6 +52,7 @@
'Operations',
'StatisticsOperations',
'UsagesOperations',
'KeysOperations',
'CertificateOperations',
'ConnectionOperations',
'ConnectionTypeOperations',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# 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.
# --------------------------------------------------------------------------

import uuid
from msrest.pipeline import ClientRawResponse

from .. import models


class KeysOperations(object):
"""KeysOperations operations.

:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: Client Api Version. Constant value: "2015-10-31".
"""

models = models

def __init__(self, client, config, serializer, deserializer):

self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2015-10-31"

self.config = config

def list_by_automation_account(
self, automation_account_name, custom_headers=None, raw=False, **operation_config):
"""Retrieve the automation keys for an account.

: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
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of Key
:rtype:
~azure.mgmt.automation.models.KeyPaged[~azure.mgmt.automation.models.Key]
:raises:
:class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
"""
def internal_paging(next_link=None, raw=False):

if not next_link:
# 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\._]+$'),
'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_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.post(url, query_parameters)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)

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

return response

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

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

return deserialized
list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/listKeys'}