зеркало из
1
0
Форкнуть 0

[AutoRelease] t2-redhatopenshift-2024-10-30-81004(can only be merged by SDK owner) (#38181)

* code and test

* update-testcase

* Update CHANGELOG.md

* Update _meta.json

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <v-chenjiang@microsoft.com>
Co-authored-by: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com>
This commit is contained in:
Azure SDK Bot 2024-10-29 23:11:51 -07:00 коммит произвёл GitHub
Родитель 4ebca9c933
Коммит 2007944ff8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
243 изменённых файлов: 902 добавлений и 46115 удалений

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

@ -1,5 +1,11 @@
# Release History
## 2.0.0 (2024-10-30)
### Breaking Changes
- This package now only targets the latest Api-Version available on Azure and removes APIs of other Api-Version. After this change, the package can have much smaller size. If your application requires a specific and non-latest Api-Version, it's recommended to pin this package to the previous released version; If your application always only use latest Api-Version, please ingore this change.
## 1.5.0 (2024-07-22)
### Features Added

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

@ -1,18 +1,11 @@
{
"commit": "260f4f4012b3bebac33ea4db5c56105dd2fd33da",
"commit": "2776cb32cd6ca9ea953a13ae26c954b989e83367",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.15.0",
"@autorest/python@6.19.0",
"@autorest/modelerfour@4.27.0"
],
"autorest_command": "autorest specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.15.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/readme.md",
"package-2020-04-30": "2024-05-15 18:25:55 +0200 7dae1e5f45f91ec89d16a628e102341490ced849 stable/2020-04-30/redhatopenshift.json",
"package-2021-09-01-preview": "2024-05-15 18:25:55 +0200 7dae1e5f45f91ec89d16a628e102341490ced849 preview/2021-09-01-preview/redhatopenshift.json",
"package-2022-04-01": "2024-05-15 18:25:55 +0200 7dae1e5f45f91ec89d16a628e102341490ced849 stable/2022-04-01/redhatopenshift.json",
"package-2022-09-04": "2024-05-15 18:25:55 +0200 7dae1e5f45f91ec89d16a628e102341490ced849 stable/2022-09-04/redhatopenshift.json",
"package-2023-04-01": "2024-05-15 18:25:55 +0200 7dae1e5f45f91ec89d16a628e102341490ced849 stable/2023-04-01/redhatopenshift.json",
"package-2023-09-04": "2024-05-15 18:25:55 +0200 7dae1e5f45f91ec89d16a628e102341490ced849 stable/2023-09-04/redhatopenshift.json",
"package-2023-11": "2024-05-15 18:25:55 +0200 7dae1e5f45f91ec89d16a628e102341490ced849 stable/2023-11-22/redhatopenshift.json"
}
"autorest_command": "autorest specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-2023-11 --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/readme.md"
}

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

@ -1,6 +0,0 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "python",
"TagPrefix": "python/redhatopenshift/azure-mgmt-redhatopenshift",
"Tag": "python/redhatopenshift/azure-mgmt-redhatopenshift_8a51d0a696"
}

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

@ -7,14 +7,20 @@
# --------------------------------------------------------------------------
from ._azure_red_hat_open_shift_client import AzureRedHatOpenShiftClient
__all__ = ['AzureRedHatOpenShiftClient']
try:
from ._patch import patch_sdk # type: ignore
patch_sdk()
except ImportError:
pass
from ._version import VERSION
__version__ = VERSION
try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"AzureRedHatOpenShiftClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,82 +1,79 @@
# 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.
#
# 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.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, Optional, TYPE_CHECKING
from copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing_extensions import Self
from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from . import models as _models
from ._configuration import AzureRedHatOpenShiftClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import (
MachinePoolsOperations,
OpenShiftClustersOperations,
OpenShiftVersionsOperations,
Operations,
SecretsOperations,
SyncIdentityProvidersOperations,
SyncSetsOperations,
)
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
class _SDKClient(object):
def __init__(self, *args, **kwargs):
"""This is a fake class to support current implemetation of MultiApiClientMixin."
Will be removed in final version of multiapi azure-core based client
"""
pass
class AzureRedHatOpenShiftClient(MultiApiClientMixin, _SDKClient):
class AzureRedHatOpenShiftClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""Rest API for Azure Red Hat OpenShift 4.
This ready contains multiple API versions, to help you deal with all of the Azure clouds
(Azure Stack, Azure Government, Azure China, etc.).
By default, it uses the latest API version available on public Azure.
For production, you should stick to a particular api-version and/or profile.
The profile sets a mapping between an operation group and its API version.
The api-version parameter sets the default API version if the operation
group is not described in the profile.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.redhatopenshift.operations.Operations
:ivar open_shift_versions: OpenShiftVersionsOperations operations
:vartype open_shift_versions: azure.mgmt.redhatopenshift.operations.OpenShiftVersionsOperations
:ivar open_shift_clusters: OpenShiftClustersOperations operations
:vartype open_shift_clusters: azure.mgmt.redhatopenshift.operations.OpenShiftClustersOperations
:ivar machine_pools: MachinePoolsOperations operations
:vartype machine_pools: azure.mgmt.redhatopenshift.operations.MachinePoolsOperations
:ivar secrets: SecretsOperations operations
:vartype secrets: azure.mgmt.redhatopenshift.operations.SecretsOperations
:ivar sync_identity_providers: SyncIdentityProvidersOperations operations
:vartype sync_identity_providers:
azure.mgmt.redhatopenshift.operations.SyncIdentityProvidersOperations
:ivar sync_sets: SyncSetsOperations operations
:vartype sync_sets: azure.mgmt.redhatopenshift.operations.SyncSetsOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
:param base_url: Service URL
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:param profile: A profile definition, from KnownProfiles to dict.
:type profile: azure.profiles.KnownProfiles
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:keyword api_version: Api Version. Default value is "2023-11-22". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
"""
DEFAULT_API_VERSION = '2023-11-22'
_PROFILE_TAG = "azure.mgmt.redhatopenshift.AzureRedHatOpenShiftClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
}},
_PROFILE_TAG + " latest"
)
def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
api_version: Optional[str]=None,
base_url: str = "https://management.azure.com",
profile: KnownProfiles=KnownProfiles.default,
**kwargs: Any
):
if api_version:
kwargs.setdefault('api_version', api_version)
self._config = AzureRedHatOpenShiftClientConfiguration(credential, subscription_id, **kwargs)
) -> None:
self._config = AzureRedHatOpenShiftClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
@ -95,234 +92,54 @@ class AzureRedHatOpenShiftClient(MultiApiClientMixin, _SDKClient):
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(AzureRedHatOpenShiftClient, self).__init__(
api_version=api_version,
profile=profile
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.open_shift_versions = OpenShiftVersionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.open_shift_clusters = OpenShiftClustersOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.machine_pools = MachinePoolsOperations(self._client, self._config, self._serialize, self._deserialize)
self.secrets = SecretsOperations(self._client, self._config, self._serialize, self._deserialize)
self.sync_identity_providers = SyncIdentityProvidersOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.sync_sets = SyncSetsOperations(self._client, self._config, self._serialize, self._deserialize)
@classmethod
def _models_dict(cls, api_version):
return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
@classmethod
def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:
>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client._send_request(request)
<HttpResponse: 200 OK>
* 2020-04-30: :mod:`v2020_04_30.models<azure.mgmt.redhatopenshift.v2020_04_30.models>`
* 2021-09-01-preview: :mod:`v2021_09_01_preview.models<azure.mgmt.redhatopenshift.v2021_09_01_preview.models>`
* 2022-04-01: :mod:`v2022_04_01.models<azure.mgmt.redhatopenshift.v2022_04_01.models>`
* 2022-09-04: :mod:`v2022_09_04.models<azure.mgmt.redhatopenshift.v2022_09_04.models>`
* 2023-04-01: :mod:`v2023_04_01.models<azure.mgmt.redhatopenshift.v2023_04_01.models>`
* 2023-09-04: :mod:`v2023_09_04.models<azure.mgmt.redhatopenshift.v2023_09_04.models>`
* 2023-11-22: :mod:`v2023_11_22.models<azure.mgmt.redhatopenshift.v2023_11_22.models>`
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.rest.HttpResponse
"""
if api_version == '2020-04-30':
from .v2020_04_30 import models
return models
elif api_version == '2021-09-01-preview':
from .v2021_09_01_preview import models
return models
elif api_version == '2022-04-01':
from .v2022_04_01 import models
return models
elif api_version == '2022-09-04':
from .v2022_09_04 import models
return models
elif api_version == '2023-04-01':
from .v2023_04_01 import models
return models
elif api_version == '2023-09-04':
from .v2023_09_04 import models
return models
elif api_version == '2023-11-22':
from .v2023_11_22 import models
return models
raise ValueError("API version {} is not available".format(api_version))
@property
def machine_pools(self):
"""Instance depends on the API version:
request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
* 2022-09-04: :class:`MachinePoolsOperations<azure.mgmt.redhatopenshift.v2022_09_04.operations.MachinePoolsOperations>`
* 2023-04-01: :class:`MachinePoolsOperations<azure.mgmt.redhatopenshift.v2023_04_01.operations.MachinePoolsOperations>`
* 2023-09-04: :class:`MachinePoolsOperations<azure.mgmt.redhatopenshift.v2023_09_04.operations.MachinePoolsOperations>`
* 2023-11-22: :class:`MachinePoolsOperations<azure.mgmt.redhatopenshift.v2023_11_22.operations.MachinePoolsOperations>`
"""
api_version = self._get_api_version('machine_pools')
if api_version == '2022-09-04':
from .v2022_09_04.operations import MachinePoolsOperations as OperationClass
elif api_version == '2023-04-01':
from .v2023_04_01.operations import MachinePoolsOperations as OperationClass
elif api_version == '2023-09-04':
from .v2023_09_04.operations import MachinePoolsOperations as OperationClass
elif api_version == '2023-11-22':
from .v2023_11_22.operations import MachinePoolsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'machine_pools'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
@property
def open_shift_clusters(self):
"""Instance depends on the API version:
* 2020-04-30: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2020_04_30.operations.OpenShiftClustersOperations>`
* 2021-09-01-preview: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2021_09_01_preview.operations.OpenShiftClustersOperations>`
* 2022-04-01: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2022_04_01.operations.OpenShiftClustersOperations>`
* 2022-09-04: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2022_09_04.operations.OpenShiftClustersOperations>`
* 2023-04-01: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2023_04_01.operations.OpenShiftClustersOperations>`
* 2023-09-04: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2023_09_04.operations.OpenShiftClustersOperations>`
* 2023-11-22: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2023_11_22.operations.OpenShiftClustersOperations>`
"""
api_version = self._get_api_version('open_shift_clusters')
if api_version == '2020-04-30':
from .v2020_04_30.operations import OpenShiftClustersOperations as OperationClass
elif api_version == '2021-09-01-preview':
from .v2021_09_01_preview.operations import OpenShiftClustersOperations as OperationClass
elif api_version == '2022-04-01':
from .v2022_04_01.operations import OpenShiftClustersOperations as OperationClass
elif api_version == '2022-09-04':
from .v2022_09_04.operations import OpenShiftClustersOperations as OperationClass
elif api_version == '2023-04-01':
from .v2023_04_01.operations import OpenShiftClustersOperations as OperationClass
elif api_version == '2023-09-04':
from .v2023_09_04.operations import OpenShiftClustersOperations as OperationClass
elif api_version == '2023-11-22':
from .v2023_11_22.operations import OpenShiftClustersOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'open_shift_clusters'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
@property
def open_shift_versions(self):
"""Instance depends on the API version:
* 2022-09-04: :class:`OpenShiftVersionsOperations<azure.mgmt.redhatopenshift.v2022_09_04.operations.OpenShiftVersionsOperations>`
* 2023-04-01: :class:`OpenShiftVersionsOperations<azure.mgmt.redhatopenshift.v2023_04_01.operations.OpenShiftVersionsOperations>`
* 2023-09-04: :class:`OpenShiftVersionsOperations<azure.mgmt.redhatopenshift.v2023_09_04.operations.OpenShiftVersionsOperations>`
* 2023-11-22: :class:`OpenShiftVersionsOperations<azure.mgmt.redhatopenshift.v2023_11_22.operations.OpenShiftVersionsOperations>`
"""
api_version = self._get_api_version('open_shift_versions')
if api_version == '2022-09-04':
from .v2022_09_04.operations import OpenShiftVersionsOperations as OperationClass
elif api_version == '2023-04-01':
from .v2023_04_01.operations import OpenShiftVersionsOperations as OperationClass
elif api_version == '2023-09-04':
from .v2023_09_04.operations import OpenShiftVersionsOperations as OperationClass
elif api_version == '2023-11-22':
from .v2023_11_22.operations import OpenShiftVersionsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'open_shift_versions'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
@property
def operations(self):
"""Instance depends on the API version:
* 2020-04-30: :class:`Operations<azure.mgmt.redhatopenshift.v2020_04_30.operations.Operations>`
* 2021-09-01-preview: :class:`Operations<azure.mgmt.redhatopenshift.v2021_09_01_preview.operations.Operations>`
* 2022-04-01: :class:`Operations<azure.mgmt.redhatopenshift.v2022_04_01.operations.Operations>`
* 2022-09-04: :class:`Operations<azure.mgmt.redhatopenshift.v2022_09_04.operations.Operations>`
* 2023-04-01: :class:`Operations<azure.mgmt.redhatopenshift.v2023_04_01.operations.Operations>`
* 2023-09-04: :class:`Operations<azure.mgmt.redhatopenshift.v2023_09_04.operations.Operations>`
* 2023-11-22: :class:`Operations<azure.mgmt.redhatopenshift.v2023_11_22.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2020-04-30':
from .v2020_04_30.operations import Operations as OperationClass
elif api_version == '2021-09-01-preview':
from .v2021_09_01_preview.operations import Operations as OperationClass
elif api_version == '2022-04-01':
from .v2022_04_01.operations import Operations as OperationClass
elif api_version == '2022-09-04':
from .v2022_09_04.operations import Operations as OperationClass
elif api_version == '2023-04-01':
from .v2023_04_01.operations import Operations as OperationClass
elif api_version == '2023-09-04':
from .v2023_09_04.operations import Operations as OperationClass
elif api_version == '2023-11-22':
from .v2023_11_22.operations import Operations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
@property
def secrets(self):
"""Instance depends on the API version:
* 2022-09-04: :class:`SecretsOperations<azure.mgmt.redhatopenshift.v2022_09_04.operations.SecretsOperations>`
* 2023-04-01: :class:`SecretsOperations<azure.mgmt.redhatopenshift.v2023_04_01.operations.SecretsOperations>`
* 2023-09-04: :class:`SecretsOperations<azure.mgmt.redhatopenshift.v2023_09_04.operations.SecretsOperations>`
* 2023-11-22: :class:`SecretsOperations<azure.mgmt.redhatopenshift.v2023_11_22.operations.SecretsOperations>`
"""
api_version = self._get_api_version('secrets')
if api_version == '2022-09-04':
from .v2022_09_04.operations import SecretsOperations as OperationClass
elif api_version == '2023-04-01':
from .v2023_04_01.operations import SecretsOperations as OperationClass
elif api_version == '2023-09-04':
from .v2023_09_04.operations import SecretsOperations as OperationClass
elif api_version == '2023-11-22':
from .v2023_11_22.operations import SecretsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'secrets'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
@property
def sync_identity_providers(self):
"""Instance depends on the API version:
* 2022-09-04: :class:`SyncIdentityProvidersOperations<azure.mgmt.redhatopenshift.v2022_09_04.operations.SyncIdentityProvidersOperations>`
* 2023-04-01: :class:`SyncIdentityProvidersOperations<azure.mgmt.redhatopenshift.v2023_04_01.operations.SyncIdentityProvidersOperations>`
* 2023-09-04: :class:`SyncIdentityProvidersOperations<azure.mgmt.redhatopenshift.v2023_09_04.operations.SyncIdentityProvidersOperations>`
* 2023-11-22: :class:`SyncIdentityProvidersOperations<azure.mgmt.redhatopenshift.v2023_11_22.operations.SyncIdentityProvidersOperations>`
"""
api_version = self._get_api_version('sync_identity_providers')
if api_version == '2022-09-04':
from .v2022_09_04.operations import SyncIdentityProvidersOperations as OperationClass
elif api_version == '2023-04-01':
from .v2023_04_01.operations import SyncIdentityProvidersOperations as OperationClass
elif api_version == '2023-09-04':
from .v2023_09_04.operations import SyncIdentityProvidersOperations as OperationClass
elif api_version == '2023-11-22':
from .v2023_11_22.operations import SyncIdentityProvidersOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'sync_identity_providers'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
@property
def sync_sets(self):
"""Instance depends on the API version:
* 2022-09-04: :class:`SyncSetsOperations<azure.mgmt.redhatopenshift.v2022_09_04.operations.SyncSetsOperations>`
* 2023-04-01: :class:`SyncSetsOperations<azure.mgmt.redhatopenshift.v2023_04_01.operations.SyncSetsOperations>`
* 2023-09-04: :class:`SyncSetsOperations<azure.mgmt.redhatopenshift.v2023_09_04.operations.SyncSetsOperations>`
* 2023-11-22: :class:`SyncSetsOperations<azure.mgmt.redhatopenshift.v2023_11_22.operations.SyncSetsOperations>`
"""
api_version = self._get_api_version('sync_sets')
if api_version == '2022-09-04':
from .v2022_09_04.operations import SyncSetsOperations as OperationClass
elif api_version == '2023-04-01':
from .v2023_04_01.operations import SyncSetsOperations as OperationClass
elif api_version == '2023-09-04':
from .v2023_09_04.operations import SyncSetsOperations as OperationClass
elif api_version == '2023-11-22':
from .v2023_11_22.operations import SyncSetsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'sync_sets'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
def close(self):
def close(self) -> None:
self._client.close()
def __enter__(self):
def __enter__(self) -> Self:
self._client.__enter__()
return self
def __exit__(self, *exc_details):
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)

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

@ -1,13 +1,11 @@
# 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.
#
# 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.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, TYPE_CHECKING
from azure.core.pipeline import policies
@ -19,7 +17,8 @@ if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
class AzureRedHatOpenShiftClientConfiguration:
class AzureRedHatOpenShiftClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for AzureRedHatOpenShiftClient.
Note that all parameters used to create this instance are saved as instance
@ -29,14 +28,14 @@ class AzureRedHatOpenShiftClientConfiguration:
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-11-22". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
):
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
api_version: str = kwargs.pop("api_version", "2023-11-22")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
@ -44,23 +43,23 @@ class AzureRedHatOpenShiftClientConfiguration:
self.credential = credential
self.subscription_id = subscription_id
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'azure-mgmt-redhatopenshift/{}'.format(VERSION))
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-redhatopenshift/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)
def _configure(
self,
**kwargs: Any
):
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

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

@ -351,9 +351,7 @@ class Model(object):
def as_dict(
self,
keep_readonly: bool = True,
key_transformer: Callable[
[str, Dict[str, Any], Any], Any
] = attribute_transformer,
key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
**kwargs: Any
) -> JSON:
"""Return a dict that can be serialized using json.dump.
@ -542,7 +540,7 @@ class Serializer(object):
"multiple": lambda x, y: x % y != 0,
}
def __init__(self, classes: Optional[Mapping[str, type]]=None):
def __init__(self, classes: Optional[Mapping[str, type]] = None):
self.serialize_type = {
"iso-8601": Serializer.serialize_iso,
"rfc-1123": Serializer.serialize_rfc,
@ -750,7 +748,7 @@ class Serializer(object):
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
do_quote = not kwargs.get('skip_quote', False)
do_quote = not kwargs.get("skip_quote", False)
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
# Not a list, regular serialization
@ -909,12 +907,8 @@ class Serializer(object):
raise
serialized.append(None)
if kwargs.get('do_quote', False):
serialized = [
'' if s is None else quote(str(s), safe='')
for s
in serialized
]
if kwargs.get("do_quote", False):
serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
if div:
serialized = ["" if s is None else str(s) for s in serialized]
@ -1371,7 +1365,7 @@ class Deserializer(object):
valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
def __init__(self, classes: Optional[Mapping[str, type]]=None):
def __init__(self, classes: Optional[Mapping[str, type]] = None):
self.deserialize_type = {
"iso-8601": Deserializer.deserialize_iso,
"rfc-1123": Deserializer.deserialize_rfc,

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

@ -6,5 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
VERSION = "1.5.0"
VERSION = "2.0.0"

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

@ -7,4 +7,17 @@
# --------------------------------------------------------------------------
from ._azure_red_hat_open_shift_client import AzureRedHatOpenShiftClient
__all__ = ['AzureRedHatOpenShiftClient']
try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"AzureRedHatOpenShiftClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,82 +1,81 @@
# 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.
#
# 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.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, Optional, TYPE_CHECKING
from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from typing_extensions import Self
from azure.core.pipeline import policies
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from .. import models as _models
from .._serialization import Deserializer, Serializer
from ._configuration import AzureRedHatOpenShiftClientConfiguration
from .operations import (
MachinePoolsOperations,
OpenShiftClustersOperations,
OpenShiftVersionsOperations,
Operations,
SecretsOperations,
SyncIdentityProvidersOperations,
SyncSetsOperations,
)
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
class _SDKClient(object):
def __init__(self, *args, **kwargs):
"""This is a fake class to support current implemetation of MultiApiClientMixin."
Will be removed in final version of multiapi azure-core based client
"""
pass
class AzureRedHatOpenShiftClient(MultiApiClientMixin, _SDKClient):
class AzureRedHatOpenShiftClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""Rest API for Azure Red Hat OpenShift 4.
This ready contains multiple API versions, to help you deal with all of the Azure clouds
(Azure Stack, Azure Government, Azure China, etc.).
By default, it uses the latest API version available on public Azure.
For production, you should stick to a particular api-version and/or profile.
The profile sets a mapping between an operation group and its API version.
The api-version parameter sets the default API version if the operation
group is not described in the profile.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.redhatopenshift.aio.operations.Operations
:ivar open_shift_versions: OpenShiftVersionsOperations operations
:vartype open_shift_versions:
azure.mgmt.redhatopenshift.aio.operations.OpenShiftVersionsOperations
:ivar open_shift_clusters: OpenShiftClustersOperations operations
:vartype open_shift_clusters:
azure.mgmt.redhatopenshift.aio.operations.OpenShiftClustersOperations
:ivar machine_pools: MachinePoolsOperations operations
:vartype machine_pools: azure.mgmt.redhatopenshift.aio.operations.MachinePoolsOperations
:ivar secrets: SecretsOperations operations
:vartype secrets: azure.mgmt.redhatopenshift.aio.operations.SecretsOperations
:ivar sync_identity_providers: SyncIdentityProvidersOperations operations
:vartype sync_identity_providers:
azure.mgmt.redhatopenshift.aio.operations.SyncIdentityProvidersOperations
:ivar sync_sets: SyncSetsOperations operations
:vartype sync_sets: azure.mgmt.redhatopenshift.aio.operations.SyncSetsOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
:param base_url: Service URL
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:param profile: A profile definition, from KnownProfiles to dict.
:type profile: azure.profiles.KnownProfiles
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:keyword api_version: Api Version. Default value is "2023-11-22". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
"""
DEFAULT_API_VERSION = '2023-11-22'
_PROFILE_TAG = "azure.mgmt.redhatopenshift.AzureRedHatOpenShiftClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
}},
_PROFILE_TAG + " latest"
)
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
api_version: Optional[str] = None,
base_url: str = "https://management.azure.com",
profile: KnownProfiles = KnownProfiles.default,
**kwargs: Any
) -> None:
if api_version:
kwargs.setdefault('api_version', api_version)
self._config = AzureRedHatOpenShiftClientConfiguration(credential, subscription_id, **kwargs)
self._config = AzureRedHatOpenShiftClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
@ -95,234 +94,56 @@ class AzureRedHatOpenShiftClient(MultiApiClientMixin, _SDKClient):
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
super(AzureRedHatOpenShiftClient, self).__init__(
api_version=api_version,
profile=profile
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.open_shift_versions = OpenShiftVersionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.open_shift_clusters = OpenShiftClustersOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.machine_pools = MachinePoolsOperations(self._client, self._config, self._serialize, self._deserialize)
self.secrets = SecretsOperations(self._client, self._config, self._serialize, self._deserialize)
self.sync_identity_providers = SyncIdentityProvidersOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.sync_sets = SyncSetsOperations(self._client, self._config, self._serialize, self._deserialize)
@classmethod
def _models_dict(cls, api_version):
return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}
def _send_request(
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any
) -> Awaitable[AsyncHttpResponse]:
"""Runs the network request through the client's chained policies.
@classmethod
def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:
>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = await client._send_request(request)
<AsyncHttpResponse: 200 OK>
* 2020-04-30: :mod:`v2020_04_30.models<azure.mgmt.redhatopenshift.v2020_04_30.models>`
* 2021-09-01-preview: :mod:`v2021_09_01_preview.models<azure.mgmt.redhatopenshift.v2021_09_01_preview.models>`
* 2022-04-01: :mod:`v2022_04_01.models<azure.mgmt.redhatopenshift.v2022_04_01.models>`
* 2022-09-04: :mod:`v2022_09_04.models<azure.mgmt.redhatopenshift.v2022_09_04.models>`
* 2023-04-01: :mod:`v2023_04_01.models<azure.mgmt.redhatopenshift.v2023_04_01.models>`
* 2023-09-04: :mod:`v2023_09_04.models<azure.mgmt.redhatopenshift.v2023_09_04.models>`
* 2023-11-22: :mod:`v2023_11_22.models<azure.mgmt.redhatopenshift.v2023_11_22.models>`
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.rest.AsyncHttpResponse
"""
if api_version == '2020-04-30':
from ..v2020_04_30 import models
return models
elif api_version == '2021-09-01-preview':
from ..v2021_09_01_preview import models
return models
elif api_version == '2022-04-01':
from ..v2022_04_01 import models
return models
elif api_version == '2022-09-04':
from ..v2022_09_04 import models
return models
elif api_version == '2023-04-01':
from ..v2023_04_01 import models
return models
elif api_version == '2023-09-04':
from ..v2023_09_04 import models
return models
elif api_version == '2023-11-22':
from ..v2023_11_22 import models
return models
raise ValueError("API version {} is not available".format(api_version))
@property
def machine_pools(self):
"""Instance depends on the API version:
request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
* 2022-09-04: :class:`MachinePoolsOperations<azure.mgmt.redhatopenshift.v2022_09_04.aio.operations.MachinePoolsOperations>`
* 2023-04-01: :class:`MachinePoolsOperations<azure.mgmt.redhatopenshift.v2023_04_01.aio.operations.MachinePoolsOperations>`
* 2023-09-04: :class:`MachinePoolsOperations<azure.mgmt.redhatopenshift.v2023_09_04.aio.operations.MachinePoolsOperations>`
* 2023-11-22: :class:`MachinePoolsOperations<azure.mgmt.redhatopenshift.v2023_11_22.aio.operations.MachinePoolsOperations>`
"""
api_version = self._get_api_version('machine_pools')
if api_version == '2022-09-04':
from ..v2022_09_04.aio.operations import MachinePoolsOperations as OperationClass
elif api_version == '2023-04-01':
from ..v2023_04_01.aio.operations import MachinePoolsOperations as OperationClass
elif api_version == '2023-09-04':
from ..v2023_09_04.aio.operations import MachinePoolsOperations as OperationClass
elif api_version == '2023-11-22':
from ..v2023_11_22.aio.operations import MachinePoolsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'machine_pools'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
@property
def open_shift_clusters(self):
"""Instance depends on the API version:
* 2020-04-30: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2020_04_30.aio.operations.OpenShiftClustersOperations>`
* 2021-09-01-preview: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2021_09_01_preview.aio.operations.OpenShiftClustersOperations>`
* 2022-04-01: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2022_04_01.aio.operations.OpenShiftClustersOperations>`
* 2022-09-04: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2022_09_04.aio.operations.OpenShiftClustersOperations>`
* 2023-04-01: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2023_04_01.aio.operations.OpenShiftClustersOperations>`
* 2023-09-04: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2023_09_04.aio.operations.OpenShiftClustersOperations>`
* 2023-11-22: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2023_11_22.aio.operations.OpenShiftClustersOperations>`
"""
api_version = self._get_api_version('open_shift_clusters')
if api_version == '2020-04-30':
from ..v2020_04_30.aio.operations import OpenShiftClustersOperations as OperationClass
elif api_version == '2021-09-01-preview':
from ..v2021_09_01_preview.aio.operations import OpenShiftClustersOperations as OperationClass
elif api_version == '2022-04-01':
from ..v2022_04_01.aio.operations import OpenShiftClustersOperations as OperationClass
elif api_version == '2022-09-04':
from ..v2022_09_04.aio.operations import OpenShiftClustersOperations as OperationClass
elif api_version == '2023-04-01':
from ..v2023_04_01.aio.operations import OpenShiftClustersOperations as OperationClass
elif api_version == '2023-09-04':
from ..v2023_09_04.aio.operations import OpenShiftClustersOperations as OperationClass
elif api_version == '2023-11-22':
from ..v2023_11_22.aio.operations import OpenShiftClustersOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'open_shift_clusters'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
@property
def open_shift_versions(self):
"""Instance depends on the API version:
* 2022-09-04: :class:`OpenShiftVersionsOperations<azure.mgmt.redhatopenshift.v2022_09_04.aio.operations.OpenShiftVersionsOperations>`
* 2023-04-01: :class:`OpenShiftVersionsOperations<azure.mgmt.redhatopenshift.v2023_04_01.aio.operations.OpenShiftVersionsOperations>`
* 2023-09-04: :class:`OpenShiftVersionsOperations<azure.mgmt.redhatopenshift.v2023_09_04.aio.operations.OpenShiftVersionsOperations>`
* 2023-11-22: :class:`OpenShiftVersionsOperations<azure.mgmt.redhatopenshift.v2023_11_22.aio.operations.OpenShiftVersionsOperations>`
"""
api_version = self._get_api_version('open_shift_versions')
if api_version == '2022-09-04':
from ..v2022_09_04.aio.operations import OpenShiftVersionsOperations as OperationClass
elif api_version == '2023-04-01':
from ..v2023_04_01.aio.operations import OpenShiftVersionsOperations as OperationClass
elif api_version == '2023-09-04':
from ..v2023_09_04.aio.operations import OpenShiftVersionsOperations as OperationClass
elif api_version == '2023-11-22':
from ..v2023_11_22.aio.operations import OpenShiftVersionsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'open_shift_versions'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
@property
def operations(self):
"""Instance depends on the API version:
* 2020-04-30: :class:`Operations<azure.mgmt.redhatopenshift.v2020_04_30.aio.operations.Operations>`
* 2021-09-01-preview: :class:`Operations<azure.mgmt.redhatopenshift.v2021_09_01_preview.aio.operations.Operations>`
* 2022-04-01: :class:`Operations<azure.mgmt.redhatopenshift.v2022_04_01.aio.operations.Operations>`
* 2022-09-04: :class:`Operations<azure.mgmt.redhatopenshift.v2022_09_04.aio.operations.Operations>`
* 2023-04-01: :class:`Operations<azure.mgmt.redhatopenshift.v2023_04_01.aio.operations.Operations>`
* 2023-09-04: :class:`Operations<azure.mgmt.redhatopenshift.v2023_09_04.aio.operations.Operations>`
* 2023-11-22: :class:`Operations<azure.mgmt.redhatopenshift.v2023_11_22.aio.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2020-04-30':
from ..v2020_04_30.aio.operations import Operations as OperationClass
elif api_version == '2021-09-01-preview':
from ..v2021_09_01_preview.aio.operations import Operations as OperationClass
elif api_version == '2022-04-01':
from ..v2022_04_01.aio.operations import Operations as OperationClass
elif api_version == '2022-09-04':
from ..v2022_09_04.aio.operations import Operations as OperationClass
elif api_version == '2023-04-01':
from ..v2023_04_01.aio.operations import Operations as OperationClass
elif api_version == '2023-09-04':
from ..v2023_09_04.aio.operations import Operations as OperationClass
elif api_version == '2023-11-22':
from ..v2023_11_22.aio.operations import Operations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
@property
def secrets(self):
"""Instance depends on the API version:
* 2022-09-04: :class:`SecretsOperations<azure.mgmt.redhatopenshift.v2022_09_04.aio.operations.SecretsOperations>`
* 2023-04-01: :class:`SecretsOperations<azure.mgmt.redhatopenshift.v2023_04_01.aio.operations.SecretsOperations>`
* 2023-09-04: :class:`SecretsOperations<azure.mgmt.redhatopenshift.v2023_09_04.aio.operations.SecretsOperations>`
* 2023-11-22: :class:`SecretsOperations<azure.mgmt.redhatopenshift.v2023_11_22.aio.operations.SecretsOperations>`
"""
api_version = self._get_api_version('secrets')
if api_version == '2022-09-04':
from ..v2022_09_04.aio.operations import SecretsOperations as OperationClass
elif api_version == '2023-04-01':
from ..v2023_04_01.aio.operations import SecretsOperations as OperationClass
elif api_version == '2023-09-04':
from ..v2023_09_04.aio.operations import SecretsOperations as OperationClass
elif api_version == '2023-11-22':
from ..v2023_11_22.aio.operations import SecretsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'secrets'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
@property
def sync_identity_providers(self):
"""Instance depends on the API version:
* 2022-09-04: :class:`SyncIdentityProvidersOperations<azure.mgmt.redhatopenshift.v2022_09_04.aio.operations.SyncIdentityProvidersOperations>`
* 2023-04-01: :class:`SyncIdentityProvidersOperations<azure.mgmt.redhatopenshift.v2023_04_01.aio.operations.SyncIdentityProvidersOperations>`
* 2023-09-04: :class:`SyncIdentityProvidersOperations<azure.mgmt.redhatopenshift.v2023_09_04.aio.operations.SyncIdentityProvidersOperations>`
* 2023-11-22: :class:`SyncIdentityProvidersOperations<azure.mgmt.redhatopenshift.v2023_11_22.aio.operations.SyncIdentityProvidersOperations>`
"""
api_version = self._get_api_version('sync_identity_providers')
if api_version == '2022-09-04':
from ..v2022_09_04.aio.operations import SyncIdentityProvidersOperations as OperationClass
elif api_version == '2023-04-01':
from ..v2023_04_01.aio.operations import SyncIdentityProvidersOperations as OperationClass
elif api_version == '2023-09-04':
from ..v2023_09_04.aio.operations import SyncIdentityProvidersOperations as OperationClass
elif api_version == '2023-11-22':
from ..v2023_11_22.aio.operations import SyncIdentityProvidersOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'sync_identity_providers'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
@property
def sync_sets(self):
"""Instance depends on the API version:
* 2022-09-04: :class:`SyncSetsOperations<azure.mgmt.redhatopenshift.v2022_09_04.aio.operations.SyncSetsOperations>`
* 2023-04-01: :class:`SyncSetsOperations<azure.mgmt.redhatopenshift.v2023_04_01.aio.operations.SyncSetsOperations>`
* 2023-09-04: :class:`SyncSetsOperations<azure.mgmt.redhatopenshift.v2023_09_04.aio.operations.SyncSetsOperations>`
* 2023-11-22: :class:`SyncSetsOperations<azure.mgmt.redhatopenshift.v2023_11_22.aio.operations.SyncSetsOperations>`
"""
api_version = self._get_api_version('sync_sets')
if api_version == '2022-09-04':
from ..v2022_09_04.aio.operations import SyncSetsOperations as OperationClass
elif api_version == '2023-04-01':
from ..v2023_04_01.aio.operations import SyncSetsOperations as OperationClass
elif api_version == '2023-09-04':
from ..v2023_09_04.aio.operations import SyncSetsOperations as OperationClass
elif api_version == '2023-11-22':
from ..v2023_11_22.aio.operations import SyncSetsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'sync_sets'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
async def close(self):
async def close(self) -> None:
await self._client.close()
async def __aenter__(self):
async def __aenter__(self) -> Self:
await self._client.__aenter__()
return self
async def __aexit__(self, *exc_details):
async def __aexit__(self, *exc_details: Any) -> None:
await self._client.__aexit__(*exc_details)

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

@ -1,13 +1,11 @@
# 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.
#
# 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.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, TYPE_CHECKING
from azure.core.pipeline import policies
@ -19,7 +17,8 @@ if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
class AzureRedHatOpenShiftClientConfiguration:
class AzureRedHatOpenShiftClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for AzureRedHatOpenShiftClient.
Note that all parameters used to create this instance are saved as instance
@ -29,14 +28,14 @@ class AzureRedHatOpenShiftClientConfiguration:
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-11-22". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
api_version: str = kwargs.pop("api_version", "2023-11-22")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
@ -44,23 +43,23 @@ class AzureRedHatOpenShiftClientConfiguration:
self.credential = credential
self.subscription_id = subscription_id
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'azure-mgmt-redhatopenshift/{}'.format(VERSION))
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-redhatopenshift/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)
def _configure(
self,
**kwargs: Any
) -> None:
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

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

