diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/__init__.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/__init__.py index defb631bfba..d82cd869b28 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/__init__.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/__init__.py @@ -16,6 +16,7 @@ from .sas_uri_response_py3 import SasUriResponse from .target_status_py3 import TargetStatus from .provider_status_py3 import ProviderStatus + from .quota_py3 import Quota from .rest_error_py3 import RestError, RestErrorException except (SyntaxError, ImportError): from .error_data import ErrorData @@ -24,13 +25,17 @@ from .sas_uri_response import SasUriResponse from .target_status import TargetStatus from .provider_status import ProviderStatus + from .quota import Quota from .rest_error import RestError, RestErrorException from .job_details_paged import JobDetailsPaged from .provider_status_paged import ProviderStatusPaged +from .quota_paged import QuotaPaged from .quantum_client_enums import ( JobStatus, ProviderAvailability, TargetAvailability, + DimensionScope, + MeterPeriod, ) __all__ = [ @@ -40,10 +45,14 @@ 'SasUriResponse', 'TargetStatus', 'ProviderStatus', + 'Quota', 'RestError', 'RestErrorException', 'JobDetailsPaged', 'ProviderStatusPaged', + 'QuotaPaged', 'JobStatus', 'ProviderAvailability', 'TargetAvailability', + 'DimensionScope', + 'MeterPeriod', ] diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/job_details.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/job_details.py index 78b3bd4d83b..79872d05917 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/job_details.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/job_details.py @@ -52,7 +52,7 @@ class JobDetails(Model): :type output_data_format: str :ivar status: The job status. Possible values include: 'Waiting', 'Executing', 'Succeeded', 'Failed', 'Cancelled' - :vartype status: str or ~azure.quantum.models.JobStatus + :vartype status: str or ~quantum.models.JobStatus :ivar creation_time: The creation time of the job. :vartype creation_time: datetime :ivar begin_execution_time: The time when the job began execution. @@ -63,7 +63,7 @@ class JobDetails(Model): :vartype cancellation_time: datetime :ivar error_data: The error data for the job. This is expected only when Status 'Failed'. - :vartype error_data: ~azure.quantum.models.ErrorData + :vartype error_data: ~quantum.models.ErrorData """ _validation = { diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/job_details_paged.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/job_details_paged.py index f8c5167c586..171821cde82 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/job_details_paged.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/job_details_paged.py @@ -14,7 +14,7 @@ class JobDetailsPaged(Paged): """ - A paging container for iterating over a list of :class:`JobDetails ` object + A paging container for iterating over a list of :class:`JobDetails ` object """ _attribute_map = { diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/job_details_py3.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/job_details_py3.py index 749ef493fd6..f7c8910e650 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/job_details_py3.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/job_details_py3.py @@ -52,7 +52,7 @@ class JobDetails(Model): :type output_data_format: str :ivar status: The job status. Possible values include: 'Waiting', 'Executing', 'Succeeded', 'Failed', 'Cancelled' - :vartype status: str or ~azure.quantum.models.JobStatus + :vartype status: str or ~quantum.models.JobStatus :ivar creation_time: The creation time of the job. :vartype creation_time: datetime :ivar begin_execution_time: The time when the job began execution. @@ -63,7 +63,7 @@ class JobDetails(Model): :vartype cancellation_time: datetime :ivar error_data: The error data for the job. This is expected only when Status 'Failed'. - :vartype error_data: ~azure.quantum.models.ErrorData + :vartype error_data: ~quantum.models.ErrorData """ _validation = { diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/provider_status.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/provider_status.py index 74a8a398980..2180e9862b2 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/provider_status.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/provider_status.py @@ -22,10 +22,9 @@ class ProviderStatus(Model): :vartype id: str :ivar current_availability: Provider availability. Possible values include: 'Available', 'Degraded', 'Unavailable' - :vartype current_availability: str or - ~azure.quantum.models.ProviderAvailability + :vartype current_availability: str or ~quantum.models.ProviderAvailability :ivar targets: - :vartype targets: list[~azure.quantum.models.TargetStatus] + :vartype targets: list[~quantum.models.TargetStatus] """ _validation = { diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/provider_status_paged.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/provider_status_paged.py index 630b1dcda60..9e498393005 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/provider_status_paged.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/provider_status_paged.py @@ -14,7 +14,7 @@ class ProviderStatusPaged(Paged): """ - A paging container for iterating over a list of :class:`ProviderStatus ` object + A paging container for iterating over a list of :class:`ProviderStatus ` object """ _attribute_map = { diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/provider_status_py3.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/provider_status_py3.py index c87bbe00ebb..98bae0f1c3d 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/provider_status_py3.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/provider_status_py3.py @@ -22,10 +22,9 @@ class ProviderStatus(Model): :vartype id: str :ivar current_availability: Provider availability. Possible values include: 'Available', 'Degraded', 'Unavailable' - :vartype current_availability: str or - ~azure.quantum.models.ProviderAvailability + :vartype current_availability: str or ~quantum.models.ProviderAvailability :ivar targets: - :vartype targets: list[~azure.quantum.models.TargetStatus] + :vartype targets: list[~quantum.models.TargetStatus] """ _validation = { diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/quantum_client_enums.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/quantum_client_enums.py index 8106788169f..38fa76b478b 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/quantum_client_enums.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/quantum_client_enums.py @@ -33,3 +33,15 @@ class TargetAvailability(str, Enum): available = "Available" degraded = "Degraded" unavailable = "Unavailable" + + +class DimensionScope(str, Enum): + + workspace = "Workspace" + subscription = "Subscription" + + +class MeterPeriod(str, Enum): + + none = "None" + monthly = "Monthly" diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/quota.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/quota.py new file mode 100644 index 00000000000..374712b42ac --- /dev/null +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/quota.py @@ -0,0 +1,57 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Quota(Model): + """Quota information. + + :param dimension: The name of the dimension associated with the quota. + :type dimension: str + :param scope: The scope at which the quota is applied. Possible values + include: 'Workspace', 'Subscription' + :type scope: str or ~quantum.models.DimensionScope + :param provider_id: The unique identifier for the provider. + :type provider_id: str + :param utilization: The amount of the usage that has been applied for the + current period. + :type utilization: float + :param holds: The amount of the usage that has been reserved but not + applied for the current period. + :type holds: float + :param limit: The maximum amount of usage allowed for the current period. + :type limit: float + :param period: The time period in which the quota's underlying meter is + accumulated. Based on calendar year. 'None' is used for concurrent quotas. + Possible values include: 'None', 'Monthly' + :type period: str or ~quantum.models.MeterPeriod + """ + + _attribute_map = { + 'dimension': {'key': 'dimension', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'provider_id': {'key': 'providerId', 'type': 'str'}, + 'utilization': {'key': 'utilization', 'type': 'float'}, + 'holds': {'key': 'holds', 'type': 'float'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'period': {'key': 'period', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Quota, self).__init__(**kwargs) + self.dimension = kwargs.get('dimension', None) + self.scope = kwargs.get('scope', None) + self.provider_id = kwargs.get('provider_id', None) + self.utilization = kwargs.get('utilization', None) + self.holds = kwargs.get('holds', None) + self.limit = kwargs.get('limit', None) + self.period = kwargs.get('period', None) diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/quota_paged.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/quota_paged.py new file mode 100644 index 00000000000..192f6c22637 --- /dev/null +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/quota_paged.py @@ -0,0 +1,27 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class QuotaPaged(Paged): + """ + A paging container for iterating over a list of :class:`Quota ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Quota]'} + } + + def __init__(self, *args, **kwargs): + + super(QuotaPaged, self).__init__(*args, **kwargs) diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/quota_py3.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/quota_py3.py new file mode 100644 index 00000000000..f9e3392c725 --- /dev/null +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/quota_py3.py @@ -0,0 +1,57 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Quota(Model): + """Quota information. + + :param dimension: The name of the dimension associated with the quota. + :type dimension: str + :param scope: The scope at which the quota is applied. Possible values + include: 'Workspace', 'Subscription' + :type scope: str or ~quantum.models.DimensionScope + :param provider_id: The unique identifier for the provider. + :type provider_id: str + :param utilization: The amount of the usage that has been applied for the + current period. + :type utilization: float + :param holds: The amount of the usage that has been reserved but not + applied for the current period. + :type holds: float + :param limit: The maximum amount of usage allowed for the current period. + :type limit: float + :param period: The time period in which the quota's underlying meter is + accumulated. Based on calendar year. 'None' is used for concurrent quotas. + Possible values include: 'None', 'Monthly' + :type period: str or ~quantum.models.MeterPeriod + """ + + _attribute_map = { + 'dimension': {'key': 'dimension', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'provider_id': {'key': 'providerId', 'type': 'str'}, + 'utilization': {'key': 'utilization', 'type': 'float'}, + 'holds': {'key': 'holds', 'type': 'float'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'period': {'key': 'period', 'type': 'str'}, + } + + def __init__(self, *, dimension: str=None, scope=None, provider_id: str=None, utilization: float=None, holds: float=None, limit: float=None, period=None, **kwargs) -> None: + super(Quota, self).__init__(**kwargs) + self.dimension = dimension + self.scope = scope + self.provider_id = provider_id + self.utilization = utilization + self.holds = holds + self.limit = limit + self.period = period diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/rest_error.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/rest_error.py index f50e5f7e52b..acbc13ce327 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/rest_error.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/rest_error.py @@ -17,7 +17,7 @@ class RestError(Model): """Error information returned by the API. :param error: - :type error: ~azure.quantum.models.ErrorData + :type error: ~quantum.models.ErrorData """ _attribute_map = { diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/rest_error_py3.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/rest_error_py3.py index f39b8fcf019..931ab9c881c 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/rest_error_py3.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/rest_error_py3.py @@ -17,7 +17,7 @@ class RestError(Model): """Error information returned by the API. :param error: - :type error: ~azure.quantum.models.ErrorData + :type error: ~quantum.models.ErrorData """ _attribute_map = { diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/target_status.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/target_status.py index a97e8d6a373..e983aef1bf8 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/target_status.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/target_status.py @@ -22,8 +22,7 @@ class TargetStatus(Model): :vartype id: str :ivar current_availability: Target availability. Possible values include: 'Available', 'Degraded', 'Unavailable' - :vartype current_availability: str or - ~azure.quantum.models.TargetAvailability + :vartype current_availability: str or ~quantum.models.TargetAvailability :ivar average_queue_time: Average queue time in seconds. :vartype average_queue_time: long :ivar status_page: A page with detailed status of the provider. diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/target_status_py3.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/target_status_py3.py index 1313de7a8ed..cb6274e2076 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/target_status_py3.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/models/target_status_py3.py @@ -22,8 +22,7 @@ class TargetStatus(Model): :vartype id: str :ivar current_availability: Target availability. Possible values include: 'Available', 'Degraded', 'Unavailable' - :vartype current_availability: str or - ~azure.quantum.models.TargetAvailability + :vartype current_availability: str or ~quantum.models.TargetAvailability :ivar average_queue_time: Average queue time in seconds. :vartype average_queue_time: long :ivar status_page: A page with detailed status of the provider. diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/__init__.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/__init__.py index 6f7c5a52eae..86281dc0138 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/__init__.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/__init__.py @@ -12,9 +12,11 @@ from .jobs_operations import JobsOperations from .providers_operations import ProvidersOperations from .storage_operations import StorageOperations +from .quotas_operations import QuotasOperations __all__ = [ 'JobsOperations', 'ProvidersOperations', 'StorageOperations', + 'QuotasOperations', ] diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/jobs_operations.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/jobs_operations.py index a0d88ec04ad..3e4f6cb63f8 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/jobs_operations.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/jobs_operations.py @@ -45,8 +45,7 @@ def list( :param operation_config: :ref:`Operation configuration overrides`. :return: An iterator like instance of JobDetails - :rtype: - ~azure.quantum.models.JobDetailsPaged[~azure.quantum.models.JobDetails] + :rtype: ~quantum.models.JobDetailsPaged[~quantum.models.JobDetails] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): @@ -112,10 +111,10 @@ def get( :param operation_config: :ref:`Operation configuration overrides`. :return: JobDetails or ClientRawResponse if raw=true - :rtype: ~azure.quantum.models.JobDetails or + :rtype: ~quantum.models.JobDetails or ~msrest.pipeline.ClientRawResponse :raises: - :class:`RestErrorException` + :class:`RestErrorException` """ # Construct URL url = self.get.metadata['url'] @@ -166,17 +165,17 @@ def create( :param job_id: Id of the job. :type job_id: str :param job: The complete metadata of the job to submit. - :type job: ~azure.quantum.models.JobDetails + :type job: ~quantum.models.JobDetails :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. :return: JobDetails or ClientRawResponse if raw=true - :rtype: ~azure.quantum.models.JobDetails or + :rtype: ~quantum.models.JobDetails or ~msrest.pipeline.ClientRawResponse :raises: - :class:`RestErrorException` + :class:`RestErrorException` """ # Construct URL url = self.create.metadata['url'] @@ -240,7 +239,7 @@ def cancel( :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: - :class:`RestErrorException` + :class:`RestErrorException` """ # Construct URL url = self.cancel.metadata['url'] diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/providers_operations.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/providers_operations.py index 0835a2dd073..8d91ae768a8 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/providers_operations.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/providers_operations.py @@ -45,9 +45,9 @@ def get_status( overrides`. :return: An iterator like instance of ProviderStatus :rtype: - ~azure.quantum.models.ProviderStatusPaged[~azure.quantum.models.ProviderStatus] + ~quantum.models.ProviderStatusPaged[~quantum.models.ProviderStatus] :raises: - :class:`RestErrorException` + :class:`RestErrorException` """ def internal_paging(next_link=None, raw=False): diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/quotas_operations.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/quotas_operations.py new file mode 100644 index 00000000000..8d6474f95b5 --- /dev/null +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/quotas_operations.py @@ -0,0 +1,98 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class QuotasOperations(object): + """QuotasOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List quotas for the given workspace. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Quota + :rtype: ~quantum.models.QuotaPaged[~quantum.models.Quota] + :raises: + :class:`RestErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str'), + 'workspaceName': self._serialize.url("self.config.workspace_name", self.config.workspace_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.RestErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QuotaPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QuotaPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/quotas'} diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/storage_operations.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/storage_operations.py index d3b3cc888e0..b91865f421c 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/storage_operations.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/operations/storage_operations.py @@ -35,28 +35,25 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def sas_uri( - self, container_name, blob_name=None, custom_headers=None, raw=False, **operation_config): + self, blob_details, custom_headers=None, raw=False, **operation_config): """Gets a URL with SAS token for a container/blob in the storage account associated with the workspace. The SAS URL can be used to upload job input and/or download job output. - :param container_name: The container name. - :type container_name: str - :param blob_name: The blob name. - :type blob_name: str + :param blob_details: The details (name and container) of the blob to + store or download data. + :type blob_details: ~quantum.models.BlobDetails :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. :return: SasUriResponse or ClientRawResponse if raw=true - :rtype: ~azure.quantum.models.SasUriResponse or + :rtype: ~quantum.models.SasUriResponse or ~msrest.pipeline.ClientRawResponse :raises: - :class:`RestErrorException` + :class:`RestErrorException` """ - blob_details = models.BlobDetails(container_name=container_name, blob_name=blob_name) - # Construct URL url = self.sas_uri.metadata['url'] path_format_arguments = { diff --git a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/quantum_client.py b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/quantum_client.py index e7a95147b6d..a05f5409813 100644 --- a/src/quantum/azext_quantum/vendored_sdks/azure_quantum/quantum_client.py +++ b/src/quantum/azext_quantum/vendored_sdks/azure_quantum/quantum_client.py @@ -16,6 +16,7 @@ from .operations.jobs_operations import JobsOperations from .operations.providers_operations import ProvidersOperations from .operations.storage_operations import StorageOperations +from .operations.quotas_operations import QuotasOperations from . import models @@ -53,7 +54,7 @@ def __init__( super(QuantumClientConfiguration, self).__init__(base_url) - self.add_user_agent('azure-quantum/{}'.format(VERSION)) + self.add_user_agent('quantumclient/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials @@ -69,11 +70,13 @@ class QuantumClient(SDKClient): :vartype config: QuantumClientConfiguration :ivar jobs: Jobs operations - :vartype jobs: azure.quantum.operations.JobsOperations + :vartype jobs: quantum.operations.JobsOperations :ivar providers: Providers operations - :vartype providers: azure.quantum.operations.ProvidersOperations + :vartype providers: quantum.operations.ProvidersOperations :ivar storage: Storage operations - :vartype storage: azure.quantum.operations.StorageOperations + :vartype storage: quantum.operations.StorageOperations + :ivar quotas: Quotas operations + :vartype quotas: quantum.operations.QuotasOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -105,3 +108,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.storage = StorageOperations( self._client, self.config, self._serialize, self._deserialize) + self.quotas = QuotasOperations( + self._client, self.config, self._serialize, self._deserialize)