Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoRelease] t2-containerservicefleet-2024-10-31-68497(can only be merged by SDK owner) #38221

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

AZURE_LOCATION = "eastus"


@pytest.mark.live_test_only
class TestContainerServiceContainerServicesOperationsAsync(AzureMgmtRecordedTestCase):
def setup_method(self, method):
Expand All @@ -25,4 +26,4 @@ async def test_list_by_resource_group(self, resource_group):
resource_group_name=resource_group.name,
)
result = [r async for r in response]
assert result == []
assert result == []
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

AZURE_LOCATION = "eastus"


@pytest.mark.live_test_only
class TestContainerServiceContainerServicesOperations(AzureMgmtRecordedTestCase):
def setup_method(self, method):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

AZURE_LOCATION = "eastus"


@pytest.mark.live_test_only
class TestContainerServiceOperationsAsync(AzureMgmtRecordedTestCase):
def setup_method(self, method):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

AZURE_LOCATION = "eastus"


@pytest.mark.live_test_only
class TestContainerServiceOperations(AzureMgmtRecordedTestCase):
def setup_method(self, method):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,19 @@
import azure.mgmt.containerservice
from devtools_testutils import AzureMgmtRecordedTestCase, ResourceGroupPreparer, recorded_by_proxy

AZURE_LOCATION = 'eastus'
AZURE_LOCATION = "eastus"


class TestMgmtContainerServiceClient(AzureMgmtRecordedTestCase):

def setup_method(self, method):
self.mgmt_client = self.create_mgmt_client(
azure.mgmt.containerservice.ContainerServiceClient
)
self.mgmt_client = self.create_mgmt_client(azure.mgmt.containerservice.ContainerServiceClient)

@pytest.mark.skip('hard to test')
@pytest.mark.skip("hard to test")
@ResourceGroupPreparer()
def test_managed_clusters(self, resource_group):
CLIENT_ID = getattr(self.settings, 'CLIENT_ID', "123")
CLIENT_SECRET = getattr(self.settings, 'CLIENT_SECRET', "123")
CLIENT_ID = getattr(self.settings, "CLIENT_ID", "123")
CLIENT_SECRET = getattr(self.settings, "CLIENT_SECRET", "123")
RESOURCE_GROUP = resource_group.name
RESOURCE_NAME = "7"

Expand All @@ -68,31 +66,31 @@ def test_managed_clusters(self, resource_group):
"mode": "System",
}
],
"service_principal_profile": {
"client_id": CLIENT_ID,
"secret": CLIENT_SECRET
},
"location": AZURE_LOCATION
"service_principal_profile": {"client_id": CLIENT_ID, "secret": CLIENT_SECRET},
"location": AZURE_LOCATION,
}
for i in range(10):
try:
result = self.mgmt_client.managed_clusters.begin_create_or_update(resource_group_name=RESOURCE_GROUP,
resource_name=RESOURCE_NAME,
parameters=BODY)
result = self.mgmt_client.managed_clusters.begin_create_or_update(
resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME, parameters=BODY
)
result.result()
except azure.core.exceptions.ResourceExistsError:
time.sleep(30)
else:
break
# 2
self.mgmt_client.managed_clusters.list_cluster_admin_credentials(resource_group_name=RESOURCE_GROUP,
resource_name=RESOURCE_NAME)
self.mgmt_client.managed_clusters.list_cluster_admin_credentials(
resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME
)
# 3
self.mgmt_client.managed_clusters.list_cluster_user_credentials(resource_group_name=RESOURCE_GROUP,
resource_name=RESOURCE_NAME)
self.mgmt_client.managed_clusters.list_cluster_user_credentials(
resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME
)
# 4
self.mgmt_client.managed_clusters.get_upgrade_profile(resource_group_name=RESOURCE_GROUP,
resource_name=RESOURCE_NAME)
self.mgmt_client.managed_clusters.get_upgrade_profile(
resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME
)
# # 5
# result = self.mgmt_client.managed_clusters.begin_stop(resource_group_name=RESOURCE_GROUP,
# resource_name=RESOURCE_NAME)
Expand All @@ -112,36 +110,34 @@ def test_managed_clusters(self, resource_group):
# resource_name=RESOURCE_NAME)
result.result()
# 11
BODY = {
"tags": {
"tier": "testing",
"archv3": ""
}
}
result = self.mgmt_client.managed_clusters.begin_update_tags(resource_group_name=RESOURCE_GROUP,
resource_name=RESOURCE_NAME, parameters=BODY)
BODY = {"tags": {"tier": "testing", "archv3": ""}}
result = self.mgmt_client.managed_clusters.begin_update_tags(
resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME, parameters=BODY
)
result.result()
# 12
self.mgmt_client.managed_clusters.list_cluster_monitoring_user_credentials(resource_group_name=RESOURCE_GROUP,
resource_name=RESOURCE_NAME)
self.mgmt_client.managed_clusters.list_cluster_monitoring_user_credentials(
resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME
)
# 13
result = self.mgmt_client.managed_clusters.begin_delete(resource_group_name=RESOURCE_GROUP,
resource_name=RESOURCE_NAME)
result = self.mgmt_client.managed_clusters.begin_delete(
resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME
)
result.result()

