Skip to content

Commit 4652858

Browse files
azclibotSDKAutoBigCat20196msyyc
authored
[AutoRelease] t2-labservices-2022-01-10-05622 (Azure#22401)
* CodeGen from PR 17292 in Azure/azure-rest-api-specs config labservice readme python (Azure#17292) * version,CHANGELOG * Update CHANGELOG.md Co-authored-by: SDKAuto <[email protected]> Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: Jiefeng Chen <[email protected]> Co-authored-by: Yuchao Yan <[email protected]>
1 parent 57b7aac commit 4652858

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+12352
-13942
lines changed

sdk/labservices/azure-mgmt-labservices/CHANGELOG.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,97 @@
11
# Release History
22

3+
## 2.0.0b1 (2022-01-18)
4+
5+
**Features**
6+
7+
- Added operation LabsOperations.begin_create_or_update
8+
- Added operation LabsOperations.begin_publish
9+
- Added operation LabsOperations.begin_sync_group
10+
- Added operation LabsOperations.begin_update
11+
- Added operation LabsOperations.list_by_resource_group
12+
- Added operation LabsOperations.list_by_subscription
13+
- Added operation Operations.list
14+
- Added operation UsersOperations.begin_create_or_update
15+
- Added operation UsersOperations.begin_invite
16+
- Added operation UsersOperations.begin_update
17+
- Added operation UsersOperations.list_by_lab
18+
- Added operation group ImagesOperations
19+
- Added operation group LabPlansOperations
20+
- Added operation group OperationResultsOperations
21+
- Added operation group SchedulesOperations
22+
- Added operation group SkusOperations
23+
- Added operation group UsagesOperations
24+
- Added operation group VirtualMachinesOperations
25+
- Model Lab has a new parameter auto_shutdown_profile
26+
- Model Lab has a new parameter connection_profile
27+
- Model Lab has a new parameter description
28+
- Model Lab has a new parameter lab_plan_id
29+
- Model Lab has a new parameter network_profile
30+
- Model Lab has a new parameter roster_profile
31+
- Model Lab has a new parameter security_profile
32+
- Model Lab has a new parameter state
33+
- Model Lab has a new parameter system_data
34+
- Model Lab has a new parameter title
35+
- Model Lab has a new parameter virtual_machine_profile
36+
- Model OperationResult has a new parameter end_time
37+
- Model OperationResult has a new parameter id
38+
- Model OperationResult has a new parameter name
39+
- Model OperationResult has a new parameter percent_complete
40+
- Model OperationResult has a new parameter start_time
41+
- Model User has a new parameter additional_usage_quota
42+
- Model User has a new parameter display_name
43+
- Model User has a new parameter invitation_sent
44+
- Model User has a new parameter invitation_state
45+
- Model User has a new parameter registration_state
46+
- Model User has a new parameter system_data
47+
48+
**Breaking changes**
49+
50+
- Model Lab no longer has parameter created_by_object_id
51+
- Model Lab no longer has parameter created_by_user_principal_name
52+
- Model Lab no longer has parameter created_date
53+
- Model Lab no longer has parameter invitation_code
54+
- Model Lab no longer has parameter latest_operation_result
55+
- Model Lab no longer has parameter max_users_in_lab
56+
- Model Lab no longer has parameter unique_identifier
57+
- Model Lab no longer has parameter usage_quota
58+
- Model Lab no longer has parameter user_access_mode
59+
- Model Lab no longer has parameter user_quota
60+
- Model Resource no longer has parameter location
61+
- Model Resource no longer has parameter tags
62+
- Model User no longer has parameter family_name
63+
- Model User no longer has parameter given_name
64+
- Model User no longer has parameter latest_operation_result
65+
- Model User no longer has parameter location
66+
- Model User no longer has parameter tags
67+
- Model User no longer has parameter tenant_id
68+
- Model User no longer has parameter unique_identifier
69+
- Operation LabsOperations.begin_delete has a new signature
70+
- Operation LabsOperations.get has a new signature
71+
- Operation LabsOperations.get has a new signature
72+
- Operation UsersOperations.begin_delete has a new signature
73+
- Operation UsersOperations.get has a new signature
74+
- Operation UsersOperations.get has a new signature
75+
- Parameter email of model User is now required
76+
- Parameter email of model User is now required
77+
- Parameter location of model Lab is now required
78+
- Parameter status of model OperationResult is now required
79+
- Removed operation LabsOperations.add_users
80+
- Removed operation LabsOperations.create_or_update
81+
- Removed operation LabsOperations.list
82+
- Removed operation LabsOperations.register
83+
- Removed operation LabsOperations.update
84+
- Removed operation Operations.get
85+
- Removed operation UsersOperations.create_or_update
86+
- Removed operation UsersOperations.list
87+
- Removed operation UsersOperations.update
88+
- Removed operation group EnvironmentSettingsOperations
89+
- Removed operation group EnvironmentsOperations
90+
- Removed operation group GalleryImagesOperations
91+
- Removed operation group GlobalUsersOperations
92+
- Removed operation group LabAccountsOperations
93+
- Removed operation group ProviderOperationsOperations
94+
395
## 1.0.0 (2021-03-31)
496

597
- GA release
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
2-
"autorest": "3.0.6369",
3-
"use": "@autorest/[email protected]",
4-
"commit": "90167a86aca9eed5d51c299b262212738e233e2a",
2+
"autorest": "3.7.2",
3+
"use": [
4+
"@autorest/[email protected]",
5+
"@autorest/[email protected]"
6+
],
7+
"commit": "2fd8d844ff4be936d818b7ec7c1b4bd668bbeddb",
58
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
6-
"autorest_command": "autorest specification/labservices/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.2 --version=3.0.6369",
9+
"autorest_command": "autorest specification/labservices/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/[email protected] --version=3.7.2",
710
"readme": "specification/labservices/resource-manager/readme.md"
811
}

sdk/labservices/azure-mgmt-labservices/azure/mgmt/labservices/__init__.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from ._managed_labs_client import ManagedLabsClient
9+
from ._lab_services_client import LabServicesClient
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13-
__all__ = ['ManagedLabsClient']
13+
__all__ = ['LabServicesClient']
1414

15-
try:
16-
from ._patch import patch_sdk # type: ignore
17-
patch_sdk()
18-
except ImportError:
19-
pass
15+
# `._patch.py` is used for handwritten extensions to the generated code
16+
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17+
from ._patch import patch_sdk
18+
patch_sdk()

sdk/labservices/azure-mgmt-labservices/azure/mgmt/labservices/_configuration.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,46 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import TYPE_CHECKING
9+
from typing import Any, TYPE_CHECKING
1010

1111
from azure.core.configuration import Configuration
1212
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
13+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1414

1515
from ._version import VERSION
1616

1717
if TYPE_CHECKING:
1818
# pylint: disable=unused-import,ungrouped-imports
19-
from typing import Any
20-
2119
from azure.core.credentials import TokenCredential
2220

2321

24-
class ManagedLabsClientConfiguration(Configuration):
25-
"""Configuration for ManagedLabsClient.
22+
class LabServicesClientConfiguration(Configuration):
23+
"""Configuration for LabServicesClient.
2624
2725
Note that all parameters used to create this instance are saved as instance
2826
attributes.
2927
3028
:param credential: Credential needed for the client to connect to Azure.
3129
:type credential: ~azure.core.credentials.TokenCredential
32-
:param subscription_id: The subscription ID.
30+
:param subscription_id: The ID of the target subscription.
3331
:type subscription_id: str
3432
"""
3533

3634
def __init__(
3735
self,
38-
credential, # type: "TokenCredential"
39-
subscription_id, # type: str
40-
**kwargs # type: Any
41-
):
42-
# type: (...) -> None
36+
credential: "TokenCredential",
37+
subscription_id: str,
38+
**kwargs: Any
39+
) -> None:
40+
super(LabServicesClientConfiguration, self).__init__(**kwargs)
4341
if credential is None:
4442
raise ValueError("Parameter 'credential' must not be None.")
4543
if subscription_id is None:
4644
raise ValueError("Parameter 'subscription_id' must not be None.")
47-
super(ManagedLabsClientConfiguration, self).__init__(**kwargs)
4845

4946
self.credential = credential
5047
self.subscription_id = subscription_id
51-
self.api_version = "2018-10-15"
48+
self.api_version = "2021-11-15-preview"
5249
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5350
kwargs.setdefault('sdk_moniker', 'mgmt-labservices/{}'.format(VERSION))
5451
self._configure(**kwargs)
@@ -68,4 +65,4 @@ def _configure(
6865
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6966
self.authentication_policy = kwargs.get('authentication_policy')
7067
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
68+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from copy import deepcopy
10+
from typing import Any, Optional, TYPE_CHECKING
11+
12+
from azure.core.rest import HttpRequest, HttpResponse
13+
from azure.mgmt.core import ARMPipelineClient
14+
from msrest import Deserializer, Serializer
15+
16+
from . import models
17+
from ._configuration import LabServicesClientConfiguration
18+
from .operations import ImagesOperations, LabPlansOperations, LabsOperations, OperationResultsOperations, Operations, SchedulesOperations, SkusOperations, UsagesOperations, UsersOperations, VirtualMachinesOperations
19+
20+
if TYPE_CHECKING:
21+
# pylint: disable=unused-import,ungrouped-imports
22+
from azure.core.credentials import TokenCredential
23+
24+
class LabServicesClient:
25+
"""REST API for managing Azure Lab Services images.
26+
27+
:ivar images: ImagesOperations operations
28+
:vartype images: azure.mgmt.labservices.operations.ImagesOperations
29+
:ivar lab_plans: LabPlansOperations operations
30+
:vartype lab_plans: azure.mgmt.labservices.operations.LabPlansOperations
31+
:ivar operations: Operations operations
32+
:vartype operations: azure.mgmt.labservices.operations.Operations
33+
:ivar labs: LabsOperations operations
34+
:vartype labs: azure.mgmt.labservices.operations.LabsOperations
35+
:ivar operation_results: OperationResultsOperations operations
36+
:vartype operation_results: azure.mgmt.labservices.operations.OperationResultsOperations
37+
:ivar schedules: SchedulesOperations operations
38+
:vartype schedules: azure.mgmt.labservices.operations.SchedulesOperations
39+
:ivar users: UsersOperations operations
40+
:vartype users: azure.mgmt.labservices.operations.UsersOperations
41+
:ivar virtual_machines: VirtualMachinesOperations operations
42+
:vartype virtual_machines: azure.mgmt.labservices.operations.VirtualMachinesOperations
43+
:ivar usages: UsagesOperations operations
44+
:vartype usages: azure.mgmt.labservices.operations.UsagesOperations
45+
:ivar skus: SkusOperations operations
46+
:vartype skus: azure.mgmt.labservices.operations.SkusOperations
47+
:param credential: Credential needed for the client to connect to Azure.
48+
:type credential: ~azure.core.credentials.TokenCredential
49+
:param subscription_id: The ID of the target subscription.
50+
:type subscription_id: str
51+
:param base_url: Service URL. Default value is 'https://management.azure.com'.
52+
:type base_url: str
53+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
54+
Retry-After header is present.
55+
"""
56+
57+
def __init__(
58+
self,
59+
credential: "TokenCredential",
60+
subscription_id: str,
61+
base_url: str = "https://management.azure.com",
62+
**kwargs: Any
63+
) -> None:
64+
self._config = LabServicesClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
65+
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
66+
67+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
68+
self._serialize = Serializer(client_models)
69+
self._deserialize = Deserializer(client_models)
70+
self._serialize.client_side_validation = False
71+
self.images = ImagesOperations(self._client, self._config, self._serialize, self._deserialize)
72+
self.lab_plans = LabPlansOperations(self._client, self._config, self._serialize, self._deserialize)
73+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
74+
self.labs = LabsOperations(self._client, self._config, self._serialize, self._deserialize)
75+
self.operation_results = OperationResultsOperations(self._client, self._config, self._serialize, self._deserialize)
76+
self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize)
77+
self.users = UsersOperations(self._client, self._config, self._serialize, self._deserialize)
78+
self.virtual_machines = VirtualMachinesOperations(self._client, self._config, self._serialize, self._deserialize)
79+
self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize)
80+
self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize)
81+
82+
83+
def _send_request(
84+
self,
85+
request, # type: HttpRequest
86+
**kwargs: Any
87+
) -> HttpResponse:
88+
"""Runs the network request through the client's chained policies.
89+
90+
>>> from azure.core.rest import HttpRequest
91+
>>> request = HttpRequest("GET", "https://www.example.org/")
92+
<HttpRequest [GET], url: 'https://www.example.org/'>
93+
>>> response = client._send_request(request)
94+
<HttpResponse: 200 OK>
95+
96+
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
97+
98+
:param request: The network request you want to make. Required.
99+
:type request: ~azure.core.rest.HttpRequest
100+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
101+
:return: The response of your network call. Does not do error handling on your response.
102+
:rtype: ~azure.core.rest.HttpResponse
103+
"""
104+
105+
request_copy = deepcopy(request)
106+
request_copy.url = self._client.format_url(request_copy.url)
107+
return self._client.send_request(request_copy, **kwargs)
108+
109+
def close(self):
110+
# type: () -> None
111+
self._client.close()
112+
113+
def __enter__(self):
114+
# type: () -> LabServicesClient
115+
self._client.__enter__()
116+
return self
117+
118+
def __exit__(self, *exc_details):
119+
# type: (Any) -> None
120+
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)