@ -50,7 +50,7 @@ class MachinePoolsOperations:
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2023_09_04.aio.AzureRedHatOpenShiftClient`'s
:class:`~azure.mgmt.redhatopenshift.aio.AzureRedHatOpenShiftClient`'s
:attr:`machine_pools` attribute.
"""
@ -62,7 +62,6 @@ class MachinePoolsOperations:
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncIterable["_models.MachinePool"]:
@ -76,14 +75,13 @@ class MachinePoolsOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: An iterator like instance of either MachinePool or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2023_09_04.models.MachinePool]
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.models.MachinePool]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.MachinePoolList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -116,7 +114,7 @@ class MachinePoolsOperations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
@ -164,7 +162,7 @@ class MachinePoolsOperations:
:param child_resource_name: The name of the MachinePool resource. Required.
:type child_resource_name: str
:return: MachinePool or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_09_04.models.MachinePool
:rtype: ~azure.mgmt.redhatopenshift.models.MachinePool
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -178,7 +176,7 @@ class MachinePoolsOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.MachinePool] = kwargs.pop("cls", None)
_request = build_get_request(
@ -234,12 +232,12 @@ class MachinePoolsOperations:
:param child_resource_name: The name of the MachinePool resource. Required.
:type child_resource_name: str
:param parameters: The MachinePool resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_09_04.models.MachinePool
:type parameters: ~azure.mgmt.redhatopenshift.models.MachinePool
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: MachinePool or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_09_04.models.MachinePool
:rtype: ~azure.mgmt.redhatopenshift.models.MachinePool
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -272,7 +270,7 @@ class MachinePoolsOperations:
Default value is "application/json".
:paramtype content_type: str
:return: MachinePool or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_09_04.models.MachinePool
:rtype: ~azure.mgmt.redhatopenshift.models.MachinePool
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -299,9 +297,9 @@ class MachinePoolsOperations:
:type child_resource_name: str
:param parameters: The MachinePool resource. Is either a MachinePool type or a IO[bytes] type.
Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_09_04.models.MachinePool or IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.MachinePool or IO[bytes]
:return: MachinePool or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_09_04.models.MachinePool
:rtype: ~azure.mgmt.redhatopenshift.models.MachinePool
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -315,7 +313,7 @@ class MachinePoolsOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.MachinePool] = kwargs.pop("cls", None)
@ -352,11 +350,7 @@ class MachinePoolsOperations:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("MachinePool", pipeline_response.http_response)
if response.status_code == 201:
deserialized = self._deserialize("MachinePool", pipeline_response.http_response)
deserialized = self._deserialize("MachinePool", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@ -393,7 +387,7 @@ class MachinePoolsOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
@ -444,12 +438,12 @@ class MachinePoolsOperations:
:param child_resource_name: The name of the MachinePool resource. Required.
:type child_resource_name: str
:param parameters: The MachinePool resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_09_04.models.MachinePoolUpdate
:type parameters: ~azure.mgmt.redhatopenshift.models.MachinePoolUpdate
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: MachinePool or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_09_04.models.MachinePool
:rtype: ~azure.mgmt.redhatopenshift.models.MachinePool
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -481,7 +475,7 @@ class MachinePoolsOperations:
Default value is "application/json".
:paramtype content_type: str
:return: MachinePool or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_09_04.models.MachinePool
:rtype: ~azure.mgmt.redhatopenshift.models.MachinePool
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -507,9 +501,9 @@ class MachinePoolsOperations:
:type child_resource_name: str
:param parameters: The MachinePool resource. Is either a MachinePoolUpdate type or a IO[bytes]
type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_09_04.models.MachinePoolUpdate or IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.MachinePoolUpdate or IO[bytes]
:return: MachinePool or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_09_04.models.MachinePool
:rtype: ~azure.mgmt.redhatopenshift.models.MachinePool
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -523,7 +517,7 @@ class MachinePoolsOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.MachinePool] = kwargs.pop("cls", None)

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

@ -18,6 +18,8 @@ from azure.core.exceptions import (
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
StreamClosedError,
StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
@ -55,7 +57,7 @@ class OpenShiftClustersOperations:
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2023_11_22.aio.AzureRedHatOpenShiftClient`'s
:class:`~azure.mgmt.redhatopenshift.aio.AzureRedHatOpenShiftClient`'s
:attr:`open_shift_clusters` attribute.
"""
@ -67,7 +69,6 @@ class OpenShiftClustersOperations:
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.OpenShiftCluster"]:
@ -77,13 +78,13 @@ class OpenShiftClustersOperations:
:return: An iterator like instance of either OpenShiftCluster or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OpenShiftClusterList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -114,7 +115,7 @@ class OpenShiftClustersOperations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
@ -159,13 +160,13 @@ class OpenShiftClustersOperations:
:type resource_group_name: str
:return: An iterator like instance of either OpenShiftCluster or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OpenShiftClusterList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -197,7 +198,7 @@ class OpenShiftClustersOperations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
@ -241,7 +242,7 @@ class OpenShiftClustersOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: OpenShiftCluster or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster
:rtype: ~azure.mgmt.redhatopenshift.models.OpenShiftCluster
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -255,7 +256,7 @@ class OpenShiftClustersOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OpenShiftCluster] = kwargs.pop("cls", None)
_request = build_get_request(
@ -304,7 +305,7 @@ class OpenShiftClustersOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
@ -329,6 +330,7 @@ class OpenShiftClustersOperations:
)
_request.url = self._client.format_url(_request.url)
_decompress = kwargs.pop("decompress", True)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
@ -337,15 +339,14 @@ class OpenShiftClustersOperations:
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
await response.read() # Load the body in memory and close the socket
try:
await response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = response.stream_download(self._client._pipeline)
if response.status_code == 201:
deserialized = response.stream_download(self._client._pipeline)
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@ -373,14 +374,13 @@ class OpenShiftClustersOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster
:type parameters: ~azure.mgmt.redhatopenshift.models.OpenShiftCluster
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -411,8 +411,7 @@ class OpenShiftClustersOperations:
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -436,17 +435,16 @@ class OpenShiftClustersOperations:
:type resource_name: str
:param parameters: The OpenShift cluster resource. Is either a OpenShiftCluster type or a
IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster or IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.OpenShiftCluster or IO[bytes]
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.OpenShiftCluster] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
@ -504,7 +502,7 @@ class OpenShiftClustersOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
_request = build_delete_request(
@ -517,6 +515,7 @@ class OpenShiftClustersOperations:
)
_request.url = self._client.format_url(_request.url)
_decompress = kwargs.pop("decompress", True)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
@ -525,15 +524,14 @@ class OpenShiftClustersOperations:
response = pipeline_response.http_response
if response.status_code not in [202, 204]:
await response.read() # Load the body in memory and close the socket
try:
await response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 202:
deserialized = response.stream_download(self._client._pipeline)
if response.status_code == 204:
deserialized = response.stream_download(self._client._pipeline)
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@ -558,7 +556,7 @@ class OpenShiftClustersOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
@ -613,7 +611,7 @@ class OpenShiftClustersOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
@ -638,6 +636,7 @@ class OpenShiftClustersOperations:
)
_request.url = self._client.format_url(_request.url)
_decompress = kwargs.pop("decompress", True)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
@ -646,15 +645,14 @@ class OpenShiftClustersOperations:
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
await response.read() # Load the body in memory and close the socket
try:
await response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = response.stream_download(self._client._pipeline)
if response.status_code == 201:
deserialized = response.stream_download(self._client._pipeline)
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@ -681,14 +679,13 @@ class OpenShiftClustersOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftClusterUpdate
:type parameters: ~azure.mgmt.redhatopenshift.models.OpenShiftClusterUpdate
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -718,8 +715,7 @@ class OpenShiftClustersOperations:
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -742,18 +738,16 @@ class OpenShiftClustersOperations:
:type resource_name: str
:param parameters: The OpenShift cluster resource. Is either a OpenShiftClusterUpdate type or a
IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftClusterUpdate or
IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.OpenShiftClusterUpdate or IO[bytes]
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.OpenShiftCluster] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
@ -812,7 +806,7 @@ class OpenShiftClustersOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: OpenShiftClusterAdminKubeconfig or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftClusterAdminKubeconfig
:rtype: ~azure.mgmt.redhatopenshift.models.OpenShiftClusterAdminKubeconfig
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -826,7 +820,7 @@ class OpenShiftClustersOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OpenShiftClusterAdminKubeconfig] = kwargs.pop("cls", None)
_request = build_list_admin_credentials_request(
@ -872,7 +866,7 @@ class OpenShiftClustersOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: OpenShiftClusterCredentials or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftClusterCredentials
:rtype: ~azure.mgmt.redhatopenshift.models.OpenShiftClusterCredentials
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -886,7 +880,7 @@ class OpenShiftClustersOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OpenShiftClusterCredentials] = kwargs.pop("cls", None)
_request = build_list_credentials_request(

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

@ -42,7 +42,7 @@ class OpenShiftVersionsOperations:
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2022_09_04.aio.AzureRedHatOpenShiftClient`'s
:class:`~azure.mgmt.redhatopenshift.aio.AzureRedHatOpenShiftClient`'s
:attr:`open_shift_versions` attribute.
"""
@ -54,7 +54,6 @@ class OpenShiftVersionsOperations:
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.OpenShiftVersion"]:
@ -66,13 +65,13 @@ class OpenShiftVersionsOperations:
:type location: str
:return: An iterator like instance of either OpenShiftVersion or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2022_09_04.models.OpenShiftVersion]
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.models.OpenShiftVersion]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OpenShiftVersionList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -104,7 +103,7 @@ class OpenShiftVersionsOperations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)

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

@ -42,7 +42,7 @@ class Operations:
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2023_09_04.aio.AzureRedHatOpenShiftClient`'s
:class:`~azure.mgmt.redhatopenshift.aio.AzureRedHatOpenShiftClient`'s
:attr:`operations` attribute.
"""
@ -54,7 +54,6 @@ class Operations:
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
@ -63,14 +62,13 @@ class Operations:
The operation returns the RP operations.
:return: An iterator like instance of either Operation or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2023_09_04.models.Operation]
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.models.Operation]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OperationList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -100,7 +98,7 @@ class Operations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)

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

@ -50,7 +50,7 @@ class SecretsOperations:
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2023_09_04.aio.AzureRedHatOpenShiftClient`'s
:class:`~azure.mgmt.redhatopenshift.aio.AzureRedHatOpenShiftClient`'s
:attr:`secrets` attribute.
"""
@ -62,7 +62,6 @@ class SecretsOperations:
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncIterable["_models.Secret"]:
@ -76,14 +75,13 @@ class SecretsOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: An iterator like instance of either Secret or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2023_09_04.models.Secret]
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.models.Secret]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SecretList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -116,7 +114,7 @@ class SecretsOperations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
@ -164,7 +162,7 @@ class SecretsOperations:
:param child_resource_name: The name of the Secret resource. Required.
:type child_resource_name: str
:return: Secret or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_09_04.models.Secret
:rtype: ~azure.mgmt.redhatopenshift.models.Secret
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -178,7 +176,7 @@ class SecretsOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.Secret] = kwargs.pop("cls", None)
_request = build_get_request(
@ -233,12 +231,12 @@ class SecretsOperations:
:param child_resource_name: The name of the Secret resource. Required.
:type child_resource_name: str
:param parameters: The Secret resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_09_04.models.Secret
:type parameters: ~azure.mgmt.redhatopenshift.models.Secret
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: Secret or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_09_04.models.Secret
:rtype: ~azure.mgmt.redhatopenshift.models.Secret
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -270,7 +268,7 @@ class SecretsOperations:
Default value is "application/json".
:paramtype content_type: str
:return: Secret or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_09_04.models.Secret
:rtype: ~azure.mgmt.redhatopenshift.models.Secret
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -295,9 +293,9 @@ class SecretsOperations:
:param child_resource_name: The name of the Secret resource. Required.
:type child_resource_name: str
:param parameters: The Secret resource. Is either a Secret type or a IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_09_04.models.Secret or IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.Secret or IO[bytes]
:return: Secret or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_09_04.models.Secret
:rtype: ~azure.mgmt.redhatopenshift.models.Secret
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -311,7 +309,7 @@ class SecretsOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.Secret] = kwargs.pop("cls", None)
@ -348,11 +346,7 @@ class SecretsOperations:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("Secret", pipeline_response.http_response)
if response.status_code == 201:
deserialized = self._deserialize("Secret", pipeline_response.http_response)
deserialized = self._deserialize("Secret", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@ -389,7 +383,7 @@ class SecretsOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
@ -440,12 +434,12 @@ class SecretsOperations:
:param child_resource_name: The name of the Secret resource. Required.
:type child_resource_name: str
:param parameters: The Secret resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_09_04.models.SecretUpdate
:type parameters: ~azure.mgmt.redhatopenshift.models.SecretUpdate
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: Secret or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_09_04.models.Secret
:rtype: ~azure.mgmt.redhatopenshift.models.Secret
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -477,7 +471,7 @@ class SecretsOperations:
Default value is "application/json".
:paramtype content_type: str
:return: Secret or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_09_04.models.Secret
:rtype: ~azure.mgmt.redhatopenshift.models.Secret
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -503,9 +497,9 @@ class SecretsOperations:
:type child_resource_name: str
:param parameters: The Secret resource. Is either a SecretUpdate type or a IO[bytes] type.
Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_09_04.models.SecretUpdate or IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.SecretUpdate or IO[bytes]
:return: Secret or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_09_04.models.Secret
:rtype: ~azure.mgmt.redhatopenshift.models.Secret
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -519,7 +513,7 @@ class SecretsOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.Secret] = kwargs.pop("cls", None)

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

@ -50,7 +50,7 @@ class SyncIdentityProvidersOperations:
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2022_09_04.aio.AzureRedHatOpenShiftClient`'s
:class:`~azure.mgmt.redhatopenshift.aio.AzureRedHatOpenShiftClient`'s
:attr:`sync_identity_providers` attribute.
"""
@ -62,7 +62,6 @@ class SyncIdentityProvidersOperations:
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(
@ -80,13 +79,13 @@ class SyncIdentityProvidersOperations:
:return: An iterator like instance of either SyncIdentityProvider or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider]
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.models.SyncIdentityProvider]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SyncIdentityProviderList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -119,7 +118,7 @@ class SyncIdentityProvidersOperations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
@ -167,7 +166,7 @@ class SyncIdentityProvidersOperations:
:param child_resource_name: The name of the SyncIdentityProvider resource. Required.
:type child_resource_name: str
:return: SyncIdentityProvider or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider
:rtype: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -181,7 +180,7 @@ class SyncIdentityProvidersOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SyncIdentityProvider] = kwargs.pop("cls", None)
_request = build_get_request(
@ -237,12 +236,12 @@ class SyncIdentityProvidersOperations:
:param child_resource_name: The name of the SyncIdentityProvider resource. Required.
:type child_resource_name: str
:param parameters: The SyncIdentityProvider resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: SyncIdentityProvider or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider
:rtype: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -275,7 +274,7 @@ class SyncIdentityProvidersOperations:
Default value is "application/json".
:paramtype content_type: str
:return: SyncIdentityProvider or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider
:rtype: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -302,10 +301,9 @@ class SyncIdentityProvidersOperations:
:type child_resource_name: str
:param parameters: The SyncIdentityProvider resource. Is either a SyncIdentityProvider type or
a IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider or
IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider or IO[bytes]
:return: SyncIdentityProvider or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider
:rtype: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -319,7 +317,7 @@ class SyncIdentityProvidersOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SyncIdentityProvider] = kwargs.pop("cls", None)
@ -356,11 +354,7 @@ class SyncIdentityProvidersOperations:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("SyncIdentityProvider", pipeline_response.http_response)
if response.status_code == 201:
deserialized = self._deserialize("SyncIdentityProvider", pipeline_response.http_response)
deserialized = self._deserialize("SyncIdentityProvider", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@ -398,7 +392,7 @@ class SyncIdentityProvidersOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
@ -450,12 +444,12 @@ class SyncIdentityProvidersOperations:
:param child_resource_name: The name of the SyncIdentityProvider resource. Required.
:type child_resource_name: str
:param parameters: The SyncIdentityProvider resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProviderUpdate
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncIdentityProviderUpdate
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: SyncIdentityProvider or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider
:rtype: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -488,7 +482,7 @@ class SyncIdentityProvidersOperations:
Default value is "application/json".
:paramtype content_type: str
:return: SyncIdentityProvider or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider
:rtype: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -515,10 +509,9 @@ class SyncIdentityProvidersOperations:
:type child_resource_name: str
:param parameters: The SyncIdentityProvider resource. Is either a SyncIdentityProviderUpdate
type or a IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProviderUpdate or
IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncIdentityProviderUpdate or IO[bytes]
:return: SyncIdentityProvider or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider
:rtype: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -532,7 +525,7 @@ class SyncIdentityProvidersOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SyncIdentityProvider] = kwargs.pop("cls", None)

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