@pytest.mark.skip('duplicated testcase')
@pytest.mark.skip("duplicated testcase")
@ResourceGroupPreparer()
@recorded_by_proxy
def test_operations(self):
result = list(self.mgmt_client.operations.list())
for item in result:
print(item.as_dict())

@pytest.mark.skip('hard to test')
@pytest.mark.skip("hard to test")
@ResourceGroupPreparer()
def test_privateLinkResources(self, resource_group):
CLIENT_ID = getattr(self.settings, 'CLIENT_ID', "123")
CLIENT_SECRET = getattr(self.settings, 'CLIENT_SECRET', "123")
CLIENT_ID = getattr(self.settings, "CLIENT_ID", "123")
CLIENT_SECRET = getattr(self.settings, "CLIENT_SECRET", "123")
RESOURCE_GROUP = resource_group.name
RESOURCE_NAME = "2"

Expand All @@ -162,20 +158,15 @@ def test_privateLinkResources(self, resource_group):
"mode": "System",
}
],
"api_server_access_profile": {
"enable_private_cluster": True # private cluster
},
"service_principal_profile": {
"client_id": CLIENT_ID,
"secret": CLIENT_SECRET
},
"location": AZURE_LOCATION
"api_server_access_profile": {"enable_private_cluster": True}, # private cluster
"service_principal_profile": {"client_id": CLIENT_ID, "secret": CLIENT_SECRET},
"location": AZURE_LOCATION,
}
for i in range(10):
try:
result = self.mgmt_client.managed_clusters.begin_create_or_update(resource_group_name=RESOURCE_GROUP,
resource_name=RESOURCE_NAME,
parameters=BODY)
result = self.mgmt_client.managed_clusters.begin_create_or_update(
resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME, parameters=BODY
)
result.result()
except azure.core.exceptions.ResourceExistsError:
time.sleep(30)
Expand All @@ -185,11 +176,11 @@ def test_privateLinkResources(self, resource_group):
# 1
self.mgmt_client.private_link_resources.list(resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME)

@pytest.mark.skip('hard to test')
@pytest.mark.skip("hard to test")
@ResourceGroupPreparer()
def test_resolvePrivateLinkServiceId(self, resource_group):
CLIENT_ID = getattr(self.settings, 'CLIENT_ID', "123")
CLIENT_SECRET = getattr(self.settings, 'CLIENT_SECRET', "123")
CLIENT_ID = getattr(self.settings, "CLIENT_ID", "123")
CLIENT_SECRET = getattr(self.settings, "CLIENT_SECRET", "123")
RESOURCE_GROUP = resource_group.name
RESOURCE_NAME = "3"

Expand All @@ -210,38 +201,32 @@ def test_resolvePrivateLinkServiceId(self, resource_group):
"mode": "System",
}
],
"api_server_access_profile": {
"enable_private_cluster": True # private cluster
},
"service_principal_profile": {
"client_id": CLIENT_ID,
"secret": CLIENT_SECRET
},
"location": AZURE_LOCATION
"api_server_access_profile": {"enable_private_cluster": True}, # private cluster
"service_principal_profile": {"client_id": CLIENT_ID, "secret": CLIENT_SECRET},
"location": AZURE_LOCATION,
}
for i in range(10):
try:
result = self.mgmt_client.managed_clusters.begin_create_or_update(resource_group_name=RESOURCE_GROUP,
resource_name=RESOURCE_NAME,
parameters=BODY)
result = self.mgmt_client.managed_clusters.begin_create_or_update(
resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME, parameters=BODY
)
result.result()
except azure.core.exceptions.ResourceExistsError:
time.sleep(30)
else:
break

# 1
BODY = {
"name": "testManagement"
}
self.mgmt_client.resolve_private_link_service_id.post(resource_group_name=RESOURCE_GROUP,
resource_name=RESOURCE_NAME, parameters=BODY)
BODY = {"name": "testManagement"}
self.mgmt_client.resolve_private_link_service_id.post(
resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME, parameters=BODY
)

@pytest.mark.skip('hard to test')
@pytest.mark.skip("hard to test")
@ResourceGroupPreparer()
def test_agentPools(self, resource_group):
CLIENT_ID = getattr(self.settings, 'CLIENT_ID', "123")
CLIENT_SECRET = getattr(self.settings, 'CLIENT_SECRET', "123")
CLIENT_ID = getattr(self.settings, "CLIENT_ID", "123")
CLIENT_SECRET = getattr(self.settings, "CLIENT_SECRET", "123")
RESOURCE_GROUP = resource_group.name
RESOURCE_NAME = "4"
AGENT_POOL_NAME = "aksagent"
Expand All @@ -265,14 +250,12 @@ def test_agentPools(self, resource_group):
"mode": "System",
}
],
"service_principal_profile": {
"client_id": CLIENT_ID,
"secret": CLIENT_SECRET
},
"location": AZURE_LOCATION
"service_principal_profile": {"client_id": CLIENT_ID, "secret": CLIENT_SECRET},
"location": AZURE_LOCATION,
}
result = self.mgmt_client.managed_clusters.begin_create_or_update(resource_group_name=RESOURCE_GROUP,
resource_name=RESOURCE_NAME, parameters=BODY)
result = self.mgmt_client.managed_clusters.begin_create_or_update(
resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME, parameters=BODY
)
result.result()

