Skip to content

Commit 34ff73f

Browse files
[AutoRelease] t2-sphere-2024-03-26-73149(can only be merged by SDK owner) (#34930)
* code and test * Update CHANGELOG.md * Update assets.json * Update dev_requirements.txt --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent 3a4636e commit 34ff73f

File tree

71 files changed

+2312
-2890
lines changed

Some content is hidden

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

71 files changed

+2312
-2890
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,68 @@
11
# Release History
22

3+
## 1.0.0 (2024-03-26)
4+
5+
### Features Added
6+
7+
- Added operation CatalogsOperations.begin_upload_image
8+
- Model Catalog has a new parameter properties
9+
- Model Certificate has a new parameter properties
10+
- Model Deployment has a new parameter properties
11+
- Model Device has a new parameter properties
12+
- Model DeviceGroup has a new parameter properties
13+
- Model DeviceGroupUpdate has a new parameter properties
14+
- Model DeviceUpdate has a new parameter properties
15+
- Model Image has a new parameter properties
16+
- Model Product has a new parameter properties
17+
- Model ProductUpdate has a new parameter properties
18+
19+
### Breaking Changes
20+
21+
- Model Catalog no longer has parameter provisioning_state
22+
- Model Certificate no longer has parameter certificate
23+
- Model Certificate no longer has parameter expiry_utc
24+
- Model Certificate no longer has parameter not_before_utc
25+
- Model Certificate no longer has parameter provisioning_state
26+
- Model Certificate no longer has parameter status
27+
- Model Certificate no longer has parameter subject
28+
- Model Certificate no longer has parameter thumbprint
29+
- Model Deployment no longer has parameter deployed_images
30+
- Model Deployment no longer has parameter deployment_date_utc
31+
- Model Deployment no longer has parameter deployment_id
32+
- Model Deployment no longer has parameter provisioning_state
33+
- Model Device no longer has parameter chip_sku
34+
- Model Device no longer has parameter device_id
35+
- Model Device no longer has parameter last_available_os_version
36+
- Model Device no longer has parameter last_installed_os_version
37+
- Model Device no longer has parameter last_os_update_utc
38+
- Model Device no longer has parameter last_update_request_utc
39+
- Model Device no longer has parameter provisioning_state
40+
- Model DeviceGroup no longer has parameter allow_crash_dumps_collection
41+
- Model DeviceGroup no longer has parameter description
42+
- Model DeviceGroup no longer has parameter has_deployment
43+
- Model DeviceGroup no longer has parameter os_feed_type
44+
- Model DeviceGroup no longer has parameter provisioning_state
45+
- Model DeviceGroup no longer has parameter regional_data_boundary
46+
- Model DeviceGroup no longer has parameter update_policy
47+
- Model DeviceGroupUpdate no longer has parameter allow_crash_dumps_collection
48+
- Model DeviceGroupUpdate no longer has parameter description
49+
- Model DeviceGroupUpdate no longer has parameter os_feed_type
50+
- Model DeviceGroupUpdate no longer has parameter regional_data_boundary
51+
- Model DeviceGroupUpdate no longer has parameter update_policy
52+
- Model DeviceUpdate no longer has parameter device_group_id
53+
- Model Image no longer has parameter component_id
54+
- Model Image no longer has parameter description
55+
- Model Image no longer has parameter image
56+
- Model Image no longer has parameter image_id
57+
- Model Image no longer has parameter image_name
58+
- Model Image no longer has parameter image_type
59+
- Model Image no longer has parameter provisioning_state
60+
- Model Image no longer has parameter regional_data_boundary
61+
- Model Image no longer has parameter uri
62+
- Model Product no longer has parameter description
63+
- Model Product no longer has parameter provisioning_state
64+
- Model ProductUpdate no longer has parameter description
65+
366
## 1.0.0b1 (2023-07-21)
467

568
* Initial Release

sdk/sphere/azure-mgmt-sphere/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Sphere Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.8+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.7+ is required to use this package.
15+
- Python 3.8+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -59,6 +59,3 @@ Code samples for this package can be found at:
5959
If you encounter any bugs or have suggestions, please file an issue in the
6060
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
6161
section of the project.
62-
63-
64-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-sphere%2FREADME.png)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "23d88533ddfde4d1565a897fe95d42fb0d9333e5",
2+
"commit": "09c37754dac91874ff689ed1e60effb4268c8669",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.6",
4+
"autorest": "3.9.7",
55
"use": [
6-
"@autorest/python@6.6.0",
7-
"@autorest/modelerfour@4.26.2"
6+
"@autorest/python@6.13.7",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/sphere/resource-manager/readme.md --generate-sample=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.6.0 --use=@autorest/modelerfour@4.26.2 --version=3.9.6 --version-tolerant=False",
9+
"autorest_command": "autorest specification/sphere/resource-manager/readme.md --generate-sample=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.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False",
1010
"readme": "specification/sphere/resource-manager/readme.md"
1111
}