@ -50,7 +50,7 @@ class SyncSetsOperations:
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2022_09_04.aio.AzureRedHatOpenShiftClient`'s
:class:`~azure.mgmt.redhatopenshift.aio.AzureRedHatOpenShiftClient`'s
:attr:`sync_sets` attribute.
"""
@ -62,7 +62,6 @@ class SyncSetsOperations:
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncIterable["_models.SyncSet"]:
@ -76,14 +75,13 @@ class SyncSetsOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: An iterator like instance of either SyncSet or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet]
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.models.SyncSet]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SyncSetList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -116,7 +114,7 @@ class SyncSetsOperations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
@ -164,7 +162,7 @@ class SyncSetsOperations:
:param child_resource_name: The name of the SyncSet resource. Required.
:type child_resource_name: str
:return: SyncSet or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet
:rtype: ~azure.mgmt.redhatopenshift.models.SyncSet
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -178,7 +176,7 @@ class SyncSetsOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SyncSet] = kwargs.pop("cls", None)
_request = build_get_request(
@ -233,12 +231,12 @@ class SyncSetsOperations:
:param child_resource_name: The name of the SyncSet resource. Required.
:type child_resource_name: str
:param parameters: The SyncSet resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncSet
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: SyncSet or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet
:rtype: ~azure.mgmt.redhatopenshift.models.SyncSet
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -270,7 +268,7 @@ class SyncSetsOperations:
Default value is "application/json".
:paramtype content_type: str
:return: SyncSet or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet
:rtype: ~azure.mgmt.redhatopenshift.models.SyncSet
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -296,9 +294,9 @@ class SyncSetsOperations:
:type child_resource_name: str
:param parameters: The SyncSet resource. Is either a SyncSet type or a IO[bytes] type.
Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet or IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncSet or IO[bytes]
:return: SyncSet or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet
:rtype: ~azure.mgmt.redhatopenshift.models.SyncSet
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -312,7 +310,7 @@ class SyncSetsOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SyncSet] = kwargs.pop("cls", None)
@ -349,11 +347,7 @@ class SyncSetsOperations:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("SyncSet", pipeline_response.http_response)
if response.status_code == 201:
deserialized = self._deserialize("SyncSet", pipeline_response.http_response)
deserialized = self._deserialize("SyncSet", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@ -390,7 +384,7 @@ class SyncSetsOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
@ -441,12 +435,12 @@ class SyncSetsOperations:
:param child_resource_name: The name of the SyncSet resource. Required.
:type child_resource_name: str
:param parameters: The SyncSet resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSetUpdate
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncSetUpdate
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: SyncSet or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet
:rtype: ~azure.mgmt.redhatopenshift.models.SyncSet
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -478,7 +472,7 @@ class SyncSetsOperations:
Default value is "application/json".
:paramtype content_type: str
:return: SyncSet or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet
:rtype: ~azure.mgmt.redhatopenshift.models.SyncSet
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -504,9 +498,9 @@ class SyncSetsOperations:
:type child_resource_name: str
:param parameters: The SyncSet resource. Is either a SyncSetUpdate type or a IO[bytes] type.
Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSetUpdate or IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncSetUpdate or IO[bytes]
:return: SyncSet or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet
:rtype: ~azure.mgmt.redhatopenshift.models.SyncSet
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -520,7 +514,7 @@ class SyncSetsOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-04"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SyncSet] = kwargs.pop("cls", None)

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

@ -1,7 +0,0 @@
# 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.
# --------------------------------------------------------------------------
from .v2023_11_22.models import *

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

@ -10,7 +10,7 @@
import datetime
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union
from ... import _serialization
from .. import _serialization
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
@ -23,7 +23,7 @@ class APIServerProfile(_serialization.Model):
Variables are only populated by the server, and will be ignored when sending a request.
:ivar visibility: API server visibility. Known values are: "Private" and "Public".
:vartype visibility: str or ~azure.mgmt.redhatopenshift.v2023_11_22.models.Visibility
:vartype visibility: str or ~azure.mgmt.redhatopenshift.models.Visibility
:ivar url: The URL to access the cluster API server.
:vartype url: str
:ivar ip: The IP of the cluster API server.
@ -44,7 +44,7 @@ class APIServerProfile(_serialization.Model):
def __init__(self, *, visibility: Optional[Union[str, "_models.Visibility"]] = None, **kwargs: Any) -> None:
"""
:keyword visibility: API server visibility. Known values are: "Private" and "Public".
:paramtype visibility: str or ~azure.mgmt.redhatopenshift.v2023_11_22.models.Visibility
:paramtype visibility: str or ~azure.mgmt.redhatopenshift.models.Visibility
"""
super().__init__(**kwargs)
self.visibility = visibility
@ -65,7 +65,7 @@ class CloudErrorBody(_serialization.Model):
error.
:vartype target: str
:ivar details: A list of additional details about the error.
:vartype details: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.CloudErrorBody]
:vartype details: list[~azure.mgmt.redhatopenshift.models.CloudErrorBody]
"""
_attribute_map = {
@ -95,7 +95,7 @@ class CloudErrorBody(_serialization.Model):
error.
:paramtype target: str
:keyword details: A list of additional details about the error.
:paramtype details: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.CloudErrorBody]
:paramtype details: list[~azure.mgmt.redhatopenshift.models.CloudErrorBody]
"""
super().__init__(**kwargs)
self.code = code
@ -117,8 +117,7 @@ class ClusterProfile(_serialization.Model):
:vartype resource_group_id: str
:ivar fips_validated_modules: If FIPS validated crypto modules are used. Known values are:
"Disabled" and "Enabled".
:vartype fips_validated_modules: str or
~azure.mgmt.redhatopenshift.v2023_11_22.models.FipsValidatedModules
:vartype fips_validated_modules: str or ~azure.mgmt.redhatopenshift.models.FipsValidatedModules
"""
_attribute_map = {
@ -151,7 +150,7 @@ class ClusterProfile(_serialization.Model):
:keyword fips_validated_modules: If FIPS validated crypto modules are used. Known values are:
"Disabled" and "Enabled".
:paramtype fips_validated_modules: str or
~azure.mgmt.redhatopenshift.v2023_11_22.models.FipsValidatedModules
~azure.mgmt.redhatopenshift.models.FipsValidatedModules
"""
super().__init__(**kwargs)
self.pull_secret = pull_secret
@ -259,7 +258,7 @@ class IngressProfile(_serialization.Model):
:ivar name: The ingress profile name.
:vartype name: str
:ivar visibility: Ingress visibility. Known values are: "Private" and "Public".
:vartype visibility: str or ~azure.mgmt.redhatopenshift.v2023_11_22.models.Visibility
:vartype visibility: str or ~azure.mgmt.redhatopenshift.models.Visibility
:ivar ip: The IP of the ingress.
:vartype ip: str
"""
@ -285,7 +284,7 @@ class IngressProfile(_serialization.Model):
:keyword name: The ingress profile name.
:paramtype name: str
:keyword visibility: Ingress visibility. Known values are: "Private" and "Public".
:paramtype visibility: str or ~azure.mgmt.redhatopenshift.v2023_11_22.models.Visibility
:paramtype visibility: str or ~azure.mgmt.redhatopenshift.models.Visibility
"""
super().__init__(**kwargs)
self.name = name
@ -300,12 +299,10 @@ class LoadBalancerProfile(_serialization.Model):
:ivar managed_outbound_ips: The desired managed outbound IPs for the cluster public load
balancer.
:vartype managed_outbound_ips:
~azure.mgmt.redhatopenshift.v2023_11_22.models.ManagedOutboundIPs
:vartype managed_outbound_ips: ~azure.mgmt.redhatopenshift.models.ManagedOutboundIPs
:ivar effective_outbound_ips: The list of effective outbound IP addresses of the public load
balancer.
:vartype effective_outbound_ips:
list[~azure.mgmt.redhatopenshift.v2023_11_22.models.EffectiveOutboundIP]
:vartype effective_outbound_ips: list[~azure.mgmt.redhatopenshift.models.EffectiveOutboundIP]
"""
_validation = {
@ -321,8 +318,7 @@ class LoadBalancerProfile(_serialization.Model):
"""
:keyword managed_outbound_ips: The desired managed outbound IPs for the cluster public load
balancer.
:paramtype managed_outbound_ips:
~azure.mgmt.redhatopenshift.v2023_11_22.models.ManagedOutboundIPs
:paramtype managed_outbound_ips: ~azure.mgmt.redhatopenshift.models.ManagedOutboundIPs
"""
super().__init__(**kwargs)
self.managed_outbound_ips = managed_outbound_ips
@ -344,7 +340,7 @@ class Resource(_serialization.Model):
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SystemData
:vartype system_data: ~azure.mgmt.redhatopenshift.models.SystemData
"""
_validation = {
@ -386,7 +382,7 @@ class ProxyResource(Resource):
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SystemData
:vartype system_data: ~azure.mgmt.redhatopenshift.models.SystemData
"""
@ -405,7 +401,7 @@ class MachinePool(ProxyResource):
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SystemData
:vartype system_data: ~azure.mgmt.redhatopenshift.models.SystemData
:ivar resources:
:vartype resources: str
"""
@ -438,7 +434,7 @@ class MachinePoolList(_serialization.Model):
"""MachinePoolList represents a list of MachinePools.
:ivar value: The list of Machine Pools.
:vartype value: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.MachinePool]
:vartype value: list[~azure.mgmt.redhatopenshift.models.MachinePool]
:ivar next_link: The link used to get the next page of operations.
:vartype next_link: str
"""
@ -453,7 +449,7 @@ class MachinePoolList(_serialization.Model):
) -> None:
"""
:keyword value: The list of Machine Pools.
:paramtype value: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.MachinePool]
:paramtype value: list[~azure.mgmt.redhatopenshift.models.MachinePool]
:keyword next_link: The link used to get the next page of operations.
:paramtype next_link: str
"""
@ -468,7 +464,7 @@ class MachinePoolUpdate(_serialization.Model):
Variables are only populated by the server, and will be ignored when sending a request.
:ivar system_data: The system meta data relating to this resource.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SystemData
:vartype system_data: ~azure.mgmt.redhatopenshift.models.SystemData
:ivar resources:
:vartype resources: str
"""
@ -526,8 +522,7 @@ class MasterProfile(_serialization.Model):
:vartype subnet_id: str
:ivar encryption_at_host: Whether master virtual machines are encrypted at host. Known values
are: "Disabled" and "Enabled".
:vartype encryption_at_host: str or
~azure.mgmt.redhatopenshift.v2023_11_22.models.EncryptionAtHost
:vartype encryption_at_host: str or ~azure.mgmt.redhatopenshift.models.EncryptionAtHost
:ivar disk_encryption_set_id: The resource ID of an associated DiskEncryptionSet, if
applicable.
:vartype disk_encryption_set_id: str
@ -556,8 +551,7 @@ class MasterProfile(_serialization.Model):
:paramtype subnet_id: str
:keyword encryption_at_host: Whether master virtual machines are encrypted at host. Known
values are: "Disabled" and "Enabled".
:paramtype encryption_at_host: str or
~azure.mgmt.redhatopenshift.v2023_11_22.models.EncryptionAtHost
:paramtype encryption_at_host: str or ~azure.mgmt.redhatopenshift.models.EncryptionAtHost
:keyword disk_encryption_set_id: The resource ID of an associated DiskEncryptionSet, if
applicable.
:paramtype disk_encryption_set_id: str
@ -578,14 +572,12 @@ class NetworkProfile(_serialization.Model):
:vartype service_cidr: str
:ivar outbound_type: The OutboundType used for egress traffic. Known values are: "Loadbalancer"
and "UserDefinedRouting".
:vartype outbound_type: str or ~azure.mgmt.redhatopenshift.v2023_11_22.models.OutboundType
:vartype outbound_type: str or ~azure.mgmt.redhatopenshift.models.OutboundType
:ivar load_balancer_profile: The cluster load balancer profile.
:vartype load_balancer_profile:
~azure.mgmt.redhatopenshift.v2023_11_22.models.LoadBalancerProfile
:vartype load_balancer_profile: ~azure.mgmt.redhatopenshift.models.LoadBalancerProfile
:ivar preconfigured_nsg: Specifies whether subnets are pre-attached with an NSG. Known values
are: "Disabled" and "Enabled".
:vartype preconfigured_nsg: str or
~azure.mgmt.redhatopenshift.v2023_11_22.models.PreconfiguredNSG
:vartype preconfigured_nsg: str or ~azure.mgmt.redhatopenshift.models.PreconfiguredNSG
"""
_attribute_map = {
@ -613,14 +605,12 @@ class NetworkProfile(_serialization.Model):
:paramtype service_cidr: str
:keyword outbound_type: The OutboundType used for egress traffic. Known values are:
"Loadbalancer" and "UserDefinedRouting".
:paramtype outbound_type: str or ~azure.mgmt.redhatopenshift.v2023_11_22.models.OutboundType
:paramtype outbound_type: str or ~azure.mgmt.redhatopenshift.models.OutboundType
:keyword load_balancer_profile: The cluster load balancer profile.
:paramtype load_balancer_profile:
~azure.mgmt.redhatopenshift.v2023_11_22.models.LoadBalancerProfile
:paramtype load_balancer_profile: ~azure.mgmt.redhatopenshift.models.LoadBalancerProfile
:keyword preconfigured_nsg: Specifies whether subnets are pre-attached with an NSG. Known
values are: "Disabled" and "Enabled".
:paramtype preconfigured_nsg: str or
~azure.mgmt.redhatopenshift.v2023_11_22.models.PreconfiguredNSG
:paramtype preconfigured_nsg: str or ~azure.mgmt.redhatopenshift.models.PreconfiguredNSG
"""
super().__init__(**kwargs)
self.pod_cidr = pod_cidr
@ -648,7 +638,7 @@ class TrackedResource(Resource):
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SystemData
:vartype system_data: ~azure.mgmt.redhatopenshift.models.SystemData
:ivar tags: Resource tags.
:vartype tags: dict[str, str]
:ivar location: The geo-location where the resource lives. Required.
@ -701,35 +691,32 @@ class OpenShiftCluster(TrackedResource): # pylint: disable=too-many-instance-at
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SystemData
:vartype system_data: ~azure.mgmt.redhatopenshift.models.SystemData
:ivar tags: Resource tags.
:vartype tags: dict[str, str]
:ivar location: The geo-location where the resource lives. Required.
:vartype location: str
:ivar provisioning_state: The cluster provisioning state. Known values are: "AdminUpdating",
"Canceled", "Creating", "Deleting", "Failed", "Succeeded", and "Updating".
:vartype provisioning_state: str or
~azure.mgmt.redhatopenshift.v2023_11_22.models.ProvisioningState
:vartype provisioning_state: str or ~azure.mgmt.redhatopenshift.models.ProvisioningState
:ivar cluster_profile: The cluster profile.
:vartype cluster_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.ClusterProfile
:vartype cluster_profile: ~azure.mgmt.redhatopenshift.models.ClusterProfile
:ivar console_profile: The console profile.
:vartype console_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.ConsoleProfile
:vartype console_profile: ~azure.mgmt.redhatopenshift.models.ConsoleProfile
:ivar service_principal_profile: The cluster service principal profile.
:vartype service_principal_profile:
~azure.mgmt.redhatopenshift.v2023_11_22.models.ServicePrincipalProfile
:vartype service_principal_profile: ~azure.mgmt.redhatopenshift.models.ServicePrincipalProfile
:ivar network_profile: The cluster network profile.
:vartype network_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.NetworkProfile
:vartype network_profile: ~azure.mgmt.redhatopenshift.models.NetworkProfile
:ivar master_profile: The cluster master profile.
:vartype master_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.MasterProfile
:vartype master_profile: ~azure.mgmt.redhatopenshift.models.MasterProfile
:ivar worker_profiles: The cluster worker profiles.
:vartype worker_profiles: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.WorkerProfile]
:vartype worker_profiles: list[~azure.mgmt.redhatopenshift.models.WorkerProfile]
:ivar worker_profiles_status: The cluster worker profiles status.
:vartype worker_profiles_status:
list[~azure.mgmt.redhatopenshift.v2023_11_22.models.WorkerProfile]
:vartype worker_profiles_status: list[~azure.mgmt.redhatopenshift.models.WorkerProfile]
:ivar apiserver_profile: The cluster API server profile.
:vartype apiserver_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.APIServerProfile
:vartype apiserver_profile: ~azure.mgmt.redhatopenshift.models.APIServerProfile
:ivar ingress_profiles: The cluster ingress profiles.
:vartype ingress_profiles: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.IngressProfile]
:vartype ingress_profiles: list[~azure.mgmt.redhatopenshift.models.IngressProfile]
"""
_validation = {
@ -783,26 +770,24 @@ class OpenShiftCluster(TrackedResource): # pylint: disable=too-many-instance-at
:paramtype location: str
:keyword provisioning_state: The cluster provisioning state. Known values are: "AdminUpdating",
"Canceled", "Creating", "Deleting", "Failed", "Succeeded", and "Updating".
:paramtype provisioning_state: str or
~azure.mgmt.redhatopenshift.v2023_11_22.models.ProvisioningState
:paramtype provisioning_state: str or ~azure.mgmt.redhatopenshift.models.ProvisioningState
:keyword cluster_profile: The cluster profile.
:paramtype cluster_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.ClusterProfile
:paramtype cluster_profile: ~azure.mgmt.redhatopenshift.models.ClusterProfile
:keyword console_profile: The console profile.
:paramtype console_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.ConsoleProfile
:paramtype console_profile: ~azure.mgmt.redhatopenshift.models.ConsoleProfile
:keyword service_principal_profile: The cluster service principal profile.
:paramtype service_principal_profile:
~azure.mgmt.redhatopenshift.v2023_11_22.models.ServicePrincipalProfile
~azure.mgmt.redhatopenshift.models.ServicePrincipalProfile
:keyword network_profile: The cluster network profile.
:paramtype network_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.NetworkProfile
:paramtype network_profile: ~azure.mgmt.redhatopenshift.models.NetworkProfile
:keyword master_profile: The cluster master profile.
:paramtype master_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.MasterProfile
:paramtype master_profile: ~azure.mgmt.redhatopenshift.models.MasterProfile
:keyword worker_profiles: The cluster worker profiles.
:paramtype worker_profiles: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.WorkerProfile]
:paramtype worker_profiles: list[~azure.mgmt.redhatopenshift.models.WorkerProfile]
:keyword apiserver_profile: The cluster API server profile.
:paramtype apiserver_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.APIServerProfile
:paramtype apiserver_profile: ~azure.mgmt.redhatopenshift.models.APIServerProfile
:keyword ingress_profiles: The cluster ingress profiles.
:paramtype ingress_profiles:
list[~azure.mgmt.redhatopenshift.v2023_11_22.models.IngressProfile]
:paramtype ingress_profiles: list[~azure.mgmt.redhatopenshift.models.IngressProfile]
"""
super().__init__(tags=tags, location=location, **kwargs)
self.provisioning_state = provisioning_state
@ -869,7 +854,7 @@ class OpenShiftClusterList(_serialization.Model):
"""OpenShiftClusterList represents a list of OpenShift clusters.
:ivar value: The list of OpenShift clusters.
:vartype value: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:vartype value: list[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:ivar next_link: The link used to get the next page of operations.
:vartype next_link: str
"""
@ -888,7 +873,7 @@ class OpenShiftClusterList(_serialization.Model):
) -> None:
"""
:keyword value: The list of OpenShift clusters.
:paramtype value: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:paramtype value: list[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:keyword next_link: The link used to get the next page of operations.
:paramtype next_link: str
"""
@ -905,31 +890,28 @@ class OpenShiftClusterUpdate(_serialization.Model): # pylint: disable=too-many-
:ivar tags: The resource tags.
:vartype tags: dict[str, str]
:ivar system_data: The system meta data relating to this resource.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SystemData
:vartype system_data: ~azure.mgmt.redhatopenshift.models.SystemData
:ivar provisioning_state: The cluster provisioning state. Known values are: "AdminUpdating",
"Canceled", "Creating", "Deleting", "Failed", "Succeeded", and "Updating".
:vartype provisioning_state: str or
~azure.mgmt.redhatopenshift.v2023_11_22.models.ProvisioningState
:vartype provisioning_state: str or ~azure.mgmt.redhatopenshift.models.ProvisioningState
:ivar cluster_profile: The cluster profile.
:vartype cluster_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.ClusterProfile
:vartype cluster_profile: ~azure.mgmt.redhatopenshift.models.ClusterProfile
:ivar console_profile: The console profile.
:vartype console_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.ConsoleProfile
:vartype console_profile: ~azure.mgmt.redhatopenshift.models.ConsoleProfile
:ivar service_principal_profile: The cluster service principal profile.
:vartype service_principal_profile:
~azure.mgmt.redhatopenshift.v2023_11_22.models.ServicePrincipalProfile
:vartype service_principal_profile: ~azure.mgmt.redhatopenshift.models.ServicePrincipalProfile
:ivar network_profile: The cluster network profile.
:vartype network_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.NetworkProfile
:vartype network_profile: ~azure.mgmt.redhatopenshift.models.NetworkProfile
:ivar master_profile: The cluster master profile.
:vartype master_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.MasterProfile
:vartype master_profile: ~azure.mgmt.redhatopenshift.models.MasterProfile
:ivar worker_profiles: The cluster worker profiles.
:vartype worker_profiles: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.WorkerProfile]
:vartype worker_profiles: list[~azure.mgmt.redhatopenshift.models.WorkerProfile]
:ivar worker_profiles_status: The cluster worker profiles status.
:vartype worker_profiles_status:
list[~azure.mgmt.redhatopenshift.v2023_11_22.models.WorkerProfile]
:vartype worker_profiles_status: list[~azure.mgmt.redhatopenshift.models.WorkerProfile]
:ivar apiserver_profile: The cluster API server profile.
:vartype apiserver_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.APIServerProfile
:vartype apiserver_profile: ~azure.mgmt.redhatopenshift.models.APIServerProfile
:ivar ingress_profiles: The cluster ingress profiles.
:vartype ingress_profiles: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.IngressProfile]
:vartype ingress_profiles: list[~azure.mgmt.redhatopenshift.models.IngressProfile]
"""
_validation = {
@ -972,26 +954,24 @@ class OpenShiftClusterUpdate(_serialization.Model): # pylint: disable=too-many-
:paramtype tags: dict[str, str]
:keyword provisioning_state: The cluster provisioning state. Known values are: "AdminUpdating",
"Canceled", "Creating", "Deleting", "Failed", "Succeeded", and "Updating".
:paramtype provisioning_state: str or
~azure.mgmt.redhatopenshift.v2023_11_22.models.ProvisioningState
:paramtype provisioning_state: str or ~azure.mgmt.redhatopenshift.models.ProvisioningState
:keyword cluster_profile: The cluster profile.
:paramtype cluster_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.ClusterProfile
:paramtype cluster_profile: ~azure.mgmt.redhatopenshift.models.ClusterProfile
:keyword console_profile: The console profile.
:paramtype console_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.ConsoleProfile
:paramtype console_profile: ~azure.mgmt.redhatopenshift.models.ConsoleProfile
:keyword service_principal_profile: The cluster service principal profile.
:paramtype service_principal_profile:
~azure.mgmt.redhatopenshift.v2023_11_22.models.ServicePrincipalProfile
~azure.mgmt.redhatopenshift.models.ServicePrincipalProfile
:keyword network_profile: The cluster network profile.
:paramtype network_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.NetworkProfile
:paramtype network_profile: ~azure.mgmt.redhatopenshift.models.NetworkProfile
:keyword master_profile: The cluster master profile.
:paramtype master_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.MasterProfile
:paramtype master_profile: ~azure.mgmt.redhatopenshift.models.MasterProfile
:keyword worker_profiles: The cluster worker profiles.
:paramtype worker_profiles: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.WorkerProfile]
:paramtype worker_profiles: list[~azure.mgmt.redhatopenshift.models.WorkerProfile]
:keyword apiserver_profile: The cluster API server profile.
:paramtype apiserver_profile: ~azure.mgmt.redhatopenshift.v2023_11_22.models.APIServerProfile
:paramtype apiserver_profile: ~azure.mgmt.redhatopenshift.models.APIServerProfile
:keyword ingress_profiles: The cluster ingress profiles.
:paramtype ingress_profiles:
list[~azure.mgmt.redhatopenshift.v2023_11_22.models.IngressProfile]
:paramtype ingress_profiles: list[~azure.mgmt.redhatopenshift.models.IngressProfile]
"""
super().__init__(**kwargs)
self.tags = tags
@ -1023,7 +1003,7 @@ class OpenShiftVersion(ProxyResource):
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SystemData
:vartype system_data: ~azure.mgmt.redhatopenshift.models.SystemData
:ivar version: Version represents the version to create the cluster at.
:vartype version: str
"""
@ -1056,7 +1036,7 @@ class OpenShiftVersionList(_serialization.Model):
"""OpenShiftVersionList represents a List of available versions.
:ivar value: The List of available versions.
:vartype value: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftVersion]
:vartype value: list[~azure.mgmt.redhatopenshift.models.OpenShiftVersion]
:ivar next_link: Next Link to next operation.
:vartype next_link: str
"""
@ -1075,7 +1055,7 @@ class OpenShiftVersionList(_serialization.Model):
) -> None:
"""
:keyword value: The List of available versions.
:paramtype value: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftVersion]
:paramtype value: list[~azure.mgmt.redhatopenshift.models.OpenShiftVersion]
:keyword next_link: Next Link to next operation.
:paramtype next_link: str
"""
@ -1090,7 +1070,7 @@ class Operation(_serialization.Model):
:ivar name: Operation name: {provider}/{resource}/{operation}.
:vartype name: str
:ivar display: The object that describes the operation.
:vartype display: ~azure.mgmt.redhatopenshift.v2023_11_22.models.Display
:vartype display: ~azure.mgmt.redhatopenshift.models.Display
:ivar origin: Sources of requests to this operation. Comma separated list with valid values
user or system, e.g. "user,system".
:vartype origin: str
@ -1114,7 +1094,7 @@ class Operation(_serialization.Model):
:keyword name: Operation name: {provider}/{resource}/{operation}.
:paramtype name: str
:keyword display: The object that describes the operation.
:paramtype display: ~azure.mgmt.redhatopenshift.v2023_11_22.models.Display
:paramtype display: ~azure.mgmt.redhatopenshift.models.Display
:keyword origin: Sources of requests to this operation. Comma separated list with valid values
user or system, e.g. "user,system".
:paramtype origin: str
@ -1129,7 +1109,7 @@ class OperationList(_serialization.Model):
"""OperationList represents an RP operation list.
:ivar value: List of operations supported by the resource provider.
:vartype value: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.Operation]
:vartype value: list[~azure.mgmt.redhatopenshift.models.Operation]
:ivar next_link: The link used to get the next page of operations.
:vartype next_link: str
"""
@ -1144,7 +1124,7 @@ class OperationList(_serialization.Model):
) -> None:
"""
:keyword value: List of operations supported by the resource provider.
:paramtype value: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.Operation]
:paramtype value: list[~azure.mgmt.redhatopenshift.models.Operation]
:keyword next_link: The link used to get the next page of operations.
:paramtype next_link: str
"""
@ -1168,7 +1148,7 @@ class Secret(ProxyResource):
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SystemData
:vartype system_data: ~azure.mgmt.redhatopenshift.models.SystemData
:ivar secret_resources: The Secrets Resources.
:vartype secret_resources: str
"""
@ -1201,7 +1181,7 @@ class SecretList(_serialization.Model):
"""SecretList represents a list of Secrets.
:ivar value: The list of secrets.
:vartype value: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.Secret]
:vartype value: list[~azure.mgmt.redhatopenshift.models.Secret]
:ivar next_link: The link used to get the next page of operations.
:vartype next_link: str
"""
@ -1216,7 +1196,7 @@ class SecretList(_serialization.Model):
) -> None:
"""
:keyword value: The list of secrets.
:paramtype value: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.Secret]
:paramtype value: list[~azure.mgmt.redhatopenshift.models.Secret]
:keyword next_link: The link used to get the next page of operations.
:paramtype next_link: str
"""
@ -1231,7 +1211,7 @@ class SecretUpdate(_serialization.Model):
Variables are only populated by the server, and will be ignored when sending a request.
:ivar system_data: The system meta data relating to this resource.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SystemData
:vartype system_data: ~azure.mgmt.redhatopenshift.models.SystemData
:ivar secret_resources: The Secrets Resources.
:vartype secret_resources: str
"""
@ -1296,7 +1276,7 @@ class SyncIdentityProvider(ProxyResource):
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SystemData
:vartype system_data: ~azure.mgmt.redhatopenshift.models.SystemData
:ivar resources:
:vartype resources: str
"""
@ -1329,7 +1309,7 @@ class SyncIdentityProviderList(_serialization.Model):
"""SyncSetList represents a list of SyncSets.
:ivar value: The list of sync identity providers.
:vartype value: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncIdentityProvider]
:vartype value: list[~azure.mgmt.redhatopenshift.models.SyncIdentityProvider]
:ivar next_link: The link used to get the next page of operations.
:vartype next_link: str
"""
@ -1348,7 +1328,7 @@ class SyncIdentityProviderList(_serialization.Model):
) -> None:
"""
:keyword value: The list of sync identity providers.
:paramtype value: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncIdentityProvider]
:paramtype value: list[~azure.mgmt.redhatopenshift.models.SyncIdentityProvider]
:keyword next_link: The link used to get the next page of operations.
:paramtype next_link: str
"""
@ -1363,7 +1343,7 @@ class SyncIdentityProviderUpdate(_serialization.Model):
Variables are only populated by the server, and will be ignored when sending a request.
:ivar system_data: The system meta data relating to this resource.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SystemData
:vartype system_data: ~azure.mgmt.redhatopenshift.models.SystemData
:ivar resources:
:vartype resources: str
"""
@ -1402,7 +1382,7 @@ class SyncSet(ProxyResource):
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SystemData
:vartype system_data: ~azure.mgmt.redhatopenshift.models.SystemData
:ivar resources: Resources represents the SyncSets configuration.
:vartype resources: str
"""
@ -1435,7 +1415,7 @@ class SyncSetList(_serialization.Model):
"""SyncSetList represents a list of SyncSets.
:ivar value: The list of syncsets.
:vartype value: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncSet]
:vartype value: list[~azure.mgmt.redhatopenshift.models.SyncSet]
:ivar next_link: The link used to get the next page of operations.
:vartype next_link: str
"""
@ -1450,7 +1430,7 @@ class SyncSetList(_serialization.Model):
) -> None:
"""
:keyword value: The list of syncsets.
:paramtype value: list[~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncSet]
:paramtype value: list[~azure.mgmt.redhatopenshift.models.SyncSet]
:keyword next_link: The link used to get the next page of operations.
:paramtype next_link: str
"""
@ -1465,7 +1445,7 @@ class SyncSetUpdate(_serialization.Model):
Variables are only populated by the server, and will be ignored when sending a request.
:ivar system_data: The system meta data relating to this resource.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SystemData
:vartype system_data: ~azure.mgmt.redhatopenshift.models.SystemData
:ivar resources: Resources represents the SyncSets configuration.
:vartype resources: str
"""
@ -1496,15 +1476,14 @@ class SystemData(_serialization.Model):
:vartype created_by: str
:ivar created_by_type: The type of identity that created the resource. Known values are:
"User", "Application", "ManagedIdentity", and "Key".
:vartype created_by_type: str or ~azure.mgmt.redhatopenshift.v2023_11_22.models.CreatedByType
:vartype created_by_type: str or ~azure.mgmt.redhatopenshift.models.CreatedByType
:ivar created_at: The timestamp of resource creation (UTC).
:vartype created_at: ~datetime.datetime
:ivar last_modified_by: The identity that last modified the resource.
:vartype last_modified_by: str
:ivar last_modified_by_type: The type of identity that last modified the resource. Known values
are: "User", "Application", "ManagedIdentity", and "Key".
:vartype last_modified_by_type: str or
~azure.mgmt.redhatopenshift.v2023_11_22.models.CreatedByType
:vartype last_modified_by_type: str or ~azure.mgmt.redhatopenshift.models.CreatedByType
:ivar last_modified_at: The timestamp of resource last modification (UTC).
:vartype last_modified_at: ~datetime.datetime
"""
@ -1534,15 +1513,14 @@ class SystemData(_serialization.Model):
:paramtype created_by: str
:keyword created_by_type: The type of identity that created the resource. Known values are:
"User", "Application", "ManagedIdentity", and "Key".
:paramtype created_by_type: str or ~azure.mgmt.redhatopenshift.v2023_11_22.models.CreatedByType
:paramtype created_by_type: str or ~azure.mgmt.redhatopenshift.models.CreatedByType
:keyword created_at: The timestamp of resource creation (UTC).
:paramtype created_at: ~datetime.datetime
:keyword last_modified_by: The identity that last modified the resource.
:paramtype last_modified_by: str
:keyword last_modified_by_type: The type of identity that last modified the resource. Known
values are: "User", "Application", "ManagedIdentity", and "Key".
:paramtype last_modified_by_type: str or
~azure.mgmt.redhatopenshift.v2023_11_22.models.CreatedByType
:paramtype last_modified_by_type: str or ~azure.mgmt.redhatopenshift.models.CreatedByType
:keyword last_modified_at: The timestamp of resource last modification (UTC).
:paramtype last_modified_at: ~datetime.datetime
"""
@ -1570,8 +1548,7 @@ class WorkerProfile(_serialization.Model):
:vartype count: int
:ivar encryption_at_host: Whether master virtual machines are encrypted at host. Known values
are: "Disabled" and "Enabled".
:vartype encryption_at_host: str or
~azure.mgmt.redhatopenshift.v2023_11_22.models.EncryptionAtHost
:vartype encryption_at_host: str or ~azure.mgmt.redhatopenshift.models.EncryptionAtHost
:ivar disk_encryption_set_id: The resource ID of an associated DiskEncryptionSet, if
applicable.
:vartype disk_encryption_set_id: str
@ -1612,8 +1589,7 @@ class WorkerProfile(_serialization.Model):
:paramtype count: int
:keyword encryption_at_host: Whether master virtual machines are encrypted at host. Known
values are: "Disabled" and "Enabled".
:paramtype encryption_at_host: str or
~azure.mgmt.redhatopenshift.v2023_11_22.models.EncryptionAtHost
:paramtype encryption_at_host: str or ~azure.mgmt.redhatopenshift.models.EncryptionAtHost
:keyword disk_encryption_set_id: The resource ID of an associated DiskEncryptionSet, if
applicable.
:paramtype disk_encryption_set_id: str

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

@ -27,7 +27,7 @@ from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from ..._serialization import Serializer
from .._serialization import Serializer
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
@ -284,7 +284,7 @@ class MachinePoolsOperations:
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2023_11_22.AzureRedHatOpenShiftClient`'s
:class:`~azure.mgmt.redhatopenshift.AzureRedHatOpenShiftClient`'s
:attr:`machine_pools` attribute.
"""
@ -296,7 +296,6 @@ class MachinePoolsOperations:
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> Iterable["_models.MachinePool"]:
@ -310,14 +309,13 @@ class MachinePoolsOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: An iterator like instance of either MachinePool or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.v2023_11_22.models.MachinePool]
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.models.MachinePool]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.MachinePoolList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -350,7 +348,7 @@ class MachinePoolsOperations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
@ -398,7 +396,7 @@ class MachinePoolsOperations:
:param child_resource_name: The name of the MachinePool resource. Required.
:type child_resource_name: str
:return: MachinePool or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.MachinePool
:rtype: ~azure.mgmt.redhatopenshift.models.MachinePool
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -412,7 +410,7 @@ class MachinePoolsOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.MachinePool] = kwargs.pop("cls", None)
_request = build_get_request(
@ -468,12 +466,12 @@ class MachinePoolsOperations:
:param child_resource_name: The name of the MachinePool resource. Required.
:type child_resource_name: str
:param parameters: The MachinePool resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.MachinePool
:type parameters: ~azure.mgmt.redhatopenshift.models.MachinePool
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: MachinePool or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.MachinePool
:rtype: ~azure.mgmt.redhatopenshift.models.MachinePool
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -506,7 +504,7 @@ class MachinePoolsOperations:
Default value is "application/json".
:paramtype content_type: str
:return: MachinePool or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.MachinePool
:rtype: ~azure.mgmt.redhatopenshift.models.MachinePool
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -533,9 +531,9 @@ class MachinePoolsOperations:
:type child_resource_name: str
:param parameters: The MachinePool resource. Is either a MachinePool type or a IO[bytes] type.
Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.MachinePool or IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.MachinePool or IO[bytes]
:return: MachinePool or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.MachinePool
:rtype: ~azure.mgmt.redhatopenshift.models.MachinePool
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -549,7 +547,7 @@ class MachinePoolsOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.MachinePool] = kwargs.pop("cls", None)
@ -586,11 +584,7 @@ class MachinePoolsOperations:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("MachinePool", pipeline_response.http_response)
if response.status_code == 201:
deserialized = self._deserialize("MachinePool", pipeline_response.http_response)
deserialized = self._deserialize("MachinePool", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@ -627,7 +621,7 @@ class MachinePoolsOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
@ -678,12 +672,12 @@ class MachinePoolsOperations:
:param child_resource_name: The name of the MachinePool resource. Required.
:type child_resource_name: str
:param parameters: The MachinePool resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.MachinePoolUpdate
:type parameters: ~azure.mgmt.redhatopenshift.models.MachinePoolUpdate
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: MachinePool or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.MachinePool
:rtype: ~azure.mgmt.redhatopenshift.models.MachinePool
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -715,7 +709,7 @@ class MachinePoolsOperations:
Default value is "application/json".
:paramtype content_type: str
:return: MachinePool or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.MachinePool
:rtype: ~azure.mgmt.redhatopenshift.models.MachinePool
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -741,9 +735,9 @@ class MachinePoolsOperations:
:type child_resource_name: str
:param parameters: The MachinePool resource. Is either a MachinePoolUpdate type or a IO[bytes]
type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.MachinePoolUpdate or IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.MachinePoolUpdate or IO[bytes]
:return: MachinePool or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.MachinePool
:rtype: ~azure.mgmt.redhatopenshift.models.MachinePool
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -757,7 +751,7 @@ class MachinePoolsOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.MachinePool] = kwargs.pop("cls", None)

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

@ -17,6 +17,8 @@ from azure.core.exceptions import (
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
StreamClosedError,
StreamConsumedError,
map_error,
)
from azure.core.paging import ItemPaged
@ -29,7 +31,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
from ..._serialization import Serializer
from .._serialization import Serializer
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
@ -306,7 +308,7 @@ class OpenShiftClustersOperations:
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2023_11_22.AzureRedHatOpenShiftClient`'s
:class:`~azure.mgmt.redhatopenshift.AzureRedHatOpenShiftClient`'s
:attr:`open_shift_clusters` attribute.
"""
@ -318,7 +320,6 @@ class OpenShiftClustersOperations:
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, **kwargs: Any) -> Iterable["_models.OpenShiftCluster"]:
@ -327,14 +328,13 @@ class OpenShiftClustersOperations:
The operation returns properties of each OpenShift cluster.
:return: An iterator like instance of either OpenShiftCluster or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OpenShiftClusterList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -365,7 +365,7 @@ class OpenShiftClustersOperations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
@ -407,14 +407,13 @@ class OpenShiftClustersOperations:
Required.
:type resource_group_name: str
:return: An iterator like instance of either OpenShiftCluster or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OpenShiftClusterList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -446,7 +445,7 @@ class OpenShiftClustersOperations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
@ -490,7 +489,7 @@ class OpenShiftClustersOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: OpenShiftCluster or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster
:rtype: ~azure.mgmt.redhatopenshift.models.OpenShiftCluster
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -504,7 +503,7 @@ class OpenShiftClustersOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OpenShiftCluster] = kwargs.pop("cls", None)
_request = build_get_request(
@ -553,7 +552,7 @@ class OpenShiftClustersOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
@ -578,6 +577,7 @@ class OpenShiftClustersOperations:
)
_request.url = self._client.format_url(_request.url)
_decompress = kwargs.pop("decompress", True)
_stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
@ -586,15 +586,14 @@ class OpenShiftClustersOperations:
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
response.read() # Load the body in memory and close the socket
try:
response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = response.stream_download(self._client._pipeline)
if response.status_code == 201:
deserialized = response.stream_download(self._client._pipeline)
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@ -622,14 +621,13 @@ class OpenShiftClustersOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster
:type parameters: ~azure.mgmt.redhatopenshift.models.OpenShiftCluster
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -660,8 +658,7 @@ class OpenShiftClustersOperations:
:paramtype content_type: str
:return: An instance of LROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -685,17 +682,16 @@ class OpenShiftClustersOperations:
:type resource_name: str
:param parameters: The OpenShift cluster resource. Is either a OpenShiftCluster type or a
IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster or IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.OpenShiftCluster or IO[bytes]
:return: An instance of LROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.OpenShiftCluster] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
@ -751,7 +747,7 @@ class OpenShiftClustersOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
_request = build_delete_request(
@ -764,6 +760,7 @@ class OpenShiftClustersOperations:
)
_request.url = self._client.format_url(_request.url)
_decompress = kwargs.pop("decompress", True)
_stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
@ -772,15 +769,14 @@ class OpenShiftClustersOperations:
response = pipeline_response.http_response
if response.status_code not in [202, 204]:
response.read() # Load the body in memory and close the socket
try:
response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 202:
deserialized = response.stream_download(self._client._pipeline)
if response.status_code == 204:
deserialized = response.stream_download(self._client._pipeline)
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@ -805,7 +801,7 @@ class OpenShiftClustersOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
@ -860,7 +856,7 @@ class OpenShiftClustersOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
@ -885,6 +881,7 @@ class OpenShiftClustersOperations:
)
_request.url = self._client.format_url(_request.url)
_decompress = kwargs.pop("decompress", True)
_stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
@ -893,15 +890,14 @@ class OpenShiftClustersOperations:
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
response.read() # Load the body in memory and close the socket
try:
response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = response.stream_download(self._client._pipeline)
if response.status_code == 201:
deserialized = response.stream_download(self._client._pipeline)
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@ -928,14 +924,13 @@ class OpenShiftClustersOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftClusterUpdate
:type parameters: ~azure.mgmt.redhatopenshift.models.OpenShiftClusterUpdate
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -965,8 +960,7 @@ class OpenShiftClustersOperations:
:paramtype content_type: str
:return: An instance of LROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -989,18 +983,16 @@ class OpenShiftClustersOperations:
:type resource_name: str
:param parameters: The OpenShift cluster resource. Is either a OpenShiftClusterUpdate type or a
IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftClusterUpdate or
IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.OpenShiftClusterUpdate or IO[bytes]
:return: An instance of LROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftCluster]
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.redhatopenshift.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.OpenShiftCluster] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
@ -1059,7 +1051,7 @@ class OpenShiftClustersOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: OpenShiftClusterAdminKubeconfig or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftClusterAdminKubeconfig
:rtype: ~azure.mgmt.redhatopenshift.models.OpenShiftClusterAdminKubeconfig
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -1073,7 +1065,7 @@ class OpenShiftClustersOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OpenShiftClusterAdminKubeconfig] = kwargs.pop("cls", None)
_request = build_list_admin_credentials_request(
@ -1119,7 +1111,7 @@ class OpenShiftClustersOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: OpenShiftClusterCredentials or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftClusterCredentials
:rtype: ~azure.mgmt.redhatopenshift.models.OpenShiftClusterCredentials
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -1133,7 +1125,7 @@ class OpenShiftClustersOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OpenShiftClusterCredentials] = kwargs.pop("cls", None)
_request = build_list_credentials_request(

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

@ -26,7 +26,7 @@ from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from ..._serialization import Serializer
from .._serialization import Serializer
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
@ -73,7 +73,7 @@ class OpenShiftVersionsOperations:
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2023_11_22.AzureRedHatOpenShiftClient`'s
:class:`~azure.mgmt.redhatopenshift.AzureRedHatOpenShiftClient`'s
:attr:`open_shift_versions` attribute.
"""
@ -85,7 +85,6 @@ class OpenShiftVersionsOperations:
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, location: str, **kwargs: Any) -> Iterable["_models.OpenShiftVersion"]:
@ -96,14 +95,13 @@ class OpenShiftVersionsOperations:
:param location: The name of Azure region. Required.
:type location: str
:return: An iterator like instance of either OpenShiftVersion or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.v2023_11_22.models.OpenShiftVersion]
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.models.OpenShiftVersion]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OpenShiftVersionList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -135,7 +133,7 @@ class OpenShiftVersionsOperations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)

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

@ -26,7 +26,7 @@ from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from ..._serialization import Serializer
from .._serialization import Serializer
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
@ -64,7 +64,7 @@ class Operations:
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2023_11_22.AzureRedHatOpenShiftClient`'s
:class:`~azure.mgmt.redhatopenshift.AzureRedHatOpenShiftClient`'s
:attr:`operations` attribute.
"""
@ -76,7 +76,6 @@ class Operations:
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
@ -85,13 +84,13 @@ class Operations:
The operation returns the RP operations.
:return: An iterator like instance of either Operation or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.v2023_11_22.models.Operation]
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.models.Operation]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OperationList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -121,7 +120,7 @@ class Operations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)

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

@ -27,7 +27,7 @@ from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from ..._serialization import Serializer
from .._serialization import Serializer
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
@ -284,7 +284,7 @@ class SecretsOperations:
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2023_11_22.AzureRedHatOpenShiftClient`'s
:class:`~azure.mgmt.redhatopenshift.AzureRedHatOpenShiftClient`'s
:attr:`secrets` attribute.
"""
@ -296,7 +296,6 @@ class SecretsOperations:
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> Iterable["_models.Secret"]:
@ -310,13 +309,13 @@ class SecretsOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: An iterator like instance of either Secret or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.v2023_11_22.models.Secret]
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.models.Secret]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SecretList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -349,7 +348,7 @@ class SecretsOperations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
@ -397,7 +396,7 @@ class SecretsOperations:
:param child_resource_name: The name of the Secret resource. Required.
:type child_resource_name: str
:return: Secret or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.Secret
:rtype: ~azure.mgmt.redhatopenshift.models.Secret
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -411,7 +410,7 @@ class SecretsOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.Secret] = kwargs.pop("cls", None)
_request = build_get_request(
@ -466,12 +465,12 @@ class SecretsOperations:
:param child_resource_name: The name of the Secret resource. Required.
:type child_resource_name: str
:param parameters: The Secret resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.Secret
:type parameters: ~azure.mgmt.redhatopenshift.models.Secret
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: Secret or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.Secret
:rtype: ~azure.mgmt.redhatopenshift.models.Secret
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -503,7 +502,7 @@ class SecretsOperations:
Default value is "application/json".
:paramtype content_type: str
:return: Secret or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.Secret
:rtype: ~azure.mgmt.redhatopenshift.models.Secret
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -528,9 +527,9 @@ class SecretsOperations:
:param child_resource_name: The name of the Secret resource. Required.
:type child_resource_name: str
:param parameters: The Secret resource. Is either a Secret type or a IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.Secret or IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.Secret or IO[bytes]
:return: Secret or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.Secret
:rtype: ~azure.mgmt.redhatopenshift.models.Secret
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -544,7 +543,7 @@ class SecretsOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.Secret] = kwargs.pop("cls", None)
@ -581,11 +580,7 @@ class SecretsOperations:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("Secret", pipeline_response.http_response)
if response.status_code == 201:
deserialized = self._deserialize("Secret", pipeline_response.http_response)
deserialized = self._deserialize("Secret", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@ -622,7 +617,7 @@ class SecretsOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
@ -673,12 +668,12 @@ class SecretsOperations:
:param child_resource_name: The name of the Secret resource. Required.
:type child_resource_name: str
:param parameters: The Secret resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SecretUpdate
:type parameters: ~azure.mgmt.redhatopenshift.models.SecretUpdate
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: Secret or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.Secret
:rtype: ~azure.mgmt.redhatopenshift.models.Secret
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -710,7 +705,7 @@ class SecretsOperations:
Default value is "application/json".
:paramtype content_type: str
:return: Secret or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.Secret
:rtype: ~azure.mgmt.redhatopenshift.models.Secret
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -736,9 +731,9 @@ class SecretsOperations:
:type child_resource_name: str
:param parameters: The Secret resource. Is either a SecretUpdate type or a IO[bytes] type.
Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SecretUpdate or IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.SecretUpdate or IO[bytes]
:return: Secret or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.Secret
:rtype: ~azure.mgmt.redhatopenshift.models.Secret
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -752,7 +747,7 @@ class SecretsOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.Secret] = kwargs.pop("cls", None)

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