# 1
Expand All @@ -283,33 +266,33 @@ def test_agentPools(self, resource_group):
"os_type": "Linux",
"type": "VirtualMachineScaleSets",
"mode": MODE,
"availability_zones": [
"1",
"2",
"3"
],
"availability_zones": ["1", "2", "3"],
# "scale_set_priority": "Regular",
# "scale_set_eviction_policy": "Delete",
"node_taints": []
"node_taints": [],
}
for i in range(10):
try:
result = self.mgmt_client.agent_pools.begin_create_or_update(resource_group_name=RESOURCE_GROUP,
resource_name=RESOURCE_NAME,
agent_pool_name=AGENT_POOL_NAME,
parameters=BODY)
result = self.mgmt_client.agent_pools.begin_create_or_update(
resource_group_name=RESOURCE_GROUP,
resource_name=RESOURCE_NAME,
agent_pool_name=AGENT_POOL_NAME,
parameters=BODY,
)
result = result.result()
except azure.core.exceptions.ResourceExistsError:
time.sleep(30)
else:
break

# 2
self.mgmt_client.agent_pools.get(resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME,
agent_pool_name=AGENT_POOL_NAME)
self.mgmt_client.agent_pools.get(
resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME, agent_pool_name=AGENT_POOL_NAME
)
# 3
self.mgmt_client.agent_pools.get_available_agent_pool_versions(resource_group_name=RESOURCE_GROUP,
resource_name=RESOURCE_NAME)
self.mgmt_client.agent_pools.get_available_agent_pool_versions(
resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME
)
# 4
self.mgmt_client.agent_pools.list(resource_group_name=RESOURCE_GROUP, resource_name=RESOURCE_NAME)

Expand Down Expand Up @@ -567,5 +550,5 @@ def test_agentPools(self, resource_group):
# # result = result.result()


if __name__ == '__main__':
if __name__ == "__main__":
unittest.main()
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 3.0.0 (2024-10-31)

### 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.

## 2.1.0 (2024-10-21)

### Features Added
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
{
"commit": "399cbac2de1bc0acbed4c9a0a864a9c84da3692e",
"commit": "a4fc4c6bda9ff2315671bca69f9de40a43e2bd8c",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.10.2",
"use": [
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/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/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"autorest_command": "autorest specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/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-2024-04 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"readme": "specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/readme.md",
"package-2023-06-preview": "2024-07-17 13:51:57 -0700 c02b366afa77a3e2a746719cea713b231b4b41bb preview/2023-06-15-preview/fleets.json",
"package-2023-03-preview": "2024-07-17 13:51:57 -0700 c02b366afa77a3e2a746719cea713b231b4b41bb preview/2023-03-15-preview/fleets.json",
"package-2022-09-preview": "2024-06-14 00:56:33 -0700 db63bea839f5648462c94e685d5cc96f8e8b38ba preview/2022-09-02-preview/fleets.json",
"package-2022-07-preview": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-07-02-preview/fleets.json",
"package-2022-06-preview": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-06-02-preview/fleets.json",
"package-2023-08-preview": "2024-07-17 13:51:57 -0700 c02b366afa77a3e2a746719cea713b231b4b41bb preview/2023-08-15-preview/fleets.json",
"package-2023-10": "2024-07-17 13:51:57 -0700 c02b366afa77a3e2a746719cea713b231b4b41bb stable/2023-10-15/fleets.json",
"package-2024-02-preview": "2024-07-17 13:51:57 -0700 c02b366afa77a3e2a746719cea713b231b4b41bb preview/2024-02-02-preview/fleets.json",
"package-2024-04": "2024-07-17 13:51:57 -0700 c02b366afa77a3e2a746719cea713b231b4b41bb stable/2024-04-01/fleets.json",
"package-2024-05-preview": "2024-09-20 16:08:37 -0700 3aa1c23a75a3af0cc5845f52cb68a98f6889a970 preview/2024-05-02-preview/fleets.json"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@
# --------------------------------------------------------------------------

from ._container_service_fleet_mgmt_client import ContainerServiceFleetMgmtClient
__all__ = ['ContainerServiceFleetMgmtClient']
from ._version import VERSION

__version__ = VERSION

try:
from ._patch import patch_sdk # type: ignore
patch_sdk()
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
pass
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

from ._version import VERSION
__all__ = [
"ContainerServiceFleetMgmtClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])

__version__ = VERSION
_patch_sdk()
Loading
Loading