Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-mgmt-appcontainers] [Microsoft.App] add debug endpoint on replica container #7603

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions sdk/appcontainers/azure-mgmt-appcontainers/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "e5404d3e55f885d2cb8fdbff3fd1a03bcfc6bb4c",
"commit": "511b5fde2628fd9e91d08176a7ba70edf66fc631",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.7",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.13.7",
"@autorest/python@6.15.0",
"@autorest/modelerfour@4.27.0"
],
"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.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False",
"autorest_command": "autorest specification/app/resource-manager/readme.md --generate-sample=True --generate-test=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.15.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/app/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,29 @@ class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance-

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param session_pool_name: Name of the session pool. Required.
:type session_pool_name: str
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-11-02-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2024-08-02-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:
api_version: str = kwargs.pop("api_version", "2023-11-02-preview")
def __init__(
self, credential: "TokenCredential", session_pool_name: str, subscription_id: str, **kwargs: Any
) -> None:
api_version: str = kwargs.pop("api_version", "2024-08-02-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if session_pool_name is None:
raise ValueError("Parameter 'session_pool_name' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")

self.credential = credential
self.session_pool_name = session_pool_name
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing_extensions import Self

from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
Expand All @@ -32,20 +33,28 @@
ConnectedEnvironmentsStoragesOperations,
ContainerAppsAPIClientOperationsMixin,
ContainerAppsAuthConfigsOperations,
ContainerAppsBuildsByContainerAppOperations,
ContainerAppsBuildsOperations,
ContainerAppsDiagnosticsOperations,
ContainerAppsOperations,
ContainerAppsPatchesOperations,
ContainerAppsRevisionReplicasOperations,
ContainerAppsRevisionsOperations,
ContainerAppsSessionPoolsOperations,
ContainerAppsSourceControlsOperations,
DaprComponentResiliencyPoliciesOperations,
DaprComponentsOperations,
DaprSubscriptionsOperations,
DotNetComponentsOperations,
FunctionsExtensionOperations,
JavaComponentsOperations,
JobsExecutionsOperations,
JobsOperations,
LogicAppsOperations,
ManagedCertificatesOperations,
ManagedEnvironmentDiagnosticsOperations,
ManagedEnvironmentPrivateEndpointConnectionsOperations,
ManagedEnvironmentPrivateLinkResourcesOperations,
ManagedEnvironmentUsagesOperations,
ManagedEnvironmentsDiagnosticsOperations,
ManagedEnvironmentsOperations,
Expand All @@ -63,7 +72,9 @@
class ContainerAppsAPIClient(
ContainerAppsAPIClientOperationsMixin
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""ContainerAppsAPIClient.
"""Functions is an extension resource to revisions and the api listed is used to proxy the call
from Web RP to the function app's host process, this api is not exposed to users and only Web
RP is allowed to invoke functions extension resource.

:ivar app_resiliency: AppResiliencyOperations operations
:vartype app_resiliency: azure.mgmt.appcontainers.operations.AppResiliencyOperations
Expand Down Expand Up @@ -100,6 +111,16 @@ class ContainerAppsAPIClient(
azure.mgmt.appcontainers.operations.ConnectedEnvironmentsStoragesOperations
:ivar container_apps: ContainerAppsOperations operations
:vartype container_apps: azure.mgmt.appcontainers.operations.ContainerAppsOperations
:ivar container_apps_builds_by_container_app: ContainerAppsBuildsByContainerAppOperations
operations
:vartype container_apps_builds_by_container_app:
azure.mgmt.appcontainers.operations.ContainerAppsBuildsByContainerAppOperations
:ivar container_apps_builds: ContainerAppsBuildsOperations operations
:vartype container_apps_builds:
azure.mgmt.appcontainers.operations.ContainerAppsBuildsOperations
:ivar container_apps_patches: ContainerAppsPatchesOperations operations
:vartype container_apps_patches:
azure.mgmt.appcontainers.operations.ContainerAppsPatchesOperations
:ivar container_apps_revisions: ContainerAppsRevisionsOperations operations
:vartype container_apps_revisions:
azure.mgmt.appcontainers.operations.ContainerAppsRevisionsOperations
Expand All @@ -117,10 +138,18 @@ class ContainerAppsAPIClient(
azure.mgmt.appcontainers.operations.ManagedEnvironmentsDiagnosticsOperations
:ivar jobs: JobsOperations operations
:vartype jobs: azure.mgmt.appcontainers.operations.JobsOperations
:ivar dot_net_components: DotNetComponentsOperations operations
:vartype dot_net_components: azure.mgmt.appcontainers.operations.DotNetComponentsOperations
:ivar functions_extension: FunctionsExtensionOperations operations
:vartype functions_extension: azure.mgmt.appcontainers.operations.FunctionsExtensionOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.appcontainers.operations.Operations
:ivar java_components: JavaComponentsOperations operations
:vartype java_components: azure.mgmt.appcontainers.operations.JavaComponentsOperations
:ivar jobs_executions: JobsExecutionsOperations operations
:vartype jobs_executions: azure.mgmt.appcontainers.operations.JobsExecutionsOperations
:ivar logic_apps: LogicAppsOperations operations
:vartype logic_apps: azure.mgmt.appcontainers.operations.LogicAppsOperations
:ivar managed_environments: ManagedEnvironmentsOperations operations
:vartype managed_environments:
azure.mgmt.appcontainers.operations.ManagedEnvironmentsOperations
Expand All @@ -131,6 +160,14 @@ class ContainerAppsAPIClient(
azure.mgmt.appcontainers.operations.ManagedCertificatesOperations
:ivar namespaces: NamespacesOperations operations
:vartype namespaces: azure.mgmt.appcontainers.operations.NamespacesOperations
:ivar managed_environment_private_endpoint_connections:
ManagedEnvironmentPrivateEndpointConnectionsOperations operations
:vartype managed_environment_private_endpoint_connections:
azure.mgmt.appcontainers.operations.ManagedEnvironmentPrivateEndpointConnectionsOperations
:ivar managed_environment_private_link_resources:
ManagedEnvironmentPrivateLinkResourcesOperations operations
:vartype managed_environment_private_link_resources:
azure.mgmt.appcontainers.operations.ManagedEnvironmentPrivateLinkResourcesOperations
:ivar dapr_component_resiliency_policies: DaprComponentResiliencyPoliciesOperations operations
:vartype dapr_component_resiliency_policies:
azure.mgmt.appcontainers.operations.DaprComponentResiliencyPoliciesOperations
Expand All @@ -141,6 +178,9 @@ class ContainerAppsAPIClient(
:ivar managed_environments_storages: ManagedEnvironmentsStoragesOperations operations
:vartype managed_environments_storages:
azure.mgmt.appcontainers.operations.ManagedEnvironmentsStoragesOperations
:ivar container_apps_session_pools: ContainerAppsSessionPoolsOperations operations
:vartype container_apps_session_pools:
azure.mgmt.appcontainers.operations.ContainerAppsSessionPoolsOperations
:ivar container_apps_source_controls: ContainerAppsSourceControlsOperations operations
:vartype container_apps_source_controls:
azure.mgmt.appcontainers.operations.ContainerAppsSourceControlsOperations
Expand All @@ -149,17 +189,15 @@ class ContainerAppsAPIClient(
:ivar managed_environment_usages: ManagedEnvironmentUsagesOperations operations
:vartype managed_environment_usages:
azure.mgmt.appcontainers.operations.ManagedEnvironmentUsagesOperations
:ivar java_components: JavaComponentsOperations operations
:vartype java_components: azure.mgmt.appcontainers.operations.JavaComponentsOperations
:ivar dot_net_components: DotNetComponentsOperations operations
:vartype dot_net_components: azure.mgmt.appcontainers.operations.DotNetComponentsOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param session_pool_name: Name of the session pool. Required.
:type session_pool_name: str
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
: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 "2023-11-02-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2024-08-02-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 All @@ -169,12 +207,13 @@ class ContainerAppsAPIClient(
def __init__(
self,
credential: "TokenCredential",
session_pool_name: str,
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = ContainerAppsAPIClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
credential=credential, session_pool_name=session_pool_name, subscription_id=subscription_id, **kwargs
)
_policies = kwargs.pop("policies", None)
if _policies is None:
Expand Down Expand Up @@ -227,6 +266,15 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.container_apps = ContainerAppsOperations(self._client, self._config, self._serialize, self._deserialize)
self.container_apps_builds_by_container_app = ContainerAppsBuildsByContainerAppOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.container_apps_builds = ContainerAppsBuildsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.container_apps_patches = ContainerAppsPatchesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.container_apps_revisions = ContainerAppsRevisionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand All @@ -243,8 +291,16 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
self.dot_net_components = DotNetComponentsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.functions_extension = FunctionsExtensionOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.java_components = JavaComponentsOperations(self._client, self._config, self._serialize, self._deserialize)
self.jobs_executions = JobsExecutionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.logic_apps = LogicAppsOperations(self._client, self._config, self._serialize, self._deserialize)
self.managed_environments = ManagedEnvironmentsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand All @@ -253,6 +309,12 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize)
self.managed_environment_private_endpoint_connections = ManagedEnvironmentPrivateEndpointConnectionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.managed_environment_private_link_resources = ManagedEnvironmentPrivateLinkResourcesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.dapr_component_resiliency_policies = DaprComponentResiliencyPoliciesOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand All @@ -263,17 +325,16 @@ def __init__(
self.managed_environments_storages = ManagedEnvironmentsStoragesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.container_apps_session_pools = ContainerAppsSessionPoolsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.container_apps_source_controls = ContainerAppsSourceControlsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize)
self.managed_environment_usages = ManagedEnvironmentUsagesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.java_components = JavaComponentsOperations(self._client, self._config, self._serialize, self._deserialize)
self.dot_net_components = DotNetComponentsOperations(
self._client, self._config, self._serialize, self._deserialize
)

def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
Expand All @@ -300,7 +361,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
def close(self) -> None:
self._client.close()

def __enter__(self) -> "ContainerAppsAPIClient":
def __enter__(self) -> Self:
self._client.__enter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#
# --------------------------------------------------------------------------


# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ def _json_attemp(data):
# context otherwise.
_LOGGER.critical("Wasn't XML not JSON, failing")
raise DeserializationError("XML is invalid") from err
elif content_type.startswith("text/"):
return data_as_str
raise DeserializationError("Cannot deserialize content-type: {}".format(content_type))

@classmethod
Expand Down Expand Up @@ -1441,7 +1443,7 @@ def _deserialize(self, target_obj, data):
elif isinstance(response, type) and issubclass(response, Enum):
return self.deserialize_enum(data, response)

if data is None:
if data is None or data is CoreNull:
return data
try:
attributes = response._attribute_map # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
from abc import ABC
from typing import TYPE_CHECKING

from azure.core.pipeline.transport import HttpRequest

from ._configuration import ContainerAppsAPIClientConfiguration

if TYPE_CHECKING:
Expand All @@ -19,14 +17,6 @@
from ._serialization import Deserializer, Serializer


def _convert_request(request, files=None):
data = request.content if not files else None
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
if files:
request.set_formdata_body(files)
return request


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

Expand Down
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.1.0b1"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,29 @@ class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance-

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param session_pool_name: Name of the session pool. Required.
:type session_pool_name: str
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-11-02-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2024-08-02-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:
api_version: str = kwargs.pop("api_version", "2023-11-02-preview")
def __init__(
self, credential: "AsyncTokenCredential", session_pool_name: str, subscription_id: str, **kwargs: Any
) -> None:
api_version: str = kwargs.pop("api_version", "2024-08-02-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if session_pool_name is None:
raise ValueError("Parameter 'session_pool_name' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")

self.credential = credential
self.session_pool_name = session_pool_name
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
Expand Down
Loading