@ -27,7 +27,7 @@ from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from ..._serialization import Serializer
from .._serialization import Serializer
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
@ -284,7 +284,7 @@ class SyncIdentityProvidersOperations:
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2023_11_22.AzureRedHatOpenShiftClient`'s
:class:`~azure.mgmt.redhatopenshift.AzureRedHatOpenShiftClient`'s
:attr:`sync_identity_providers` attribute.
"""
@ -296,7 +296,6 @@ class SyncIdentityProvidersOperations:
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(
@ -313,14 +312,13 @@ class SyncIdentityProvidersOperations:
:type resource_name: str
:return: An iterator like instance of either SyncIdentityProvider or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncIdentityProvider]
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.models.SyncIdentityProvider]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SyncIdentityProviderList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -353,7 +351,7 @@ class SyncIdentityProvidersOperations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
@ -401,7 +399,7 @@ class SyncIdentityProvidersOperations:
:param child_resource_name: The name of the SyncIdentityProvider resource. Required.
:type child_resource_name: str
:return: SyncIdentityProvider or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncIdentityProvider
:rtype: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -415,7 +413,7 @@ class SyncIdentityProvidersOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SyncIdentityProvider] = kwargs.pop("cls", None)
_request = build_get_request(
@ -471,12 +469,12 @@ class SyncIdentityProvidersOperations:
:param child_resource_name: The name of the SyncIdentityProvider resource. Required.
:type child_resource_name: str
:param parameters: The SyncIdentityProvider resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncIdentityProvider
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: SyncIdentityProvider or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncIdentityProvider
:rtype: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -509,7 +507,7 @@ class SyncIdentityProvidersOperations:
Default value is "application/json".
:paramtype content_type: str
:return: SyncIdentityProvider or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncIdentityProvider
:rtype: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -536,10 +534,9 @@ class SyncIdentityProvidersOperations:
:type child_resource_name: str
:param parameters: The SyncIdentityProvider resource. Is either a SyncIdentityProvider type or
a IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncIdentityProvider or
IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider or IO[bytes]
:return: SyncIdentityProvider or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncIdentityProvider
:rtype: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -553,7 +550,7 @@ class SyncIdentityProvidersOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SyncIdentityProvider] = kwargs.pop("cls", None)
@ -590,11 +587,7 @@ class SyncIdentityProvidersOperations:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("SyncIdentityProvider", pipeline_response.http_response)
if response.status_code == 201:
deserialized = self._deserialize("SyncIdentityProvider", pipeline_response.http_response)
deserialized = self._deserialize("SyncIdentityProvider", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@ -632,7 +625,7 @@ class SyncIdentityProvidersOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
@ -684,12 +677,12 @@ class SyncIdentityProvidersOperations:
:param child_resource_name: The name of the SyncIdentityProvider resource. Required.
:type child_resource_name: str
:param parameters: The SyncIdentityProvider resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncIdentityProviderUpdate
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncIdentityProviderUpdate
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: SyncIdentityProvider or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncIdentityProvider
:rtype: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -722,7 +715,7 @@ class SyncIdentityProvidersOperations:
Default value is "application/json".
:paramtype content_type: str
:return: SyncIdentityProvider or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncIdentityProvider
:rtype: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -749,10 +742,9 @@ class SyncIdentityProvidersOperations:
:type child_resource_name: str
:param parameters: The SyncIdentityProvider resource. Is either a SyncIdentityProviderUpdate
type or a IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncIdentityProviderUpdate or
IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncIdentityProviderUpdate or IO[bytes]
:return: SyncIdentityProvider or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncIdentityProvider
:rtype: ~azure.mgmt.redhatopenshift.models.SyncIdentityProvider
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -766,7 +758,7 @@ class SyncIdentityProvidersOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SyncIdentityProvider] = kwargs.pop("cls", None)

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

@ -27,7 +27,7 @@ from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from ..._serialization import Serializer
from .._serialization import Serializer
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
@ -284,7 +284,7 @@ class SyncSetsOperations:
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2023_11_22.AzureRedHatOpenShiftClient`'s
:class:`~azure.mgmt.redhatopenshift.AzureRedHatOpenShiftClient`'s
:attr:`sync_sets` attribute.
"""
@ -296,7 +296,6 @@ class SyncSetsOperations:
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> Iterable["_models.SyncSet"]:
@ -310,13 +309,13 @@ class SyncSetsOperations:
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: An iterator like instance of either SyncSet or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncSet]
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.models.SyncSet]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SyncSetList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -349,7 +348,7 @@ class SyncSetsOperations:
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
@ -397,7 +396,7 @@ class SyncSetsOperations:
:param child_resource_name: The name of the SyncSet resource. Required.
:type child_resource_name: str
:return: SyncSet or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncSet
:rtype: ~azure.mgmt.redhatopenshift.models.SyncSet
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -411,7 +410,7 @@ class SyncSetsOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SyncSet] = kwargs.pop("cls", None)
_request = build_get_request(
@ -466,12 +465,12 @@ class SyncSetsOperations:
:param child_resource_name: The name of the SyncSet resource. Required.
:type child_resource_name: str
:param parameters: The SyncSet resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncSet
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncSet
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: SyncSet or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncSet
:rtype: ~azure.mgmt.redhatopenshift.models.SyncSet
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -503,7 +502,7 @@ class SyncSetsOperations:
Default value is "application/json".
:paramtype content_type: str
:return: SyncSet or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncSet
:rtype: ~azure.mgmt.redhatopenshift.models.SyncSet
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -529,9 +528,9 @@ class SyncSetsOperations:
:type child_resource_name: str
:param parameters: The SyncSet resource. Is either a SyncSet type or a IO[bytes] type.
Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncSet or IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncSet or IO[bytes]
:return: SyncSet or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncSet
:rtype: ~azure.mgmt.redhatopenshift.models.SyncSet
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -545,7 +544,7 @@ class SyncSetsOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SyncSet] = kwargs.pop("cls", None)
@ -582,11 +581,7 @@ class SyncSetsOperations:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("SyncSet", pipeline_response.http_response)
if response.status_code == 201:
deserialized = self._deserialize("SyncSet", pipeline_response.http_response)
deserialized = self._deserialize("SyncSet", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@ -623,7 +618,7 @@ class SyncSetsOperations:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
@ -674,12 +669,12 @@ class SyncSetsOperations:
:param child_resource_name: The name of the SyncSet resource. Required.
:type child_resource_name: str
:param parameters: The SyncSet resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncSetUpdate
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncSetUpdate
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: SyncSet or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncSet
:rtype: ~azure.mgmt.redhatopenshift.models.SyncSet
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -711,7 +706,7 @@ class SyncSetsOperations:
Default value is "application/json".
:paramtype content_type: str
:return: SyncSet or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncSet
:rtype: ~azure.mgmt.redhatopenshift.models.SyncSet
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -737,9 +732,9 @@ class SyncSetsOperations:
:type child_resource_name: str
:param parameters: The SyncSet resource. Is either a SyncSetUpdate type or a IO[bytes] type.
Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncSetUpdate or IO[bytes]
:type parameters: ~azure.mgmt.redhatopenshift.models.SyncSetUpdate or IO[bytes]
:return: SyncSet or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2023_11_22.models.SyncSet
:rtype: ~azure.mgmt.redhatopenshift.models.SyncSet
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -753,7 +748,7 @@ class SyncSetsOperations:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-22"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SyncSet] = kwargs.pop("cls", None)

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

@ -1,26 +0,0 @@
# 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 ._azure_red_hat_open_shift4_client import AzureRedHatOpenShift4Client
from ._version import VERSION
__version__ = VERSION
try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"AzureRedHatOpenShift4Client",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,118 +0,0 @@
# 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 copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing_extensions import Self
from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
from . import models as _models
from .._serialization import Deserializer, Serializer
from ._configuration import AzureRedHatOpenShift4ClientConfiguration
from .operations import OpenShiftClustersOperations, Operations
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
class AzureRedHatOpenShift4Client: # pylint: disable=client-accepts-api-version-keyword
"""Rest API for Azure Red Hat OpenShift 4.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.redhatopenshift.v2020_04_30.operations.Operations
:ivar open_shift_clusters: OpenShiftClustersOperations operations
:vartype open_shift_clusters:
azure.mgmt.redhatopenshift.v2020_04_30.operations.OpenShiftClustersOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2020-04-30". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
"""
def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = AzureRedHatOpenShift4ClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
policies.RequestIdPolicy(**kwargs),
self._config.headers_policy,
self._config.user_agent_policy,
self._config.proxy_policy,
policies.ContentDecodePolicy(**kwargs),
ARMAutoResourceProviderRegistrationPolicy(),
self._config.redirect_policy,
self._config.retry_policy,
self._config.authentication_policy,
self._config.custom_hook_policy,
self._config.logging_policy,
policies.DistributedTracingPolicy(**kwargs),
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2020-04-30")
self.open_shift_clusters = OpenShiftClustersOperations(
self._client, self._config, self._serialize, self._deserialize, "2020-04-30"
)
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client._send_request(request)
<HttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.rest.HttpResponse
"""
request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
def close(self) -> None:
self._client.close()
def __enter__(self) -> Self:
self._client.__enter__()
return self
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)

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

