Skip to content

Commit

Permalink
CodeGen from PR 24103 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Release app microsoft.app 2023 04 01 preview (Azure#24103)

* Adds base for updating Microsoft.App from version preview/2022-11-01-preview to version 2023-04-01-preview

* Updates readme

* Updates API version in new specs and examples

* support terminationGracePeriodSeconds (Azure#23476)

* Support SubPath in volume mount and mount options for azure file volume (Azure#23496)

* Support SubPath in volume mount and mount options for azure file volume

* update description

* Add replica/container running state (Azure#23617)

* add replica/container running state

* spell error fix

* add event trigger for Container Jobs 2023-04-01-preview (Azure#23724)

* add event trigger for Container Jobs 2023-04-01-preview

* prettier and avocado fix

---------

Co-authored-by: Taher Darolywala <tdarolywala@microsoft.com>

* Resolve Comments for Event driven jobs (Azure#23729)

* Resolve Comments for Event driven jobs

* change scaling rule to azure-servicebus

* update example

---------

Co-authored-by: Taher Darolywala <tdarolywala@microsoft.com>

* Swagger change for mtls and runningState (Azure#23767)

* 1. Add mtls properties for managed ManagedEnvironment
2. Add running state for Revision

* fix

* Add ContainerApp Start/Stop for 2023-04-01-preview (Azure#23497)

* Add ContainerApp Start/Stop for 2023-04-01-preview

* Fix validation error

* Fix validation error

* Change example to add location in header

* Fix lint error

* Fix lint issue

* Fix lint issue

* Fix lint issue

* Fix lint issue

* Fix lint issue

* Fix lint issue

* Fix lint issue

* Fix lint issue

* Add new source controls properties (Azure#23891)

* Add new source controls properties

* Update examples

* fix examples

* Change event trigger replica properties to executions, add polling in… (Azure#23810)

* Change event trigger replica properties to executions, add polling interval to event trigger, fix typos and descriptions to accommodate both apps and jobs

* Fix validation errors

* code review comments

* Fix formatting errors

* Code review comments

* Add single execution history endpoint, refactor copy paste code for j… (Azure#23816)

* Add single execution history endpoint, refactor copy paste code for jobName and jobExecutionName path parameters

* Fix validation errors from ARM

* Fix validation errors

* Code review comments

* Fix validation error

* code review comments from Anand

* Add springboard properties (Azure#23932)

* Add springboard properties

* CR comments

* Update specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_CreateOrUpdate.json

Co-authored-by: Jitin John <jijohn@microsoft.com>

* Update specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_CreateOrUpdate.json

Co-authored-by: Jitin John <jijohn@microsoft.com>

---------

Co-authored-by: Jitin John <jijohn@microsoft.com>

* Fix Lint issues in ContainerApps.json (Azure#24107)

* Fix lint issue

* Fix format issue

* Fix json format issue

* Fix model validation

* Fix lint error

* fix param (Azure#24166)

Co-authored-by: Chenghui Yu <chenghuiyu@microsoft.com>

---------

Co-authored-by: Zunli Hu <zuh@microsoft.com>
Co-authored-by: njucz <740360112@qq.com>
Co-authored-by: LaylaLiu-gmail <38268900+LaylaLiu-gmail@users.noreply.github.com>
Co-authored-by: Xingjian Wang <79332479+xwang971@users.noreply.github.com>
Co-authored-by: Taher Daroly <41846928+tdaroly@users.noreply.github.com>
Co-authored-by: Taher Darolywala <tdarolywala@microsoft.com>
Co-authored-by: zhenqxuMSFT <zhenqxu@microsoft.com>
Co-authored-by: Zijian-Ju <53360473+Zijian-Ju@users.noreply.github.com>
Co-authored-by: Sanchit Mehta <sanchit.mehta602@gmail.com>
Co-authored-by: trajkobal <108365738+trajkobal@users.noreply.github.com>
Co-authored-by: Ahmed ElSayed <ahmed@elsayed.io>
Co-authored-by: Jitin John <jijohn@microsoft.com>
Co-authored-by: Seris370 <38371667+Seris370@users.noreply.github.com>
Co-authored-by: Chenghui Yu <chenghuiyu@microsoft.com>
  • Loading branch information
15 people committed May 26, 2023
1 parent 873a22d commit 846312f
Show file tree
Hide file tree
Showing 159 changed files with 1,855 additions and 599 deletions.
6 changes: 3 additions & 3 deletions sdk/appcontainers/azure-mgmt-appcontainers/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "3c639105c011765893db51cbb0dda056e34dc994",
"commit": "ea8a5619f5d473e5989252aa15d9173e2339d444",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.4.8",
"@autorest/python@6.4.12",
"@autorest/modelerfour@4.24.3"
],
"autorest_command": "autorest specification/app/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/app/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.4.12 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"readme": "specification/app/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class ContainerAppsAPIClientConfiguration(Configuration): # pylint: disable=too
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-11-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2023-04-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(ContainerAppsAPIClientConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2022-11-01-preview")
api_version: str = kwargs.pop("api_version", "2023-04-01-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
ConnectedEnvironmentsDaprComponentsOperations,
ConnectedEnvironmentsOperations,
ConnectedEnvironmentsStoragesOperations,
ContainerAppsAPIClientOperationsMixin,
ContainerAppsAuthConfigsOperations,
ContainerAppsDiagnosticsOperations,
ContainerAppsOperations,
Expand All @@ -46,7 +47,9 @@
from azure.core.credentials import TokenCredential


class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
class ContainerAppsAPIClient(
ContainerAppsAPIClientOperationsMixin
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""ContainerAppsAPIClient.
:ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations
Expand All @@ -73,10 +76,6 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw
azure.mgmt.appcontainers.operations.ConnectedEnvironmentsStoragesOperations
:ivar container_apps: ContainerAppsOperations operations
:vartype container_apps: azure.mgmt.appcontainers.operations.ContainerAppsOperations
:ivar jobs: JobsOperations operations
:vartype jobs: azure.mgmt.appcontainers.operations.JobsOperations
:ivar jobs_executions: JobsExecutionsOperations operations
:vartype jobs_executions: azure.mgmt.appcontainers.operations.JobsExecutionsOperations
:ivar container_apps_revisions: ContainerAppsRevisionsOperations operations
:vartype container_apps_revisions:
azure.mgmt.appcontainers.operations.ContainerAppsRevisionsOperations
Expand All @@ -94,6 +93,10 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw
azure.mgmt.appcontainers.operations.ManagedEnvironmentsDiagnosticsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.appcontainers.operations.Operations
:ivar jobs: JobsOperations operations
:vartype jobs: azure.mgmt.appcontainers.operations.JobsOperations
:ivar jobs_executions: JobsExecutionsOperations operations
:vartype jobs_executions: azure.mgmt.appcontainers.operations.JobsExecutionsOperations
:ivar managed_environments: ManagedEnvironmentsOperations operations
:vartype managed_environments:
azure.mgmt.appcontainers.operations.ManagedEnvironmentsOperations
Expand All @@ -118,7 +121,7 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw
:type subscription_id: str
: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-11-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2023-04-01-preview". 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
Expand Down Expand Up @@ -161,8 +164,6 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.container_apps = ContainerAppsOperations(self._client, self._config, self._serialize, self._deserialize)
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
self.jobs_executions = JobsExecutionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.container_apps_revisions = ContainerAppsRevisionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand All @@ -179,6 +180,8 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
self.jobs_executions = JobsExecutionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.managed_environments = ManagedEnvironmentsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import List, cast
from abc import ABC
from typing import List, TYPE_CHECKING, cast

from azure.core.pipeline.transport import HttpRequest

from ._configuration import ContainerAppsAPIClientConfiguration

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core import PipelineClient

from ._serialization import Deserializer, Serializer


def _convert_request(request, files=None):
data = request.content if not files else None
Expand All @@ -28,3 +37,12 @@ def _format_url_section(template, **kwargs):
formatted_components = cast(List[str], template.split("/"))
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
template = "/".join(components)


class ContainerAppsAPIClientMixinABC(ABC):
"""DO NOT use this class. It is for internal typing use only."""

_client: "PipelineClient"
_config: ContainerAppsAPIClientConfiguration
_serialize: "Serializer"
_deserialize: "Deserializer"
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 = "3.0.0b1"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class ContainerAppsAPIClientConfiguration(Configuration): # pylint: disable=too
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-11-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2023-04-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(ContainerAppsAPIClientConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2022-11-01-preview")
api_version: str = kwargs.pop("api_version", "2023-04-01-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
ConnectedEnvironmentsDaprComponentsOperations,
ConnectedEnvironmentsOperations,
ConnectedEnvironmentsStoragesOperations,
ContainerAppsAPIClientOperationsMixin,
ContainerAppsAuthConfigsOperations,
ContainerAppsDiagnosticsOperations,
ContainerAppsOperations,
Expand All @@ -46,7 +47,9 @@
from azure.core.credentials_async import AsyncTokenCredential


class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
class ContainerAppsAPIClient(
ContainerAppsAPIClientOperationsMixin
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""ContainerAppsAPIClient.
:ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations
Expand All @@ -73,10 +76,6 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw
azure.mgmt.appcontainers.aio.operations.ConnectedEnvironmentsStoragesOperations
:ivar container_apps: ContainerAppsOperations operations
:vartype container_apps: azure.mgmt.appcontainers.aio.operations.ContainerAppsOperations
:ivar jobs: JobsOperations operations
:vartype jobs: azure.mgmt.appcontainers.aio.operations.JobsOperations
:ivar jobs_executions: JobsExecutionsOperations operations
:vartype jobs_executions: azure.mgmt.appcontainers.aio.operations.JobsExecutionsOperations
:ivar container_apps_revisions: ContainerAppsRevisionsOperations operations
:vartype container_apps_revisions:
azure.mgmt.appcontainers.aio.operations.ContainerAppsRevisionsOperations
Expand All @@ -94,6 +93,10 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw
azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentsDiagnosticsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.appcontainers.aio.operations.Operations
:ivar jobs: JobsOperations operations
:vartype jobs: azure.mgmt.appcontainers.aio.operations.JobsOperations
:ivar jobs_executions: JobsExecutionsOperations operations
:vartype jobs_executions: azure.mgmt.appcontainers.aio.operations.JobsExecutionsOperations
:ivar managed_environments: ManagedEnvironmentsOperations operations
:vartype managed_environments:
azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentsOperations
Expand All @@ -118,7 +121,7 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw
:type subscription_id: str
: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-11-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2023-04-01-preview". 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
Expand Down Expand Up @@ -161,8 +164,6 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.container_apps = ContainerAppsOperations(self._client, self._config, self._serialize, self._deserialize)
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
self.jobs_executions = JobsExecutionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.container_apps_revisions = ContainerAppsRevisionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand All @@ -179,6 +180,8 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
self.jobs_executions = JobsExecutionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.managed_environments = ManagedEnvironmentsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# --------------------------------------------------------------------------
# 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 abc import ABC
from typing import TYPE_CHECKING

from azure.core.pipeline.transport import HttpRequest

from ._configuration import ContainerAppsAPIClientConfiguration

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core import AsyncPipelineClient

from .._serialization import Deserializer, Serializer


class ContainerAppsAPIClientMixinABC(ABC):
"""DO NOT use this class. It is for internal typing use only."""

_client: "AsyncPipelineClient"
_config: ContainerAppsAPIClientConfiguration
_serialize: "Serializer"
_deserialize: "Deserializer"
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations
from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations
from ._container_apps_operations import ContainerAppsOperations
from ._jobs_operations import JobsOperations
from ._jobs_executions_operations import JobsExecutionsOperations
from ._container_apps_revisions_operations import ContainerAppsRevisionsOperations
from ._container_apps_revision_replicas_operations import ContainerAppsRevisionReplicasOperations
from ._container_apps_diagnostics_operations import ContainerAppsDiagnosticsOperations
from ._managed_environment_diagnostics_operations import ManagedEnvironmentDiagnosticsOperations
from ._managed_environments_diagnostics_operations import ManagedEnvironmentsDiagnosticsOperations
from ._operations import Operations
from ._jobs_operations import JobsOperations
from ._jobs_executions_operations import JobsExecutionsOperations
from ._container_apps_api_client_operations import ContainerAppsAPIClientOperationsMixin
from ._managed_environments_operations import ManagedEnvironmentsOperations
from ._certificates_operations import CertificatesOperations
from ._managed_certificates_operations import ManagedCertificatesOperations
Expand All @@ -43,14 +44,15 @@
"ConnectedEnvironmentsDaprComponentsOperations",
"ConnectedEnvironmentsStoragesOperations",
"ContainerAppsOperations",
"JobsOperations",
"JobsExecutionsOperations",
"ContainerAppsRevisionsOperations",
"ContainerAppsRevisionReplicasOperations",
"ContainerAppsDiagnosticsOperations",
"ManagedEnvironmentDiagnosticsOperations",
"ManagedEnvironmentsDiagnosticsOperations",
"Operations",
"JobsOperations",
"JobsExecutionsOperations",
"ContainerAppsAPIClientOperationsMixin",
"ManagedEnvironmentsOperations",
"CertificatesOperations",
"ManagedCertificatesOperations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from ... import models as _models
from ..._vendor import _convert_request
from ...operations._available_workload_profiles_operations import build_get_request
from .._vendor import ContainerAppsAPIClientMixinABC

T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from ... import models as _models
from ..._vendor import _convert_request
from ...operations._billing_meters_operations import build_get_request
from .._vendor import ContainerAppsAPIClientMixinABC

T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse

Expand Down Expand Up @@ -35,6 +36,7 @@
build_list_request,
build_update_request,
)
from .._vendor import ContainerAppsAPIClientMixinABC

T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand Down Expand Up @@ -338,7 +340,7 @@ async def create_or_update(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(certificate_envelope, (IO, bytes)):
if isinstance(certificate_envelope, (IOBase, bytes)):
_content = certificate_envelope
else:
if certificate_envelope is not None:
Expand Down Expand Up @@ -566,7 +568,7 @@ async def update(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(certificate_envelope, (IO, bytes)):
if isinstance(certificate_envelope, (IOBase, bytes)):
_content = certificate_envelope
else:
_json = self._serialize.body(certificate_envelope, "CertificatePatch")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse

Expand Down Expand Up @@ -35,6 +36,7 @@
build_list_request,
build_update_request,
)
from .._vendor import ContainerAppsAPIClientMixinABC

T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand Down Expand Up @@ -338,7 +340,7 @@ async def create_or_update(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(certificate_envelope, (IO, bytes)):
if isinstance(certificate_envelope, (IOBase, bytes)):
_content = certificate_envelope
else:
if certificate_envelope is not None:
Expand Down Expand Up @@ -566,7 +568,7 @@ async def update(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(certificate_envelope, (IO, bytes)):
if isinstance(certificate_envelope, (IOBase, bytes)):
_content = certificate_envelope
else:
_json = self._serialize.body(certificate_envelope, "CertificatePatch")
Expand Down
Loading

0 comments on commit 846312f

Please sign in to comment.