Skip to content

Commit

Permalink
CodeGen from PR 13623 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Quota API extension model for Quota RP (New RP providing Capacity RP's quota APIs as ARM extension) (Azure#13623)

* 1.Breaking Change - Removing duplicate autoQuotaIncreaseState from supportTicketAction.
2. Removing state=enabledForPreview.
3. Updating Example.

* Updating Provider name in example.

* Capacity RP Quota APIs for GA

* Adding preview version to stable dir as base files.

* Files from preview version, which will be removed.

* Updating to GA Version.

* 1. Updated reservation version tag to - Microsoft.Capacity/preview/2020-10-01-preview/reservations.json, which matches the previous SDK release.
2. Documentation changes.

* Documentation updates for put and patch request, which includes only ONE quota request, so changing quotas to quota.

* Update documenation for put.

* Doc update.

* Adding -preview tag for GO sdk.

* Updating Go settings for output folder to be -preview.

* Adding preview subdir for GO package.

* Adding preview subdir to Go sdk path.

* Removing tag - tag: package-2020-10-25-preview

* introduce a new tag to keep the go sdk package unchanged

* Revert "introduce a new tag to keep the go sdk package unchanged"

This reverts commit 8f58d3451e9ae5a4746d2a5883911f14ca261f1b.

* Adding Azure CLI readme configuration.

* Updating the ReadMe configurations.

* Updating readme.md

* Removing duplicate cli: tag.

* Fixing build issues.

* Removing Parameter alias.

* cli config changes.

* Updating the package name to reservation.

* Updates - removin .az.md.

* Updating Example names to be unique for Get PUT

* Adding operations and python-sdk-output-folder.

* Updates.

* Removing unused file.

* Revert "Removing unused file."

This reverts commit 4f763bdb14240a3f1ba8e1dce6c7f0b643ee6a9e.

* Revert "Revert "Removing unused file.""

This reverts commit 60c520e5b50bc13c42d8227624f32031c7ca7694.

* Add reference to python readme.md file.

* Adding python readme file.

* Adding Operations for test-scenario

* Adding split

* Disabling few operation, which is not needed.

* Removing split for Operation

* Disabling the reservation Operations.

* Disable reservation operations.

* Revert "Disable reservation operations."

This reverts commit d98cbcbafeb855395f9de45292dfc9db2f5aea9d.

* Adding client-subscription-bound: false

* Adding Quota Extension Model APIs and examples.

* Updating Batch Example.

* Updatng Quota Dimensions model.

* Model Updates.

* Updated examples and backup.

* Updating examples to flat file structure.

* Updating data model for quotaMetaData.

* Removing backup files.

* Updating quota,json.

* Fixing examples.

* Fixing enum definition.

* Addind systemData to response.

* Updated atch example.

* Remove blank line.

* Fixing path for types.json

* Running prettier

* Removing systemData.

* Updating readonly falg.

* Changing API version to preview-2021-03-15 to address INCONSISTENT_API_VERSION.

* Updating RP name to Quota

* Updating API version to 2021-03-15-preview

* Adding other SDKs build configuration

* Updating name to Quota.

* Updating API version - 2021-03-15-preview to 2021-03-15.
To address INCONSISTENT_API_VERSION

* Updating and adding version to stable and preview.

* Updates to config.

* Adding Ruby to config.

* Config Updates.

* Update

* Update.

* Adding supression.
Fix it later as needed.

* Updating for warnings.

* Prettier check fix.

* Updating build settings.

* Temp fix for permission issue. Pointing to existing reservations dir.
Change it back to -
  output-folder: $(csharp-sdks-folder)/quota/Microsoft.Azure.Management.Quota/src/Generated

* fixing readme.md.

* Removing conflict with reservation.

* setting -preview to default.

* remove -preview tag.

* Spliting variable path APIs and fixed path APIS.

* Spliting the extension and non extension APIs.

* Prettier fix.

* Fixing examples.

* Running prettier.

* Adding definion to duplicate file.

* Adding definitios.

* Reference to new file.

* pdating to stable version.

* Removing preview version files.

* Removing Preview version from readme.md.

* Removing preview version.

* Removing Preview version.

* Updating Batch Sample.

* Adding rescourceQuery and resourceQueryUri to quota dimensions.

* Removing resourceQueryUri.

* Remove quotaMetadata API and examples.

* Add update for metadata API and preview version.

* Adding Preview version API.

* Preview version.

* Updating preview version.

* Updating Preview version.

* Adding resourceUsagesApiTemplate to get resource usages.

* Adding resourceUsagesApiTemplate.

* run Prettier.

* Adding resourceUsagesApiTemplate to stable version.

* Updating example.

* Moving resourceUsagesApiTemplate at resourceType level.

* Prettier check.

* Updating examples.

* Adding Preview version config.

* Copying from master

* Move ResourceQuery at ResourceType level.

* Updating documentation.

* Updating field name to - isQuotaRequestPermitted.
Updating examples to include field - isQuotaRequestPermitted.
Updating build version and directives.

* Changing field name to isQuotaApplicable

* Removing .vscode files.

* Adding isOptional Field for resourceUsagesQuery

* Fixing formatting.

* Adding "resourceUsagesQuery" optional field to example.

* Fixing formatting.

* Ficing formatting.

* Adding new fields for resource query and making it extendable.

* Removing "isOptional": field.

* Updating stable schema.

* Updating examples.

* Fixing examples.

* Updating examples.

* Updating examples to include full resource path in id field.

* Running prettier to fix the formatting.

* Fixing readme files.

* Updating readme.md files.

* Undo changes for Package-lock.json.

* Undo changes to Package.json.

* Documentation update for Quota APIs.

* Removing mdash&;. It didn't like that tag in docs.

* 1. Using common types for ApiVersionParameter.
2. Removing "resourceUsagesApiTemplate" field.
3. Updating examples with full url.

* Removing ref - ApiVersionParameter, as it causing build error.

* Using {scope} to define path.

* Adding scope parameter definition.

* Update API definitions to include {scope} in put and patch.
Updated RP metadata example.

* Updating examples with Azure resource graph query.

* Fixing {scope} path.

* Adding - "x-ms-parameter-location": "method" for scope parameter.

* Adding missing subscriptions/ element to examples.

* Fixing CLI readme.md

* ReadMe.cli.md update.

* Adding Id field in quotaLimits.

* Updating name to match SKU name.

* changed serviceLimitsRequests to quotaLimitsRequests to match the operations.

* Update put/patch responses to 202.

* Updating response code to 202.

* Removing the nested Properties from the put response.

* Apply nested properties, as Model validation failed.

* Revert "Apply nested properties, as Model validation failed."

This reverts commit 88e6f87e36050efb73e63e9f33cd010881bd45e6.

* Revert "Removing the nested Properties from the put response."

This reverts commit c54a20b4b9e39bf63d1b4bb9a04fc8eb00c5148d.

* Updating the Model and patch sample to validate the suggested changes.

* Updating example responses for put and patch

* Running prettier

* Adding "type" : "object" to the schema

* Adding headers for Async operation.

* Fix the location uri.

* Updating Put and Patch APIs examples with async headers.

* Updating Put response to 201 and updating examples.

* 1. Adding type to the Get responses.
2. Include the original request body in response.

* 1. Return Put/Patch response same as the original request body .
2. Updated schema and examples.

* Removing readonly property unit.

* 1. Put id, name, type with all other properties.

* Fxing examples.

* Fixing ML example

* Moving id, name, type to top level. Fixing examples.

* Fixing - Top level properties should be one of name, type, id.

* Fixing Get API examples.

* Updating operations api response.

* Updating the examples and model.

* Fixing id values in put,patch examples.

* Fixing Azure CLI md file.

* Adding top level name property.
Fixing examples.
Removing unused models.

* Removing  "x-ms-azure-resource": true

* Adding top level name property to put and patch examples.

* Fixinf Put response to 202.

* Removing test-scenario from reame.cli.md

* Fixing GO build settings.

Co-authored-by: Arcturus Zhang <dapzhang@microsoft.com>
  • Loading branch information
SDKAuto and ArcturusZhang committed Jun 18, 2021
1 parent fd411ac commit c74f341
Show file tree
Hide file tree
Showing 24 changed files with 3,233 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sdk/quota/azure-mgmt-quota/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Release History

## 0.1.0 (1970-01-01)

* Initial Release
6 changes: 6 additions & 0 deletions sdk/quota/azure-mgmt-quota/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
include azure/mgmt/__init__.py

27 changes: 27 additions & 0 deletions sdk/quota/azure-mgmt-quota/README.md
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-mgmt-quota%2FREADME.png)
8 changes: 8 additions & 0 deletions sdk/quota/azure-mgmt-quota/_meta.json
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": "a6302e8490871f3619de9cd7001fd5f9cba887bf",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/quota/resource-manager/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 --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2",
"readme": "specification/quota/resource-manager/readme.md"
}
1 change: 1 addition & 0 deletions sdk/quota/azure-mgmt-quota/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
1 change: 1 addition & 0 deletions sdk/quota/azure-mgmt-quota/azure/mgmt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
19 changes: 19 additions & 0 deletions sdk/quota/azure-mgmt-quota/azure/mgmt/quota/__init__.py
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 AzureQuotaExtensionAPIConfiguration
from ._azure_quota_extension_api import AzureQuotaExtensionAPI
__all__ = ['AzureQuotaExtensionAPI', 'AzureQuotaExtensionAPIConfiguration']