@ -1,65 +0,0 @@
# 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 typing import Any, TYPE_CHECKING
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
from ._version import VERSION
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
class AzureRedHatOpenShift4ClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for AzureRedHatOpenShift4Client.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2020-04-30". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
api_version: str = kwargs.pop("api_version", "2020-04-30")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-redhatopenshift/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

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

@ -1,111 +0,0 @@
{
"chosen_version": "2020-04-30",
"total_api_version_list": ["2020-04-30"],
"client": {
"name": "AzureRedHatOpenShift4Client",
"filename": "_azure_red_hat_open_shift4_client",
"description": "Rest API for Azure Red Hat OpenShift 4.",
"host_value": "\"https://management.azure.com\"",
"parameterized_host_template": null,
"azure_arm": true,
"has_public_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"AzureRedHatOpenShift4ClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"AzureRedHatOpenShift4ClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential: \"TokenCredential\",",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true,
"method_location": "positional"
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "The ID of the target subscription. Required.",
"docstring_type": "str",
"required": true,
"method_location": "positional"
}
},
"async": {
"credential": {
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "The ID of the target subscription. Required.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version: Optional[str]=None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"base_url": {
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"profile": {
"signature": "profile: KnownProfiles=KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false,
"method_location": "positional"
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"base_url": {
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false,
"method_location": "positional"
}
}
}
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"sync_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"operations": "Operations",
"open_shift_clusters": "OpenShiftClustersOperations"
}
}

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

@ -1,32 +0,0 @@
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass

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

@ -1,9 +0,0 @@
# 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.
# --------------------------------------------------------------------------
VERSION = "1.5.0"

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

