Skip to content

Commit c875783

Browse files
azure-sdkaudunn
andauthored
[AutoRelease] t2-netapp-2025-04-04-80956(can only be merged by SDK owner) (#40370)
* code and test * tests * tests assets * import pytest --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: Audunn Baldvinsson <[email protected]>
1 parent a8f4b0f commit c875783

File tree

170 files changed

+1483
-555
lines changed

Some content is hidden

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

170 files changed

+1483
-555
lines changed

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

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

3+
## 13.5.0 (2025-04-21)
4+
5+
### Features Added
6+
7+
- Client `NetAppManagementClient` added operation group `net_app_resource_usages`
8+
- Model `Backup` added property `snapshot_creation_date`
9+
- Model `Backup` added property `completion_date`
10+
- Model `Backup` added property `is_large_volume`
11+
- Model `EncryptionIdentity` added property `federated_client_id`
12+
- Model `NetAppAccount` added property `nfs_v4_id_domain`
13+
- Model `NetAppAccount` added property `multi_ad_status`
14+
- Model `NetAppAccountPatch` added property `nfs_v4_id_domain`
15+
- Model `NetAppAccountPatch` added property `multi_ad_status`
16+
- Model `OperationListResult` added property `next_link`
17+
- Model `ReplicationObject` added property `destination_replications`
18+
- Added model `DestinationReplication`
19+
- Added enum `MultiAdStatus`
20+
- Added enum `ReplicationType`
21+
- Added model `UsageName`
22+
- Added model `UsageResult`
23+
- Added model `UsagesListResult`
24+
- Added model `NetAppResourceUsagesOperations`
25+
326
## 13.4.0 (2025-02-26)
427

528
### Features Added

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.

sdk/netapp/azure-mgmt-netapp/_meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"commit": "1d424c359209fda4d6ec397e43267da82e87a070",
2+
"commit": "27046dbff974e3901970aa53b29cec6d8ec1342a",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [

sdk/netapp/azure-mgmt-netapp/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/netapp/azure-mgmt-netapp",
5-
"Tag": "python/netapp/azure-mgmt-netapp_7fb2d50e01"
5+
"Tag": "python/netapp/azure-mgmt-netapp_e267792b26"
66
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ class NetAppManagementClientConfiguration: # pylint: disable=too-many-instance-
2727
:type credential: ~azure.core.credentials.TokenCredential
2828
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
2929
:type subscription_id: str
30-
:keyword api_version: Api Version. Default value is "2024-09-01". Note that overriding this
30+
:keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this
3131
default value may result in unsupported behavior.
3232
:paramtype api_version: str
3333
"""
3434

3535
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
36-
api_version: str = kwargs.pop("api_version", "2024-09-01")
36+
api_version: str = kwargs.pop("api_version", "2025-01-01")
3737

3838
if credential is None:
3939
raise ValueError("Parameter 'credential' must not be None.")

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_net_app_management_client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
NetAppResourceOperations,
3030
NetAppResourceQuotaLimitsOperations,
3131
NetAppResourceRegionInfosOperations,
32+
NetAppResourceUsagesOperations,
3233
Operations,
3334
PoolsOperations,
3435
SnapshotPoliciesOperations,
@@ -50,6 +51,8 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes
5051
:vartype operations: azure.mgmt.netapp.operations.Operations
5152
:ivar net_app_resource: NetAppResourceOperations operations
5253
:vartype net_app_resource: azure.mgmt.netapp.operations.NetAppResourceOperations
54+
:ivar net_app_resource_usages: NetAppResourceUsagesOperations operations
55+
:vartype net_app_resource_usages: azure.mgmt.netapp.operations.NetAppResourceUsagesOperations
5356
:ivar net_app_resource_quota_limits: NetAppResourceQuotaLimitsOperations operations
5457
:vartype net_app_resource_quota_limits:
5558
azure.mgmt.netapp.operations.NetAppResourceQuotaLimitsOperations
@@ -91,7 +94,7 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes
9194
:type subscription_id: str
9295
:param base_url: Service URL. Default value is "https://management.azure.com".
9396
:type base_url: str
94-
:keyword api_version: Api Version. Default value is "2024-09-01". Note that overriding this
97+
:keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this
9598
default value may result in unsupported behavior.
9699
:paramtype api_version: str
97100
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -134,6 +137,9 @@ def __init__(
134137
self._serialize.client_side_validation = False
135138
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
136139
self.net_app_resource = NetAppResourceOperations(self._client, self._config, self._serialize, self._deserialize)
140+
self.net_app_resource_usages = NetAppResourceUsagesOperations(
141+
self._client, self._config, self._serialize, self._deserialize
142+
)
137143
self.net_app_resource_quota_limits = NetAppResourceQuotaLimitsOperations(
138144
self._client, self._config, self._serialize, self._deserialize
139145
)

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "13.4.0"
9+
VERSION = "13.5.0"

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ class NetAppManagementClientConfiguration: # pylint: disable=too-many-instance-
2727
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
2828
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
2929
:type subscription_id: str
30-
:keyword api_version: Api Version. Default value is "2024-09-01". Note that overriding this
30+
:keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this
3131
default value may result in unsupported behavior.
3232
:paramtype api_version: str
3333
"""
3434

3535
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
36-
api_version: str = kwargs.pop("api_version", "2024-09-01")
36+
api_version: str = kwargs.pop("api_version", "2025-01-01")
3737

3838
if credential is None:
3939
raise ValueError("Parameter 'credential' must not be None.")

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_net_app_management_client.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
NetAppResourceOperations,
3030
NetAppResourceQuotaLimitsOperations,
3131
NetAppResourceRegionInfosOperations,
32+
NetAppResourceUsagesOperations,
3233
Operations,
3334
PoolsOperations,
3435
SnapshotPoliciesOperations,
@@ -50,6 +51,9 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes
5051
:vartype operations: azure.mgmt.netapp.aio.operations.Operations
5152
:ivar net_app_resource: NetAppResourceOperations operations
5253
:vartype net_app_resource: azure.mgmt.netapp.aio.operations.NetAppResourceOperations
54+
:ivar net_app_resource_usages: NetAppResourceUsagesOperations operations
55+
:vartype net_app_resource_usages:
56+
azure.mgmt.netapp.aio.operations.NetAppResourceUsagesOperations
5357
:ivar net_app_resource_quota_limits: NetAppResourceQuotaLimitsOperations operations
5458
:vartype net_app_resource_quota_limits:
5559
azure.mgmt.netapp.aio.operations.NetAppResourceQuotaLimitsOperations
@@ -91,7 +95,7 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes
9195
:type subscription_id: str
9296
:param base_url: Service URL. Default value is "https://management.azure.com".
9397
:type base_url: str
94-
:keyword api_version: Api Version. Default value is "2024-09-01". Note that overriding this
98+
:keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this
9599
default value may result in unsupported behavior.
96100
:paramtype api_version: str
97101
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -134,6 +138,9 @@ def __init__(
134138
self._serialize.client_side_validation = False
135139
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
136140
self.net_app_resource = NetAppResourceOperations(self._client, self._config, self._serialize, self._deserialize)
141+
self.net_app_resource_usages = NetAppResourceUsagesOperations(
142+
self._client, self._config, self._serialize, self._deserialize
143+
)
137144
self.net_app_resource_quota_limits = NetAppResourceQuotaLimitsOperations(
138145
self._client, self._config, self._serialize, self._deserialize
139146
)

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from ._operations import Operations # type: ignore
1616
from ._net_app_resource_operations import NetAppResourceOperations # type: ignore
17+
from ._net_app_resource_usages_operations import NetAppResourceUsagesOperations # type: ignore
1718
from ._net_app_resource_quota_limits_operations import NetAppResourceQuotaLimitsOperations # type: ignore
1819
from ._net_app_resource_region_infos_operations import NetAppResourceRegionInfosOperations # type: ignore
1920
from ._accounts_operations import AccountsOperations # type: ignore
@@ -38,6 +39,7 @@
3839
__all__ = [
3940
"Operations",
4041
"NetAppResourceOperations",
42+
"NetAppResourceUsagesOperations",
4143
"NetAppResourceQuotaLimitsOperations",
4244
"NetAppResourceRegionInfosOperations",
4345
"AccountsOperations",
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
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+
import sys
9+
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
10+
import urllib.parse
11+
12+
from azure.core.async_paging import AsyncItemPaged, AsyncList
13+
from azure.core.exceptions import (
14+
ClientAuthenticationError,
15+
HttpResponseError,
16+
ResourceExistsError,
17+
ResourceNotFoundError,
18+
ResourceNotModifiedError,
19+
map_error,
20+
)
21+
from azure.core.pipeline import PipelineResponse
22+
from azure.core.rest import AsyncHttpResponse, HttpRequest
23+
from azure.core.tracing.decorator import distributed_trace
24+
from azure.core.tracing.decorator_async import distributed_trace_async
25+
from azure.core.utils import case_insensitive_dict
26+
from azure.mgmt.core.exceptions import ARMErrorFormat
27+
28+
from ... import models as _models
29+
from ...operations._net_app_resource_usages_operations import build_get_request, build_list_request
30+
31+
if sys.version_info >= (3, 9):
32+
from collections.abc import MutableMapping
33+
else:
34+
from typing import MutableMapping # type: ignore
35+
T = TypeVar("T")
36+
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
37+
38+
39+
class NetAppResourceUsagesOperations:
40+
"""
41+
.. warning::
42+
**DO NOT** instantiate this class directly.
43+
44+
Instead, you should access the following operations through
45+
:class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
46+
:attr:`net_app_resource_usages` attribute.
47+
"""
48+
49+
models = _models
50+
51+
def __init__(self, *args, **kwargs) -> None:
52+
input_args = list(args)
53+
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
54+
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
55+
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
56+
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
57+
58+
@distributed_trace
59+
def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.UsageResult"]:
60+
"""Get usages.
61+
62+
Get current subscription usages.
63+
64+
:param location: The name of the Azure region. Required.
65+
:type location: str
66+
:return: An iterator like instance of either UsageResult or the result of cls(response)
67+
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.UsageResult]
68+
:raises ~azure.core.exceptions.HttpResponseError:
69+
"""
70+
_headers = kwargs.pop("headers", {}) or {}
71+
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
72+
73+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
74+
cls: ClsType[_models.UsagesListResult] = kwargs.pop("cls", None)
75+
76+
error_map: MutableMapping = {
77+
401: ClientAuthenticationError,
78+
404: ResourceNotFoundError,
79+
409: ResourceExistsError,
80+
304: ResourceNotModifiedError,
81+
}
82+
error_map.update(kwargs.pop("error_map", {}) or {})
83+
84+
def prepare_request(next_link=None):
85+
if not next_link:
86+
87+
_request = build_list_request(
88+
location=location,
89+
subscription_id=self._config.subscription_id,
90+
api_version=api_version,
91+
headers=_headers,
92+
params=_params,
93+
)
94+
_request.url = self._client.format_url(_request.url)
95+
96+
else:
97+
# make call to next link with the client's api-version
98+
_parsed_next_link = urllib.parse.urlparse(next_link)
99+
_next_request_params = case_insensitive_dict(
100+
{
101+
key: [urllib.parse.quote(v) for v in value]
102+
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
103+
}
104+
)
105+
_next_request_params["api-version"] = self._config.api_version
106+
_request = HttpRequest(
107+
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
108+
)
109+
_request.url = self._client.format_url(_request.url)
110+
_request.method = "GET"
111+
return _request
112+
113+
async def extract_data(pipeline_response):
114+
deserialized = self._deserialize("UsagesListResult", pipeline_response)
115+
list_of_elem = deserialized.value
116+
if cls:
117+
list_of_elem = cls(list_of_elem) # type: ignore
118+
return deserialized.next_link or None, AsyncList(list_of_elem)
119+
120+
async def get_next(next_link=None):
121+
_request = prepare_request(next_link)
122+
123+
_stream = False
124+
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
125+
_request, stream=_stream, **kwargs
126+
)
127+
response = pipeline_response.http_response
128+
129+
if response.status_code not in [200]:
130+
map_error(status_code=response.status_code, response=response, error_map=error_map)
131+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
132+
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
133+
134+
return pipeline_response
135+
136+
return AsyncItemPaged(get_next, extract_data)
137+
138+
@distributed_trace_async
139+
async def get(self, location: str, usage_type: str, **kwargs: Any) -> _models.UsageResult:
140+
"""Get specific type of usage.
141+
142+
Get current subscription usage of the specific type.
143+
144+
:param location: The name of the Azure region. Required.
145+
:type location: str
146+
:param usage_type: The type of usage. Required.
147+
:type usage_type: str
148+
:return: UsageResult or the result of cls(response)
149+
:rtype: ~azure.mgmt.netapp.models.UsageResult
150+
:raises ~azure.core.exceptions.HttpResponseError:
151+
"""
152+
error_map: MutableMapping = {
153+
401: ClientAuthenticationError,
154+
404: ResourceNotFoundError,
155+
409: ResourceExistsError,
156+
304: ResourceNotModifiedError,
157+
}
158+
error_map.update(kwargs.pop("error_map", {}) or {})
159+
160+
_headers = kwargs.pop("headers", {}) or {}
161+
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
162+
163+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
164+
cls: ClsType[_models.UsageResult] = kwargs.pop("cls", None)
165+
166+
_request = build_get_request(
167+
location=location,
168+
usage_type=usage_type,
169+
subscription_id=self._config.subscription_id,
170+
api_version=api_version,
171+
headers=_headers,
172+
params=_params,
173+
)
174+
_request.url = self._client.format_url(_request.url)
175+
176+
_stream = False
177+
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
178+
_request, stream=_stream, **kwargs
179+
)
180+
181+
response = pipeline_response.http_response
182+
183+
if response.status_code not in [200]:
184+
map_error(status_code=response.status_code, response=response, error_map=error_map)
185+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
186+
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
187+
188+
deserialized = self._deserialize("UsageResult", pipeline_response.http_response)
189+
190+
if cls:
191+
return cls(pipeline_response, deserialized, {}) # type: ignore
192+
193+
return deserialized # type: ignore

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ async def extract_data(pipeline_response):
110110
list_of_elem = deserialized.value
111111
if cls:
112112
list_of_elem = cls(list_of_elem) # type: ignore
113-
return None, AsyncList(list_of_elem)
113+
return deserialized.next_link or None, AsyncList(list_of_elem)
114114

115115
async def get_next(next_link=None):
116116
_request = prepare_request(next_link)

0 commit comments

Comments
 (0)