from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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 AzureQuotaExtensionAPIConfiguration
from .operations import QuotaOperations
from .operations import QuotaRequestStatusOperations
from .operations import QuotaResourceProvidersOperations
from .operations import OperationOperations
from . import models


class AzureQuotaExtensionAPI(SDKClient):
"""Microsoft Azure Quota Resource Provider
:ivar config: Configuration for client.
:vartype config: AzureQuotaExtensionAPIConfiguration
:ivar quota: Quota operations
:vartype quota: azure.mgmt.quota.operations.QuotaOperations
:ivar quota_request_status: QuotaRequestStatus operations
:vartype quota_request_status: azure.mgmt.quota.operations.QuotaRequestStatusOperations
:ivar quota_resource_providers: QuotaResourceProviders operations
:vartype quota_resource_providers: azure.mgmt.quota.operations.QuotaResourceProvidersOperations
:ivar operation: Operation operations
:vartype operation: azure.mgmt.quota.operations.OperationOperations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param str base_url: Service URL
"""

def __init__(
self, credentials, base_url=None):

self.config = AzureQuotaExtensionAPIConfiguration(credentials, base_url)
super(AzureQuotaExtensionAPI, 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 = '2021-03-15-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.quota = QuotaOperations(
self._client, self.config, self._serialize, self._deserialize)
self.quota_request_status = QuotaRequestStatusOperations(
self._client, self.config, self._serialize, self._deserialize)
self.quota_resource_providers = QuotaResourceProvidersOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operation = OperationOperations(
self._client, self.config, self._serialize, self._deserialize)
43 changes: 43 additions & 0 deletions sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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 AzureQuotaExtensionAPIConfiguration(AzureConfiguration):
"""Configuration for AzureQuotaExtensionAPI
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 str base_url: Service URL
"""