sdk/sphere/azure-mgmt-sphere/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/sphere/azure-mgmt-sphere",
5-
"Tag": "python/sphere/azure-mgmt-sphere_180c756981"
5+
"Tag": "python/sphere/azure-mgmt-sphere_20733529ee"
66
}

sdk/sphere/azure-mgmt-sphere/azure/mgmt/sphere/_azure_sphere_mgmt_client.py

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
1111

12+
from azure.core.pipeline import policies
1213
from azure.core.rest import HttpRequest, HttpResponse
1314
from azure.mgmt.core import ARMPipelineClient
15+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1416

1517
from . import models as _models
1618
from ._configuration import AzureSphereMgmtClientConfiguration
@@ -56,8 +58,8 @@ class AzureSphereMgmtClient: # pylint: disable=client-accepts-api-version-keywo
5658
:type subscription_id: str
5759
:param base_url: Service URL. Default value is "https://management.azure.com".
5860
:type base_url: str
59-
:keyword api_version: Api Version. Default value is "2022-09-01-preview". Note that overriding
60-
this default value may result in unsupported behavior.
61+
:keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this
62+
default value may result in unsupported behavior.
6163
:paramtype api_version: str
6264
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
6365
Retry-After header is present.
@@ -73,7 +75,25 @@ def __init__(
7375
self._config = AzureSphereMgmtClientConfiguration(
7476
credential=credential, subscription_id=subscription_id, **kwargs
7577
)
76-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
78+
_policies = kwargs.pop("policies", None)
79+
if _policies is None:
80+
_policies = [
81+
policies.RequestIdPolicy(**kwargs),
82+
self._config.headers_policy,
83+
self._config.user_agent_policy,
84+
self._config.proxy_policy,
85+
policies.ContentDecodePolicy(**kwargs),
86+
ARMAutoResourceProviderRegistrationPolicy(),
87+
self._config.redirect_policy,
88+
self._config.retry_policy,
89+
self._config.authentication_policy,
90+
self._config.custom_hook_policy,
91+
self._config.logging_policy,
92+
policies.DistributedTracingPolicy(**kwargs),
93+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
94+
self._config.http_logging_policy,
95+
]
96+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
7797

7898
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
7999
self._serialize = Serializer(client_models)
@@ -88,7 +108,7 @@ def __init__(
88108
self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize)
89109
self.devices = DevicesOperations(self._client, self._config, self._serialize, self._deserialize)
90110

91-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
111+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
92112
"""Runs the network request through the client's chained policies.
93113
94114
>>> from azure.core.rest import HttpRequest
@@ -108,7 +128,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
108128

109129
request_copy = deepcopy(request)
110130
request_copy.url = self._client.format_url(request_copy.url)
111-
return self._client.send_request(request_copy, **kwargs)
131+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
112132

113133
def close(self) -> None:
114134
self._client.close()

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from typing import Any, TYPE_CHECKING
1010

11-
from azure.core.configuration import Configuration
1211
from azure.core.pipeline import policies
1312
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1413

@@ -19,7 +18,7 @@
1918
from azure.core.credentials import TokenCredential
2019

2120

22-
class AzureSphereMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
21+
class AzureSphereMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2322
"""Configuration for AzureSphereMgmtClient.
2423
2524
Note that all parameters used to create this instance are saved as instance
@@ -29,14 +28,13 @@ class AzureSphereMgmtClientConfiguration(Configuration): # pylint: disable=too-
2928
:type credential: ~azure.core.credentials.TokenCredential
3029
:param subscription_id: The ID of the target subscription. Required.
3130
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2022-09-01-preview". Note that overriding
33-
this default value may result in unsupported behavior.
31+
:keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this
32+
default value may result in unsupported behavior.
3433
:paramtype api_version: str
3534
"""
3635

3736
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38-
super(AzureSphereMgmtClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2022-09-01-preview")
37+
api_version: str = kwargs.pop("api_version", "2024-04-01")
4038

4139
if credential is None:
4240
raise ValueError("Parameter 'credential' must not be None.")
@@ -48,6 +46,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4846
self.api_version = api_version
4947
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5048
kwargs.setdefault("sdk_moniker", "mgmt-sphere/{}".format(VERSION))
49+
self.polling_interval = kwargs.get("polling_interval", 30)
5150
self._configure(**kwargs)
5251

5352
def _configure(self, **kwargs: Any) -> None:
@@ -56,9 +55,9 @@ def _configure(self, **kwargs: Any) -> None:
5655
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5756
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5857
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
59-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6058
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
6159
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
60+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6261
self.authentication_policy = kwargs.get("authentication_policy")
6362
if self.credential and not self.authentication_policy:
6463
self.authentication_policy = ARMChallengeAuthenticationPolicy(

0 commit comments

Comments
 (0)