Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions sdk/netapp/azure-mgmt-netapp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Release History

## 13.5.0 (2025-04-01)

### Features Added

- Client `NetAppManagementClient` added operation group `net_app_resource_usages`
- Model `Backup` added property `snapshot_creation_date`
- Model `Backup` added property `completion_date`
- Model `Backup` added property `is_large_volume`
- Model `EncryptionIdentity` added property `federated_client_id`
- Model `NetAppAccount` added property `nfs_v4_id_domain`
- Model `NetAppAccount` added property `multi_ad_status`
- Model `NetAppAccountPatch` added property `nfs_v4_id_domain`
- Model `NetAppAccountPatch` added property `multi_ad_status`
- Model `OperationListResult` added property `next_link`
- Model `ReplicationObject` added property `destination_replications`
- Added model `DestinationReplication`
- Added enum `MultiAdStatus`
- Added enum `ReplicationType`
- Added model `UsageName`
- Added model `UsageResult`
- Added model `UsagesListResult`
- Added model `NetAppResourceUsagesOperations`

## 13.4.0 (2025-02-26)

### Features Added
Expand Down
2 changes: 1 addition & 1 deletion sdk/netapp/azure-mgmt-netapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pip install azure-identity

### Authentication

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

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
Expand Down
4 changes: 2 additions & 2 deletions sdk/netapp/azure-mgmt-netapp/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "1d424c359209fda4d6ec397e43267da82e87a070",
"commit": "bd273888e919170132a459af9fa049d8b977a66d",
"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/netapp/resource-manager/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 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"autorest_command": "autorest specification/netapp/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"readme": "specification/netapp/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ class NetAppManagementClientConfiguration: # pylint: disable=too-many-instance-
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2024-09-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

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

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
NetAppResourceOperations,
NetAppResourceQuotaLimitsOperations,
NetAppResourceRegionInfosOperations,
NetAppResourceUsagesOperations,
Operations,
PoolsOperations,
SnapshotPoliciesOperations,
Expand All @@ -50,6 +51,8 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes
:vartype operations: azure.mgmt.netapp.operations.Operations
:ivar net_app_resource: NetAppResourceOperations operations
:vartype net_app_resource: azure.mgmt.netapp.operations.NetAppResourceOperations
:ivar net_app_resource_usages: NetAppResourceUsagesOperations operations
:vartype net_app_resource_usages: azure.mgmt.netapp.operations.NetAppResourceUsagesOperations
:ivar net_app_resource_quota_limits: NetAppResourceQuotaLimitsOperations operations
:vartype net_app_resource_quota_limits:
azure.mgmt.netapp.operations.NetAppResourceQuotaLimitsOperations
Expand Down Expand Up @@ -91,7 +94,7 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2024-09-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down Expand Up @@ -134,6 +137,9 @@ def __init__(
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.net_app_resource = NetAppResourceOperations(self._client, self._config, self._serialize, self._deserialize)
self.net_app_resource_usages = NetAppResourceUsagesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.net_app_resource_quota_limits = NetAppResourceQuotaLimitsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down
2 changes: 1 addition & 1 deletion sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "13.4.0"
VERSION = "13.5.0"
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ class NetAppManagementClientConfiguration: # pylint: disable=too-many-instance-
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2024-09-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

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

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
NetAppResourceOperations,
NetAppResourceQuotaLimitsOperations,
NetAppResourceRegionInfosOperations,
NetAppResourceUsagesOperations,
Operations,
PoolsOperations,
SnapshotPoliciesOperations,
Expand All @@ -50,6 +51,9 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes
:vartype operations: azure.mgmt.netapp.aio.operations.Operations
:ivar net_app_resource: NetAppResourceOperations operations
:vartype net_app_resource: azure.mgmt.netapp.aio.operations.NetAppResourceOperations
:ivar net_app_resource_usages: NetAppResourceUsagesOperations operations
:vartype net_app_resource_usages:
azure.mgmt.netapp.aio.operations.NetAppResourceUsagesOperations
:ivar net_app_resource_quota_limits: NetAppResourceQuotaLimitsOperations operations
:vartype net_app_resource_quota_limits:
azure.mgmt.netapp.aio.operations.NetAppResourceQuotaLimitsOperations
Expand Down Expand Up @@ -91,7 +95,7 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2024-09-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down Expand Up @@ -134,6 +138,9 @@ def __init__(
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.net_app_resource = NetAppResourceOperations(self._client, self._config, self._serialize, self._deserialize)
self.net_app_resource_usages = NetAppResourceUsagesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.net_app_resource_quota_limits = NetAppResourceQuotaLimitsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from ._operations import Operations # type: ignore
from ._net_app_resource_operations import NetAppResourceOperations # type: ignore
from ._net_app_resource_usages_operations import NetAppResourceUsagesOperations # type: ignore
from ._net_app_resource_quota_limits_operations import NetAppResourceQuotaLimitsOperations # type: ignore
from ._net_app_resource_region_infos_operations import NetAppResourceRegionInfosOperations # type: ignore
from ._accounts_operations import AccountsOperations # type: ignore
Expand All @@ -38,6 +39,7 @@
__all__ = [
"Operations",
"NetAppResourceOperations",
"NetAppResourceUsagesOperations",
"NetAppResourceQuotaLimitsOperations",
"NetAppResourceRegionInfosOperations",
"AccountsOperations",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse

from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models as _models
from ...operations._net_app_resource_usages_operations import build_get_request, build_list_request

if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]


class NetAppResourceUsagesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.

Instead, you should access the following operations through
:class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
:attr:`net_app_resource_usages` attribute.
"""

models = _models

def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")

@distributed_trace
def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.UsageResult"]:
"""Get usages.

Get current subscription usages.

:param location: The name of the Azure region. Required.
:type location: str
:return: An iterator like instance of either UsageResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.UsageResult]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.UsagesListResult] = kwargs.pop("cls", None)

error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

def prepare_request(next_link=None):
if not next_link:

_request = build_list_request(
location=location,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)

else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request

async def extract_data(pipeline_response):
deserialized = self._deserialize("UsagesListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)

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

_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

return pipeline_response

return AsyncItemPaged(get_next, extract_data)

@distributed_trace_async
async def get(self, location: str, usage_type: str, **kwargs: Any) -> _models.UsageResult:
"""Get specific type of usage.

Get current subscription usage of the specific type.

:param location: The name of the Azure region. Required.
:type location: str
:param usage_type: The type of usage. Required.
:type usage_type: str
:return: UsageResult or the result of cls(response)
:rtype: ~azure.mgmt.netapp.models.UsageResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.UsageResult] = kwargs.pop("cls", None)

_request = build_get_request(
location=location,
usage_type=usage_type,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)

_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)

response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize("UsageResult", pipeline_response.http_response)

if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore

return deserialized # type: ignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async def extract_data(pipeline_response):
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return None, AsyncList(list_of_elem)
return deserialized.next_link or None, AsyncList(list_of_elem)

async def get_next(next_link=None):
_request = prepare_request(next_link)
Expand Down
Loading