def __init__(
self, credentials, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(AzureQuotaExtensionAPIConfiguration, 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-mgmt-quota/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
110 changes: 110 additions & 0 deletions sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# 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 CommonResourceProperties
from ._models_py3 import CreateGenericQuotaRequestParameters
from ._models_py3 import CurrentQuotaLimitBase
from ._models_py3 import ExceptionResponse, ExceptionResponseException
from ._models_py3 import OperationDisplay
from ._models_py3 import OperationResponse
from ._models_py3 import QuotaBucketProperties
from ._models_py3 import QuotaLimitsResponse
from ._models_py3 import QuotaProperties
from ._models_py3 import QuotaRequestDetails
from ._models_py3 import QuotaRequestOneResourceSubmitResponse
from ._models_py3 import QuotaRequestProperties
from ._models_py3 import QuotaRequestSubmitResponse
from ._models_py3 import QuotaRequestSubmitResponse202
from ._models_py3 import QuotaTemplateDetails
from ._models_py3 import QuotaTemplatesDetails
from ._models_py3 import QuotaTypeDimensionInformation
from ._models_py3 import ResourceName
from ._models_py3 import ResourceProviderDimension
from ._models_py3 import ResourceProviderInformation
from ._models_py3 import ResourceProvidersList
from ._models_py3 import ResourceProviderTemplate
from ._models_py3 import ResourceQueryDetails
from ._models_py3 import ServiceError
from ._models_py3 import ServiceErrorDetail
from ._models_py3 import SubRequest
except (SyntaxError, ImportError):
from ._models import CommonResourceProperties
from ._models import CreateGenericQuotaRequestParameters
from ._models import CurrentQuotaLimitBase
from ._models import ExceptionResponse, ExceptionResponseException
from ._models import OperationDisplay
from ._models import OperationResponse
from ._models import QuotaBucketProperties
from ._models import QuotaLimitsResponse
from ._models import QuotaProperties
from ._models import QuotaRequestDetails
from ._models import QuotaRequestOneResourceSubmitResponse
from ._models import QuotaRequestProperties
from ._models import QuotaRequestSubmitResponse
from ._models import QuotaRequestSubmitResponse202
from ._models import QuotaTemplateDetails
from ._models import QuotaTemplatesDetails
from ._models import QuotaTypeDimensionInformation
from ._models import ResourceName
from ._models import ResourceProviderDimension
from ._models import ResourceProviderInformation
from ._models import ResourceProvidersList
from ._models import ResourceProviderTemplate
from ._models import ResourceQueryDetails
from ._models import ServiceError
from ._models import ServiceErrorDetail
from ._models import SubRequest
from ._paged_models import CurrentQuotaLimitBasePaged
from ._paged_models import OperationResponsePaged
from ._paged_models import QuotaRequestDetailsPaged
from ._azure_quota_extension_api_enums import (
ResourceType,
QuotaRequestState,
ResourceQueryType,
ResourceQueryMethod,
)

__all__ = [
'CommonResourceProperties',
'CreateGenericQuotaRequestParameters',
'CurrentQuotaLimitBase',
'ExceptionResponse', 'ExceptionResponseException',
'OperationDisplay',
'OperationResponse',
'QuotaBucketProperties',
'QuotaLimitsResponse',
'QuotaProperties',
'QuotaRequestDetails',
'QuotaRequestOneResourceSubmitResponse',
'QuotaRequestProperties',
'QuotaRequestSubmitResponse',
'QuotaRequestSubmitResponse202',
'QuotaTemplateDetails',
'QuotaTemplatesDetails',
'QuotaTypeDimensionInformation',
'ResourceName',
'ResourceProviderDimension',
'ResourceProviderInformation',
'ResourceProvidersList',
'ResourceProviderTemplate',
'ResourceQueryDetails',
'ServiceError',
'ServiceErrorDetail',
'SubRequest',
'CurrentQuotaLimitBasePaged',
'QuotaRequestDetailsPaged',
'OperationResponsePaged',
'ResourceType',
'QuotaRequestState',
'ResourceQueryType',
'ResourceQueryMethod',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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 enum import Enum


class ResourceType(str, Enum):

standard = "standard"
dedicated = "dedicated"
low_priority = "lowPriority"
shared = "shared"
service_specific = "serviceSpecific"


class QuotaRequestState(str, Enum):

accepted = "Accepted"
invalid = "Invalid"
succeeded = "Succeeded"
failed = "Failed"
in_progress = "InProgress"


class ResourceQueryType(str, Enum):

arg = "ARG"
rest_api = "RestAPI"


class ResourceQueryMethod(str, Enum):

get = "GET"
post = "POST"
Loading

0 comments on commit c74f341

Please sign in to comment.