@ -1,23 +0,0 @@
# 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 ._azure_red_hat_open_shift4_client import AzureRedHatOpenShift4Client
try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"AzureRedHatOpenShift4Client",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,120 +0,0 @@
# 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 copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from typing_extensions import Self
from azure.core.pipeline import policies
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy
from .. import models as _models
from ..._serialization import Deserializer, Serializer
from ._configuration import AzureRedHatOpenShift4ClientConfiguration
from .operations import OpenShiftClustersOperations, Operations
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
class AzureRedHatOpenShift4Client: # pylint: disable=client-accepts-api-version-keyword
"""Rest API for Azure Red Hat OpenShift 4.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.redhatopenshift.v2020_04_30.aio.operations.Operations
:ivar open_shift_clusters: OpenShiftClustersOperations operations
:vartype open_shift_clusters:
azure.mgmt.redhatopenshift.v2020_04_30.aio.operations.OpenShiftClustersOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2020-04-30". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
"""
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = AzureRedHatOpenShift4ClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
policies.RequestIdPolicy(**kwargs),
self._config.headers_policy,
self._config.user_agent_policy,
self._config.proxy_policy,
policies.ContentDecodePolicy(**kwargs),
AsyncARMAutoResourceProviderRegistrationPolicy(),
self._config.redirect_policy,
self._config.retry_policy,
self._config.authentication_policy,
self._config.custom_hook_policy,
self._config.logging_policy,
policies.DistributedTracingPolicy(**kwargs),
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2020-04-30")
self.open_shift_clusters = OpenShiftClustersOperations(
self._client, self._config, self._serialize, self._deserialize, "2020-04-30"
)
def _send_request(
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any
) -> Awaitable[AsyncHttpResponse]:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = await client._send_request(request)
<AsyncHttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.rest.AsyncHttpResponse
"""
request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
async def close(self) -> None:
await self._client.close()
async def __aenter__(self) -> Self:
await self._client.__aenter__()
return self
async def __aexit__(self, *exc_details: Any) -> None:
await self._client.__aexit__(*exc_details)

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

@ -1,65 +0,0 @@
# 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 typing import Any, TYPE_CHECKING
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
from .._version import VERSION
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
class AzureRedHatOpenShift4ClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for AzureRedHatOpenShift4Client.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2020-04-30". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
api_version: str = kwargs.pop("api_version", "2020-04-30")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-redhatopenshift/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

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

@ -1,32 +0,0 @@
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass

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

@ -1,21 +0,0 @@
# 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 ._operations import Operations
from ._open_shift_clusters_operations import OpenShiftClustersOperations
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"Operations",
"OpenShiftClustersOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,860 +0,0 @@
# pylint: disable=too-many-lines,too-many-statements
# 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 io import IOBase
import sys
from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
from ... import models as _models
from ...operations._open_shift_clusters_operations import (
build_create_or_update_request,
build_delete_request,
build_get_request,
build_list_by_resource_group_request,
build_list_credentials_request,
build_list_request,
build_update_request,
)
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class OpenShiftClustersOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2020_04_30.aio.AzureRedHatOpenShift4Client`'s
:attr:`open_shift_clusters` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.OpenShiftCluster"]:
"""Lists OpenShift clusters in the specified subscription.
The operation returns properties of each OpenShift cluster.
:return: An iterator like instance of either OpenShiftCluster or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-30"))
cls: ClsType[_models.OpenShiftClusterList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("OpenShiftClusterList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace
def list_by_resource_group(
self, resource_group_name: str, **kwargs: Any
) -> AsyncIterable["_models.OpenShiftCluster"]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:return: An iterator like instance of either OpenShiftCluster or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-30"))
cls: ClsType[_models.OpenShiftClusterList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_by_resource_group_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("OpenShiftClusterList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace_async
async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.OpenShiftCluster:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: OpenShiftCluster or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftCluster
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-30"))
cls: ClsType[_models.OpenShiftCluster] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("OpenShiftCluster", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
resource_name: str,
parameters: Union[_models.OpenShiftCluster, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-30"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(parameters, (IOBase, bytes)):
_content = parameters
else:
_json = self._serialize.body(parameters, "OpenShiftCluster")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
await response.read() # Load the body in memory and close the socket
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = response.stream_download(self._client._pipeline)
if response.status_code == 201:
deserialized = response.stream_download(self._client._pipeline)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
resource_name: str,
parameters: _models.OpenShiftCluster,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftCluster
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
resource_name: str,
parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
resource_name: str,
parameters: Union[_models.OpenShiftCluster, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Is either a OpenShiftCluster type or a
IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftCluster or IO[bytes]
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-30"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.OpenShiftCluster] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
resource_name=resource_name,
parameters=parameters,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("OpenShiftCluster", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.OpenShiftCluster].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.OpenShiftCluster](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial(
self, resource_group_name: str, resource_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-30"))
cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202, 204]:
await response.read() # Load the body in memory and close the socket
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 202:
deserialized = response.stream_download(self._client._pipeline)
if response.status_code == 204:
deserialized = response.stream_download(self._client._pipeline)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace_async
async def begin_delete(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-30"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial(
resource_group_name=resource_group_name,
resource_name=resource_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _update_initial(
self,
resource_group_name: str,
resource_name: str,
parameters: Union[_models.OpenShiftClusterUpdate, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-30"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(parameters, (IOBase, bytes)):
_content = parameters
else:
_json = self._serialize.body(parameters, "OpenShiftClusterUpdate")
_request = build_update_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
await response.read() # Load the body in memory and close the socket
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = response.stream_download(self._client._pipeline)
if response.status_code == 201:
deserialized = response.stream_download(self._client._pipeline)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_update(
self,
resource_group_name: str,
resource_name: str,
parameters: _models.OpenShiftClusterUpdate,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftClusterUpdate
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_update(
self,
resource_group_name: str,
resource_name: str,
parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_update(
self,
resource_group_name: str,
resource_name: str,
parameters: Union[_models.OpenShiftClusterUpdate, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Is either a OpenShiftClusterUpdate type or a
IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftClusterUpdate or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-30"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.OpenShiftCluster] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._update_initial(
resource_group_name=resource_group_name,
resource_name=resource_name,
parameters=parameters,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("OpenShiftCluster", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.OpenShiftCluster].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.OpenShiftCluster](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
@distributed_trace_async
async def list_credentials(
self, resource_group_name: str, resource_name: str, **kwargs: Any
) -> _models.OpenShiftClusterCredentials:
"""Lists credentials of an 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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: OpenShiftClusterCredentials or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftClusterCredentials
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-30"))
cls: ClsType[_models.OpenShiftClusterCredentials] = kwargs.pop("cls", None)
_request = build_list_credentials_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("OpenShiftClusterCredentials", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore

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

@ -1,133 +0,0 @@
# pylint: disable=too-many-lines,too-many-statements
# 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 sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
from ...operations._operations import build_list_request
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class Operations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2020_04_30.aio.AzureRedHatOpenShift4Client`'s
:attr:`operations` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
"""Lists all of the available RP operations.
The operation returns the RP operations.
:return: An iterator like instance of either Operation or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2020_04_30.models.Operation]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-30"))
cls: ClsType[_models.OperationList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("OperationList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)

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

@ -1,59 +0,0 @@
# 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 ._models_py3 import APIServerProfile
from ._models_py3 import CloudErrorBody
from ._models_py3 import ClusterProfile
from ._models_py3 import ConsoleProfile
from ._models_py3 import Display
from ._models_py3 import IngressProfile
from ._models_py3 import MasterProfile
from ._models_py3 import NetworkProfile
from ._models_py3 import OpenShiftCluster
from ._models_py3 import OpenShiftClusterCredentials
from ._models_py3 import OpenShiftClusterList
from ._models_py3 import OpenShiftClusterUpdate
from ._models_py3 import Operation
from ._models_py3 import OperationList
from ._models_py3 import Resource
from ._models_py3 import ServicePrincipalProfile
from ._models_py3 import TrackedResource
from ._models_py3 import WorkerProfile
from ._azure_red_hat_open_shift4_client_enums import ProvisioningState
from ._azure_red_hat_open_shift4_client_enums import VMSize
from ._azure_red_hat_open_shift4_client_enums import Visibility
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"APIServerProfile",
"CloudErrorBody",
"ClusterProfile",
"ConsoleProfile",
"Display",
"IngressProfile",
"MasterProfile",
"NetworkProfile",
"OpenShiftCluster",
"OpenShiftClusterCredentials",
"OpenShiftClusterList",
"OpenShiftClusterUpdate",
"Operation",
"OperationList",
"Resource",
"ServicePrincipalProfile",
"TrackedResource",
"WorkerProfile",
"ProvisioningState",
"VMSize",
"Visibility",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,36 +0,0 @@
# 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 enum import Enum
from azure.core import CaseInsensitiveEnumMeta
class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""ProvisioningState represents a provisioning state."""
ADMIN_UPDATING = "AdminUpdating"
CREATING = "Creating"
DELETING = "Deleting"
FAILED = "Failed"
SUCCEEDED = "Succeeded"
UPDATING = "Updating"
class Visibility(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Visibility represents visibility."""
PRIVATE = "Private"
PUBLIC = "Public"
class VMSize(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""VMSize represents a VM size."""
STANDARD_D2_S_V3 = "Standard_D2s_v3"
STANDARD_D4_S_V3 = "Standard_D4s_v3"
STANDARD_D8_S_V3 = "Standard_D8s_v3"

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

@ -1,826 +0,0 @@
# coding=utf-8
# pylint: disable=too-many-lines
# --------------------------------------------------------------------------
# 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 typing import Any, Dict, List, Optional, TYPE_CHECKING, Union
from ... import _serialization
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
class APIServerProfile(_serialization.Model):
"""APIServerProfile represents an API server profile.
:ivar visibility: API server visibility (immutable). Known values are: "Private" and "Public".
:vartype visibility: str or ~azure.mgmt.redhatopenshift.v2020_04_30.models.Visibility
:ivar url: The URL to access the cluster API server (immutable).
:vartype url: str
:ivar ip: The IP of the cluster API server (immutable).
:vartype ip: str
"""
_attribute_map = {
"visibility": {"key": "visibility", "type": "str"},
"url": {"key": "url", "type": "str"},
"ip": {"key": "ip", "type": "str"},
}
def __init__(
self,
*,
visibility: Optional[Union[str, "_models.Visibility"]] = None,
url: Optional[str] = None,
ip: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword visibility: API server visibility (immutable). Known values are: "Private" and
"Public".
:paramtype visibility: str or ~azure.mgmt.redhatopenshift.v2020_04_30.models.Visibility
:keyword url: The URL to access the cluster API server (immutable).
:paramtype url: str
:keyword ip: The IP of the cluster API server (immutable).
:paramtype ip: str
"""
super().__init__(**kwargs)
self.visibility = visibility
self.url = url
self.ip = ip
class CloudErrorBody(_serialization.Model):
"""CloudErrorBody represents the body of a cloud error.
:ivar code: An identifier for the error. Codes are invariant and are intended to be consumed
programmatically.
:vartype code: str
:ivar message: A message describing the error, intended to be suitable for display in a user
interface.
:vartype message: str
:ivar target: The target of the particular error. For example, the name of the property in
error.
:vartype target: str
:ivar details: A list of additional details about the error.
:vartype details: list[~azure.mgmt.redhatopenshift.v2020_04_30.models.CloudErrorBody]
"""
_attribute_map = {
"code": {"key": "code", "type": "str"},
"message": {"key": "message", "type": "str"},
"target": {"key": "target", "type": "str"},
"details": {"key": "details", "type": "[CloudErrorBody]"},
}
def __init__(
self,
*,
code: Optional[str] = None,
message: Optional[str] = None,
target: Optional[str] = None,
details: Optional[List["_models.CloudErrorBody"]] = None,
**kwargs: Any
) -> None:
"""
:keyword code: An identifier for the error. Codes are invariant and are intended to be consumed
programmatically.
:paramtype code: str
:keyword message: A message describing the error, intended to be suitable for display in a user
interface.
:paramtype message: str
:keyword target: The target of the particular error. For example, the name of the property in
error.
:paramtype target: str
:keyword details: A list of additional details about the error.
:paramtype details: list[~azure.mgmt.redhatopenshift.v2020_04_30.models.CloudErrorBody]
"""
super().__init__(**kwargs)
self.code = code
self.message = message
self.target = target
self.details = details
class ClusterProfile(_serialization.Model):
"""ClusterProfile represents a cluster profile.
:ivar pull_secret: The pull secret for the cluster (immutable).
:vartype pull_secret: str
:ivar domain: The domain for the cluster (immutable).
:vartype domain: str
:ivar version: The version of the cluster (immutable).
:vartype version: str
:ivar resource_group_id: The ID of the cluster resource group (immutable).
:vartype resource_group_id: str
"""
_attribute_map = {
"pull_secret": {"key": "pullSecret", "type": "str"},
"domain": {"key": "domain", "type": "str"},
"version": {"key": "version", "type": "str"},
"resource_group_id": {"key": "resourceGroupId", "type": "str"},
}
def __init__(
self,
*,
pull_secret: Optional[str] = None,
domain: Optional[str] = None,
version: Optional[str] = None,
resource_group_id: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword pull_secret: The pull secret for the cluster (immutable).
:paramtype pull_secret: str
:keyword domain: The domain for the cluster (immutable).
:paramtype domain: str
:keyword version: The version of the cluster (immutable).
:paramtype version: str
:keyword resource_group_id: The ID of the cluster resource group (immutable).
:paramtype resource_group_id: str
"""
super().__init__(**kwargs)
self.pull_secret = pull_secret
self.domain = domain
self.version = version
self.resource_group_id = resource_group_id
class ConsoleProfile(_serialization.Model):
"""ConsoleProfile represents a console profile.
:ivar url: The URL to access the cluster console (immutable).
:vartype url: str
"""
_attribute_map = {
"url": {"key": "url", "type": "str"},
}
def __init__(self, *, url: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword url: The URL to access the cluster console (immutable).
:paramtype url: str
"""
super().__init__(**kwargs)
self.url = url
class Display(_serialization.Model):
"""Display represents the display details of an operation.
:ivar provider: Friendly name of the resource provider.
:vartype provider: str
:ivar resource: Resource type on which the operation is performed.
:vartype resource: str
:ivar operation: Operation type: read, write, delete, listKeys/action, etc.
:vartype operation: str
:ivar description: Friendly name of the operation.
:vartype description: str
"""
_attribute_map = {
"provider": {"key": "provider", "type": "str"},
"resource": {"key": "resource", "type": "str"},
"operation": {"key": "operation", "type": "str"},
"description": {"key": "description", "type": "str"},
}
def __init__(
self,
*,
provider: Optional[str] = None,
resource: Optional[str] = None,
operation: Optional[str] = None,
description: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword provider: Friendly name of the resource provider.
:paramtype provider: str
:keyword resource: Resource type on which the operation is performed.
:paramtype resource: str
:keyword operation: Operation type: read, write, delete, listKeys/action, etc.
:paramtype operation: str
:keyword description: Friendly name of the operation.
:paramtype description: str
"""
super().__init__(**kwargs)
self.provider = provider
self.resource = resource
self.operation = operation
self.description = description
class IngressProfile(_serialization.Model):
"""IngressProfile represents an ingress profile.
:ivar name: The ingress profile name. Must be "default" (immutable).
:vartype name: str
:ivar visibility: Ingress visibility (immutable). Known values are: "Private" and "Public".
:vartype visibility: str or ~azure.mgmt.redhatopenshift.v2020_04_30.models.Visibility
:ivar ip: The IP of the ingress (immutable).
:vartype ip: str
"""
_attribute_map = {
"name": {"key": "name", "type": "str"},
"visibility": {"key": "visibility", "type": "str"},
"ip": {"key": "ip", "type": "str"},
}
def __init__(
self,
*,
name: Optional[str] = None,
visibility: Optional[Union[str, "_models.Visibility"]] = None,
ip: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword name: The ingress profile name. Must be "default" (immutable).
:paramtype name: str
:keyword visibility: Ingress visibility (immutable). Known values are: "Private" and "Public".
:paramtype visibility: str or ~azure.mgmt.redhatopenshift.v2020_04_30.models.Visibility
:keyword ip: The IP of the ingress (immutable).
:paramtype ip: str
"""
super().__init__(**kwargs)
self.name = name
self.visibility = visibility
self.ip = ip
class MasterProfile(_serialization.Model):
"""MasterProfile represents a master profile.
:ivar vm_size: The size of the master VMs (immutable). Known values are: "Standard_D2s_v3",
"Standard_D4s_v3", and "Standard_D8s_v3".
:vartype vm_size: str or ~azure.mgmt.redhatopenshift.v2020_04_30.models.VMSize
:ivar subnet_id: The Azure resource ID of the master subnet (immutable).
:vartype subnet_id: str
"""
_attribute_map = {
"vm_size": {"key": "vmSize", "type": "str"},
"subnet_id": {"key": "subnetId", "type": "str"},
}
def __init__(
self, *, vm_size: Optional[Union[str, "_models.VMSize"]] = None, subnet_id: Optional[str] = None, **kwargs: Any
) -> None:
"""
:keyword vm_size: The size of the master VMs (immutable). Known values are: "Standard_D2s_v3",
"Standard_D4s_v3", and "Standard_D8s_v3".
:paramtype vm_size: str or ~azure.mgmt.redhatopenshift.v2020_04_30.models.VMSize
:keyword subnet_id: The Azure resource ID of the master subnet (immutable).
:paramtype subnet_id: str
"""
super().__init__(**kwargs)
self.vm_size = vm_size
self.subnet_id = subnet_id
class NetworkProfile(_serialization.Model):
"""NetworkProfile represents a network profile.
:ivar pod_cidr: The CIDR used for OpenShift/Kubernetes Pods (immutable).
:vartype pod_cidr: str
:ivar service_cidr: The CIDR used for OpenShift/Kubernetes Services (immutable).
:vartype service_cidr: str
"""
_attribute_map = {
"pod_cidr": {"key": "podCidr", "type": "str"},
"service_cidr": {"key": "serviceCidr", "type": "str"},
}
def __init__(self, *, pod_cidr: Optional[str] = None, service_cidr: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword pod_cidr: The CIDR used for OpenShift/Kubernetes Pods (immutable).
:paramtype pod_cidr: str
:keyword service_cidr: The CIDR used for OpenShift/Kubernetes Services (immutable).
:paramtype service_cidr: str
"""
super().__init__(**kwargs)
self.pod_cidr = pod_cidr
self.service_cidr = service_cidr
class Resource(_serialization.Model):
"""Common fields that are returned in the response for all Azure Resource Manager resources.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.id = None
self.name = None
self.type = None
class TrackedResource(Resource):
"""The resource model definition for an Azure Resource Manager tracked top level resource which
has 'tags' and a 'location'.
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 server.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar tags: Resource tags.
:vartype tags: dict[str, str]
:ivar location: The geo-location where the resource lives. Required.
:vartype location: str
"""
_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"},
"tags": {"key": "tags", "type": "{str}"},
"location": {"key": "location", "type": "str"},
}
def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None:
"""
:keyword tags: Resource tags.
:paramtype tags: dict[str, str]
:keyword location: The geo-location where the resource lives. Required.
:paramtype location: str
"""
super().__init__(**kwargs)
self.tags = tags
self.location = location
class OpenShiftCluster(TrackedResource): # pylint: disable=too-many-instance-attributes
"""OpenShiftCluster represents an Azure Red Hat OpenShift cluster.
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 server.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar tags: Resource tags.
:vartype tags: dict[str, str]
:ivar location: The geo-location where the resource lives. Required.
:vartype location: str
:ivar provisioning_state: The cluster provisioning state (immutable). Known values are:
"AdminUpdating", "Creating", "Deleting", "Failed", "Succeeded", and "Updating".
:vartype provisioning_state: str or
~azure.mgmt.redhatopenshift.v2020_04_30.models.ProvisioningState
:ivar cluster_profile: The cluster profile.
:vartype cluster_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.ClusterProfile
:ivar console_profile: The console profile.
:vartype console_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.ConsoleProfile
:ivar service_principal_profile: The cluster service principal profile.
:vartype service_principal_profile:
~azure.mgmt.redhatopenshift.v2020_04_30.models.ServicePrincipalProfile
:ivar network_profile: The cluster network profile.
:vartype network_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.NetworkProfile
:ivar master_profile: The cluster master profile.
:vartype master_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.MasterProfile
:ivar worker_profiles: The cluster worker profiles.
:vartype worker_profiles: list[~azure.mgmt.redhatopenshift.v2020_04_30.models.WorkerProfile]
:ivar apiserver_profile: The cluster API server profile.
:vartype apiserver_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.APIServerProfile
:ivar ingress_profiles: The cluster ingress profiles.
:vartype ingress_profiles: list[~azure.mgmt.redhatopenshift.v2020_04_30.models.IngressProfile]
"""
_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"},
"tags": {"key": "tags", "type": "{str}"},
"location": {"key": "location", "type": "str"},
"provisioning_state": {"key": "properties.provisioningState", "type": "str"},
"cluster_profile": {"key": "properties.clusterProfile", "type": "ClusterProfile"},
"console_profile": {"key": "properties.consoleProfile", "type": "ConsoleProfile"},
"service_principal_profile": {"key": "properties.servicePrincipalProfile", "type": "ServicePrincipalProfile"},
"network_profile": {"key": "properties.networkProfile", "type": "NetworkProfile"},
"master_profile": {"key": "properties.masterProfile", "type": "MasterProfile"},
"worker_profiles": {"key": "properties.workerProfiles", "type": "[WorkerProfile]"},
"apiserver_profile": {"key": "properties.apiserverProfile", "type": "APIServerProfile"},
"ingress_profiles": {"key": "properties.ingressProfiles", "type": "[IngressProfile]"},
}
def __init__(
self,
*,
location: str,
tags: Optional[Dict[str, str]] = None,
provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None,
cluster_profile: Optional["_models.ClusterProfile"] = None,
console_profile: Optional["_models.ConsoleProfile"] = None,
service_principal_profile: Optional["_models.ServicePrincipalProfile"] = None,
network_profile: Optional["_models.NetworkProfile"] = None,
master_profile: Optional["_models.MasterProfile"] = None,
worker_profiles: Optional[List["_models.WorkerProfile"]] = None,
apiserver_profile: Optional["_models.APIServerProfile"] = None,
ingress_profiles: Optional[List["_models.IngressProfile"]] = None,
**kwargs: Any
) -> None:
"""
:keyword tags: Resource tags.
:paramtype tags: dict[str, str]
:keyword location: The geo-location where the resource lives. Required.
:paramtype location: str
:keyword provisioning_state: The cluster provisioning state (immutable). Known values are:
"AdminUpdating", "Creating", "Deleting", "Failed", "Succeeded", and "Updating".
:paramtype provisioning_state: str or
~azure.mgmt.redhatopenshift.v2020_04_30.models.ProvisioningState
:keyword cluster_profile: The cluster profile.
:paramtype cluster_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.ClusterProfile
:keyword console_profile: The console profile.
:paramtype console_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.ConsoleProfile
:keyword service_principal_profile: The cluster service principal profile.
:paramtype service_principal_profile:
~azure.mgmt.redhatopenshift.v2020_04_30.models.ServicePrincipalProfile
:keyword network_profile: The cluster network profile.
:paramtype network_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.NetworkProfile
:keyword master_profile: The cluster master profile.
:paramtype master_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.MasterProfile
:keyword worker_profiles: The cluster worker profiles.
:paramtype worker_profiles: list[~azure.mgmt.redhatopenshift.v2020_04_30.models.WorkerProfile]
:keyword apiserver_profile: The cluster API server profile.
:paramtype apiserver_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.APIServerProfile
:keyword ingress_profiles: The cluster ingress profiles.
:paramtype ingress_profiles:
list[~azure.mgmt.redhatopenshift.v2020_04_30.models.IngressProfile]
"""
super().__init__(tags=tags, location=location, **kwargs)
self.provisioning_state = provisioning_state
self.cluster_profile = cluster_profile
self.console_profile = console_profile
self.service_principal_profile = service_principal_profile
self.network_profile = network_profile
self.master_profile = master_profile
self.worker_profiles = worker_profiles
self.apiserver_profile = apiserver_profile
self.ingress_profiles = ingress_profiles
class OpenShiftClusterCredentials(_serialization.Model):
"""OpenShiftClusterCredentials represents an OpenShift cluster's credentials.
:ivar kubeadmin_username: The username for the kubeadmin user.
:vartype kubeadmin_username: str
:ivar kubeadmin_password: The password for the kubeadmin user.
:vartype kubeadmin_password: str
"""
_attribute_map = {
"kubeadmin_username": {"key": "kubeadminUsername", "type": "str"},
"kubeadmin_password": {"key": "kubeadminPassword", "type": "str"},
}
def __init__(
self, *, kubeadmin_username: Optional[str] = None, kubeadmin_password: Optional[str] = None, **kwargs: Any
) -> None:
"""
:keyword kubeadmin_username: The username for the kubeadmin user.
:paramtype kubeadmin_username: str
:keyword kubeadmin_password: The password for the kubeadmin user.
:paramtype kubeadmin_password: str
"""
super().__init__(**kwargs)
self.kubeadmin_username = kubeadmin_username
self.kubeadmin_password = kubeadmin_password
class OpenShiftClusterList(_serialization.Model):
"""OpenShiftClusterList represents a list of OpenShift clusters.
:ivar value: The list of OpenShift clusters.
:vartype value: list[~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftCluster]
:ivar next_link: The link used to get the next page of operations.
:vartype next_link: str
"""
_attribute_map = {
"value": {"key": "value", "type": "[OpenShiftCluster]"},
"next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
self,
*,
value: Optional[List["_models.OpenShiftCluster"]] = None,
next_link: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword value: The list of OpenShift clusters.
:paramtype value: list[~azure.mgmt.redhatopenshift.v2020_04_30.models.OpenShiftCluster]
:keyword next_link: The link used to get the next page of operations.
:paramtype next_link: str
"""
super().__init__(**kwargs)
self.value = value
self.next_link = next_link
class OpenShiftClusterUpdate(_serialization.Model):
"""OpenShiftCluster represents an Azure Red Hat OpenShift cluster.
:ivar tags: The resource tags.
:vartype tags: dict[str, str]
:ivar provisioning_state: The cluster provisioning state (immutable). Known values are:
"AdminUpdating", "Creating", "Deleting", "Failed", "Succeeded", and "Updating".
:vartype provisioning_state: str or
~azure.mgmt.redhatopenshift.v2020_04_30.models.ProvisioningState
:ivar cluster_profile: The cluster profile.
:vartype cluster_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.ClusterProfile
:ivar console_profile: The console profile.
:vartype console_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.ConsoleProfile
:ivar service_principal_profile: The cluster service principal profile.
:vartype service_principal_profile:
~azure.mgmt.redhatopenshift.v2020_04_30.models.ServicePrincipalProfile
:ivar network_profile: The cluster network profile.
:vartype network_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.NetworkProfile
:ivar master_profile: The cluster master profile.
:vartype master_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.MasterProfile
:ivar worker_profiles: The cluster worker profiles.
:vartype worker_profiles: list[~azure.mgmt.redhatopenshift.v2020_04_30.models.WorkerProfile]
:ivar apiserver_profile: The cluster API server profile.
:vartype apiserver_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.APIServerProfile
:ivar ingress_profiles: The cluster ingress profiles.
:vartype ingress_profiles: list[~azure.mgmt.redhatopenshift.v2020_04_30.models.IngressProfile]
"""
_attribute_map = {
"tags": {"key": "tags", "type": "{str}"},
"provisioning_state": {"key": "properties.provisioningState", "type": "str"},
"cluster_profile": {"key": "properties.clusterProfile", "type": "ClusterProfile"},
"console_profile": {"key": "properties.consoleProfile", "type": "ConsoleProfile"},
"service_principal_profile": {"key": "properties.servicePrincipalProfile", "type": "ServicePrincipalProfile"},
"network_profile": {"key": "properties.networkProfile", "type": "NetworkProfile"},
"master_profile": {"key": "properties.masterProfile", "type": "MasterProfile"},
"worker_profiles": {"key": "properties.workerProfiles", "type": "[WorkerProfile]"},
"apiserver_profile": {"key": "properties.apiserverProfile", "type": "APIServerProfile"},
"ingress_profiles": {"key": "properties.ingressProfiles", "type": "[IngressProfile]"},
}
def __init__(
self,
*,
tags: Optional[Dict[str, str]] = None,
provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None,
cluster_profile: Optional["_models.ClusterProfile"] = None,
console_profile: Optional["_models.ConsoleProfile"] = None,
service_principal_profile: Optional["_models.ServicePrincipalProfile"] = None,
network_profile: Optional["_models.NetworkProfile"] = None,
master_profile: Optional["_models.MasterProfile"] = None,
worker_profiles: Optional[List["_models.WorkerProfile"]] = None,
apiserver_profile: Optional["_models.APIServerProfile"] = None,
ingress_profiles: Optional[List["_models.IngressProfile"]] = None,
**kwargs: Any
) -> None:
"""
:keyword tags: The resource tags.
:paramtype tags: dict[str, str]
:keyword provisioning_state: The cluster provisioning state (immutable). Known values are:
"AdminUpdating", "Creating", "Deleting", "Failed", "Succeeded", and "Updating".
:paramtype provisioning_state: str or
~azure.mgmt.redhatopenshift.v2020_04_30.models.ProvisioningState
:keyword cluster_profile: The cluster profile.
:paramtype cluster_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.ClusterProfile
:keyword console_profile: The console profile.
:paramtype console_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.ConsoleProfile
:keyword service_principal_profile: The cluster service principal profile.
:paramtype service_principal_profile:
~azure.mgmt.redhatopenshift.v2020_04_30.models.ServicePrincipalProfile
:keyword network_profile: The cluster network profile.
:paramtype network_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.NetworkProfile
:keyword master_profile: The cluster master profile.
:paramtype master_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.MasterProfile
:keyword worker_profiles: The cluster worker profiles.
:paramtype worker_profiles: list[~azure.mgmt.redhatopenshift.v2020_04_30.models.WorkerProfile]
:keyword apiserver_profile: The cluster API server profile.
:paramtype apiserver_profile: ~azure.mgmt.redhatopenshift.v2020_04_30.models.APIServerProfile
:keyword ingress_profiles: The cluster ingress profiles.
:paramtype ingress_profiles:
list[~azure.mgmt.redhatopenshift.v2020_04_30.models.IngressProfile]
"""
super().__init__(**kwargs)
self.tags = tags
self.provisioning_state = provisioning_state
self.cluster_profile = cluster_profile
self.console_profile = console_profile
self.service_principal_profile = service_principal_profile
self.network_profile = network_profile
self.master_profile = master_profile
self.worker_profiles = worker_profiles
self.apiserver_profile = apiserver_profile
self.ingress_profiles = ingress_profiles
class Operation(_serialization.Model):
"""Operation represents an RP operation.
:ivar name: Operation name: {provider}/{resource}/{operation}.
:vartype name: str
:ivar display: The object that describes the operation.
:vartype display: ~azure.mgmt.redhatopenshift.v2020_04_30.models.Display
:ivar origin: Sources of requests to this operation. Comma separated list with valid values
user or system, e.g. "user,system".
:vartype origin: str
"""
_attribute_map = {
"name": {"key": "name", "type": "str"},
"display": {"key": "display", "type": "Display"},
"origin": {"key": "origin", "type": "str"},
}
def __init__(
self,
*,
name: Optional[str] = None,
display: Optional["_models.Display"] = None,
origin: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword name: Operation name: {provider}/{resource}/{operation}.
:paramtype name: str
:keyword display: The object that describes the operation.
:paramtype display: ~azure.mgmt.redhatopenshift.v2020_04_30.models.Display
:keyword origin: Sources of requests to this operation. Comma separated list with valid values
user or system, e.g. "user,system".
:paramtype origin: str
"""
super().__init__(**kwargs)
self.name = name
self.display = display
self.origin = origin
class OperationList(_serialization.Model):
"""OperationList represents an RP operation list.
:ivar value: List of operations supported by the resource provider.
:vartype value: list[~azure.mgmt.redhatopenshift.v2020_04_30.models.Operation]
:ivar next_link: The link used to get the next page of operations.
:vartype next_link: str
"""
_attribute_map = {
"value": {"key": "value", "type": "[Operation]"},
"next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
self, *, value: Optional[List["_models.Operation"]] = None, next_link: Optional[str] = None, **kwargs: Any
) -> None:
"""
:keyword value: List of operations supported by the resource provider.
:paramtype value: list[~azure.mgmt.redhatopenshift.v2020_04_30.models.Operation]
:keyword next_link: The link used to get the next page of operations.
:paramtype next_link: str
"""
super().__init__(**kwargs)
self.value = value
self.next_link = next_link
class ServicePrincipalProfile(_serialization.Model):
"""ServicePrincipalProfile represents a service principal profile.
:ivar client_id: The client ID used for the cluster (immutable).
:vartype client_id: str
:ivar client_secret: The client secret used for the cluster (immutable).
:vartype client_secret: str
"""
_attribute_map = {
"client_id": {"key": "clientId", "type": "str"},
"client_secret": {"key": "clientSecret", "type": "str"},
}
def __init__(self, *, client_id: Optional[str] = None, client_secret: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword client_id: The client ID used for the cluster (immutable).
:paramtype client_id: str
:keyword client_secret: The client secret used for the cluster (immutable).
:paramtype client_secret: str
"""
super().__init__(**kwargs)
self.client_id = client_id
self.client_secret = client_secret
class WorkerProfile(_serialization.Model):
"""WorkerProfile represents a worker profile.
:ivar name: The worker profile name. Must be "worker" (immutable).
:vartype name: str
:ivar vm_size: The size of the worker VMs (immutable). Known values are: "Standard_D2s_v3",
"Standard_D4s_v3", and "Standard_D8s_v3".
:vartype vm_size: str or ~azure.mgmt.redhatopenshift.v2020_04_30.models.VMSize
:ivar disk_size_gb: The disk size of the worker VMs. Must be 128 or greater (immutable).
:vartype disk_size_gb: int
:ivar subnet_id: The Azure resource ID of the worker subnet (immutable).
:vartype subnet_id: str
:ivar count: The number of worker VMs. Must be between 3 and 20 (immutable).
:vartype count: int
"""
_attribute_map = {
"name": {"key": "name", "type": "str"},
"vm_size": {"key": "vmSize", "type": "str"},
"disk_size_gb": {"key": "diskSizeGB", "type": "int"},
"subnet_id": {"key": "subnetId", "type": "str"},
"count": {"key": "count", "type": "int"},
}
def __init__(
self,
*,
name: Optional[str] = None,
vm_size: Optional[Union[str, "_models.VMSize"]] = None,
disk_size_gb: Optional[int] = None,
subnet_id: Optional[str] = None,
count: Optional[int] = None,
**kwargs: Any
) -> None:
"""
:keyword name: The worker profile name. Must be "worker" (immutable).
:paramtype name: str
:keyword vm_size: The size of the worker VMs (immutable). Known values are: "Standard_D2s_v3",
"Standard_D4s_v3", and "Standard_D8s_v3".
:paramtype vm_size: str or ~azure.mgmt.redhatopenshift.v2020_04_30.models.VMSize
:keyword disk_size_gb: The disk size of the worker VMs. Must be 128 or greater (immutable).
:paramtype disk_size_gb: int
:keyword subnet_id: The Azure resource ID of the worker subnet (immutable).
:paramtype subnet_id: str
:keyword count: The number of worker VMs. Must be between 3 and 20 (immutable).
:paramtype count: int
"""
super().__init__(**kwargs)
self.name = name
self.vm_size = vm_size
self.disk_size_gb = disk_size_gb
self.subnet_id = subnet_id
self.count = count

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

@ -1,21 +0,0 @@
# 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 ._operations import Operations
from ._open_shift_clusters_operations import OpenShiftClustersOperations
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"Operations",
"OpenShiftClustersOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,154 +0,0 @@
# pylint: disable=too-many-lines,too-many-statements
# 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 sys
from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
import urllib.parse
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from ..._serialization import Serializer
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False
def build_list_request(**kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-04-30"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop("template_url", "/providers/Microsoft.RedHatOpenShift/operations")
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
class Operations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2020_04_30.AzureRedHatOpenShift4Client`'s
:attr:`operations` attribute.
"""
models = _models
def __init__(self, *args, **kwargs):
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
"""Lists all of the available RP operations.
The operation returns the RP operations.
:return: An iterator like instance of either Operation or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.v2020_04_30.models.Operation]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-30"))
cls: ClsType[_models.OperationList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("OperationList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(get_next, extract_data)

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

@ -1 +0,0 @@
# Marker file for PEP 561.

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

@ -1,26 +0,0 @@
# 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 ._azure_red_hat_open_shift_client import AzureRedHatOpenShiftClient
from ._version import VERSION
__version__ = VERSION
try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"AzureRedHatOpenShiftClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,120 +0,0 @@
# 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 copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing_extensions import Self
from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
from . import models as _models
from .._serialization import Deserializer, Serializer
from ._configuration import AzureRedHatOpenShiftClientConfiguration
from .operations import OpenShiftClustersOperations, Operations
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
class AzureRedHatOpenShiftClient: # pylint: disable=client-accepts-api-version-keyword
"""Rest API for Azure Red Hat OpenShift 4.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.redhatopenshift.v2021_09_01_preview.operations.Operations
:ivar open_shift_clusters: OpenShiftClustersOperations operations
:vartype open_shift_clusters:
azure.mgmt.redhatopenshift.v2021_09_01_preview.operations.OpenShiftClustersOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2021-09-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
"""
def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = AzureRedHatOpenShiftClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
policies.RequestIdPolicy(**kwargs),
self._config.headers_policy,
self._config.user_agent_policy,
self._config.proxy_policy,
policies.ContentDecodePolicy(**kwargs),
ARMAutoResourceProviderRegistrationPolicy(),
self._config.redirect_policy,
self._config.retry_policy,
self._config.authentication_policy,
self._config.custom_hook_policy,
self._config.logging_policy,
policies.DistributedTracingPolicy(**kwargs),
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize, "2021-09-01-preview"
)
self.open_shift_clusters = OpenShiftClustersOperations(
self._client, self._config, self._serialize, self._deserialize, "2021-09-01-preview"
)
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client._send_request(request)
<HttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.rest.HttpResponse
"""
request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
def close(self) -> None:
self._client.close()
def __enter__(self) -> Self:
self._client.__enter__()
return self
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)

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

@ -1,65 +0,0 @@
# 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 typing import Any, TYPE_CHECKING
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
from ._version import VERSION
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
class AzureRedHatOpenShiftClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for AzureRedHatOpenShiftClient.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2021-09-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
api_version: str = kwargs.pop("api_version", "2021-09-01-preview")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-redhatopenshift/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

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

@ -1,111 +0,0 @@
{
"chosen_version": "2021-09-01-preview",
"total_api_version_list": ["2021-09-01-preview"],
"client": {
"name": "AzureRedHatOpenShiftClient",
"filename": "_azure_red_hat_open_shift_client",
"description": "Rest API for Azure Red Hat OpenShift 4.",
"host_value": "\"https://management.azure.com\"",
"parameterized_host_template": null,
"azure_arm": true,
"has_public_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"AzureRedHatOpenShiftClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"AzureRedHatOpenShiftClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential: \"TokenCredential\",",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true,
"method_location": "positional"
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "The ID of the target subscription. Required.",
"docstring_type": "str",
"required": true,
"method_location": "positional"
}
},
"async": {
"credential": {
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "The ID of the target subscription. Required.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version: Optional[str]=None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"base_url": {
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"profile": {
"signature": "profile: KnownProfiles=KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false,
"method_location": "positional"
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"base_url": {
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false,
"method_location": "positional"
}
}
}
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"sync_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"operations": "Operations",
"open_shift_clusters": "OpenShiftClustersOperations"
}
}

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

@ -1,32 +0,0 @@
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass

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

@ -1,9 +0,0 @@
# 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.
# --------------------------------------------------------------------------
VERSION = "1.5.0"

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

@ -1,23 +0,0 @@
# 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 ._azure_red_hat_open_shift_client import AzureRedHatOpenShiftClient
try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"AzureRedHatOpenShiftClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,122 +0,0 @@
# 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 copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from typing_extensions import Self
from azure.core.pipeline import policies
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy
from .. import models as _models
from ..._serialization import Deserializer, Serializer
from ._configuration import AzureRedHatOpenShiftClientConfiguration
from .operations import OpenShiftClustersOperations, Operations
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
class AzureRedHatOpenShiftClient: # pylint: disable=client-accepts-api-version-keyword
"""Rest API for Azure Red Hat OpenShift 4.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.redhatopenshift.v2021_09_01_preview.aio.operations.Operations
:ivar open_shift_clusters: OpenShiftClustersOperations operations
:vartype open_shift_clusters:
azure.mgmt.redhatopenshift.v2021_09_01_preview.aio.operations.OpenShiftClustersOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2021-09-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
"""
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = AzureRedHatOpenShiftClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
policies.RequestIdPolicy(**kwargs),
self._config.headers_policy,
self._config.user_agent_policy,
self._config.proxy_policy,
policies.ContentDecodePolicy(**kwargs),
AsyncARMAutoResourceProviderRegistrationPolicy(),
self._config.redirect_policy,
self._config.retry_policy,
self._config.authentication_policy,
self._config.custom_hook_policy,
self._config.logging_policy,
policies.DistributedTracingPolicy(**kwargs),
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize, "2021-09-01-preview"
)
self.open_shift_clusters = OpenShiftClustersOperations(
self._client, self._config, self._serialize, self._deserialize, "2021-09-01-preview"
)
def _send_request(
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any
) -> Awaitable[AsyncHttpResponse]:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = await client._send_request(request)
<AsyncHttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.rest.AsyncHttpResponse
"""
request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
async def close(self) -> None:
await self._client.close()
async def __aenter__(self) -> Self:
await self._client.__aenter__()
return self
async def __aexit__(self, *exc_details: Any) -> None:
await self._client.__aexit__(*exc_details)

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

@ -1,65 +0,0 @@
# 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 typing import Any, TYPE_CHECKING
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
from .._version import VERSION
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
class AzureRedHatOpenShiftClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for AzureRedHatOpenShiftClient.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2021-09-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
api_version: str = kwargs.pop("api_version", "2021-09-01-preview")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-redhatopenshift/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

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

@ -1,32 +0,0 @@
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass

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

@ -1,21 +0,0 @@
# 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 ._operations import Operations
from ._open_shift_clusters_operations import OpenShiftClustersOperations
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"Operations",
"OpenShiftClustersOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,944 +0,0 @@
# pylint: disable=too-many-lines,too-many-statements
# 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 io import IOBase
import sys
from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
from ... import models as _models
from ...operations._open_shift_clusters_operations import (
build_create_or_update_request,
build_delete_request,
build_get_request,
build_list_admin_credentials_request,
build_list_by_resource_group_request,
build_list_credentials_request,
build_list_request,
build_update_request,
)
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class OpenShiftClustersOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2021_09_01_preview.aio.AzureRedHatOpenShiftClient`'s
:attr:`open_shift_clusters` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.OpenShiftCluster"]:
"""Lists OpenShift clusters in the specified subscription.
The operation returns properties of each OpenShift cluster.
:return: An iterator like instance of either OpenShiftCluster or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2021-09-01-preview")
)
cls: ClsType[_models.OpenShiftClusterList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("OpenShiftClusterList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace
def list_by_resource_group(
self, resource_group_name: str, **kwargs: Any
) -> AsyncIterable["_models.OpenShiftCluster"]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:return: An iterator like instance of either OpenShiftCluster or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2021-09-01-preview")
)
cls: ClsType[_models.OpenShiftClusterList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_by_resource_group_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("OpenShiftClusterList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace_async
async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.OpenShiftCluster:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: OpenShiftCluster or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.OpenShiftCluster
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2021-09-01-preview")
)
cls: ClsType[_models.OpenShiftCluster] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("OpenShiftCluster", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
resource_name: str,
parameters: Union[_models.OpenShiftCluster, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2021-09-01-preview")
)
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(parameters, (IOBase, bytes)):
_content = parameters
else:
_json = self._serialize.body(parameters, "OpenShiftCluster")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
await response.read() # Load the body in memory and close the socket
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = response.stream_download(self._client._pipeline)
if response.status_code == 201:
deserialized = response.stream_download(self._client._pipeline)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
resource_name: str,
parameters: _models.OpenShiftCluster,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.OpenShiftCluster
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
resource_name: str,
parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
resource_name: str,
parameters: Union[_models.OpenShiftCluster, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Is either a OpenShiftCluster type or a
IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.OpenShiftCluster or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2021-09-01-preview")
)
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.OpenShiftCluster] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
resource_name=resource_name,
parameters=parameters,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("OpenShiftCluster", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.OpenShiftCluster].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.OpenShiftCluster](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial(
self, resource_group_name: str, resource_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2021-09-01-preview")
)
cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202, 204]:
await response.read() # Load the body in memory and close the socket
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 202:
deserialized = response.stream_download(self._client._pipeline)
if response.status_code == 204:
deserialized = response.stream_download(self._client._pipeline)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace_async
async def begin_delete(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2021-09-01-preview")
)
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial(
resource_group_name=resource_group_name,
resource_name=resource_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _update_initial(
self,
resource_group_name: str,
resource_name: str,
parameters: Union[_models.OpenShiftClusterUpdate, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2021-09-01-preview")
)
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(parameters, (IOBase, bytes)):
_content = parameters
else:
_json = self._serialize.body(parameters, "OpenShiftClusterUpdate")
_request = build_update_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
await response.read() # Load the body in memory and close the socket
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = response.stream_download(self._client._pipeline)
if response.status_code == 201:
deserialized = response.stream_download(self._client._pipeline)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_update(
self,
resource_group_name: str,
resource_name: str,
parameters: _models.OpenShiftClusterUpdate,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.OpenShiftClusterUpdate
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_update(
self,
resource_group_name: str,
resource_name: str,
parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_update(
self,
resource_group_name: str,
resource_name: str,
parameters: Union[_models.OpenShiftClusterUpdate, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Is either a OpenShiftClusterUpdate type or a
IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.OpenShiftClusterUpdate
or IO[bytes]
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2021-09-01-preview")
)
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.OpenShiftCluster] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._update_initial(
resource_group_name=resource_group_name,
resource_name=resource_name,
parameters=parameters,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("OpenShiftCluster", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.OpenShiftCluster].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.OpenShiftCluster](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
@distributed_trace_async
async def list_admin_credentials(
self, resource_group_name: str, resource_name: str, **kwargs: Any
) -> _models.OpenShiftClusterAdminKubeconfig:
"""Lists admin kubeconfig of an OpenShift cluster with the specified subscription, resource group
and resource name.
The operation returns the admin kubeconfig.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: OpenShiftClusterAdminKubeconfig or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.OpenShiftClusterAdminKubeconfig
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2021-09-01-preview")
)
cls: ClsType[_models.OpenShiftClusterAdminKubeconfig] = kwargs.pop("cls", None)
_request = build_list_admin_credentials_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("OpenShiftClusterAdminKubeconfig", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace_async
async def list_credentials(
self, resource_group_name: str, resource_name: str, **kwargs: Any
) -> _models.OpenShiftClusterCredentials:
"""Lists credentials of an 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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: OpenShiftClusterCredentials or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.OpenShiftClusterCredentials
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2021-09-01-preview")
)
cls: ClsType[_models.OpenShiftClusterCredentials] = kwargs.pop("cls", None)
_request = build_list_credentials_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("OpenShiftClusterCredentials", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore

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

@ -1,135 +0,0 @@
# pylint: disable=too-many-lines,too-many-statements
# 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 sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
from ...operations._operations import build_list_request
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class Operations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2021_09_01_preview.aio.AzureRedHatOpenShiftClient`'s
:attr:`operations` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
"""Lists all of the available RP operations.
The operation returns the RP operations.
:return: An iterator like instance of either Operation or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.Operation]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2021-09-01-preview")
)
cls: ClsType[_models.OperationList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("OperationList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)

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

@ -1,69 +0,0 @@
# 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 ._models_py3 import APIServerProfile
from ._models_py3 import CloudErrorBody
from ._models_py3 import ClusterProfile
from ._models_py3 import ConsoleProfile
from ._models_py3 import Display
from ._models_py3 import IngressProfile
from ._models_py3 import MasterProfile
from ._models_py3 import NetworkProfile
from ._models_py3 import OpenShiftCluster
from ._models_py3 import OpenShiftClusterAdminKubeconfig
from ._models_py3 import OpenShiftClusterCredentials
from ._models_py3 import OpenShiftClusterList
from ._models_py3 import OpenShiftClusterUpdate
from ._models_py3 import Operation
from ._models_py3 import OperationList
from ._models_py3 import Resource
from ._models_py3 import ServicePrincipalProfile
from ._models_py3 import SystemData
from ._models_py3 import TrackedResource
from ._models_py3 import WorkerProfile
from ._azure_red_hat_open_shift_client_enums import CreatedByType
from ._azure_red_hat_open_shift_client_enums import EncryptionAtHost
from ._azure_red_hat_open_shift_client_enums import ProvisioningState
from ._azure_red_hat_open_shift_client_enums import SoftwareDefinedNetwork
from ._azure_red_hat_open_shift_client_enums import VMSize
from ._azure_red_hat_open_shift_client_enums import Visibility
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"APIServerProfile",
"CloudErrorBody",
"ClusterProfile",
"ConsoleProfile",
"Display",
"IngressProfile",
"MasterProfile",
"NetworkProfile",
"OpenShiftCluster",
"OpenShiftClusterAdminKubeconfig",
"OpenShiftClusterCredentials",
"OpenShiftClusterList",
"OpenShiftClusterUpdate",
"Operation",
"OperationList",
"Resource",
"ServicePrincipalProfile",
"SystemData",
"TrackedResource",
"WorkerProfile",
"CreatedByType",
"EncryptionAtHost",
"ProvisioningState",
"SoftwareDefinedNetwork",
"VMSize",
"Visibility",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,79 +0,0 @@
# 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 enum import Enum
from azure.core import CaseInsensitiveEnumMeta
class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The type of identity that created the resource."""
USER = "User"
APPLICATION = "Application"
MANAGED_IDENTITY = "ManagedIdentity"
KEY = "Key"
class EncryptionAtHost(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""EncryptionAtHost represents encryption at host state."""
DISABLED = "Disabled"
ENABLED = "Enabled"
class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""ProvisioningState represents a provisioning state."""
ADMIN_UPDATING = "AdminUpdating"
CREATING = "Creating"
DELETING = "Deleting"
FAILED = "Failed"
SUCCEEDED = "Succeeded"
UPDATING = "Updating"
class SoftwareDefinedNetwork(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""SoftwareDefinedNetwork constants."""
OVN_KUBERNETES = "OVNKubernetes"
OPEN_SHIFT_SDN = "OpenShiftSDN"
class Visibility(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Visibility represents visibility."""
PRIVATE = "Private"
PUBLIC = "Public"
class VMSize(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""VMSize represents a VM size."""
STANDARD_D16_AS_V4 = "Standard_D16as_v4"
STANDARD_D16_S_V3 = "Standard_D16s_v3"
STANDARD_D2_S_V3 = "Standard_D2s_v3"
STANDARD_D32_AS_V4 = "Standard_D32as_v4"
STANDARD_D32_S_V3 = "Standard_D32s_v3"
STANDARD_D4_AS_V4 = "Standard_D4as_v4"
STANDARD_D4_S_V3 = "Standard_D4s_v3"
STANDARD_D8_AS_V4 = "Standard_D8as_v4"
STANDARD_D8_S_V3 = "Standard_D8s_v3"
STANDARD_E16_S_V3 = "Standard_E16s_v3"
STANDARD_E32_S_V3 = "Standard_E32s_v3"
STANDARD_E4_S_V3 = "Standard_E4s_v3"
STANDARD_E64_I_V3 = "Standard_E64i_v3"
STANDARD_E64_IS_V3 = "Standard_E64is_v3"
STANDARD_E8_S_V3 = "Standard_E8s_v3"
STANDARD_F16_S_V2 = "Standard_F16s_v2"
STANDARD_F32_S_V2 = "Standard_F32s_v2"
STANDARD_F4_S_V2 = "Standard_F4s_v2"
STANDARD_F72_S_V2 = "Standard_F72s_v2"
STANDARD_F8_S_V2 = "Standard_F8s_v2"
STANDARD_G5 = "Standard_G5"
STANDARD_GS5 = "Standard_GS5"
STANDARD_M128_MS = "Standard_M128ms"

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,21 +0,0 @@
# 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 ._operations import Operations
from ._open_shift_clusters_operations import OpenShiftClustersOperations
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"Operations",
"OpenShiftClustersOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,157 +0,0 @@
# pylint: disable=too-many-lines,too-many-statements
# 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 sys
from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
import urllib.parse
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from ..._serialization import Serializer
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False
def build_list_request(**kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop("template_url", "/providers/Microsoft.RedHatOpenShift/operations")
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
class Operations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2021_09_01_preview.AzureRedHatOpenShiftClient`'s
:attr:`operations` attribute.
"""
models = _models
def __init__(self, *args, **kwargs):
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
"""Lists all of the available RP operations.
The operation returns the RP operations.
:return: An iterator like instance of either Operation or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.v2021_09_01_preview.models.Operation]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2021-09-01-preview")
)
cls: ClsType[_models.OperationList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("OperationList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(get_next, extract_data)

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

@ -1,20 +0,0 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""Customize generated code here.
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.
`patch_sdk` is a last resort escape hatch that allows you to do customizations
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

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

@ -1 +0,0 @@
# Marker file for PEP 561.

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

@ -1,26 +0,0 @@
# 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 ._azure_red_hat_open_shift_client import AzureRedHatOpenShiftClient
from ._version import VERSION
__version__ = VERSION
try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"AzureRedHatOpenShiftClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,118 +0,0 @@
# 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 copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing_extensions import Self
from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
from . import models as _models
from .._serialization import Deserializer, Serializer
from ._configuration import AzureRedHatOpenShiftClientConfiguration
from .operations import OpenShiftClustersOperations, Operations
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
class AzureRedHatOpenShiftClient: # pylint: disable=client-accepts-api-version-keyword
"""Rest API for Azure Red Hat OpenShift 4.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.redhatopenshift.v2022_04_01.operations.Operations
:ivar open_shift_clusters: OpenShiftClustersOperations operations
:vartype open_shift_clusters:
azure.mgmt.redhatopenshift.v2022_04_01.operations.OpenShiftClustersOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-04-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
"""
def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = AzureRedHatOpenShiftClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
policies.RequestIdPolicy(**kwargs),
self._config.headers_policy,
self._config.user_agent_policy,
self._config.proxy_policy,
policies.ContentDecodePolicy(**kwargs),
ARMAutoResourceProviderRegistrationPolicy(),
self._config.redirect_policy,
self._config.retry_policy,
self._config.authentication_policy,
self._config.custom_hook_policy,
self._config.logging_policy,
policies.DistributedTracingPolicy(**kwargs),
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2022-04-01")
self.open_shift_clusters = OpenShiftClustersOperations(
self._client, self._config, self._serialize, self._deserialize, "2022-04-01"
)
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client._send_request(request)
<HttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.rest.HttpResponse
"""
request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
def close(self) -> None:
self._client.close()
def __enter__(self) -> Self:
self._client.__enter__()
return self
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)

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

@ -1,65 +0,0 @@
# 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 typing import Any, TYPE_CHECKING
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
from ._version import VERSION
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
class AzureRedHatOpenShiftClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for AzureRedHatOpenShiftClient.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-04-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
api_version: str = kwargs.pop("api_version", "2022-04-01")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-redhatopenshift/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

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

@ -1,111 +0,0 @@
{
"chosen_version": "2022-04-01",
"total_api_version_list": ["2022-04-01"],
"client": {
"name": "AzureRedHatOpenShiftClient",
"filename": "_azure_red_hat_open_shift_client",
"description": "Rest API for Azure Red Hat OpenShift 4.",
"host_value": "\"https://management.azure.com\"",
"parameterized_host_template": null,
"azure_arm": true,
"has_public_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"AzureRedHatOpenShiftClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"AzureRedHatOpenShiftClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential: \"TokenCredential\",",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true,
"method_location": "positional"
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "The ID of the target subscription. Required.",
"docstring_type": "str",
"required": true,
"method_location": "positional"
}
},
"async": {
"credential": {
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "The ID of the target subscription. Required.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version: Optional[str]=None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"base_url": {
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"profile": {
"signature": "profile: KnownProfiles=KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false,
"method_location": "positional"
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"base_url": {
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false,
"method_location": "positional"
}
}
}
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"sync_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"operations": "Operations",
"open_shift_clusters": "OpenShiftClustersOperations"
}
}

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

@ -1,32 +0,0 @@
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass

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

@ -1,9 +0,0 @@
# 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.
# --------------------------------------------------------------------------
VERSION = "1.5.0"

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

@ -1,23 +0,0 @@
# 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 ._azure_red_hat_open_shift_client import AzureRedHatOpenShiftClient
try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"AzureRedHatOpenShiftClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,120 +0,0 @@
# 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 copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from typing_extensions import Self
from azure.core.pipeline import policies
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy
from .. import models as _models
from ..._serialization import Deserializer, Serializer
from ._configuration import AzureRedHatOpenShiftClientConfiguration
from .operations import OpenShiftClustersOperations, Operations
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
class AzureRedHatOpenShiftClient: # pylint: disable=client-accepts-api-version-keyword
"""Rest API for Azure Red Hat OpenShift 4.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.redhatopenshift.v2022_04_01.aio.operations.Operations
:ivar open_shift_clusters: OpenShiftClustersOperations operations
:vartype open_shift_clusters:
azure.mgmt.redhatopenshift.v2022_04_01.aio.operations.OpenShiftClustersOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-04-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
"""
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = AzureRedHatOpenShiftClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
policies.RequestIdPolicy(**kwargs),
self._config.headers_policy,
self._config.user_agent_policy,
self._config.proxy_policy,
policies.ContentDecodePolicy(**kwargs),
AsyncARMAutoResourceProviderRegistrationPolicy(),
self._config.redirect_policy,
self._config.retry_policy,
self._config.authentication_policy,
self._config.custom_hook_policy,
self._config.logging_policy,
policies.DistributedTracingPolicy(**kwargs),
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2022-04-01")
self.open_shift_clusters = OpenShiftClustersOperations(
self._client, self._config, self._serialize, self._deserialize, "2022-04-01"
)
def _send_request(
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any
) -> Awaitable[AsyncHttpResponse]:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = await client._send_request(request)
<AsyncHttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.rest.AsyncHttpResponse
"""
request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
async def close(self) -> None:
await self._client.close()
async def __aenter__(self) -> Self:
await self._client.__aenter__()
return self
async def __aexit__(self, *exc_details: Any) -> None:
await self._client.__aexit__(*exc_details)

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

@ -1,65 +0,0 @@
# 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 typing import Any, TYPE_CHECKING
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
from .._version import VERSION
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
class AzureRedHatOpenShiftClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for AzureRedHatOpenShiftClient.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-04-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
api_version: str = kwargs.pop("api_version", "2022-04-01")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-redhatopenshift/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

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

@ -1,32 +0,0 @@
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass

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

@ -1,21 +0,0 @@
# 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 ._operations import Operations
from ._open_shift_clusters_operations import OpenShiftClustersOperations
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"Operations",
"OpenShiftClustersOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,921 +0,0 @@
# pylint: disable=too-many-lines,too-many-statements
# 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 io import IOBase
import sys
from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
from ... import models as _models
from ...operations._open_shift_clusters_operations import (
build_create_or_update_request,
build_delete_request,
build_get_request,
build_list_admin_credentials_request,
build_list_by_resource_group_request,
build_list_credentials_request,
build_list_request,
build_update_request,
)
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class OpenShiftClustersOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2022_04_01.aio.AzureRedHatOpenShiftClient`'s
:attr:`open_shift_clusters` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.OpenShiftCluster"]:
"""Lists OpenShift clusters in the specified subscription.
The operation returns properties of each OpenShift cluster.
:return: An iterator like instance of either OpenShiftCluster or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01"))
cls: ClsType[_models.OpenShiftClusterList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("OpenShiftClusterList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace
def list_by_resource_group(
self, resource_group_name: str, **kwargs: Any
) -> AsyncIterable["_models.OpenShiftCluster"]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:return: An iterator like instance of either OpenShiftCluster or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01"))
cls: ClsType[_models.OpenShiftClusterList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_by_resource_group_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("OpenShiftClusterList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace_async
async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.OpenShiftCluster:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: OpenShiftCluster or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftCluster
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01"))
cls: ClsType[_models.OpenShiftCluster] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("OpenShiftCluster", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
resource_name: str,
parameters: Union[_models.OpenShiftCluster, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(parameters, (IOBase, bytes)):
_content = parameters
else:
_json = self._serialize.body(parameters, "OpenShiftCluster")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
await response.read() # Load the body in memory and close the socket
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = response.stream_download(self._client._pipeline)
if response.status_code == 201:
deserialized = response.stream_download(self._client._pipeline)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
resource_name: str,
parameters: _models.OpenShiftCluster,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftCluster
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
resource_name: str,
parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
resource_name: str,
parameters: Union[_models.OpenShiftCluster, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Is either a OpenShiftCluster type or a
IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftCluster or IO[bytes]
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.OpenShiftCluster] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
resource_name=resource_name,
parameters=parameters,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("OpenShiftCluster", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.OpenShiftCluster].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.OpenShiftCluster](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial(
self, resource_group_name: str, resource_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01"))
cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202, 204]:
await response.read() # Load the body in memory and close the socket
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 202:
deserialized = response.stream_download(self._client._pipeline)
if response.status_code == 204:
deserialized = response.stream_download(self._client._pipeline)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace_async
async def begin_delete(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial(
resource_group_name=resource_group_name,
resource_name=resource_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _update_initial(
self,
resource_group_name: str,
resource_name: str,
parameters: Union[_models.OpenShiftClusterUpdate, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(parameters, (IOBase, bytes)):
_content = parameters
else:
_json = self._serialize.body(parameters, "OpenShiftClusterUpdate")
_request = build_update_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
await response.read() # Load the body in memory and close the socket
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = response.stream_download(self._client._pipeline)
if response.status_code == 201:
deserialized = response.stream_download(self._client._pipeline)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_update(
self,
resource_group_name: str,
resource_name: str,
parameters: _models.OpenShiftClusterUpdate,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftClusterUpdate
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_update(
self,
resource_group_name: str,
resource_name: str,
parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Required.
:type parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_update(
self,
resource_group_name: str,
resource_name: str,
parameters: Union[_models.OpenShiftClusterUpdate, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.OpenShiftCluster]:
"""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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:param parameters: The OpenShift cluster resource. Is either a OpenShiftClusterUpdate type or a
IO[bytes] type. Required.
:type parameters: ~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftClusterUpdate or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either OpenShiftCluster or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftCluster]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.OpenShiftCluster] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._update_initial(
resource_group_name=resource_group_name,
resource_name=resource_name,
parameters=parameters,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("OpenShiftCluster", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.OpenShiftCluster].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.OpenShiftCluster](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
@distributed_trace_async
async def list_admin_credentials(
self, resource_group_name: str, resource_name: str, **kwargs: Any
) -> _models.OpenShiftClusterAdminKubeconfig:
"""Lists admin kubeconfig of an OpenShift cluster with the specified subscription, resource group
and resource name.
The operation returns the admin kubeconfig.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: OpenShiftClusterAdminKubeconfig or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftClusterAdminKubeconfig
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01"))
cls: ClsType[_models.OpenShiftClusterAdminKubeconfig] = kwargs.pop("cls", None)
_request = build_list_admin_credentials_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("OpenShiftClusterAdminKubeconfig", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace_async
async def list_credentials(
self, resource_group_name: str, resource_name: str, **kwargs: Any
) -> _models.OpenShiftClusterCredentials:
"""Lists credentials of an 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. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource_name: The name of the OpenShift cluster resource. Required.
:type resource_name: str
:return: OpenShiftClusterCredentials or the result of cls(response)
:rtype: ~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftClusterCredentials
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01"))
cls: ClsType[_models.OpenShiftClusterCredentials] = kwargs.pop("cls", None)
_request = build_list_credentials_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("OpenShiftClusterCredentials", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore

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

@ -1,133 +0,0 @@
# pylint: disable=too-many-lines,too-many-statements
# 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 sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
from ...operations._operations import build_list_request
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class Operations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2022_04_01.aio.AzureRedHatOpenShiftClient`'s
:attr:`operations` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
"""Lists all of the available RP operations.
The operation returns the RP operations.
:return: An iterator like instance of either Operation or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.redhatopenshift.v2022_04_01.models.Operation]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01"))
cls: ClsType[_models.OperationList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("OperationList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)

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

@ -1,20 +0,0 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""Customize generated code here.
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.
`patch_sdk` is a last resort escape hatch that allows you to do customizations
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

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

@ -1,67 +0,0 @@
# 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 ._models_py3 import APIServerProfile
from ._models_py3 import CloudErrorBody
from ._models_py3 import ClusterProfile
from ._models_py3 import ConsoleProfile
from ._models_py3 import Display
from ._models_py3 import IngressProfile
from ._models_py3 import MasterProfile
from ._models_py3 import NetworkProfile
from ._models_py3 import OpenShiftCluster
from ._models_py3 import OpenShiftClusterAdminKubeconfig
from ._models_py3 import OpenShiftClusterCredentials
from ._models_py3 import OpenShiftClusterList
from ._models_py3 import OpenShiftClusterUpdate
from ._models_py3 import Operation
from ._models_py3 import OperationList
from ._models_py3 import Resource
from ._models_py3 import ServicePrincipalProfile
from ._models_py3 import SystemData
from ._models_py3 import TrackedResource
from ._models_py3 import WorkerProfile
from ._azure_red_hat_open_shift_client_enums import CreatedByType
from ._azure_red_hat_open_shift_client_enums import EncryptionAtHost
from ._azure_red_hat_open_shift_client_enums import FipsValidatedModules
from ._azure_red_hat_open_shift_client_enums import ProvisioningState
from ._azure_red_hat_open_shift_client_enums import Visibility
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"APIServerProfile",
"CloudErrorBody",
"ClusterProfile",
"ConsoleProfile",
"Display",
"IngressProfile",
"MasterProfile",
"NetworkProfile",
"OpenShiftCluster",
"OpenShiftClusterAdminKubeconfig",
"OpenShiftClusterCredentials",
"OpenShiftClusterList",
"OpenShiftClusterUpdate",
"Operation",
"OperationList",
"Resource",
"ServicePrincipalProfile",
"SystemData",
"TrackedResource",
"WorkerProfile",
"CreatedByType",
"EncryptionAtHost",
"FipsValidatedModules",
"ProvisioningState",
"Visibility",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,51 +0,0 @@
# 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 enum import Enum
from azure.core import CaseInsensitiveEnumMeta
class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The type of identity that created the resource."""
USER = "User"
APPLICATION = "Application"
MANAGED_IDENTITY = "ManagedIdentity"
KEY = "Key"
class EncryptionAtHost(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""EncryptionAtHost represents encryption at host state."""
DISABLED = "Disabled"
ENABLED = "Enabled"
class FipsValidatedModules(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""FipsValidatedModules determines if FIPS is used."""
DISABLED = "Disabled"
ENABLED = "Enabled"
class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""ProvisioningState represents a provisioning state."""
ADMIN_UPDATING = "AdminUpdating"
CREATING = "Creating"
DELETING = "Deleting"
FAILED = "Failed"
SUCCEEDED = "Succeeded"
UPDATING = "Updating"
class Visibility(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Visibility represents visibility."""
PRIVATE = "Private"
PUBLIC = "Public"

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

@ -1,978 +0,0 @@
# coding=utf-8
# pylint: disable=too-many-lines
# --------------------------------------------------------------------------
# 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 datetime
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union
from ... import _serialization
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
class APIServerProfile(_serialization.Model):
"""APIServerProfile represents an API server profile.
:ivar visibility: API server visibility. Known values are: "Private" and "Public".
:vartype visibility: str or ~azure.mgmt.redhatopenshift.v2022_04_01.models.Visibility
:ivar url: The URL to access the cluster API server.
:vartype url: str
:ivar ip: The IP of the cluster API server.
:vartype ip: str
"""
_attribute_map = {
"visibility": {"key": "visibility", "type": "str"},
"url": {"key": "url", "type": "str"},
"ip": {"key": "ip", "type": "str"},
}
def __init__(
self,
*,
visibility: Optional[Union[str, "_models.Visibility"]] = None,
url: Optional[str] = None,
ip: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword visibility: API server visibility. Known values are: "Private" and "Public".
:paramtype visibility: str or ~azure.mgmt.redhatopenshift.v2022_04_01.models.Visibility
:keyword url: The URL to access the cluster API server.
:paramtype url: str
:keyword ip: The IP of the cluster API server.
:paramtype ip: str
"""
super().__init__(**kwargs)
self.visibility = visibility
self.url = url
self.ip = ip
class CloudErrorBody(_serialization.Model):
"""CloudErrorBody represents the body of a cloud error.
:ivar code: An identifier for the error. Codes are invariant and are intended to be consumed
programmatically.
:vartype code: str
:ivar message: A message describing the error, intended to be suitable for display in a user
interface.
:vartype message: str
:ivar target: The target of the particular error. For example, the name of the property in
error.
:vartype target: str
:ivar details: A list of additional details about the error.
:vartype details: list[~azure.mgmt.redhatopenshift.v2022_04_01.models.CloudErrorBody]
"""
_attribute_map = {
"code": {"key": "code", "type": "str"},
"message": {"key": "message", "type": "str"},
"target": {"key": "target", "type": "str"},
"details": {"key": "details", "type": "[CloudErrorBody]"},
}
def __init__(
self,
*,
code: Optional[str] = None,
message: Optional[str] = None,
target: Optional[str] = None,
details: Optional[List["_models.CloudErrorBody"]] = None,
**kwargs: Any
) -> None:
"""
:keyword code: An identifier for the error. Codes are invariant and are intended to be consumed
programmatically.
:paramtype code: str
:keyword message: A message describing the error, intended to be suitable for display in a user
interface.
:paramtype message: str
:keyword target: The target of the particular error. For example, the name of the property in
error.
:paramtype target: str
:keyword details: A list of additional details about the error.
:paramtype details: list[~azure.mgmt.redhatopenshift.v2022_04_01.models.CloudErrorBody]
"""
super().__init__(**kwargs)
self.code = code
self.message = message
self.target = target
self.details = details
class ClusterProfile(_serialization.Model):
"""ClusterProfile represents a cluster profile.
:ivar pull_secret: The pull secret for the cluster.
:vartype pull_secret: str
:ivar domain: The domain for the cluster.
:vartype domain: str
:ivar version: The version of the cluster.
:vartype version: str
:ivar resource_group_id: The ID of the cluster resource group.
:vartype resource_group_id: str
:ivar fips_validated_modules: If FIPS validated crypto modules are used. Known values are:
"Disabled" and "Enabled".
:vartype fips_validated_modules: str or
~azure.mgmt.redhatopenshift.v2022_04_01.models.FipsValidatedModules
"""
_attribute_map = {
"pull_secret": {"key": "pullSecret", "type": "str"},
"domain": {"key": "domain", "type": "str"},
"version": {"key": "version", "type": "str"},
"resource_group_id": {"key": "resourceGroupId", "type": "str"},
"fips_validated_modules": {"key": "fipsValidatedModules", "type": "str"},
}
def __init__(
self,
*,
pull_secret: Optional[str] = None,
domain: Optional[str] = None,
version: Optional[str] = None,
resource_group_id: Optional[str] = None,
fips_validated_modules: Optional[Union[str, "_models.FipsValidatedModules"]] = None,
**kwargs: Any
) -> None:
"""
:keyword pull_secret: The pull secret for the cluster.
:paramtype pull_secret: str
:keyword domain: The domain for the cluster.
:paramtype domain: str
:keyword version: The version of the cluster.
:paramtype version: str
:keyword resource_group_id: The ID of the cluster resource group.
:paramtype resource_group_id: str
:keyword fips_validated_modules: If FIPS validated crypto modules are used. Known values are:
"Disabled" and "Enabled".
:paramtype fips_validated_modules: str or
~azure.mgmt.redhatopenshift.v2022_04_01.models.FipsValidatedModules
"""
super().__init__(**kwargs)
self.pull_secret = pull_secret
self.domain = domain
self.version = version
self.resource_group_id = resource_group_id
self.fips_validated_modules = fips_validated_modules
class ConsoleProfile(_serialization.Model):
"""ConsoleProfile represents a console profile.
:ivar url: The URL to access the cluster console.
:vartype url: str
"""
_attribute_map = {
"url": {"key": "url", "type": "str"},
}
def __init__(self, *, url: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword url: The URL to access the cluster console.
:paramtype url: str
"""
super().__init__(**kwargs)
self.url = url
class Display(_serialization.Model):
"""Display represents the display details of an operation.
:ivar provider: Friendly name of the resource provider.
:vartype provider: str
:ivar resource: Resource type on which the operation is performed.
:vartype resource: str
:ivar operation: Operation type: read, write, delete, listKeys/action, etc.
:vartype operation: str
:ivar description: Friendly name of the operation.
:vartype description: str
"""
_attribute_map = {
"provider": {"key": "provider", "type": "str"},
"resource": {"key": "resource", "type": "str"},
"operation": {"key": "operation", "type": "str"},
"description": {"key": "description", "type": "str"},
}
def __init__(
self,
*,
provider: Optional[str] = None,
resource: Optional[str] = None,
operation: Optional[str] = None,
description: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword provider: Friendly name of the resource provider.
:paramtype provider: str
:keyword resource: Resource type on which the operation is performed.
:paramtype resource: str
:keyword operation: Operation type: read, write, delete, listKeys/action, etc.
:paramtype operation: str
:keyword description: Friendly name of the operation.
:paramtype description: str
"""
super().__init__(**kwargs)
self.provider = provider
self.resource = resource
self.operation = operation
self.description = description
class IngressProfile(_serialization.Model):
"""IngressProfile represents an ingress profile.
:ivar name: The ingress profile name.
:vartype name: str
:ivar visibility: Ingress visibility. Known values are: "Private" and "Public".
:vartype visibility: str or ~azure.mgmt.redhatopenshift.v2022_04_01.models.Visibility
:ivar ip: The IP of the ingress.
:vartype ip: str
"""
_attribute_map = {
"name": {"key": "name", "type": "str"},
"visibility": {"key": "visibility", "type": "str"},
"ip": {"key": "ip", "type": "str"},
}
def __init__(
self,
*,
name: Optional[str] = None,
visibility: Optional[Union[str, "_models.Visibility"]] = None,
ip: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword name: The ingress profile name.
:paramtype name: str
:keyword visibility: Ingress visibility. Known values are: "Private" and "Public".
:paramtype visibility: str or ~azure.mgmt.redhatopenshift.v2022_04_01.models.Visibility
:keyword ip: The IP of the ingress.
:paramtype ip: str
"""
super().__init__(**kwargs)
self.name = name
self.visibility = visibility
self.ip = ip
class MasterProfile(_serialization.Model):
"""MasterProfile represents a master profile.
:ivar vm_size: The size of the master VMs.
:vartype vm_size: str
:ivar subnet_id: The Azure resource ID of the master subnet.
:vartype subnet_id: str
:ivar encryption_at_host: Whether master virtual machines are encrypted at host. Known values
are: "Disabled" and "Enabled".
:vartype encryption_at_host: str or
~azure.mgmt.redhatopenshift.v2022_04_01.models.EncryptionAtHost
:ivar disk_encryption_set_id: The resource ID of an associated DiskEncryptionSet, if
applicable.
:vartype disk_encryption_set_id: str
"""
_attribute_map = {
"vm_size": {"key": "vmSize", "type": "str"},
"subnet_id": {"key": "subnetId", "type": "str"},
"encryption_at_host": {"key": "encryptionAtHost", "type": "str"},
"disk_encryption_set_id": {"key": "diskEncryptionSetId", "type": "str"},
}
def __init__(
self,
*,
vm_size: Optional[str] = None,
subnet_id: Optional[str] = None,
encryption_at_host: Optional[Union[str, "_models.EncryptionAtHost"]] = None,
disk_encryption_set_id: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword vm_size: The size of the master VMs.
:paramtype vm_size: str
:keyword subnet_id: The Azure resource ID of the master subnet.
:paramtype subnet_id: str
:keyword encryption_at_host: Whether master virtual machines are encrypted at host. Known
values are: "Disabled" and "Enabled".
:paramtype encryption_at_host: str or
~azure.mgmt.redhatopenshift.v2022_04_01.models.EncryptionAtHost
:keyword disk_encryption_set_id: The resource ID of an associated DiskEncryptionSet, if
applicable.
:paramtype disk_encryption_set_id: str
"""
super().__init__(**kwargs)
self.vm_size = vm_size
self.subnet_id = subnet_id
self.encryption_at_host = encryption_at_host
self.disk_encryption_set_id = disk_encryption_set_id
class NetworkProfile(_serialization.Model):
"""NetworkProfile represents a network profile.
:ivar pod_cidr: The CIDR used for OpenShift/Kubernetes Pods.
:vartype pod_cidr: str
:ivar service_cidr: The CIDR used for OpenShift/Kubernetes Services.
:vartype service_cidr: str
"""
_attribute_map = {
"pod_cidr": {"key": "podCidr", "type": "str"},
"service_cidr": {"key": "serviceCidr", "type": "str"},
}
def __init__(self, *, pod_cidr: Optional[str] = None, service_cidr: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword pod_cidr: The CIDR used for OpenShift/Kubernetes Pods.
:paramtype pod_cidr: str
:keyword service_cidr: The CIDR used for OpenShift/Kubernetes Services.
:paramtype service_cidr: str
"""
super().__init__(**kwargs)
self.pod_cidr = pod_cidr
self.service_cidr = service_cidr
class Resource(_serialization.Model):
"""Common fields that are returned in the response for all Azure Resource Manager resources.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.id = None
self.name = None
self.type = None
class TrackedResource(Resource):
"""The resource model definition for an Azure Resource Manager tracked top level resource which
has 'tags' and a 'location'.
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 server.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar tags: Resource tags.
:vartype tags: dict[str, str]
:ivar location: The geo-location where the resource lives. Required.
:vartype location: str
"""
_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"},
"tags": {"key": "tags", "type": "{str}"},
"location": {"key": "location", "type": "str"},
}
def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None:
"""
:keyword tags: Resource tags.
:paramtype tags: dict[str, str]
:keyword location: The geo-location where the resource lives. Required.
:paramtype location: str
"""
super().__init__(**kwargs)
self.tags = tags
self.location = location
class OpenShiftCluster(TrackedResource): # pylint: disable=too-many-instance-attributes
"""OpenShiftCluster represents an Azure Red Hat OpenShift cluster.
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 server.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar tags: Resource tags.
:vartype tags: dict[str, str]
:ivar location: The geo-location where the resource lives. Required.
:vartype location: str
:ivar system_data: The system meta data relating to this resource.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2022_04_01.models.SystemData
:ivar provisioning_state: The cluster provisioning state. Known values are: "AdminUpdating",
"Creating", "Deleting", "Failed", "Succeeded", and "Updating".
:vartype provisioning_state: str or
~azure.mgmt.redhatopenshift.v2022_04_01.models.ProvisioningState
:ivar cluster_profile: The cluster profile.
:vartype cluster_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.ClusterProfile
:ivar console_profile: The console profile.
:vartype console_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.ConsoleProfile
:ivar service_principal_profile: The cluster service principal profile.
:vartype service_principal_profile:
~azure.mgmt.redhatopenshift.v2022_04_01.models.ServicePrincipalProfile
:ivar network_profile: The cluster network profile.
:vartype network_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.NetworkProfile
:ivar master_profile: The cluster master profile.
:vartype master_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.MasterProfile
:ivar worker_profiles: The cluster worker profiles.
:vartype worker_profiles: list[~azure.mgmt.redhatopenshift.v2022_04_01.models.WorkerProfile]
:ivar apiserver_profile: The cluster API server profile.
:vartype apiserver_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.APIServerProfile
:ivar ingress_profiles: The cluster ingress profiles.
:vartype ingress_profiles: list[~azure.mgmt.redhatopenshift.v2022_04_01.models.IngressProfile]
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"location": {"required": True},
"system_data": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"tags": {"key": "tags", "type": "{str}"},
"location": {"key": "location", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"provisioning_state": {"key": "properties.provisioningState", "type": "str"},
"cluster_profile": {"key": "properties.clusterProfile", "type": "ClusterProfile"},
"console_profile": {"key": "properties.consoleProfile", "type": "ConsoleProfile"},
"service_principal_profile": {"key": "properties.servicePrincipalProfile", "type": "ServicePrincipalProfile"},
"network_profile": {"key": "properties.networkProfile", "type": "NetworkProfile"},
"master_profile": {"key": "properties.masterProfile", "type": "MasterProfile"},
"worker_profiles": {"key": "properties.workerProfiles", "type": "[WorkerProfile]"},
"apiserver_profile": {"key": "properties.apiserverProfile", "type": "APIServerProfile"},
"ingress_profiles": {"key": "properties.ingressProfiles", "type": "[IngressProfile]"},
}
def __init__(
self,
*,
location: str,
tags: Optional[Dict[str, str]] = None,
provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None,
cluster_profile: Optional["_models.ClusterProfile"] = None,
console_profile: Optional["_models.ConsoleProfile"] = None,
service_principal_profile: Optional["_models.ServicePrincipalProfile"] = None,
network_profile: Optional["_models.NetworkProfile"] = None,
master_profile: Optional["_models.MasterProfile"] = None,
worker_profiles: Optional[List["_models.WorkerProfile"]] = None,
apiserver_profile: Optional["_models.APIServerProfile"] = None,
ingress_profiles: Optional[List["_models.IngressProfile"]] = None,
**kwargs: Any
) -> None:
"""
:keyword tags: Resource tags.
:paramtype tags: dict[str, str]
:keyword location: The geo-location where the resource lives. Required.
:paramtype location: str
:keyword provisioning_state: The cluster provisioning state. Known values are: "AdminUpdating",
"Creating", "Deleting", "Failed", "Succeeded", and "Updating".
:paramtype provisioning_state: str or
~azure.mgmt.redhatopenshift.v2022_04_01.models.ProvisioningState
:keyword cluster_profile: The cluster profile.
:paramtype cluster_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.ClusterProfile
:keyword console_profile: The console profile.
:paramtype console_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.ConsoleProfile
:keyword service_principal_profile: The cluster service principal profile.
:paramtype service_principal_profile:
~azure.mgmt.redhatopenshift.v2022_04_01.models.ServicePrincipalProfile
:keyword network_profile: The cluster network profile.
:paramtype network_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.NetworkProfile
:keyword master_profile: The cluster master profile.
:paramtype master_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.MasterProfile
:keyword worker_profiles: The cluster worker profiles.
:paramtype worker_profiles: list[~azure.mgmt.redhatopenshift.v2022_04_01.models.WorkerProfile]
:keyword apiserver_profile: The cluster API server profile.
:paramtype apiserver_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.APIServerProfile
:keyword ingress_profiles: The cluster ingress profiles.
:paramtype ingress_profiles:
list[~azure.mgmt.redhatopenshift.v2022_04_01.models.IngressProfile]
"""
super().__init__(tags=tags, location=location, **kwargs)
self.system_data = None
self.provisioning_state = provisioning_state
self.cluster_profile = cluster_profile
self.console_profile = console_profile
self.service_principal_profile = service_principal_profile
self.network_profile = network_profile
self.master_profile = master_profile
self.worker_profiles = worker_profiles
self.apiserver_profile = apiserver_profile
self.ingress_profiles = ingress_profiles
class OpenShiftClusterAdminKubeconfig(_serialization.Model):
"""OpenShiftClusterAdminKubeconfig represents an OpenShift cluster's admin kubeconfig.
:ivar kubeconfig: The base64-encoded kubeconfig file.
:vartype kubeconfig: str
"""
_attribute_map = {
"kubeconfig": {"key": "kubeconfig", "type": "str"},
}
def __init__(self, *, kubeconfig: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword kubeconfig: The base64-encoded kubeconfig file.
:paramtype kubeconfig: str
"""
super().__init__(**kwargs)
self.kubeconfig = kubeconfig
class OpenShiftClusterCredentials(_serialization.Model):
"""OpenShiftClusterCredentials represents an OpenShift cluster's credentials.
:ivar kubeadmin_username: The username for the kubeadmin user.
:vartype kubeadmin_username: str
:ivar kubeadmin_password: The password for the kubeadmin user.
:vartype kubeadmin_password: str
"""
_attribute_map = {
"kubeadmin_username": {"key": "kubeadminUsername", "type": "str"},
"kubeadmin_password": {"key": "kubeadminPassword", "type": "str"},
}
def __init__(
self, *, kubeadmin_username: Optional[str] = None, kubeadmin_password: Optional[str] = None, **kwargs: Any
) -> None:
"""
:keyword kubeadmin_username: The username for the kubeadmin user.
:paramtype kubeadmin_username: str
:keyword kubeadmin_password: The password for the kubeadmin user.
:paramtype kubeadmin_password: str
"""
super().__init__(**kwargs)
self.kubeadmin_username = kubeadmin_username
self.kubeadmin_password = kubeadmin_password
class OpenShiftClusterList(_serialization.Model):
"""OpenShiftClusterList represents a list of OpenShift clusters.
:ivar value: The list of OpenShift clusters.
:vartype value: list[~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftCluster]
:ivar next_link: The link used to get the next page of operations.
:vartype next_link: str
"""
_attribute_map = {
"value": {"key": "value", "type": "[OpenShiftCluster]"},
"next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
self,
*,
value: Optional[List["_models.OpenShiftCluster"]] = None,
next_link: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword value: The list of OpenShift clusters.
:paramtype value: list[~azure.mgmt.redhatopenshift.v2022_04_01.models.OpenShiftCluster]
:keyword next_link: The link used to get the next page of operations.
:paramtype next_link: str
"""
super().__init__(**kwargs)
self.value = value
self.next_link = next_link
class OpenShiftClusterUpdate(_serialization.Model): # pylint: disable=too-many-instance-attributes
"""OpenShiftCluster represents an Azure Red Hat OpenShift cluster.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar tags: The resource tags.
:vartype tags: dict[str, str]
:ivar system_data: The system meta data relating to this resource.
:vartype system_data: ~azure.mgmt.redhatopenshift.v2022_04_01.models.SystemData
:ivar provisioning_state: The cluster provisioning state. Known values are: "AdminUpdating",
"Creating", "Deleting", "Failed", "Succeeded", and "Updating".
:vartype provisioning_state: str or
~azure.mgmt.redhatopenshift.v2022_04_01.models.ProvisioningState
:ivar cluster_profile: The cluster profile.
:vartype cluster_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.ClusterProfile
:ivar console_profile: The console profile.
:vartype console_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.ConsoleProfile
:ivar service_principal_profile: The cluster service principal profile.
:vartype service_principal_profile:
~azure.mgmt.redhatopenshift.v2022_04_01.models.ServicePrincipalProfile
:ivar network_profile: The cluster network profile.
:vartype network_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.NetworkProfile
:ivar master_profile: The cluster master profile.
:vartype master_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.MasterProfile
:ivar worker_profiles: The cluster worker profiles.
:vartype worker_profiles: list[~azure.mgmt.redhatopenshift.v2022_04_01.models.WorkerProfile]
:ivar apiserver_profile: The cluster API server profile.
:vartype apiserver_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.APIServerProfile
:ivar ingress_profiles: The cluster ingress profiles.
:vartype ingress_profiles: list[~azure.mgmt.redhatopenshift.v2022_04_01.models.IngressProfile]
"""
_validation = {
"system_data": {"readonly": True},
}
_attribute_map = {
"tags": {"key": "tags", "type": "{str}"},
"system_data": {"key": "systemData", "type": "SystemData"},
"provisioning_state": {"key": "properties.provisioningState", "type": "str"},
"cluster_profile": {"key": "properties.clusterProfile", "type": "ClusterProfile"},
"console_profile": {"key": "properties.consoleProfile", "type": "ConsoleProfile"},
"service_principal_profile": {"key": "properties.servicePrincipalProfile", "type": "ServicePrincipalProfile"},
"network_profile": {"key": "properties.networkProfile", "type": "NetworkProfile"},
"master_profile": {"key": "properties.masterProfile", "type": "MasterProfile"},
"worker_profiles": {"key": "properties.workerProfiles", "type": "[WorkerProfile]"},
"apiserver_profile": {"key": "properties.apiserverProfile", "type": "APIServerProfile"},
"ingress_profiles": {"key": "properties.ingressProfiles", "type": "[IngressProfile]"},
}
def __init__(
self,
*,
tags: Optional[Dict[str, str]] = None,
provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None,
cluster_profile: Optional["_models.ClusterProfile"] = None,
console_profile: Optional["_models.ConsoleProfile"] = None,
service_principal_profile: Optional["_models.ServicePrincipalProfile"] = None,
network_profile: Optional["_models.NetworkProfile"] = None,
master_profile: Optional["_models.MasterProfile"] = None,
worker_profiles: Optional[List["_models.WorkerProfile"]] = None,
apiserver_profile: Optional["_models.APIServerProfile"] = None,
ingress_profiles: Optional[List["_models.IngressProfile"]] = None,
**kwargs: Any
) -> None:
"""
:keyword tags: The resource tags.
:paramtype tags: dict[str, str]
:keyword provisioning_state: The cluster provisioning state. Known values are: "AdminUpdating",
"Creating", "Deleting", "Failed", "Succeeded", and "Updating".
:paramtype provisioning_state: str or
~azure.mgmt.redhatopenshift.v2022_04_01.models.ProvisioningState
:keyword cluster_profile: The cluster profile.
:paramtype cluster_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.ClusterProfile
:keyword console_profile: The console profile.
:paramtype console_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.ConsoleProfile
:keyword service_principal_profile: The cluster service principal profile.
:paramtype service_principal_profile:
~azure.mgmt.redhatopenshift.v2022_04_01.models.ServicePrincipalProfile
:keyword network_profile: The cluster network profile.
:paramtype network_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.NetworkProfile
:keyword master_profile: The cluster master profile.
:paramtype master_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.MasterProfile
:keyword worker_profiles: The cluster worker profiles.
:paramtype worker_profiles: list[~azure.mgmt.redhatopenshift.v2022_04_01.models.WorkerProfile]
:keyword apiserver_profile: The cluster API server profile.
:paramtype apiserver_profile: ~azure.mgmt.redhatopenshift.v2022_04_01.models.APIServerProfile
:keyword ingress_profiles: The cluster ingress profiles.
:paramtype ingress_profiles:
list[~azure.mgmt.redhatopenshift.v2022_04_01.models.IngressProfile]
"""
super().__init__(**kwargs)
self.tags = tags
self.system_data = None
self.provisioning_state = provisioning_state
self.cluster_profile = cluster_profile
self.console_profile = console_profile
self.service_principal_profile = service_principal_profile
self.network_profile = network_profile
self.master_profile = master_profile
self.worker_profiles = worker_profiles
self.apiserver_profile = apiserver_profile
self.ingress_profiles = ingress_profiles
class Operation(_serialization.Model):
"""Operation represents an RP operation.
:ivar name: Operation name: {provider}/{resource}/{operation}.
:vartype name: str
:ivar display: The object that describes the operation.
:vartype display: ~azure.mgmt.redhatopenshift.v2022_04_01.models.Display
:ivar origin: Sources of requests to this operation. Comma separated list with valid values
user or system, e.g. "user,system".
:vartype origin: str
"""
_attribute_map = {
"name": {"key": "name", "type": "str"},
"display": {"key": "display", "type": "Display"},
"origin": {"key": "origin", "type": "str"},
}
def __init__(
self,
*,
name: Optional[str] = None,
display: Optional["_models.Display"] = None,
origin: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword name: Operation name: {provider}/{resource}/{operation}.
:paramtype name: str
:keyword display: The object that describes the operation.
:paramtype display: ~azure.mgmt.redhatopenshift.v2022_04_01.models.Display
:keyword origin: Sources of requests to this operation. Comma separated list with valid values
user or system, e.g. "user,system".
:paramtype origin: str
"""
super().__init__(**kwargs)
self.name = name
self.display = display
self.origin = origin
class OperationList(_serialization.Model):
"""OperationList represents an RP operation list.
:ivar value: List of operations supported by the resource provider.
:vartype value: list[~azure.mgmt.redhatopenshift.v2022_04_01.models.Operation]
:ivar next_link: The link used to get the next page of operations.
:vartype next_link: str
"""
_attribute_map = {
"value": {"key": "value", "type": "[Operation]"},
"next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
self, *, value: Optional[List["_models.Operation"]] = None, next_link: Optional[str] = None, **kwargs: Any
) -> None:
"""
:keyword value: List of operations supported by the resource provider.
:paramtype value: list[~azure.mgmt.redhatopenshift.v2022_04_01.models.Operation]
:keyword next_link: The link used to get the next page of operations.
:paramtype next_link: str
"""
super().__init__(**kwargs)
self.value = value
self.next_link = next_link
class ServicePrincipalProfile(_serialization.Model):
"""ServicePrincipalProfile represents a service principal profile.
:ivar client_id: The client ID used for the cluster.
:vartype client_id: str
:ivar client_secret: The client secret used for the cluster.
:vartype client_secret: str
"""
_attribute_map = {
"client_id": {"key": "clientId", "type": "str"},
"client_secret": {"key": "clientSecret", "type": "str"},
}
def __init__(self, *, client_id: Optional[str] = None, client_secret: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword client_id: The client ID used for the cluster.
:paramtype client_id: str
:keyword client_secret: The client secret used for the cluster.
:paramtype client_secret: str
"""
super().__init__(**kwargs)
self.client_id = client_id
self.client_secret = client_secret
class SystemData(_serialization.Model):
"""Metadata pertaining to creation and last modification of the resource.
:ivar created_by: The identity that created the resource.
:vartype created_by: str
:ivar created_by_type: The type of identity that created the resource. Known values are:
"User", "Application", "ManagedIdentity", and "Key".
:vartype created_by_type: str or ~azure.mgmt.redhatopenshift.v2022_04_01.models.CreatedByType
:ivar created_at: The timestamp of resource creation (UTC).
:vartype created_at: ~datetime.datetime
:ivar last_modified_by: The identity that last modified the resource.
:vartype last_modified_by: str
:ivar last_modified_by_type: The type of identity that last modified the resource. Known values
are: "User", "Application", "ManagedIdentity", and "Key".
:vartype last_modified_by_type: str or
~azure.mgmt.redhatopenshift.v2022_04_01.models.CreatedByType
:ivar last_modified_at: The timestamp of resource last modification (UTC).
:vartype last_modified_at: ~datetime.datetime
"""
_attribute_map = {
"created_by": {"key": "createdBy", "type": "str"},
"created_by_type": {"key": "createdByType", "type": "str"},
"created_at": {"key": "createdAt", "type": "iso-8601"},
"last_modified_by": {"key": "lastModifiedBy", "type": "str"},
"last_modified_by_type": {"key": "lastModifiedByType", "type": "str"},
"last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"},
}
def __init__(
self,
*,
created_by: Optional[str] = None,
created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
created_at: Optional[datetime.datetime] = None,
last_modified_by: Optional[str] = None,
last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
last_modified_at: Optional[datetime.datetime] = None,
**kwargs: Any
) -> None:
"""
:keyword created_by: The identity that created the resource.
:paramtype created_by: str
:keyword created_by_type: The type of identity that created the resource. Known values are:
"User", "Application", "ManagedIdentity", and "Key".
:paramtype created_by_type: str or ~azure.mgmt.redhatopenshift.v2022_04_01.models.CreatedByType
:keyword created_at: The timestamp of resource creation (UTC).
:paramtype created_at: ~datetime.datetime
:keyword last_modified_by: The identity that last modified the resource.
:paramtype last_modified_by: str
:keyword last_modified_by_type: The type of identity that last modified the resource. Known
values are: "User", "Application", "ManagedIdentity", and "Key".
:paramtype last_modified_by_type: str or
~azure.mgmt.redhatopenshift.v2022_04_01.models.CreatedByType
:keyword last_modified_at: The timestamp of resource last modification (UTC).
:paramtype last_modified_at: ~datetime.datetime
"""
super().__init__(**kwargs)
self.created_by = created_by
self.created_by_type = created_by_type
self.created_at = created_at
self.last_modified_by = last_modified_by
self.last_modified_by_type = last_modified_by_type
self.last_modified_at = last_modified_at
class WorkerProfile(_serialization.Model):
"""WorkerProfile represents a worker profile.
:ivar name: The worker profile name.
:vartype name: str
:ivar vm_size: The size of the worker VMs.
:vartype vm_size: str
:ivar disk_size_gb: The disk size of the worker VMs.
:vartype disk_size_gb: int
:ivar subnet_id: The Azure resource ID of the worker subnet.
:vartype subnet_id: str
:ivar count: The number of worker VMs.
:vartype count: int
:ivar encryption_at_host: Whether master virtual machines are encrypted at host. Known values
are: "Disabled" and "Enabled".
:vartype encryption_at_host: str or
~azure.mgmt.redhatopenshift.v2022_04_01.models.EncryptionAtHost
:ivar disk_encryption_set_id: The resource ID of an associated DiskEncryptionSet, if
applicable.
:vartype disk_encryption_set_id: str
"""
_attribute_map = {
"name": {"key": "name", "type": "str"},
"vm_size": {"key": "vmSize", "type": "str"},
"disk_size_gb": {"key": "diskSizeGB", "type": "int"},
"subnet_id": {"key": "subnetId", "type": "str"},
"count": {"key": "count", "type": "int"},
"encryption_at_host": {"key": "encryptionAtHost", "type": "str"},
"disk_encryption_set_id": {"key": "diskEncryptionSetId", "type": "str"},
}
def __init__(
self,
*,
name: Optional[str] = None,
vm_size: Optional[str] = None,
disk_size_gb: Optional[int] = None,
subnet_id: Optional[str] = None,
count: Optional[int] = None,
encryption_at_host: Optional[Union[str, "_models.EncryptionAtHost"]] = None,
disk_encryption_set_id: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword name: The worker profile name.
:paramtype name: str
:keyword vm_size: The size of the worker VMs.
:paramtype vm_size: str
:keyword disk_size_gb: The disk size of the worker VMs.
:paramtype disk_size_gb: int
:keyword subnet_id: The Azure resource ID of the worker subnet.
:paramtype subnet_id: str
:keyword count: The number of worker VMs.
:paramtype count: int
:keyword encryption_at_host: Whether master virtual machines are encrypted at host. Known
values are: "Disabled" and "Enabled".
:paramtype encryption_at_host: str or
~azure.mgmt.redhatopenshift.v2022_04_01.models.EncryptionAtHost
:keyword disk_encryption_set_id: The resource ID of an associated DiskEncryptionSet, if
applicable.
:paramtype disk_encryption_set_id: str
"""
super().__init__(**kwargs)
self.name = name
self.vm_size = vm_size
self.disk_size_gb = disk_size_gb
self.subnet_id = subnet_id
self.count = count
self.encryption_at_host = encryption_at_host
self.disk_encryption_set_id = disk_encryption_set_id

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

@ -1,20 +0,0 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""Customize generated code here.
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.
`patch_sdk` is a last resort escape hatch that allows you to do customizations
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

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

@ -1,21 +0,0 @@
# 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 ._operations import Operations
from ._open_shift_clusters_operations import OpenShiftClustersOperations
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"Operations",
"OpenShiftClustersOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -1,154 +0,0 @@
# pylint: disable=too-many-lines,too-many-statements
# 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 sys
from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
import urllib.parse
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from ..._serialization import Serializer
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False
def build_list_request(**kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop("template_url", "/providers/Microsoft.RedHatOpenShift/operations")
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
class Operations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.redhatopenshift.v2022_04_01.AzureRedHatOpenShiftClient`'s
:attr:`operations` attribute.
"""
models = _models
def __init__(self, *args, **kwargs):
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
"""Lists all of the available RP operations.
The operation returns the RP operations.
:return: An iterator like instance of either Operation or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.v2022_04_01.models.Operation]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01"))
cls: ClsType[_models.OperationList] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("OperationList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(get_next, extract_data)

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

@ -1,20 +0,0 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""Customize generated code here.
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.
`patch_sdk` is a last resort escape hatch that allows you to do customizations
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

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

@ -1 +0,0 @@
# Marker file for PEP 561.

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше