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
6 changes: 3 additions & 3 deletions sdk/storage/azure-mgmt-storagecache/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.7.2",
"use": [
"@autorest/python@5.12.0",
"@autorest/python@5.13.0",
"@autorest/modelerfour@4.19.3"
],
"commit": "2c66a689c610dbef623d6c4e4c4e913446d5ac68",
"commit": "35dea9c9199a5481f438ab0933f96f5f0f97c80f",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/storagecache/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
"autorest_command": "autorest specification/storagecache/resource-manager/readme.md --multiapi --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
"readme": "specification/storagecache/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@
from azure.core.credentials import TokenCredential


class StorageCacheManagementClientConfiguration(Configuration):
class StorageCacheManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for StorageCacheManagementClient.

Note that all parameters used to create this instance are saved as instance
attributes.

:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(
Expand All @@ -38,14 +42,16 @@ def __init__(
**kwargs: Any
) -> None:
super(StorageCacheManagementClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2022-05-01") # type: str

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

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2022-01-01"
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-storagecache/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chosen_version": "2022-01-01",
"total_api_version_list": ["2022-01-01"],
"chosen_version": "2022-05-01",
"total_api_version_list": ["2022-05-01"],
"client": {
"name": "StorageCacheManagementClient",
"filename": "_storage_cache_management_client",
Expand All @@ -10,8 +10,8 @@
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"StorageCacheManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"StorageCacheManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"StorageCacheManagementClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"StorageCacheManagementClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
},
"global_parameters": {
"sync": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import Any, Optional, TYPE_CHECKING
from typing import Any, TYPE_CHECKING

from msrest import Deserializer, Serializer

from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from msrest import Deserializer, Serializer

from . import models
from ._configuration import StorageCacheManagementClientConfiguration
Expand All @@ -21,32 +22,37 @@
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential

class StorageCacheManagementClient:
"""A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches.
class StorageCacheManagementClient: # pylint: disable=too-many-instance-attributes
"""A Storage Cache provides scalable caching service for NAS clients, serving data from either
NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to
manage Caches.

:ivar operations: Operations operations
:vartype operations: storage_cache_management_client.operations.Operations
:vartype operations: azure.mgmt.storagecache.operations.Operations
:ivar skus: SkusOperations operations
:vartype skus: storage_cache_management_client.operations.SkusOperations
:vartype skus: azure.mgmt.storagecache.operations.SkusOperations
:ivar usage_models: UsageModelsOperations operations
:vartype usage_models: storage_cache_management_client.operations.UsageModelsOperations
:vartype usage_models: azure.mgmt.storagecache.operations.UsageModelsOperations
:ivar asc_operations: AscOperationsOperations operations
:vartype asc_operations: storage_cache_management_client.operations.AscOperationsOperations
:vartype asc_operations: azure.mgmt.storagecache.operations.AscOperationsOperations
:ivar asc_usages: AscUsagesOperations operations
:vartype asc_usages: storage_cache_management_client.operations.AscUsagesOperations
:vartype asc_usages: azure.mgmt.storagecache.operations.AscUsagesOperations
:ivar caches: CachesOperations operations
:vartype caches: storage_cache_management_client.operations.CachesOperations
:vartype caches: azure.mgmt.storagecache.operations.CachesOperations
:ivar storage_targets: StorageTargetsOperations operations
:vartype storage_targets: storage_cache_management_client.operations.StorageTargetsOperations
:vartype storage_targets: azure.mgmt.storagecache.operations.StorageTargetsOperations
:ivar storage_target: StorageTargetOperations operations
:vartype storage_target: storage_cache_management_client.operations.StorageTargetOperations
:vartype storage_target: azure.mgmt.storagecache.operations.StorageTargetOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call.
:type subscription_id: str
:param base_url: Service URL. Default value is 'https://management.azure.com'.
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-05-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
Retry-After header is present.
"""
Expand Down Expand Up @@ -77,7 +83,7 @@ def __init__(

def _send_request(
self,
request, # type: HttpRequest
request: HttpRequest,
**kwargs: Any
) -> HttpResponse:
"""Runs the network request through the client's chained policies.
Expand Down
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 = "1.2.0"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@
from azure.core.credentials_async import AsyncTokenCredential


class StorageCacheManagementClientConfiguration(Configuration):
class StorageCacheManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for StorageCacheManagementClient.

Note that all parameters used to create this instance are saved as instance
attributes.

:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(
Expand All @@ -38,14 +42,16 @@ def __init__(
**kwargs: Any
) -> None:
super(StorageCacheManagementClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2022-05-01") # type: str

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

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2022-01-01"
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-storagecache/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import Any, Awaitable, Optional, TYPE_CHECKING
from typing import Any, Awaitable, TYPE_CHECKING

from msrest import Deserializer, Serializer

from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

from .. import models
from ._configuration import StorageCacheManagementClientConfiguration
Expand All @@ -21,33 +22,37 @@
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential

class StorageCacheManagementClient:
"""A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches.
class StorageCacheManagementClient: # pylint: disable=too-many-instance-attributes
"""A Storage Cache provides scalable caching service for NAS clients, serving data from either
NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to
manage Caches.

:ivar operations: Operations operations
:vartype operations: storage_cache_management_client.aio.operations.Operations
:vartype operations: azure.mgmt.storagecache.aio.operations.Operations
:ivar skus: SkusOperations operations
:vartype skus: storage_cache_management_client.aio.operations.SkusOperations
:vartype skus: azure.mgmt.storagecache.aio.operations.SkusOperations
:ivar usage_models: UsageModelsOperations operations
:vartype usage_models: storage_cache_management_client.aio.operations.UsageModelsOperations
:vartype usage_models: azure.mgmt.storagecache.aio.operations.UsageModelsOperations
:ivar asc_operations: AscOperationsOperations operations
:vartype asc_operations: storage_cache_management_client.aio.operations.AscOperationsOperations
:vartype asc_operations: azure.mgmt.storagecache.aio.operations.AscOperationsOperations
:ivar asc_usages: AscUsagesOperations operations
:vartype asc_usages: storage_cache_management_client.aio.operations.AscUsagesOperations
:vartype asc_usages: azure.mgmt.storagecache.aio.operations.AscUsagesOperations
:ivar caches: CachesOperations operations
:vartype caches: storage_cache_management_client.aio.operations.CachesOperations
:vartype caches: azure.mgmt.storagecache.aio.operations.CachesOperations
:ivar storage_targets: StorageTargetsOperations operations
:vartype storage_targets:
storage_cache_management_client.aio.operations.StorageTargetsOperations
:vartype storage_targets: azure.mgmt.storagecache.aio.operations.StorageTargetsOperations
:ivar storage_target: StorageTargetOperations operations
:vartype storage_target: storage_cache_management_client.aio.operations.StorageTargetOperations
:vartype storage_target: azure.mgmt.storagecache.aio.operations.StorageTargetOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call.
:type subscription_id: str
:param base_url: Service URL. Default value is 'https://management.azure.com'.
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-05-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
Retry-After header is present.
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# pylint: disable=too-many-lines
# 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 functools
from typing import Any, Callable, Dict, Generic, Optional, TypeVar
import warnings
from typing import Any, Callable, Dict, Optional, TypeVar

from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
Expand All @@ -29,7 +28,7 @@ class AscOperationsOperations:
instantiates it for you and attaches it as an attribute.

:ivar models: Alias to model classes used in this operation group.
:type models: ~storage_cache_management_client.models
:type models: ~azure.mgmt.storagecache.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
Expand Down Expand Up @@ -59,7 +58,7 @@ async def get(
:type operation_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: AscOperation, or the result of cls(response)
:rtype: ~storage_cache_management_client.models.AscOperation
:rtype: ~azure.mgmt.storagecache.models.AscOperation
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.AscOperation"]
Expand All @@ -68,17 +67,24 @@ async def get(
}
error_map.update(kwargs.pop('error_map', {}))

api_version = kwargs.pop('api_version', "2022-05-01") # type: str


request = build_get_request(
subscription_id=self._config.subscription_id,
location=location,
operation_id=operation_id,
api_version=api_version,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)

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

if response.status_code not in [200]:
Expand All @@ -92,5 +98,5 @@ async def get(

return deserialized

get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/locations/{location}/ascOperations/{operationId}'} # type: ignore
get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/locations/{location}/ascOperations/{operationId}"} # type: ignore

Loading