Skip to content
Prev Previous commit
Next Next commit
Generated from 3f9220b29a0180bf1a037013514ea859e6a0bf22
add listcredential api back
  • Loading branch information
AutorestCI committed Oct 17, 2018
commit dac1c4603bac3eb343fa69c4c8c6716db3ac0d3c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
from .managed_cluster_aad_profile_py3 import ManagedClusterAADProfile
from .managed_cluster_py3 import ManagedCluster
from .orchestrator_profile_py3 import OrchestratorProfile
from .managed_cluster_access_profile_py3 import ManagedClusterAccessProfile
from .managed_cluster_pool_upgrade_profile_py3 import ManagedClusterPoolUpgradeProfile
from .managed_cluster_upgrade_profile_py3 import ManagedClusterUpgradeProfile
from .credential_result_py3 import CredentialResult
Expand Down Expand Up @@ -83,6 +84,7 @@
from .managed_cluster_aad_profile import ManagedClusterAADProfile
from .managed_cluster import ManagedCluster
from .orchestrator_profile import OrchestratorProfile
from .managed_cluster_access_profile import ManagedClusterAccessProfile
from .managed_cluster_pool_upgrade_profile import ManagedClusterPoolUpgradeProfile
from .managed_cluster_upgrade_profile import ManagedClusterUpgradeProfile
from .credential_result import CredentialResult
Expand Down Expand Up @@ -138,6 +140,7 @@
'ManagedClusterAADProfile',
'ManagedCluster',
'OrchestratorProfile',
'ManagedClusterAccessProfile',
'ManagedClusterPoolUpgradeProfile',
'ManagedClusterUpgradeProfile',
'CredentialResult',
Expand Down
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 .resource import Resource


class ManagedClusterAccessProfile(Resource):
"""Managed cluster Access Profile.

Variables are only populated by the server, and will be ignored when
sending a request.

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

:ivar id: Resource Id
:vartype id: str
:ivar name: Resource name
:vartype name: str
:ivar type: Resource type
:vartype type: str
:param location: Required. Resource location
:type location: str
:param tags: Resource tags
:type tags: dict[str, str]
:param kube_config: Base64-encoded Kubernetes configuration file.
:type kube_config: bytearray
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'},
}

def __init__(self, **kwargs):
super(ManagedClusterAccessProfile, self).__init__(**kwargs)
self.kube_config = kwargs.get('kube_config', None)
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 .resource_py3 import Resource


class ManagedClusterAccessProfile(Resource):
"""Managed cluster Access Profile.

Variables are only populated by the server, and will be ignored when
sending a request.

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

:ivar id: Resource Id
:vartype id: str
:ivar name: Resource name
:vartype name: str
:ivar type: Resource type
:vartype type: str
:param location: Required. Resource location
:type location: str
:param tags: Resource tags
:type tags: dict[str, str]
:param kube_config: Base64-encoded Kubernetes configuration file.
:type kube_config: bytearray
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'},
}

def __init__(self, *, location: str, tags=None, kube_config: bytearray=None, **kwargs) -> None:
super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs)
self.kube_config = kube_config
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,76 @@ def get_upgrade_profile(
return deserialized
get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'}

def get_access_profile(
self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config):
"""Gets an access profile of a managed cluster.

Gets the accessProfile for the specified role name of the managed
cluster with a specified resource group and name.

:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_name: The name of the managed cluster resource.
:type resource_name: str
:param role_name: The name of the role for managed cluster
accessProfile resource.
:type role_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: ManagedClusterAccessProfile or ClientRawResponse if raw=true
:rtype:
~azure.mgmt.containerservice.models.ManagedClusterAccessProfile or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.get_access_profile.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'resourceName': self._serialize.url("resource_name", resource_name, 'str'),
'roleName': self._serialize.url("role_name", role_name, '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')

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
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, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('ManagedClusterAccessProfile', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'}

def list_cluster_admin_credentials(
self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config):
"""Gets clusteradmin credential of a managed cluster.
Expand Down