bring python client closer to what would be officially shipped

This commit is contained in:
Jim Minter 2019-12-13 14:55:41 -06:00
Родитель 3f3d26ec32
Коммит 227f4e13dc
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 0730CBDA10D1A2D3
19 изменённых файлов: 77 добавлений и 789 удалений

Просмотреть файл

@ -27,10 +27,12 @@ client: generate
--use=@microsoft.azure/autorest.python@4.0.70 \
--python \
--azure-arm \
--namespace=azure.mgmt.redhatopenshift.v2019_12_31_preview \
--input-file=/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2019-12-31-preview/redhatopenshift.json \
--output-folder=/python/client/2019-12-31-preview
--output-folder=/python/client
sudo chown -R $(USER):$(USER) pkg/client python/client
rm -rf python/client/azure/mgmt/redhatopenshift/v2019_12_31_preview/aio
go run ./vendor/golang.org/x/tools/cmd/goimports -w -local=github.com/jim-minter/rp pkg/client

Просмотреть файл

@ -1,9 +0,0 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ._azure_red_hat_open_shift_client_async import AzureRedHatOpenShiftClient
__all__ = ['AzureRedHatOpenShiftClient']

Просмотреть файл

@ -1,52 +0,0 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.async_client import SDKClientAsync
from msrest import Serializer, Deserializer
from .._configuration import AzureRedHatOpenShiftClientConfiguration
from .operations_async import Operations
from .operations_async import OpenShiftClustersOperations
from .. import models
class AzureRedHatOpenShiftClient(SDKClientAsync):
"""Rest API for Azure Red Hat OpenShift
:ivar config: Configuration for client.
:vartype config: AzureRedHatOpenShiftClientConfiguration
:ivar operations: Operations operations
:vartype operations: redhatopenshift.operations.Operations
:ivar open_shift_clusters: OpenShiftClusters operations
:vartype open_shift_clusters: redhatopenshift.operations.OpenShiftClustersOperations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""
def __init__(
self, credentials, subscription_id, base_url=None):
self.config = AzureRedHatOpenShiftClientConfiguration(credentials, subscription_id, base_url)
super(AzureRedHatOpenShiftClient, self).__init__(self.config)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2019-12-31-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.open_shift_clusters = OpenShiftClustersOperations(
self._client, self.config, self._serialize, self._deserialize)

Просмотреть файл

@ -1,14 +0,0 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ._operations_async import Operations
from ._open_shift_clusters_operations_async import OpenShiftClustersOperations
__all__ = [
'Operations',
'OpenShiftClustersOperations',
]

Просмотреть файл

@ -1,581 +0,0 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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 msrestazure.azure_exceptions import CloudError
from msrest.polling.async_poller import async_poller, AsyncNoPolling
from msrestazure.polling.async_arm_polling import AsyncARMPolling
from ... import models
class OpenShiftClustersOperations:
"""OpenShiftClustersOperations async operations.
You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute.
: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: "2019-12-31-preview".
"""
models = models
def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-12-31-preview"
self.config = config
async def list(
self, *, custom_headers=None, raw=False, **operation_config):
"""Lists OpenShift clusters in the specified subscription.
Lists OpenShift clusters in the specified subscription. The operation
returns properties of each OpenShift cluster.
: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: OpenShiftClusterList or ClientRawResponse if raw=true
:rtype: ~redhatopenshift.models.OpenShiftClusterList or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.list.metadata['url']
path_format_arguments = {
'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')
# 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.get(url, query_parameters, header_parameters)
response = await self._client.async_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('OpenShiftClusterList', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/openShiftClusters'}
async def list_by_resource_group(
self, resource_group_name, *, custom_headers=None, raw=False, **operation_config):
"""Lists OpenShift clusters in the specified subscription and resource
group.
Lists OpenShift clusters in the specified subscription and resource
group. The operation returns properties of each OpenShift cluster.
:param resource_group_name: The name of the resource group.
:type resource_group_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: OpenShiftClusterList or ClientRawResponse if raw=true
:rtype: ~redhatopenshift.models.OpenShiftClusterList or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.list_by_resource_group.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')
}
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.get(url, query_parameters, header_parameters)
response = await self._client.async_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('OpenShiftClusterList', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters'}
async def get(
self, resource_group_name, resource_name, *, custom_headers=None, raw=False, **operation_config):
"""Gets a OpenShift cluster with the specified subscription, resource
group and resource name.
Gets a OpenShift cluster with the specified subscription, resource
group and resource name. The operation returns properties of a
OpenShift cluster.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource.
:type resource_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: OpenShiftCluster or ClientRawResponse if raw=true
:rtype: ~redhatopenshift.models.OpenShiftCluster or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.get.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')
}
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.get(url, query_parameters, header_parameters)
response = await self._client.async_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('OpenShiftCluster', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}'}
async def _create_initial(
self, resource_group_name, resource_name, parameters, *, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = self.create.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')
}
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'
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 body
body_content = self._serialize.body(parameters, 'OpenShiftCluster')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = await self._client.async_send(request, stream=False, **operation_config)
if response.status_code not in [200, 201]:
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('OpenShiftCluster', response)
if response.status_code == 201:
deserialized = self._deserialize('OpenShiftCluster', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
async def create(
self, resource_group_name, resource_name, parameters, *, custom_headers=None, raw=False, polling=True, **operation_config):
"""Creates or updates a OpenShift cluster with the specified subscription,
resource group and resource name.
Creates or updates a OpenShift cluster with the specified subscription,
resource group and resource name. The operation returns properties of
a OpenShift cluster.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource.
:type resource_name: str
:param parameters: The OpenShift cluster resource.
:type parameters: ~redhatopenshift.models.OpenShiftCluster
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for AsyncARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of OpenShiftCluster or
ClientRawResponse<OpenShiftCluster> if raw==True
:rtype: ~~redhatopenshift.models.OpenShiftCluster or
~msrest.pipeline.ClientRawResponse[~redhatopenshift.models.OpenShiftCluster]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = await self._create_initial(
resource_group_name=resource_group_name,
resource_name=resource_name,
parameters=parameters,
custom_headers=custom_headers,
raw=True,
**operation_config
)
def get_long_running_output(response):
deserialized = self._deserialize('OpenShiftCluster', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = AsyncARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
return await async_poller(self._client, raw_result, get_long_running_output, polling_method)
create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}'}
async def _delete_initial(
self, resource_group_name, resource_name, *, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = self.delete.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')
}
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 = {}
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.delete(url, query_parameters, header_parameters)
response = await self._client.async_send(request, stream=False, **operation_config)
if response.status_code not in [200, 204]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
async def delete(
self, resource_group_name, resource_name, *, custom_headers=None, raw=False, polling=True, **operation_config):
"""Deletes a OpenShift cluster with the specified subscription, resource
group and resource name.
Deletes a OpenShift cluster with the specified subscription, resource
group and resource name. The operation returns nothing.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource.
:type resource_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for AsyncARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of None or ClientRawResponse<None> if raw==True
:rtype: ~None or ~msrest.pipeline.ClientRawResponse[None]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = await self._delete_initial(
resource_group_name=resource_group_name,
resource_name=resource_name,
custom_headers=custom_headers,
raw=True,
**operation_config
)
def get_long_running_output(response):
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = AsyncARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
return await async_poller(self._client, raw_result, get_long_running_output, polling_method)
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}'}
async def _update_initial(
self, resource_group_name, resource_name, parameters, *, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = self.update.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')
}
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'
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 body
body_content = self._serialize.body(parameters, 'OpenShiftCluster')
# Construct and send request
request = self._client.patch(url, query_parameters, header_parameters, body_content)
response = await self._client.async_send(request, stream=False, **operation_config)
if response.status_code not in [200, 201]:
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('OpenShiftCluster', response)
if response.status_code == 201:
deserialized = self._deserialize('OpenShiftCluster', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
async def update(
self, resource_group_name, resource_name, parameters, *, custom_headers=None, raw=False, polling=True, **operation_config):
"""Creates or updates a OpenShift cluster with the specified subscription,
resource group and resource name.
Creates or updates a OpenShift cluster with the specified subscription,
resource group and resource name. The operation returns properties of
a OpenShift cluster.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource.
:type resource_name: str
:param parameters: The OpenShift cluster resource.
:type parameters: ~redhatopenshift.models.OpenShiftCluster
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for AsyncARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of OpenShiftCluster or
ClientRawResponse<OpenShiftCluster> if raw==True
:rtype: ~~redhatopenshift.models.OpenShiftCluster or
~msrest.pipeline.ClientRawResponse[~redhatopenshift.models.OpenShiftCluster]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = await self._update_initial(
resource_group_name=resource_group_name,
resource_name=resource_name,
parameters=parameters,
custom_headers=custom_headers,
raw=True,
**operation_config
)
def get_long_running_output(response):
deserialized = self._deserialize('OpenShiftCluster', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = AsyncARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
return await async_poller(self._client, raw_result, get_long_running_output, polling_method)
update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}'}
async def get_credentials(
self, resource_group_name, resource_name, *, custom_headers=None, raw=False, **operation_config):
"""Gets credentials of a OpenShift cluster with the specified
subscription, resource group and resource name.
Gets credentials of a OpenShift cluster with the specified
subscription, resource group and resource name. The operation returns
the credentials.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource.
:type resource_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: OpenShiftClusterCredentials or ClientRawResponse if raw=true
:rtype: ~redhatopenshift.models.OpenShiftClusterCredentials or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.get_credentials.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')
}
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 = await self._client.async_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('OpenShiftClusterCredentials', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}/credentials'}

