Skip to content

Commit 558ed7a

Browse files
author
SDK Automation
committed
Update from release/v3
1 parent c96ce20 commit 558ed7a

File tree

7 files changed

+228
-1
lines changed

7 files changed

+228
-1
lines changed

sdk/storage/azure-mgmt-storagecache/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This is the Microsoft Azure MyService Management Client Library.
44
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
5-
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
5+
For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/)
66

77

88
# Usage

sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_storage_cache_management_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from .operations import Operations
1717
from .operations import SkusOperations
1818
from .operations import UsageModelsOperations
19+
from .operations import AscOperations
1920
from .operations import CachesOperations
2021
from .operations import StorageTargetsOperations
2122
from . import models
@@ -33,6 +34,8 @@ class StorageCacheManagementClient(SDKClient):
3334
:vartype skus: azure.mgmt.storagecache.operations.SkusOperations
3435
:ivar usage_models: UsageModels operations
3536
:vartype usage_models: azure.mgmt.storagecache.operations.UsageModelsOperations
37+
:ivar asc_operations: AscOperations operations
38+
:vartype asc_operations: azure.mgmt.storagecache.operations.AscOperations
3639
:ivar caches: Caches operations
3740
:vartype caches: azure.mgmt.storagecache.operations.CachesOperations
3841
:ivar storage_targets: StorageTargets operations
@@ -65,6 +68,8 @@ def __init__(
6568
self._client, self.config, self._serialize, self._deserialize)
6669
self.usage_models = UsageModelsOperations(
6770
self._client, self.config, self._serialize, self._deserialize)
71+
self.asc_operations = AscOperations(
72+
self._client, self.config, self._serialize, self._deserialize)
6873
self.caches = CachesOperations(
6974
self._client, self.config, self._serialize, self._deserialize)
7075
self.storage_targets = StorageTargetsOperations(

sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
try:
1313
from ._models_py3 import ApiOperation
1414
from ._models_py3 import ApiOperationDisplay
15+
from ._models_py3 import AscOperation
1516
from ._models_py3 import Cache
1617
from ._models_py3 import CacheEncryptionSettings
1718
from ._models_py3 import CacheHealth
@@ -23,6 +24,7 @@
2324
from ._models_py3 import ClfsTarget
2425
from ._models_py3 import ClfsTargetProperties
2526
from ._models_py3 import CloudErrorBody
27+
from ._models_py3 import ErrorResponse
2628
from ._models_py3 import KeyVaultKeyReference
2729
from ._models_py3 import KeyVaultKeyReferenceSourceVault
2830
from ._models_py3 import NamespaceJunction
@@ -42,6 +44,7 @@
4244
except (SyntaxError, ImportError):
4345
from ._models import ApiOperation
4446
from ._models import ApiOperationDisplay
47+
from ._models import AscOperation
4548
from ._models import Cache
4649
from ._models import CacheEncryptionSettings
4750
from ._models import CacheHealth
@@ -53,6 +56,7 @@
5356
from ._models import ClfsTarget
5457
from ._models import ClfsTargetProperties
5558
from ._models import CloudErrorBody
59+
from ._models import ErrorResponse
5660
from ._models import KeyVaultKeyReference
5761
from ._models import KeyVaultKeyReferenceSourceVault
5862
from ._models import NamespaceJunction
@@ -86,6 +90,7 @@
8690
__all__ = [
8791
'ApiOperation',
8892
'ApiOperationDisplay',
93+
'AscOperation',
8994
'Cache',
9095
'CacheEncryptionSettings',
9196
'CacheHealth',
@@ -97,6 +102,7 @@
97102
'ClfsTarget',
98103
'ClfsTargetProperties',
99104
'CloudErrorBody',
105+
'ErrorResponse',
100106
'KeyVaultKeyReference',
101107
'KeyVaultKeyReferenceSourceVault',
102108
'NamespaceJunction',

sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,42 @@ def __init__(self, **kwargs):
5858
self.resource = kwargs.get('resource', None)
5959

6060

61+
class AscOperation(Model):
62+
"""The status of operation.
63+
64+
:param id: The operation Id.
65+
:type id: str
66+
:param name: The operation name.
67+
:type name: str
68+
:param start_time: The start time of the operation.
69+
:type start_time: str
70+
:param end_time: The end time of the operation.
71+
:type end_time: str
72+
:param status: The status of the operation.
73+
:type status: str
74+
:param error: The error detail of the operation if any.
75+
:type error: ~azure.mgmt.storagecache.models.ErrorResponse
76+
"""
77+
78+
_attribute_map = {
79+
'id': {'key': 'id', 'type': 'str'},
80+
'name': {'key': 'name', 'type': 'str'},
81+
'start_time': {'key': 'startTime', 'type': 'str'},
82+
'end_time': {'key': 'endTime', 'type': 'str'},
83+
'status': {'key': 'status', 'type': 'str'},
84+
'error': {'key': 'error', 'type': 'ErrorResponse'},
85+
}
86+
87+
def __init__(self, **kwargs):
88+
super(AscOperation, self).__init__(**kwargs)
89+
self.id = kwargs.get('id', None)
90+
self.name = kwargs.get('name', None)
91+
self.start_time = kwargs.get('start_time', None)
92+
self.end_time = kwargs.get('end_time', None)
93+
self.status = kwargs.get('status', None)
94+
self.error = kwargs.get('error', None)
95+
96+
6197
class Cache(Model):
6298
"""A Cache instance. Follows Azure Resource Manager standards:
6399
https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md.
@@ -519,6 +555,26 @@ def __init__(self, **kwargs):
519555
self.target = kwargs.get('target', None)
520556

521557

558+
class ErrorResponse(Model):
559+
"""Describes the format of Error response.
560+
561+
:param code: Error code
562+
:type code: str
563+
:param message: Error message indicating why the operation failed.
564+
:type message: str
565+
"""
566+
567+
_attribute_map = {
568+
'code': {'key': 'code', 'type': 'str'},
569+
'message': {'key': 'message', 'type': 'str'},
570+
}
571+
572+
def __init__(self, **kwargs):
573+
super(ErrorResponse, self).__init__(**kwargs)
574+
self.code = kwargs.get('code', None)
575+
self.message = kwargs.get('message', None)
576+
577+
522578
class KeyVaultKeyReference(Model):
523579
"""Describes a reference to Key Vault Key.
524580

sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models_py3.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,42 @@ def __init__(self, *, operation: str=None, provider: str=None, resource: str=Non
5858
self.resource = resource
5959

6060

61+
class AscOperation(Model):
62+
"""The status of operation.
63+
64+
:param id: The operation Id.
65+
:type id: str
66+
:param name: The operation name.
67+
:type name: str
68+
:param start_time: The start time of the operation.
69+
:type start_time: str
70+
:param end_time: The end time of the operation.
71+
:type end_time: str
72+
:param status: The status of the operation.
73+
:type status: str
74+
:param error: The error detail of the operation if any.
75+
:type error: ~azure.mgmt.storagecache.models.ErrorResponse
76+
"""
77+
78+
_attribute_map = {
79+
'id': {'key': 'id', 'type': 'str'},
80+
'name': {'key': 'name', 'type': 'str'},
81+
'start_time': {'key': 'startTime', 'type': 'str'},
82+
'end_time': {'key': 'endTime', 'type': 'str'},
83+
'status': {'key': 'status', 'type': 'str'},
84+
'error': {'key': 'error', 'type': 'ErrorResponse'},
85+
}
86+
87+
def __init__(self, *, id: str=None, name: str=None, start_time: str=None, end_time: str=None, status: str=None, error=None, **kwargs) -> None:
88+
super(AscOperation, self).__init__(**kwargs)
89+
self.id = id
90+
self.name = name
91+
self.start_time = start_time
92+
self.end_time = end_time
93+
self.status = status
94+
self.error = error
95+
96+
6197
class Cache(Model):
6298
"""A Cache instance. Follows Azure Resource Manager standards:
6399
https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md.
@@ -519,6 +555,26 @@ def __init__(self, *, code: str=None, details=None, message: str=None, target: s
519555
self.target = target
520556

521557

558+
class ErrorResponse(Model):
559+
"""Describes the format of Error response.
560+
561+
:param code: Error code
562+
:type code: str
563+
:param message: Error message indicating why the operation failed.
564+
:type message: str
565+
"""
566+
567+
_attribute_map = {
568+
'code': {'key': 'code', 'type': 'str'},
569+
'message': {'key': 'message', 'type': 'str'},
570+
}
571+
572+
def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None:
573+
super(ErrorResponse, self).__init__(**kwargs)
574+
self.code = code
575+
self.message = message
576+
577+
522578
class KeyVaultKeyReference(Model):
523579
"""Describes a reference to Key Vault Key.
524580

sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
from ._operations import Operations
1313
from ._skus_operations import SkusOperations
1414
from ._usage_models_operations import UsageModelsOperations
15+
from ._asc_operations import AscOperations
1516
from ._caches_operations import CachesOperations
1617
from ._storage_targets_operations import StorageTargetsOperations
1718

1819
__all__ = [
1920
'Operations',
2021
'SkusOperations',
2122
'UsageModelsOperations',
23+
'AscOperations',
2224
'CachesOperations',
2325
'StorageTargetsOperations',
2426
]
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
import uuid
13+
from msrest.pipeline import ClientRawResponse
14+
from msrestazure.azure_exceptions import CloudError
15+
16+
from .. import models
17+
18+
19+
class AscOperations(object):
20+
"""AscOperations operations.
21+
22+
You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute.
23+
24+
:param client: Client for service requests.
25+
:param config: Configuration of service client.
26+
:param serializer: An object model serializer.
27+
:param deserializer: An object model deserializer.
28+
:ivar api_version: Client API version. Constant value: "2020-03-01".
29+
"""
30+
31+
models = models
32+
33+
def __init__(self, client, config, serializer, deserializer):
34+
35+
self._client = client
36+
self._serialize = serializer
37+
self._deserialize = deserializer
38+
self.api_version = "2020-03-01"
39+
40+
self.config = config
41+
42+
def get(
43+
self, location, operation_id, custom_headers=None, raw=False, **operation_config):
44+
"""Gets the status of an asynchronous operation for the Azure HPC cache.
45+
46+
:param location: The region name which the operation will lookup into.
47+
:type location: str
48+
:param operation_id: The operation id which uniquely identifies the
49+
asynchronous operation.
50+
:type operation_id: str
51+
:param dict custom_headers: headers that will be added to the request
52+
:param bool raw: returns the direct response alongside the
53+
deserialized response
54+
:param operation_config: :ref:`Operation configuration
55+
overrides<msrest:optionsforoperations>`.
56+
:return: AscOperation or ClientRawResponse if raw=true
57+
:rtype: ~azure.mgmt.storagecache.models.AscOperation or
58+
~msrest.pipeline.ClientRawResponse
59+
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
60+
"""
61+
# Construct URL
62+
url = self.get.metadata['url']
63+
path_format_arguments = {
64+
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
65+
'location': self._serialize.url("location", location, 'str'),
66+
'operationId': self._serialize.url("operation_id", operation_id, 'str')
67+
}
68+
url = self._client.format_url(url, **path_format_arguments)
69+
70+
# Construct parameters
71+
query_parameters = {}
72+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
73+
74+
# Construct headers
75+
header_parameters = {}
76+
header_parameters['Accept'] = 'application/json'
77+
if self.config.generate_client_request_id:
78+
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
79+
if custom_headers:
80+
header_parameters.update(custom_headers)
81+
if self.config.accept_language is not None:
82+
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
83+
84+
# Construct and send request
85+
request = self._client.get(url, query_parameters, header_parameters)
86+
response = self._client.send(request, stream=False, **operation_config)
87+
88+
if response.status_code not in [200]:
89+
exp = CloudError(response)
90+
exp.request_id = response.headers.get('x-ms-request-id')
91+
raise exp
92+
93+
deserialized = None
94+
if response.status_code == 200:
95+
deserialized = self._deserialize('AscOperation', response)
96+
97+
if raw:
98+
client_raw_response = ClientRawResponse(deserialized, response)
99+
return client_raw_response
100+
101+
return deserialized
102+
get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/locations/{location}/ascOperations/{operationId}'}

0 commit comments

Comments
 (0)