forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 16339 in Azure/azure-rest-api-specs
[Quantum] Add job cost estimate (Azure#16339) * copy existin api-version * update api-version ref * new feature
- Loading branch information
SDKAuto
committed
Oct 11, 2021
1 parent
3a14782
commit d77abcf
Showing
23 changed files
with
1,793 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Release History | ||
|
||
## 0.1.0 (1970-01-01) | ||
|
||
* Initial Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
include _meta.json | ||
recursive-include tests *.py *.yaml | ||
include *.md | ||
include azure/__init__.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Microsoft Azure SDK for Python | ||
|
||
This is the Microsoft Azure MyService Management Client Library. | ||
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. | ||
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). | ||
|
||
|
||
# Usage | ||
|
||
|
||
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) | ||
|
||
|
||
|
||
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) | ||
Code samples for this package can be found at [MyService Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. | ||
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) | ||
|
||
|
||
# Provide Feedback | ||
|
||
If you encounter any bugs or have suggestions, please file an issue in the | ||
[Issues](https://github.com/Azure/azure-sdk-for-python/issues) | ||
section of the project. | ||
|
||
|
||
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-quantum%2FREADME.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"autorest": "V2", | ||
"use": "@microsoft.azure/autorest.python@~4.0.71", | ||
"commit": "4df4b843dd2692aadd416dd9ede5979610c08be6", | ||
"repository_url": "https://github.com/Azure/azure-rest-api-specs", | ||
"autorest_command": "autorest specification/quantum/data-plane/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk [email protected]/autorest.python@~4.0.71 --version=V2", | ||
"readme": "specification/quantum/data-plane/readme.md" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# 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 ._configuration import QuantumClientConfiguration | ||
from ._quantum_client import QuantumClient | ||
__all__ = ['QuantumClient', 'QuantumClientConfiguration'] | ||
|
||
from .version import VERSION | ||
|
||
__version__ = VERSION | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# 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 msrestazure import AzureConfiguration | ||
|
||
from .version import VERSION | ||
|
||
|
||
class QuantumClientConfiguration(AzureConfiguration): | ||
"""Configuration for QuantumClient | ||
Note that all parameters used to create this instance are saved as instance | ||
attributes. | ||
:param credentials: Credentials needed for the client to connect to Azure. | ||
:type credentials: :mod:`A msrestazure Credentials | ||
object<msrestazure.azure_active_directory>` | ||
:param subscription_id: The Azure subscription ID. This is a | ||
GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) | ||
:type subscription_id: str | ||
:param resource_group_name: Name of an Azure resource group. | ||
:type resource_group_name: str | ||
:param workspace_name: Name of the workspace. | ||
:type workspace_name: str | ||
:param str base_url: Service URL | ||
""" | ||
|
||
def __init__( | ||
self, credentials, subscription_id, resource_group_name, workspace_name, base_url=None): | ||
|
||
if credentials is None: | ||
raise ValueError("Parameter 'credentials' must not be None.") | ||
if subscription_id is None: | ||
raise ValueError("Parameter 'subscription_id' must not be None.") | ||
if resource_group_name is None: | ||
raise ValueError("Parameter 'resource_group_name' must not be None.") | ||
if workspace_name is None: | ||
raise ValueError("Parameter 'workspace_name' must not be None.") | ||
if not base_url: | ||
base_url = 'https://quantum.azure.com' | ||
|
||
super(QuantumClientConfiguration, self).__init__(base_url) | ||
|
||
# Starting Autorest.Python 4.0.64, make connection pool activated by default | ||
self.keep_alive = True | ||
|
||
self.add_user_agent('azure-quantum/{}'.format(VERSION)) | ||
self.add_user_agent('Azure-SDK-For-Python') | ||
|
||
self.credentials = credentials | ||
self.subscription_id = subscription_id | ||
self.resource_group_name = resource_group_name | ||
self.workspace_name = workspace_name |
69 changes: 69 additions & 0 deletions
69
sdk/quantum/azure-quantum/azure/quantum/_quantum_client.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# 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.service_client import SDKClient | ||
from msrest import Serializer, Deserializer | ||
|
||
from ._configuration import QuantumClientConfiguration | ||
from .operations import JobsOperations | ||
from .operations import ProvidersOperations | ||
from .operations import StorageOperations | ||
from .operations import QuotasOperations | ||
from . import models | ||
|
||
|
||
class QuantumClient(SDKClient): | ||
"""Azure Quantum REST API client | ||
:ivar config: Configuration for client. | ||
:vartype config: QuantumClientConfiguration | ||
:ivar jobs: Jobs operations | ||
:vartype jobs: azure.quantum.operations.JobsOperations | ||
:ivar providers: Providers operations | ||
:vartype providers: azure.quantum.operations.ProvidersOperations | ||
:ivar storage: Storage operations | ||
:vartype storage: azure.quantum.operations.StorageOperations | ||
:ivar quotas: Quotas operations | ||
:vartype quotas: azure.quantum.operations.QuotasOperations | ||
:param credentials: Credentials needed for the client to connect to Azure. | ||
:type credentials: :mod:`A msrestazure Credentials | ||
object<msrestazure.azure_active_directory>` | ||
:param subscription_id: The Azure subscription ID. This is a | ||
GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) | ||
:type subscription_id: str | ||
:param resource_group_name: Name of an Azure resource group. | ||
:type resource_group_name: str | ||
:param workspace_name: Name of the workspace. | ||
:type workspace_name: str | ||
:param str base_url: Service URL | ||
""" | ||
|
||
def __init__( | ||
self, credentials, subscription_id, resource_group_name, workspace_name, base_url=None): | ||
|
||
self.config = QuantumClientConfiguration(credentials, subscription_id, resource_group_name, workspace_name, base_url) | ||
super(QuantumClient, self).__init__(self.config.credentials, self.config) | ||
|
||
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} | ||
self.api_version = '2019-11-04-preview' | ||
self._serialize = Serializer(client_models) | ||
self._deserialize = Deserializer(client_models) | ||
|
||
self.jobs = JobsOperations( | ||
self._client, self.config, self._serialize, self._deserialize) | ||
self.providers = ProvidersOperations( | ||
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) |
58 changes: 58 additions & 0 deletions
58
sdk/quantum/azure-quantum/azure/quantum/models/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# 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. | ||
# -------------------------------------------------------------------------- | ||
|
||
try: | ||
from ._models_py3 import BlobDetails | ||
from ._models_py3 import ErrorData | ||
from ._models_py3 import JobDetails | ||
from ._models_py3 import ProviderStatus | ||
from ._models_py3 import Quota | ||
from ._models_py3 import RestError, RestErrorException | ||
from ._models_py3 import SasUriResponse | ||
from ._models_py3 import TargetStatus | ||
except (SyntaxError, ImportError): | ||
from ._models import BlobDetails | ||
from ._models import ErrorData | ||
from ._models import JobDetails | ||
from ._models import ProviderStatus | ||
from ._models import Quota | ||
from ._models import RestError, RestErrorException | ||
from ._models import SasUriResponse | ||
from ._models import TargetStatus | ||
from ._paged_models import JobDetailsPaged | ||
from ._paged_models import ProviderStatusPaged | ||
from ._paged_models import QuotaPaged | ||
from ._quantum_client_enums import ( | ||
JobStatus, | ||
ProviderAvailability, | ||
TargetAvailability, | ||
DimensionScope, | ||
MeterPeriod, | ||
) | ||
|
||
__all__ = [ | ||
'BlobDetails', | ||
'ErrorData', | ||
'JobDetails', | ||
'ProviderStatus', | ||
'Quota', | ||
'RestError', 'RestErrorException', | ||
'SasUriResponse', | ||
'TargetStatus', | ||
'JobDetailsPaged', | ||
'ProviderStatusPaged', | ||
'QuotaPaged', | ||
'JobStatus', | ||
'ProviderAvailability', | ||
'TargetAvailability', | ||
'DimensionScope', | ||
'MeterPeriod', | ||
] |
Oops, something went wrong.