Skip to content

Commit

Permalink
[az fleet] Bumping fleet SDK to latest preview version (#7389)
Browse files Browse the repository at this point in the history
* Update vendored SDK versions and remove unused files

* updated version notes

* updated test recordings

---------

Co-authored-by: Sean Hobbs <sehobbs@microsoft.com>
  • Loading branch information
Ealianis and Sean Hobbs authored Mar 18, 2024
1 parent c051d9b commit f3f8aeb
Show file tree
Hide file tree
Showing 40 changed files with 7,829 additions and 5,691 deletions.
6 changes: 5 additions & 1 deletion src/fleet/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,8 @@ Release History

1.0.4
++++++
* Added new --upgrade-type parameter "ControlPlaneOnly" for command `az fleet updaterun create --upgrade-type`.
* Added new --upgrade-type parameter "ControlPlaneOnly" for command `az fleet updaterun create --upgrade-type`.

1.0.5
++++++
* Upgrade SDK version to 2024-02-02-preview
2 changes: 1 addition & 1 deletion src/fleet/azext_fleet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def register_fleet_resource_type():
register_resource_type(
"latest",
CUSTOM_MGMT_FLEET,
SDKProfile("2023-08-15-preview"),
SDKProfile("2024-02-02-preview"),
)


Expand Down
8,690 changes: 5,523 additions & 3,167 deletions src/fleet/azext_fleet/tests/latest/recordings/test_fleet_hubful.yaml

Large diffs are not rendered by default.

1,463 changes: 614 additions & 849 deletions src/fleet/azext_fleet/tests/latest/recordings/test_fleet_hubless.yaml

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/fleet/azext_fleet/vendored_sdks/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# --------------------------------------------------------------------------
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

Expand All @@ -20,7 +19,7 @@
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential

class ContainerServiceFleetMgmtClientConfiguration(Configuration):
class ContainerServiceFleetMgmtClientConfiguration:
"""Configuration for ContainerServiceFleetMgmtClient.
Note that all parameters used to create this instance are saved as instance
Expand All @@ -42,12 +41,12 @@ def __init__(
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(ContainerServiceFleetMgmtClientConfiguration, self).__init__(**kwargs)

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-containerservicefleet/{}'.format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)

def _configure(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline import policies
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

Expand Down Expand Up @@ -53,7 +55,7 @@ class ContainerServiceFleetMgmtClient(MultiApiClientMixin, _SDKClient):
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

DEFAULT_API_VERSION = '2023-08-15-preview'
DEFAULT_API_VERSION = '2023-10-15'
_PROFILE_TAG = "azure.mgmt.containerservicefleet.ContainerServiceFleetMgmtClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand All @@ -74,7 +76,25 @@ def __init__(
if api_version:
kwargs.setdefault('api_version', api_version)
self._config = ContainerServiceFleetMgmtClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **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(base_url=base_url, policies=_policies, **kwargs)
super(ContainerServiceFleetMgmtClient, self).__init__(
api_version=api_version,
profile=profile
Expand All @@ -94,6 +114,8 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2023-03-15-preview: :mod:`v2023_03_15_preview.models<azure.mgmt.containerservicefleet.v2023_03_15_preview.models>`
* 2023-06-15-preview: :mod:`v2023_06_15_preview.models<azure.mgmt.containerservicefleet.v2023_06_15_preview.models>`
* 2023-08-15-preview: :mod:`v2023_08_15_preview.models<azure.mgmt.containerservicefleet.v2023_08_15_preview.models>`
* 2023-10-15: :mod:`v2023_10_15.models<azure.mgmt.containerservicefleet.v2023_10_15.models>`
* 2024-02-02-preview: :mod:`v2024_02_02_preview.models<azure.mgmt.containerservicefleet.v2024_02_02_preview.models>`
"""
if api_version == '2022-09-02-preview':
from .v2022_06_02_preview import models
Expand All @@ -113,6 +135,12 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2023-08-15-preview':
from .v2023_08_15_preview import models
return models
elif api_version == '2023-10-15':
from .v2023_10_15 import models
return models
elif api_version == '2024-02-02-preview':
from .v2024_02_02_preview import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
Expand All @@ -125,6 +153,8 @@ def fleet_members(self):
* 2023-03-15-preview: :class:`FleetMembersOperations<azure.mgmt.containerservicefleet.v2023_03_15_preview.operations.FleetMembersOperations>`
* 2023-06-15-preview: :class:`FleetMembersOperations<azure.mgmt.containerservicefleet.v2023_06_15_preview.operations.FleetMembersOperations>`
* 2023-08-15-preview: :class:`FleetMembersOperations<azure.mgmt.containerservicefleet.v2023_08_15_preview.operations.FleetMembersOperations>`
* 2023-10-15: :class:`FleetMembersOperations<azure.mgmt.containerservicefleet.v2023_10_15.operations.FleetMembersOperations>`
* 2024-02-02-preview: :class:`FleetMembersOperations<azure.mgmt.containerservicefleet.v2024_02_02_preview.operations.FleetMembersOperations>`
"""
api_version = self._get_api_version('fleet_members')
if api_version == '2022-09-02-preview':
Expand All @@ -139,6 +169,10 @@ def fleet_members(self):
from .v2023_06_15_preview.operations import FleetMembersOperations as OperationClass
elif api_version == '2023-08-15-preview':
from .v2023_08_15_preview.operations import FleetMembersOperations as OperationClass
elif api_version == '2023-10-15':
from .v2023_10_15.operations import FleetMembersOperations as OperationClass
elif api_version == '2024-02-02-preview':
from .v2024_02_02_preview.operations import FleetMembersOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'fleet_members'".format(api_version))
self._config.api_version = api_version
Expand All @@ -149,10 +183,16 @@ def fleet_update_strategies(self):
"""Instance depends on the API version:
* 2023-08-15-preview: :class:`FleetUpdateStrategiesOperations<azure.mgmt.containerservicefleet.v2023_08_15_preview.operations.FleetUpdateStrategiesOperations>`
* 2023-10-15: :class:`FleetUpdateStrategiesOperations<azure.mgmt.containerservicefleet.v2023_10_15.operations.FleetUpdateStrategiesOperations>`
* 2024-02-02-preview: :class:`FleetUpdateStrategiesOperations<azure.mgmt.containerservicefleet.v2024_02_02_preview.operations.FleetUpdateStrategiesOperations>`
"""
api_version = self._get_api_version('fleet_update_strategies')
if api_version == '2023-08-15-preview':
from .v2023_08_15_preview.operations import FleetUpdateStrategiesOperations as OperationClass
elif api_version == '2023-10-15':
from .v2023_10_15.operations import FleetUpdateStrategiesOperations as OperationClass
elif api_version == '2024-02-02-preview':
from .v2024_02_02_preview.operations import FleetUpdateStrategiesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'fleet_update_strategies'".format(api_version))
self._config.api_version = api_version
Expand All @@ -168,6 +208,8 @@ def fleets(self):
* 2023-03-15-preview: :class:`FleetsOperations<azure.mgmt.containerservicefleet.v2023_03_15_preview.operations.FleetsOperations>`
* 2023-06-15-preview: :class:`FleetsOperations<azure.mgmt.containerservicefleet.v2023_06_15_preview.operations.FleetsOperations>`
* 2023-08-15-preview: :class:`FleetsOperations<azure.mgmt.containerservicefleet.v2023_08_15_preview.operations.FleetsOperations>`
* 2023-10-15: :class:`FleetsOperations<azure.mgmt.containerservicefleet.v2023_10_15.operations.FleetsOperations>`
* 2024-02-02-preview: :class:`FleetsOperations<azure.mgmt.containerservicefleet.v2024_02_02_preview.operations.FleetsOperations>`
"""
api_version = self._get_api_version('fleets')
if api_version == '2022-09-02-preview':
Expand All @@ -182,6 +224,10 @@ def fleets(self):
from .v2023_06_15_preview.operations import FleetsOperations as OperationClass
elif api_version == '2023-08-15-preview':
from .v2023_08_15_preview.operations import FleetsOperations as OperationClass
elif api_version == '2023-10-15':
from .v2023_10_15.operations import FleetsOperations as OperationClass
elif api_version == '2024-02-02-preview':
from .v2024_02_02_preview.operations import FleetsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'fleets'".format(api_version))
self._config.api_version = api_version
Expand All @@ -195,6 +241,8 @@ def operations(self):
* 2023-03-15-preview: :class:`Operations<azure.mgmt.containerservicefleet.v2023_03_15_preview.operations.Operations>`
* 2023-06-15-preview: :class:`Operations<azure.mgmt.containerservicefleet.v2023_06_15_preview.operations.Operations>`
* 2023-08-15-preview: :class:`Operations<azure.mgmt.containerservicefleet.v2023_08_15_preview.operations.Operations>`
* 2023-10-15: :class:`Operations<azure.mgmt.containerservicefleet.v2023_10_15.operations.Operations>`
* 2024-02-02-preview: :class:`Operations<azure.mgmt.containerservicefleet.v2024_02_02_preview.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2022-09-02-preview':
Expand All @@ -205,6 +253,10 @@ def operations(self):
from .v2023_06_15_preview.operations import Operations as OperationClass
elif api_version == '2023-08-15-preview':
from .v2023_08_15_preview.operations import Operations as OperationClass
elif api_version == '2023-10-15':
from .v2023_10_15.operations import Operations as OperationClass
elif api_version == '2024-02-02-preview':
from .v2024_02_02_preview.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
Expand All @@ -217,6 +269,8 @@ def update_runs(self):
* 2023-03-15-preview: :class:`UpdateRunsOperations<azure.mgmt.containerservicefleet.v2023_03_15_preview.operations.UpdateRunsOperations>`
* 2023-06-15-preview: :class:`UpdateRunsOperations<azure.mgmt.containerservicefleet.v2023_06_15_preview.operations.UpdateRunsOperations>`
* 2023-08-15-preview: :class:`UpdateRunsOperations<azure.mgmt.containerservicefleet.v2023_08_15_preview.operations.UpdateRunsOperations>`
* 2023-10-15: :class:`UpdateRunsOperations<azure.mgmt.containerservicefleet.v2023_10_15.operations.UpdateRunsOperations>`
* 2024-02-02-preview: :class:`UpdateRunsOperations<azure.mgmt.containerservicefleet.v2024_02_02_preview.operations.UpdateRunsOperations>`
"""
api_version = self._get_api_version('update_runs')
if api_version == '2023-03-15-preview':
Expand All @@ -225,6 +279,10 @@ def update_runs(self):
from .v2023_06_15_preview.operations import UpdateRunsOperations as OperationClass
elif api_version == '2023-08-15-preview':
from .v2023_08_15_preview.operations import UpdateRunsOperations as OperationClass
elif api_version == '2023-10-15':
from .v2023_10_15.operations import UpdateRunsOperations as OperationClass
elif api_version == '2024-02-02-preview':
from .v2024_02_02_preview.operations import UpdateRunsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'update_runs'".format(api_version))
self._config.api_version = api_version
Expand Down
Loading

0 comments on commit f3f8aeb

Please sign in to comment.