Просмотреть файл

@ -1,90 +0,0 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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 msrestazure.azure_exceptions import CloudError
from ... import models
class Operations:
"""Operations async operations.
You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute.
: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: "2019-12-31-preview".
"""
models = models
def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-12-31-preview"
self.config = config
async def list(
self, *, custom_headers=None, raw=False, **operation_config):
"""Lists all of the available RP operations.
Lists all of the available RP operations. The operation returns the
operations.
: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: OperationList or ClientRawResponse if raw=true
:rtype: ~redhatopenshift.models.OperationList or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.list.metadata['url']
# 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.get(url, query_parameters, header_parameters)
response = await self._client.async_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('OperationList', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
list.metadata = {'url': '/providers/Microsoft.RedHatOpenShift/operations'}

Просмотреть файл

@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

Просмотреть файл

@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

Просмотреть файл

@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

Просмотреть файл

@ -21,9 +21,9 @@ class AzureRedHatOpenShiftClient(SDKClient):
:vartype config: AzureRedHatOpenShiftClientConfiguration
:ivar operations: Operations operations
:vartype operations: redhatopenshift.operations.Operations
:vartype operations: azure.mgmt.redhatopenshift.v2019_12_31_preview.operations.Operations
:ivar open_shift_clusters: OpenShiftClusters operations
:vartype open_shift_clusters: redhatopenshift.operations.OpenShiftClustersOperations
:vartype open_shift_clusters: azure.mgmt.redhatopenshift.v2019_12_31_preview.operations.OpenShiftClustersOperations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials

Просмотреть файл

@ -13,7 +13,8 @@ class CloudError(Model):
"""CloudError represents a cloud error.
:param error: An error response from the service.
:type error: ~redhatopenshift.models.CloudErrorBody
:type error:
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.CloudErrorBody
"""
_attribute_map = {
@ -50,7 +51,8 @@ class CloudErrorBody(Model):
of the property in error.
:type target: str
:param details: A list of additional details about the error.
:type details: list[~redhatopenshift.models.CloudErrorBody]
:type details:
list[~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.CloudErrorBody]
"""
_attribute_map = {
@ -102,7 +104,8 @@ class MasterProfile(Model):
:param vm_size: The size of the master VMs (immutable). Possible values
include: 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3'
:type vm_size: str or ~redhatopenshift.models.enum
:type vm_size: str or
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.enum
:param subnet_id: The Azure resource ID of the worker subnet (immutable).
:type subnet_id: str
"""
@ -158,16 +161,20 @@ class OpenShiftCluster(Model):
:param provisioning_state: The cluster provisioning state (immutable).
Possible values include: 'Creating', 'Deleting', 'Failed', 'Succeeded',
'Updating'
:type provisioning_state: str or ~redhatopenshift.models.enum
:type provisioning_state: str or
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.enum
:param service_principal_profile: The cluster service principal profile.
:type service_principal_profile:
~redhatopenshift.models.ServicePrincipalProfile
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.ServicePrincipalProfile
:param network_profile: The cluster network profile.
:type network_profile: ~redhatopenshift.models.NetworkProfile
:type network_profile:
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.NetworkProfile
:param master_profile: The cluster master profile.
:type master_profile: ~redhatopenshift.models.MasterProfile
:type master_profile:
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.MasterProfile
:param worker_profiles: The cluster worker profiles.
:type worker_profiles: list[~redhatopenshift.models.WorkerProfile]
:type worker_profiles:
list[~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.WorkerProfile]
:param apiserver_url: The URL to access the cluster API server
(immutable).
:type apiserver_url: str
@ -232,7 +239,8 @@ class OpenShiftClusterList(Model):
"""OpenShiftClusterList represents a list of OpenShift clusters.
:param value: The list of OpenShift clusters.
:type value: list[~redhatopenshift.models.OpenShiftCluster]
:type value:
list[~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.OpenShiftCluster]
"""
_attribute_map = {
@ -250,7 +258,8 @@ class Operation(Model):
:param name: Operation name: {provider}/{resource}/{operation}.
:type name: str
:param display: The object that describes the operation.
:type display: ~redhatopenshift.models.Display
:type display:
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.Display
"""
_attribute_map = {
@ -268,7 +277,8 @@ class OperationList(Model):
"""OperationList represents an operation list.
:param value: List of operations supported by the resource provider.
:type value: list[~redhatopenshift.models.Operation]
:type value:
list[~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.Operation]
"""
_attribute_map = {
@ -307,7 +317,8 @@ class WorkerProfile(Model):
:type name: str
:param vm_size: The size of the worker VMs (immutable). Possible values
include: 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3'
:type vm_size: str or ~redhatopenshift.models.enum
:type vm_size: str or
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.enum
:param disk_size_gb: The disk size of the worker VMs. Must be 128 or
greater (immutable).
:type disk_size_gb: int

Просмотреть файл

@ -13,7 +13,8 @@ class CloudError(Model):
"""CloudError represents a cloud error.
:param error: An error response from the service.
:type error: ~redhatopenshift.models.CloudErrorBody
:type error:
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.CloudErrorBody
"""
_attribute_map = {
@ -50,7 +51,8 @@ class CloudErrorBody(Model):
of the property in error.
:type target: str
:param details: A list of additional details about the error.
:type details: list[~redhatopenshift.models.CloudErrorBody]
:type details:
list[~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.CloudErrorBody]
"""
_attribute_map = {
@ -102,7 +104,8 @@ class MasterProfile(Model):
:param vm_size: The size of the master VMs (immutable). Possible values
include: 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3'
:type vm_size: str or ~redhatopenshift.models.enum
:type vm_size: str or
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.enum
:param subnet_id: The Azure resource ID of the worker subnet (immutable).
:type subnet_id: str
"""
@ -158,16 +161,20 @@ class OpenShiftCluster(Model):
:param provisioning_state: The cluster provisioning state (immutable).
Possible values include: 'Creating', 'Deleting', 'Failed', 'Succeeded',
'Updating'
:type provisioning_state: str or ~redhatopenshift.models.enum
:type provisioning_state: str or
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.enum
:param service_principal_profile: The cluster service principal profile.
:type service_principal_profile:
~redhatopenshift.models.ServicePrincipalProfile
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.ServicePrincipalProfile
:param network_profile: The cluster network profile.
:type network_profile: ~redhatopenshift.models.NetworkProfile
:type network_profile:
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.NetworkProfile
:param master_profile: The cluster master profile.
:type master_profile: ~redhatopenshift.models.MasterProfile
:type master_profile:
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.MasterProfile
:param worker_profiles: The cluster worker profiles.
:type worker_profiles: list[~redhatopenshift.models.WorkerProfile]
:type worker_profiles:
list[~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.WorkerProfile]
:param apiserver_url: The URL to access the cluster API server
(immutable).
:type apiserver_url: str
@ -232,7 +239,8 @@ class OpenShiftClusterList(Model):
"""OpenShiftClusterList represents a list of OpenShift clusters.
:param value: The list of OpenShift clusters.
:type value: list[~redhatopenshift.models.OpenShiftCluster]
:type value:
list[~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.OpenShiftCluster]
"""
_attribute_map = {
@ -250,7 +258,8 @@ class Operation(Model):
:param name: Operation name: {provider}/{resource}/{operation}.
:type name: str
:param display: The object that describes the operation.
:type display: ~redhatopenshift.models.Display
:type display:
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.Display
"""
_attribute_map = {
@ -268,7 +277,8 @@ class OperationList(Model):
"""OperationList represents an operation list.
:param value: List of operations supported by the resource provider.
:type value: list[~redhatopenshift.models.Operation]
:type value:
list[~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.Operation]
"""
_attribute_map = {
@ -307,7 +317,8 @@ class WorkerProfile(Model):
:type name: str
:param vm_size: The size of the worker VMs (immutable). Possible values
include: 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3'
:type vm_size: str or ~redhatopenshift.models.enum
:type vm_size: str or
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.enum
:param disk_size_gb: The disk size of the worker VMs. Must be 128 or
greater (immutable).
:type disk_size_gb: int

Просмотреть файл

@ -50,8 +50,9 @@ class OpenShiftClustersOperations(object):
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OpenShiftClusterList or ClientRawResponse if raw=true
:rtype: ~redhatopenshift.models.OpenShiftClusterList or
~msrest.pipeline.ClientRawResponse
:rtype:
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.OpenShiftClusterList
or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
@ -111,8 +112,9 @@ class OpenShiftClustersOperations(object):
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OpenShiftClusterList or ClientRawResponse if raw=true
:rtype: ~redhatopenshift.models.OpenShiftClusterList or
~msrest.pipeline.ClientRawResponse
:rtype:
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.OpenShiftClusterList
or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
@ -176,8 +178,9 @@ class OpenShiftClustersOperations(object):
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OpenShiftCluster or ClientRawResponse if raw=true
:rtype: ~redhatopenshift.models.OpenShiftCluster or
~msrest.pipeline.ClientRawResponse
:rtype:
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.OpenShiftCluster
or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
@ -289,7 +292,8 @@ class OpenShiftClustersOperations(object):
:param resource_name: The name of the OpenShift cluster resource.
:type resource_name: str
:param parameters: The OpenShift cluster resource.
:type parameters: ~redhatopenshift.models.OpenShiftCluster
:type parameters:
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.OpenShiftCluster
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
@ -298,9 +302,9 @@ class OpenShiftClustersOperations(object):
:return: An instance of LROPoller that returns OpenShiftCluster or
ClientRawResponse<OpenShiftCluster> if raw==True
:rtype:
~msrestazure.azure_operation.AzureOperationPoller[~redhatopenshift.models.OpenShiftCluster]
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.OpenShiftCluster]
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~redhatopenshift.models.OpenShiftCluster]]
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.OpenShiftCluster]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._create_initial(
@ -479,7 +483,8 @@ class OpenShiftClustersOperations(object):
:param resource_name: The name of the OpenShift cluster resource.
:type resource_name: str
:param parameters: The OpenShift cluster resource.
:type parameters: ~redhatopenshift.models.OpenShiftCluster
:type parameters:
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.OpenShiftCluster
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
@ -488,9 +493,9 @@ class OpenShiftClustersOperations(object):
:return: An instance of LROPoller that returns OpenShiftCluster or
ClientRawResponse<OpenShiftCluster> if raw==True
:rtype:
~msrestazure.azure_operation.AzureOperationPoller[~redhatopenshift.models.OpenShiftCluster]
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.OpenShiftCluster]
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~redhatopenshift.models.OpenShiftCluster]]
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.OpenShiftCluster]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._update_initial(
@ -539,8 +544,9 @@ class OpenShiftClustersOperations(object):
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OpenShiftClusterCredentials or ClientRawResponse if raw=true
:rtype: ~redhatopenshift.models.OpenShiftClusterCredentials or
~msrest.pipeline.ClientRawResponse
:rtype:
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.OpenShiftClusterCredentials
or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL

Просмотреть файл

@ -48,8 +48,9 @@ class Operations(object):
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationList or ClientRawResponse if raw=true
:rtype: ~redhatopenshift.models.OperationList or
~msrest.pipeline.ClientRawResponse
:rtype:
~azure.mgmt.redhatopenshift.v2019_12_31_preview.models.OperationList
or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL