From d411c30f9ae910c56325b31cf78279f576344df4 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Fri, 24 Jul 2026 22:52:19 +0000 Subject: [PATCH] Configurations: 'specification/chaos/resource-manager/Microsoft.Chaos/Chaos/tspconfig.yaml', SDK Release Type: beta, and CommitSHA: 'dd0a22906855bb0582ef763a37187de5e5605d54' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6615672 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- sdk/chaos/azure-mgmt-chaos/CHANGELOG.md | 47 + sdk/chaos/azure-mgmt-chaos/README.md | 2 +- sdk/chaos/azure-mgmt-chaos/_metadata.json | 9 +- sdk/chaos/azure-mgmt-chaos/api.md | 4656 +++++++++++++++++ sdk/chaos/azure-mgmt-chaos/api.metadata.yml | 3 + .../azure-mgmt-chaos/apiview-properties.json | 48 +- .../azure/mgmt/chaos/_client.py | 22 +- .../azure/mgmt/chaos/_configuration.py | 7 +- .../azure/mgmt/chaos/_patch.py | 1 + .../azure/mgmt/chaos/_utils/model_base.py | 454 +- .../azure/mgmt/chaos/_utils/serialization.py | 138 +- .../azure/mgmt/chaos/_version.py | 2 +- .../azure/mgmt/chaos/aio/_client.py | 22 +- .../azure/mgmt/chaos/aio/_configuration.py | 7 +- .../azure/mgmt/chaos/aio/_patch.py | 1 + .../mgmt/chaos/aio/operations/__init__.py | 6 +- .../mgmt/chaos/aio/operations/_operations.py | 2420 ++++++--- .../azure/mgmt/chaos/aio/operations/_patch.py | 1 + .../azure/mgmt/chaos/models/__init__.py | 26 +- .../azure/mgmt/chaos/models/_enums.py | 44 + .../azure/mgmt/chaos/models/_models.py | 608 ++- .../azure/mgmt/chaos/models/_patch.py | 1 + .../azure/mgmt/chaos/operations/__init__.py | 6 +- .../mgmt/chaos/operations/_operations.py | 2819 +++++++--- .../azure/mgmt/chaos/operations/_patch.py | 1 + .../azure/mgmt/chaos/types.py | 1247 +++++ .../generated_samples/action_versions_get.py | 2 +- .../generated_samples/action_versions_list.py | 2 +- .../generated_samples/actions_get.py | 2 +- .../generated_samples/actions_list.py | 2 +- .../capabilities_create_or_update.py | 2 +- .../generated_samples/capabilities_delete.py | 2 +- .../generated_samples/capabilities_get.py | 2 +- .../generated_samples/capabilities_list.py | 2 +- .../generated_samples/capability_types_get.py | 2 +- .../capability_types_list.py | 2 +- .../connections_create_or_update.py | 52 + .../generated_samples/connections_delete.py | 42 + .../generated_samples/connections_get.py | 43 + .../generated_samples/connections_list_all.py | 43 + .../discovered_resources_get.py | 2 +- .../discovered_resources_list_by_workspace.py | 2 +- .../generated_samples/experiments_cancel.py | 2 +- .../experiments_create_or_update.py | 2 +- .../generated_samples/experiments_delete.py | 2 +- .../experiments_execution_details.py | 2 +- .../generated_samples/experiments_get.py | 2 +- .../experiments_get_execution.py | 2 +- .../generated_samples/experiments_list.py | 2 +- .../generated_samples/experiments_list_all.py | 2 +- .../experiments_list_all_executions.py | 2 +- .../generated_samples/experiments_start.py | 2 +- .../generated_samples/experiments_update.py | 2 +- .../operation_statuses_get.py | 2 +- .../generated_samples/operations_list.py | 2 +- ...ate_or_update_a_private_access_resource.py | 2 +- ...ess_resource_with_public_network_access.py | 2 +- .../private_accesses_delete.py | 2 +- ...ses_delete_aprivate_endpoint_connection.py | 2 +- ...cesses_get_aprivate_endpoint_connection.py | 2 +- ...esses_get_get_a_private_access_resource.py | 2 +- ...e_access_resource_with_private_endpoint.py | 2 +- ...ate_accesses_get_private_link_resources.py | 2 +- .../private_accesses_list.py | 2 +- .../private_accesses_list_all.py | 2 +- ...esses_list_private_endpoint_connections.py | 2 +- .../private_accesses_update.py | 2 +- ...cenario_configurations_create_or_update.py | 20 +- ...ns_create_or_update_with_physical_zones.py | 16 +- .../scenario_configurations_delete.py | 2 +- .../scenario_configurations_execute.py | 7 +- ...configurations_fix_resource_permissions.py | 2 +- .../scenario_configurations_get.py | 2 +- .../scenario_configurations_list_all.py | 2 +- .../scenario_configurations_validate.py | 2 +- .../generated_samples/scenario_runs_cancel.py | 7 +- .../generated_samples/scenario_runs_get.py | 2 +- .../scenario_runs_list_all.py | 2 +- .../scenarios_create_or_update.py | 2 +- .../generated_samples/scenarios_delete.py | 2 +- .../generated_samples/scenarios_get.py | 2 +- .../generated_samples/scenarios_list_all.py | 2 +- .../generated_samples/target_types_get.py | 2 +- .../generated_samples/target_types_list.py | 2 +- .../targets_create_or_update.py | 2 +- .../generated_samples/targets_delete.py | 2 +- .../generated_samples/targets_get.py | 2 +- .../generated_samples/targets_list.py | 2 +- .../workspaces_create_or_update.py | 2 +- .../generated_samples/workspaces_delete.py | 2 +- ...ommendations.py => workspaces_discover.py} | 6 +- .../generated_samples/workspaces_evaluate.py | 42 + .../generated_samples/workspaces_get.py | 2 +- .../generated_samples/workspaces_list.py | 2 +- .../generated_samples/workspaces_list_all.py | 2 +- .../generated_samples/workspaces_update.py | 2 +- ...chaos_management_connections_operations.py | 91 + ...management_connections_operations_async.py | 92 + ...ment_scenario_configurations_operations.py | 26 +- ...cenario_configurations_operations_async.py | 40 +- ...aos_management_scenario_runs_operations.py | 6 +- ...nagement_scenario_runs_operations_async.py | 16 +- ..._chaos_management_workspaces_operations.py | 15 +- ..._management_workspaces_operations_async.py | 17 +- sdk/chaos/azure-mgmt-chaos/pyproject.toml | 4 +- sdk/chaos/azure-mgmt-chaos/tsp-location.yaml | 2 +- 106 files changed, 11408 insertions(+), 1897 deletions(-) create mode 100644 sdk/chaos/azure-mgmt-chaos/api.md create mode 100644 sdk/chaos/azure-mgmt-chaos/api.metadata.yml create mode 100644 sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/types.py create mode 100644 sdk/chaos/azure-mgmt-chaos/generated_samples/connections_create_or_update.py create mode 100644 sdk/chaos/azure-mgmt-chaos/generated_samples/connections_delete.py create mode 100644 sdk/chaos/azure-mgmt-chaos/generated_samples/connections_get.py create mode 100644 sdk/chaos/azure-mgmt-chaos/generated_samples/connections_list_all.py rename sdk/chaos/azure-mgmt-chaos/generated_samples/{workspaces_refresh_recommendations.py => workspaces_discover.py} (87%) create mode 100644 sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_evaluate.py create mode 100644 sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_connections_operations.py create mode 100644 sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_connections_operations_async.py diff --git a/sdk/chaos/azure-mgmt-chaos/CHANGELOG.md b/sdk/chaos/azure-mgmt-chaos/CHANGELOG.md index a0fddfd0ef6b..3d2e41e833d4 100644 --- a/sdk/chaos/azure-mgmt-chaos/CHANGELOG.md +++ b/sdk/chaos/azure-mgmt-chaos/CHANGELOG.md @@ -1,5 +1,52 @@ # Release History +## 3.0.0b2 (2026-07-24) + +### Features Added + + - Client `ChaosManagementClient` added operation group `connections` + - Model `PermissionError` added property `error_message` + - Model `ScenarioConfigurationProperties` added property `resource_targeting` + - Model `ScenarioRunProperties` added property `excluded_resources` + - Model `ScenarioRunProperties` added property `resource_snapshot_id` + - Model `ValidationProperties` added property `excluded_resources` + - Model `ValidationProperties` added property `resources` + - Model `WorkspaceEvaluationProperties` added property `num_templates_evaluated_cancelled` + - Model `WorkspaceEvaluationProperties` added property `num_templates_evaluated_failed` + - Model `WorkspaceEvaluationProperties` added property `num_templates_evaluated_succeeded` + - Model `WorkspaceEvaluationProperties` added property `num_templates_to_evaluate` + - Model `WorkspaceEvaluationProperties` added property `resource_snapshot_id` + - Added model `Connection` + - Added enum `ConnectionKind` + - Added model `ConnectionProperties` + - Added enum `ConnectionStatus` + - Added model `ResourceTargeting` + - Added model `ResourceTargetingCriteria` + - Added model `TemplateEvaluationResultItem` + - Added model `WorkspaceDiscovery` + - Added model `WorkspaceDiscoveryProperties` + - Added enum `WorkspaceDiscoveryStatus` + - Model `ScenarioConfigurationsOperations` added method `begin_execute` + - Model `ScenarioRunsOperations` added method `begin_cancel` + - Model `WorkspacesOperations` added method `begin_discover` + - Model `WorkspacesOperations` added method `begin_evaluate` + - Added operation group `ConnectionsOperations` + +### Breaking Changes + + - Model `ScenarioConfigurationProperties` deleted or renamed its instance variable `exclusions` + - Model `ScenarioConfigurationProperties` deleted or renamed its instance variable `filters` + - Model `WorkspaceEvaluationProperties` deleted or renamed its instance variable `num_scenarios_evaluated_cancelled` + - Model `WorkspaceEvaluationProperties` deleted or renamed its instance variable `num_scenarios_evaluated_failed` + - Model `WorkspaceEvaluationProperties` deleted or renamed its instance variable `num_scenarios_evaluated_succeeded` + - Model `WorkspaceEvaluationProperties` deleted or renamed its instance variable `num_scenarios_to_evaluate` + - Deleted or renamed model `ConfigurationExclusions` + - Deleted or renamed model `ConfigurationFilters` + - Deleted or renamed model `ScenarioEvaluationResultItem` + - Deleted or renamed method `ScenarioConfigurationsOperations.execute` + - Deleted or renamed method `ScenarioRunsOperations.cancel` + - Deleted or renamed method `WorkspacesOperations.begin_refresh_recommendations` + ## 3.0.0b1 (2026-05-06) ### Features Added diff --git a/sdk/chaos/azure-mgmt-chaos/README.md b/sdk/chaos/azure-mgmt-chaos/README.md index 696eabbfe567..cea08bc135bc 100644 --- a/sdk/chaos/azure-mgmt-chaos/README.md +++ b/sdk/chaos/azure-mgmt-chaos/README.md @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/chaos/azure-mgmt-chaos/_metadata.json b/sdk/chaos/azure-mgmt-chaos/_metadata.json index fb14511ae5ee..3509d5d9f29b 100644 --- a/sdk/chaos/azure-mgmt-chaos/_metadata.json +++ b/sdk/chaos/azure-mgmt-chaos/_metadata.json @@ -1,10 +1,11 @@ { - "apiVersion": "2026-05-01-preview", + "apiVersion": "2026-08-01-preview", "apiVersions": { - "Microsoft.Chaos": "2026-05-01-preview" + "Microsoft.Chaos": "2026-08-01-preview" }, - "commit": "84d40416fbb3d2416cb7abe7ec82e63c76832963", + "commit": "dd0a22906855bb0582ef763a37187de5e5605d54", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/chaos/resource-manager/Microsoft.Chaos/Chaos", - "emitterVersion": "0.61.3" + "emitterVersion": "0.63.3", + "httpClientPythonVersion": "^0.34.2" } \ No newline at end of file diff --git a/sdk/chaos/azure-mgmt-chaos/api.md b/sdk/chaos/azure-mgmt-chaos/api.md new file mode 100644 index 000000000000..f1c705e0705a --- /dev/null +++ b/sdk/chaos/azure-mgmt-chaos/api.md @@ -0,0 +1,4656 @@ +```py +namespace azure.mgmt.chaos + + class azure.mgmt.chaos.ChaosManagementClient: implements ContextManager + action_versions: ActionVersionsOperations + actions: ActionsOperations + capabilities: CapabilitiesOperations + capability_types: CapabilityTypesOperations + connections: ConnectionsOperations + discovered_resources: DiscoveredResourcesOperations + experiments: ExperimentsOperations + operation_statuses: OperationStatusesOperations + operations: Operations + private_accesses: PrivateAccessesOperations + scenario_configurations: ScenarioConfigurationsOperations + scenario_runs: ScenarioRunsOperations + scenarios: ScenariosOperations + target_types: TargetTypesOperations + targets: TargetsOperations + workspaces: WorkspacesOperations + + def __init__( + self, + credential: TokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.mgmt.chaos.aio + + class azure.mgmt.chaos.aio.ChaosManagementClient: implements AsyncContextManager + action_versions: ActionVersionsOperations + actions: ActionsOperations + capabilities: CapabilitiesOperations + capability_types: CapabilityTypesOperations + connections: ConnectionsOperations + discovered_resources: DiscoveredResourcesOperations + experiments: ExperimentsOperations + operation_statuses: OperationStatusesOperations + operations: Operations + private_accesses: PrivateAccessesOperations + scenario_configurations: ScenarioConfigurationsOperations + scenario_runs: ScenarioRunsOperations + scenarios: ScenariosOperations + target_types: TargetTypesOperations + targets: TargetsOperations + workspaces: WorkspacesOperations + + def __init__( + self, + credential: AsyncTokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.mgmt.chaos.aio.operations + + class azure.mgmt.chaos.aio.operations.ActionVersionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'location', 'action_name', 'version_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def get( + self, + location: str, + action_name: str, + version_name: str, + **kwargs: Any + ) -> ActionVersion: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'location', 'action_name', 'continuation_token_parameter', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list( + self, + location: str, + action_name: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[ActionVersion]: ... + + + class azure.mgmt.chaos.aio.operations.ActionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'location', 'action_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def get( + self, + location: str, + action_name: str, + **kwargs: Any + ) -> Action: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'location', 'continuation_token_parameter', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list( + self, + location: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Action]: ... + + + class azure.mgmt.chaos.aio.operations.CapabilitiesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + capability_name: str, + resource: Capability, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Capability: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + capability_name: str, + resource: Capability, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Capability: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + capability_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Capability: ... + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + capability_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + capability_name: str, + **kwargs: Any + ) -> Capability: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Capability]: ... + + + class azure.mgmt.chaos.aio.operations.CapabilityTypesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + location: str, + target_type_name: str, + capability_type_name: str, + **kwargs: Any + ) -> CapabilityType: ... + + @distributed_trace + def list( + self, + location: str, + target_type_name: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[CapabilityType]: ... + + + class azure.mgmt.chaos.aio.operations.ConnectionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + resource: Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Connection: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + resource: Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Connection: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Connection: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-08-01-preview', params_added_on={'2026-08-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'connection_name']}, api_versions_list=['2026-08-01-preview']) + async def delete( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-08-01-preview', params_added_on={'2026-08-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'connection_name', 'accept']}, api_versions_list=['2026-08-01-preview']) + async def get( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + **kwargs: Any + ) -> Connection: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-08-01-preview', params_added_on={'2026-08-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'accept']}, api_versions_list=['2026-08-01-preview']) + def list_all( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Connection]: ... + + + class azure.mgmt.chaos.aio.operations.DiscoveredResourcesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'discovered_resource_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def get( + self, + resource_group_name: str, + workspace_name: str, + discovered_resource_name: str, + **kwargs: Any + ) -> DiscoveredResource: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list_by_workspace( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> AsyncItemPaged[DiscoveredResource]: ... + + + class azure.mgmt.chaos.aio.operations.ExperimentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def begin_cancel( + self, + resource_group_name: str, + experiment_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + experiment_name: str, + resource: Experiment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Experiment]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + experiment_name: str, + resource: Experiment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Experiment]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + experiment_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Experiment]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + experiment_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def begin_start( + self, + resource_group_name: str, + experiment_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + experiment_name: str, + properties: ExperimentUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Experiment]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + experiment_name: str, + properties: ExperimentUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Experiment]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + experiment_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Experiment]: ... + + @distributed_trace_async + async def execution_details( + self, + resource_group_name: str, + experiment_name: str, + execution_id: str, + **kwargs: Any + ) -> ExperimentExecutionDetails: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + experiment_name: str, + **kwargs: Any + ) -> Experiment: ... + + @distributed_trace_async + async def get_execution( + self, + resource_group_name: str, + experiment_name: str, + execution_id: str, + **kwargs: Any + ) -> ExperimentExecution: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + *, + continuation_token_parameter: Optional[str] = ..., + running: Optional[bool] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Experiment]: ... + + @distributed_trace + def list_all( + self, + *, + continuation_token_parameter: Optional[str] = ..., + running: Optional[bool] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Experiment]: ... + + @distributed_trace + def list_all_executions( + self, + resource_group_name: str, + experiment_name: str, + **kwargs: Any + ) -> AsyncItemPaged[ExperimentExecution]: ... + + + class azure.mgmt.chaos.aio.operations.OperationStatusesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + location: str, + operation_id: str, + **kwargs: Any + ) -> OperationStatusResult: ... + + + class azure.mgmt.chaos.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list_all(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + + class azure.mgmt.chaos.aio.operations.PrivateAccessesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + private_access_name: str, + resource: PrivateAccess, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateAccess]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + private_access_name: str, + resource: PrivateAccess, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateAccess]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + private_access_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateAccess]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'private_access_name']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def begin_delete( + self, + resource_group_name: str, + private_access_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'private_access_name', 'private_endpoint_connection_name']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def begin_delete_a_private_endpoint_connection( + self, + resource_group_name: str, + private_access_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + private_access_name: str, + properties: PrivateAccessPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateAccess]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + private_access_name: str, + properties: PrivateAccessPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateAccess]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + private_access_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateAccess]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'private_access_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def get( + self, + resource_group_name: str, + private_access_name: str, + **kwargs: Any + ) -> PrivateAccess: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'private_access_name', 'private_endpoint_connection_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def get_a_private_endpoint_connection( + self, + resource_group_name: str, + private_access_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> PrivateEndpointConnection: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'private_access_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def get_private_link_resources( + self, + resource_group_name: str, + private_access_name: str, + **kwargs: Any + ) -> PrivateLinkResourceListResult: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'continuation_token_parameter', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list( + self, + resource_group_name: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[PrivateAccess]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'continuation_token_parameter', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list_all( + self, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[PrivateAccess]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'private_access_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list_private_endpoint_connections( + self, + resource_group_name: str, + private_access_name: str, + **kwargs: Any + ) -> AsyncItemPaged[PrivateEndpointConnection]: ... + + + class azure.mgmt.chaos.aio.operations.ScenarioConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + resource: ScenarioConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ScenarioConfiguration]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + resource: ScenarioConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ScenarioConfiguration]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ScenarioConfiguration]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'scenario_configuration_name']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def begin_delete( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'scenario_configuration_name']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def begin_execute( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + **kwargs: Any + ) -> AsyncLROPoller[ScenarioRun]: ... + + @overload + async def begin_fix_resource_permissions( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + body: Optional[FixResourcePermissionsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PermissionsFix]: ... + + @overload + async def begin_fix_resource_permissions( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + body: Optional[FixResourcePermissionsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PermissionsFix]: ... + + @overload + async def begin_fix_resource_permissions( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PermissionsFix]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'scenario_configuration_name']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def begin_validate( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + **kwargs: Any + ) -> AsyncLROPoller[Validation]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'scenario_configuration_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def get( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + **kwargs: Any + ) -> ScenarioConfiguration: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list_all( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + **kwargs: Any + ) -> AsyncItemPaged[ScenarioConfiguration]: ... + + + class azure.mgmt.chaos.aio.operations.ScenarioRunsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'run_id']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def begin_cancel( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + run_id: str, + **kwargs: Any + ) -> AsyncLROPoller[ScenarioRun]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'run_id', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def get( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + run_id: str, + **kwargs: Any + ) -> ScenarioRun: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list_all( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + **kwargs: Any + ) -> AsyncItemPaged[ScenarioRun]: ... + + + class azure.mgmt.chaos.aio.operations.ScenariosOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + resource: Scenario, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Scenario: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + resource: Scenario, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Scenario: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Scenario: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def delete( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def get( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + **kwargs: Any + ) -> Scenario: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list_all( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Scenario]: ... + + + class azure.mgmt.chaos.aio.operations.TargetTypesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + location: str, + target_type_name: str, + **kwargs: Any + ) -> TargetType: ... + + @distributed_trace + def list( + self, + location: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[TargetType]: ... + + + class azure.mgmt.chaos.aio.operations.TargetsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + resource: Target, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Target: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + resource: Target, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Target: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Target: ... + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + **kwargs: Any + ) -> Target: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Target]: ... + + + class azure.mgmt.chaos.aio.operations.WorkspacesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + resource: Workspace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Workspace]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + resource: Workspace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Workspace]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Workspace]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def begin_delete( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-08-01-preview', params_added_on={'2026-08-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name']}, api_versions_list=['2026-08-01-preview']) + async def begin_discover( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> AsyncLROPoller[WorkspaceDiscovery]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-08-01-preview', params_added_on={'2026-08-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name']}, api_versions_list=['2026-08-01-preview']) + async def begin_evaluate( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> AsyncLROPoller[WorkspaceEvaluation]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + workspace_name: str, + properties: WorkspaceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Workspace]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + workspace_name: str, + properties: WorkspaceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Workspace]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + workspace_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Workspace]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + async def get( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> Workspace: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'continuation_token_parameter', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list( + self, + resource_group_name: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Workspace]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'continuation_token_parameter', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list_all( + self, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Workspace]: ... + + +namespace azure.mgmt.chaos.models + + class azure.mgmt.chaos.models.Action(ProxyResource): + id: str + name: str + properties: ActionProperties + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: ActionProperties + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.chaos.models.ActionDependency(_Model): + name: str + on_action_lifecycle: Optional[Union[str, ActionLifecycle]] + type: Union[str, ActionDependencyType] + + @overload + def __init__( + self, + *, + name: str, + on_action_lifecycle: Optional[Union[str, ActionLifecycle]] = ..., + type: Union[str, ActionDependencyType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ActionDependencyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTION = "Action" + + + class azure.mgmt.chaos.models.ActionKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELABLE = "Cancelable" + CONTINUOUS = "Continuous" + DISCRETE = "Discrete" + + + class azure.mgmt.chaos.models.ActionLifecycle(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANY_TERMINAL = "AnyTerminal" + FAILURE = "Failure" + RUNNING = "Running" + SKIPPED = "Skipped" + START = "Start" + SUCCESS = "Success" + + + class azure.mgmt.chaos.models.ActionProperties(_Model): + action_name: Optional[str] + action_type: Optional[Union[str, ActionKind]] + canonical_id: Optional[str] + description: Optional[str] + display_name: Optional[str] + parameters_schema: Optional[Any] + recommended_roles: Optional[list[str]] + supported_target_types: Optional[list[ActionSupportedTargetType]] + version: Optional[str] + + + class azure.mgmt.chaos.models.ActionStatus(_Model): + action_id: Optional[str] + action_name: Optional[str] + end_time: Optional[datetime] + start_time: Optional[datetime] + status: Optional[str] + targets: Optional[list[ExperimentExecutionActionTargetDetailsProperties]] + + + class azure.mgmt.chaos.models.ActionSupportedTargetType(_Model): + required_permissions: Optional[list[str]] + target_type: Optional[str] + + @overload + def __init__( + self, + *, + required_permissions: Optional[list[str]] = ..., + target_type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERNAL = "Internal" + + + class azure.mgmt.chaos.models.ActionVersion(ProxyResource): + id: str + name: str + properties: ActionProperties + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: ActionProperties + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.chaos.models.BranchStatus(_Model): + actions: Optional[list[ActionStatus]] + branch_id: Optional[str] + branch_name: Optional[str] + status: Optional[str] + + + class azure.mgmt.chaos.models.Capability(ProxyResource): + id: str + name: str + properties: Optional[CapabilityProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[CapabilityProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.chaos.models.CapabilityProperties(_Model): + description: Optional[str] + parameters_schema: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + publisher: Optional[str] + target_type: Optional[str] + urn: Optional[str] + + + class azure.mgmt.chaos.models.CapabilityType(ProxyResource): + id: str + name: str + properties: Optional[CapabilityTypeProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[CapabilityTypeProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.chaos.models.CapabilityTypeProperties(_Model): + azure_rbac_actions: Optional[list[str]] + azure_rbac_data_actions: Optional[list[str]] + description: Optional[str] + display_name: Optional[str] + kind: Optional[str] + parameters_schema: Optional[str] + publisher: Optional[str] + required_azure_role_definition_ids: Optional[list[str]] + runtime_properties: Optional[CapabilityTypePropertiesRuntimeProperties] + target_type: Optional[str] + urn: Optional[str] + + + class azure.mgmt.chaos.models.CapabilityTypePropertiesRuntimeProperties(_Model): + kind: Optional[str] + + + class azure.mgmt.chaos.models.ChaosExperimentAction(_Model): + name: str + type: str + + @overload + def __init__( + self, + *, + name: str, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ChaosExperimentBranch(_Model): + actions: list[ChaosExperimentAction] + name: str + + @overload + def __init__( + self, + *, + actions: list[ChaosExperimentAction], + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ChaosExperimentStep(_Model): + branches: list[ChaosExperimentBranch] + name: str + + @overload + def __init__( + self, + *, + branches: list[ChaosExperimentBranch], + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ChaosTargetFilter(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ChaosTargetListSelector(ChaosTargetSelector, discriminator='List'): + filter: ChaosTargetFilter + id: str + targets: list[TargetReference] + type: Literal[SelectorType.LIST] + + @overload + def __init__( + self, + *, + filter: Optional[ChaosTargetFilter] = ..., + id: str, + targets: list[TargetReference] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ChaosTargetQuerySelector(ChaosTargetSelector, discriminator='Query'): + filter: ChaosTargetFilter + id: str + query_string: str + subscription_ids: list[str] + type: Literal[SelectorType.QUERY] + + @overload + def __init__( + self, + *, + filter: Optional[ChaosTargetFilter] = ..., + id: str, + query_string: str, + subscription_ids: list[str] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ChaosTargetSelector(_Model): + filter: Optional[ChaosTargetFilter] + id: str + type: str + + @overload + def __init__( + self, + *, + filter: Optional[ChaosTargetFilter] = ..., + id: str, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ChaosTargetSimpleFilter(ChaosTargetFilter, discriminator='Simple'): + parameters: Optional[ChaosTargetSimpleFilterParameters] + type: Literal[FilterType.SIMPLE] + + @overload + def __init__( + self, + *, + parameters: Optional[ChaosTargetSimpleFilterParameters] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ChaosTargetSimpleFilterParameters(_Model): + zones: Optional[list[str]] + + @overload + def __init__( + self, + *, + zones: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.Connection(ProxyResource): + id: str + name: str + properties: Optional[ConnectionProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[ConnectionProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ConnectionKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AKS_EXTENSION = "AksExtension" + CHAOS_AGENT = "ChaosAgent" + CSFI = "Csfi" + + + class azure.mgmt.chaos.models.ConnectionProperties(_Model): + certificate_issuer: Optional[str] + certificate_subject_name: Optional[str] + data_plane_endpoint: Optional[str] + dsts_principal: Optional[str] + kind: Union[str, ConnectionKind] + principal_id: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + status: Optional[Union[str, ConnectionStatus]] + target_resource_id: str + tenant_id: Optional[str] + + @overload + def __init__( + self, + *, + certificate_issuer: Optional[str] = ..., + certificate_subject_name: Optional[str] = ..., + dsts_principal: Optional[str] = ..., + kind: Union[str, ConnectionKind], + principal_id: Optional[str] = ..., + target_resource_id: str, + tenant_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONNECTED = "Connected" + DISCONNECTED = "Disconnected" + PENDING = "Pending" + REVOKED = "Revoked" + + + class azure.mgmt.chaos.models.ContinuousAction(ChaosExperimentAction, discriminator='continuous'): + duration: timedelta + name: str + parameters: list[KeyValuePair] + selector_id: str + type: Literal[ExperimentActionType.CONTINUOUS] + + @overload + def __init__( + self, + *, + duration: timedelta, + name: str, + parameters: list[KeyValuePair], + selector_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.chaos.models.CustomerDataStorageProperties(_Model): + blob_container_name: Optional[str] + storage_account_resource_id: Optional[str] + + @overload + def __init__( + self, + *, + blob_container_name: Optional[str] = ..., + storage_account_resource_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.DelayAction(ChaosExperimentAction, discriminator='delay'): + duration: timedelta + name: str + type: Literal[ExperimentActionType.DELAY] + + @overload + def __init__( + self, + *, + duration: timedelta, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.DiscoveredResource(ProxyResource): + id: str + name: str + properties: Optional[DiscoveredResourceProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[DiscoveredResourceProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.DiscoveredResourceProperties(_Model): + discovered_at: datetime + fully_qualified_identifier: str + resource_name: str + resource_namespace: str + resource_type: str + scope: str + + + class azure.mgmt.chaos.models.DiscreteAction(ChaosExperimentAction, discriminator='discrete'): + name: str + parameters: list[KeyValuePair] + selector_id: str + type: Literal[ExperimentActionType.DISCRETE] + + @overload + def __init__( + self, + *, + name: str, + parameters: list[KeyValuePair], + selector_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.EntraIdentity(_Model): + object_id: str + tenant_id: str + + + class azure.mgmt.chaos.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.chaos.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.chaos.models.ErrorResponse(_Model): + error: Optional[ErrorDetail] + + @overload + def __init__( + self, + *, + error: Optional[ErrorDetail] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.Experiment(TrackedResource): + id: str + identity: Optional[ManagedServiceIdentity] + location: str + name: str + properties: ExperimentProperties + system_data: SystemData + tags: dict[str, str] + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + location: str, + properties: ExperimentProperties, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.chaos.models.ExperimentActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTINUOUS = "continuous" + DELAY = "delay" + DISCRETE = "discrete" + + + class azure.mgmt.chaos.models.ExperimentExecution(ProxyResource): + id: str + name: str + properties: Optional[ExperimentExecutionProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[ExperimentExecutionProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.chaos.models.ExperimentExecutionActionTargetDetailsError(_Model): + code: Optional[str] + message: Optional[str] + + + class azure.mgmt.chaos.models.ExperimentExecutionActionTargetDetailsProperties(_Model): + error: Optional[ExperimentExecutionActionTargetDetailsError] + status: Optional[str] + target: Optional[str] + target_completed_time: Optional[datetime] + target_failed_time: Optional[datetime] + + + class azure.mgmt.chaos.models.ExperimentExecutionDetails(_Model): + id: Optional[str] + name: Optional[str] + properties: Optional[ExperimentExecutionDetailsProperties] + type: Optional[str] + + + class azure.mgmt.chaos.models.ExperimentExecutionDetailsProperties(_Model): + failure_reason: Optional[str] + last_action_at: Optional[datetime] + provisioning_state: Optional[Union[str, ProvisioningState]] + run_information: Optional[ExperimentExecutionDetailsPropertiesRunInformation] + started_at: Optional[datetime] + status: Optional[str] + stopped_at: Optional[datetime] + + + class azure.mgmt.chaos.models.ExperimentExecutionDetailsPropertiesRunInformation(_Model): + steps: Optional[list[StepStatus]] + + + class azure.mgmt.chaos.models.ExperimentExecutionProperties(_Model): + provisioning_state: Optional[Union[str, ProvisioningState]] + started_at: Optional[datetime] + status: Optional[str] + stopped_at: Optional[datetime] + + + class azure.mgmt.chaos.models.ExperimentProperties(_Model): + customer_data_storage: Optional[CustomerDataStorageProperties] + provisioning_state: Optional[Union[str, ProvisioningState]] + selectors: list[ChaosTargetSelector] + steps: list[ChaosExperimentStep] + + @overload + def __init__( + self, + *, + customer_data_storage: Optional[CustomerDataStorageProperties] = ..., + selectors: list[ChaosTargetSelector], + steps: list[ChaosExperimentStep] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ExperimentUpdate(_Model): + identity: Optional[ManagedServiceIdentity] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ExternalResource(_Model): + resource_id: Optional[str] + + @overload + def __init__( + self, + *, + resource_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.FilterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SIMPLE = "Simple" + + + class azure.mgmt.chaos.models.FixResourcePermissionsRequest(_Model): + what_if: Optional[bool] + + @overload + def __init__( + self, + *, + what_if: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.KeyValuePair(_Model): + key: str + value: str + + @overload + def __init__( + self, + *, + key: str, + value: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ManagedServiceIdentity(_Model): + principal_id: Optional[str] + tenant_id: Optional[str] + type: Union[str, ManagedServiceIdentityType] + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] + + @overload + def __init__( + self, + *, + type: Union[str, ManagedServiceIdentityType], + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + USER_ASSIGNED = "UserAssigned" + + + class azure.mgmt.chaos.models.Operation(_Model): + action_type: Optional[Union[str, ActionType]] + display: Optional[OperationDisplay] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[Union[str, Origin]] + + @overload + def __init__( + self, + *, + display: Optional[OperationDisplay] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + + class azure.mgmt.chaos.models.OperationError(_Model): + error_code: str + error_message: str + + @overload + def __init__( + self, + *, + error_code: str, + error_message: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.OperationStatusResult(_Model): + end_time: Optional[datetime] + error: Optional[ErrorDetail] + id: Optional[str] + name: Optional[str] + operations: Optional[list[OperationStatusResult]] + percent_complete: Optional[float] + resource_id: Optional[str] + start_time: Optional[datetime] + status: str + + @overload + def __init__( + self, + *, + end_time: Optional[datetime] = ..., + error: Optional[ErrorDetail] = ..., + id: Optional[str] = ..., + name: Optional[str] = ..., + operations: Optional[list[OperationStatusResult]] = ..., + percent_complete: Optional[float] = ..., + start_time: Optional[datetime] = ..., + status: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + USER_SYSTEM = "user,system" + + + class azure.mgmt.chaos.models.ParameterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ARRAY = "array" + BOOLEAN = "boolean" + NUMBER = "number" + OBJECT = "object" + STRING = "string" + + + class azure.mgmt.chaos.models.PermissionError(_Model): + error_message: Optional[str] + identity: Optional[EntraIdentity] + missing_permissions: list[str] + recommended_roles: list[str] + required_permissions: list[str] + resource_id: str + + + class azure.mgmt.chaos.models.PermissionsFix(ProxyResource): + id: str + name: str + properties: Optional[PermissionsFixProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[PermissionsFixProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.PermissionsFixProperties(_Model): + completed_at: Optional[datetime] + role_assignments: list[RoleAssignmentResult] + started_at: datetime + state: Union[str, PermissionsFixState] + summary: PermissionsFixSummary + what_if_mode: bool + + + class azure.mgmt.chaos.models.PermissionsFixState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "Failed" + IN_PROGRESS = "InProgress" + NOT_STARTED = "NotStarted" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + SUCCEEDED = "Succeeded" + WHAT_IF_COMPLETED = "WhatIfCompleted" + + + class azure.mgmt.chaos.models.PermissionsFixSummary(_Model): + failed: int + skipped: int + succeeded: int + total_required: int + + + class azure.mgmt.chaos.models.PhysicalToLogicalZoneMapping(_Model): + logical_zone: str + physical_zone: str + + + class azure.mgmt.chaos.models.PrivateAccess(TrackedResource): + id: str + location: str + name: str + properties: PrivateAccessProperties + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + location: str, + properties: PrivateAccessProperties, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.PrivateAccessPatch(_Model): + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.PrivateAccessProperties(_Model): + private_endpoint_connections: Optional[list[PrivateEndpointConnection]] + provisioning_state: Optional[Union[str, ProvisioningState]] + public_network_access: Optional[Union[str, PublicNetworkAccessOption]] + + @overload + def __init__( + self, + *, + public_network_access: Optional[Union[str, PublicNetworkAccessOption]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.PrivateEndpoint(_Model): + id: Optional[str] + + + class azure.mgmt.chaos.models.PrivateEndpointConnection(ProxyResource): + id: str + name: str + properties: Optional[PrivateEndpointConnectionProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[PrivateEndpointConnectionProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.PrivateEndpointConnectionProperties(_Model): + group_ids: Optional[list[str]] + private_endpoint: Optional[PrivateEndpoint] + private_link_service_connection_state: PrivateLinkServiceConnectionState + provisioning_state: Optional[Union[str, ProvisioningState]] + + @overload + def __init__( + self, + *, + private_endpoint: Optional[PrivateEndpoint] = ..., + private_link_service_connection_state: PrivateLinkServiceConnectionState + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPROVED = "Approved" + PENDING = "Pending" + REJECTED = "Rejected" + + + class azure.mgmt.chaos.models.PrivateLinkResource(TrackedResource): + id: str + location: str + name: str + properties: PrivateLinkResourceProperties + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + location: str, + properties: PrivateLinkResourceProperties, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.PrivateLinkResourceListResult(_Model): + next_link: Optional[str] + value: list[PrivateLinkResource] + + @overload + def __init__( + self, + *, + next_link: Optional[str] = ..., + value: list[PrivateLinkResource] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.PrivateLinkResourceProperties(_Model): + group_id: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + required_members: Optional[list[str]] + required_zone_names: Optional[list[str]] + + @overload + def __init__( + self, + *, + required_zone_names: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.PrivateLinkServiceConnectionState(_Model): + actions_required: Optional[str] + description: Optional[str] + status: Optional[Union[str, PrivateEndpointServiceConnectionStatus]] + + @overload + def __init__( + self, + *, + actions_required: Optional[str] = ..., + description: Optional[str] = ..., + status: Optional[Union[str, PrivateEndpointServiceConnectionStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + RUNNING = "Running" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + + class azure.mgmt.chaos.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.chaos.models.PublicNetworkAccessOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.chaos.models.Recommendation(_Model): + evaluation_run_at: Optional[datetime] + recommendation_status: Union[str, RecommendationStatus] + + + class azure.mgmt.chaos.models.RecommendationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATING = "Evaluating" + EVALUATION_CANCELLED = "EvaluationCancelled" + EVALUATION_FAILED = "EvaluationFailed" + NOT_APPLICABLE = "NotApplicable" + NOT_EVALUATED = "NotEvaluated" + RECOMMENDED = "Recommended" + + + class azure.mgmt.chaos.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.chaos.models.ResourceStateError(_Model): + error_code: int + error_message: str + remediation_uri: str + resource_id: str + + + class azure.mgmt.chaos.models.ResourceTargeting(_Model): + exclude: Optional[ResourceTargetingCriteria] + include: Optional[ResourceTargetingCriteria] + + @overload + def __init__( + self, + *, + exclude: Optional[ResourceTargetingCriteria] = ..., + include: Optional[ResourceTargetingCriteria] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ResourceTargetingCriteria(_Model): + locations: Optional[list[str]] + physical_zones: Optional[list[str]] + resources: Optional[list[str]] + tags: Optional[list[KeyValuePair]] + types: Optional[list[str]] + zones: Optional[list[str]] + + @overload + def __init__( + self, + *, + locations: Optional[list[str]] = ..., + physical_zones: Optional[list[str]] = ..., + resources: Optional[list[str]] = ..., + tags: Optional[list[KeyValuePair]] = ..., + types: Optional[list[str]] = ..., + zones: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.RoleAssignmentError(_Model): + code: str + message: str + + + class azure.mgmt.chaos.models.RoleAssignmentResult(_Model): + error: Optional[RoleAssignmentError] + principal_id: str + role_assignment_id: Optional[str] + role_definition_id: str + role_definition_name: str + scope: str + status: Union[str, RoleAssignmentStatus] + target_resource_id: str + + + class azure.mgmt.chaos.models.RoleAssignmentStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "Failed" + PENDING = "Pending" + SKIPPED = "Skipped" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.chaos.models.RunAfter(_Model): + behavior: Optional[Union[str, RunAfterBehavior]] + items_property: list[ActionDependency] + + @overload + def __init__( + self, + *, + behavior: Optional[Union[str, RunAfterBehavior]] = ..., + items_property: list[ActionDependency] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.RunAfterBehavior(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALL = "All" + ANY = "Any" + AT_LEAST_ONE = "AtLeastOne" + + + class azure.mgmt.chaos.models.Scenario(ProxyResource): + id: str + name: str + properties: Optional[ScenarioProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[ScenarioProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ScenarioAction(_Model): + action_id: str + description: Optional[str] + duration: str + external_resource: Optional[ExternalResource] + name: str + parameters: Optional[list[KeyValuePair]] + run_after: Optional[RunAfter] + timeout: Optional[str] + wait_before: Optional[str] + + @overload + def __init__( + self, + *, + action_id: str, + description: Optional[str] = ..., + duration: str, + external_resource: Optional[ExternalResource] = ..., + name: str, + parameters: Optional[list[KeyValuePair]] = ..., + run_after: Optional[RunAfter] = ..., + timeout: Optional[str] = ..., + wait_before: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ScenarioConfiguration(ProxyResource): + id: str + name: str + properties: Optional[ScenarioConfigurationProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[ScenarioConfigurationProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ScenarioConfigurationProperties(_Model): + parameters: Optional[list[KeyValuePair]] + provisioning_state: Optional[Union[str, ProvisioningState]] + resource_targeting: Optional[ResourceTargeting] + scenario_id: str + + @overload + def __init__( + self, + *, + parameters: Optional[list[KeyValuePair]] = ..., + resource_targeting: Optional[ResourceTargeting] = ..., + scenario_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ScenarioErrors(_Model): + error_code: Optional[str] + error_message: Optional[str] + permission: list[PermissionError] + resource: list[ResourceStateError] + + @overload + def __init__( + self, + *, + error_code: Optional[str] = ..., + error_message: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ScenarioParameter(_Model): + default: Optional[str] + description: Optional[str] + name: str + required: Optional[bool] + type: Union[str, ParameterType] + + @overload + def __init__( + self, + *, + default: Optional[str] = ..., + description: Optional[str] = ..., + name: str, + required: Optional[bool] = ..., + type: Union[str, ParameterType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ScenarioProperties(_Model): + actions: list[ScenarioAction] + created_from: Optional[str] + description: Optional[str] + parameters: list[ScenarioParameter] + provisioning_state: Optional[Union[str, ProvisioningState]] + recommendation: Optional[Recommendation] + version: Optional[str] + + @overload + def __init__( + self, + *, + actions: list[ScenarioAction], + description: Optional[str] = ..., + parameters: list[ScenarioParameter] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ScenarioRun(ProxyResource): + id: str + name: str + properties: Optional[ScenarioRunProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[ScenarioRunProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ScenarioRunProperties(_Model): + end_time: Optional[datetime] + errors: Optional[list[OperationError]] + excluded_resources: Optional[list[ScenarioRunResource]] + execution_errors: Optional[ScenarioErrors] + managed_identity_principal_id: str + resource_snapshot_id: Optional[str] + resources: list[ScenarioRunResource] + scenario_configuration_name: str + scenario_name: str + scenario_run_json: Optional[str] + scenario_run_summary: Optional[list[ScenarioRunSummaryAction]] + start_time: datetime + status: Union[str, ScenarioRunState] + workspace_name: str + zone_resolution: Optional[ZoneResolutionInfo] + + + class azure.mgmt.chaos.models.ScenarioRunResource(_Model): + id: str + + + class azure.mgmt.chaos.models.ScenarioRunState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + CANCELING = "Canceling" + CLEANING_UP = "CleaningUp" + FAILED = "Failed" + GENERATING = "Generating" + PREPARING = "Preparing" + QUEUED = "Queued" + RESOLVING = "Resolving" + RUNNING = "Running" + STARTING = "Starting" + SUCCEEDED = "Succeeded" + VALIDATING = "Validating" + VALIDATION_SUCCEEDED = "ValidationSucceeded" + + + class azure.mgmt.chaos.models.ScenarioRunSummaryAction(_Model): + action_urn: str + completed_at: Optional[datetime] + resources: list[ScenarioRunResource] + started_at: Optional[datetime] + state: Union[str, ScenarioSummaryState] + + + class azure.mgmt.chaos.models.ScenarioSummaryState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + CANCELING = "Canceling" + FAILED = "Failed" + FAILING_ON_ERROR = "FailingOnError" + PENDING = "Pending" + RUNNING = "Running" + SKIPPED = "Skipped" + STARTING = "Starting" + STOPPING = "Stopping" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.chaos.models.ScenarioValidationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACCEPTED = "Accepted" + GENERATING = "Generating" + NOT_STARTED = "NotStarted" + NO_RESOLVED_RESOURCES = "NoResolvedResources" + REQUIRES_ATTENTION = "RequiresAttention" + RESOLVING = "Resolving" + SUCCEEDED = "Succeeded" + VALIDATING = "Validating" + + + class azure.mgmt.chaos.models.SelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LIST = "List" + QUERY = "Query" + + + class azure.mgmt.chaos.models.StepStatus(_Model): + branches: Optional[list[BranchStatus]] + status: Optional[str] + step_id: Optional[str] + step_name: Optional[str] + + + class azure.mgmt.chaos.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.Target(ProxyResource): + id: str + location: Optional[str] + name: str + properties: dict[str, Any] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + location: Optional[str] = ..., + properties: dict[str, Any] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.TargetReference(_Model): + id: str + type: Union[str, TargetReferenceType] + + @overload + def __init__( + self, + *, + id: str, + type: Union[str, TargetReferenceType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.TargetReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CHAOS_TARGET = "ChaosTarget" + + + class azure.mgmt.chaos.models.TargetType(ProxyResource): + id: str + name: str + properties: TargetTypeProperties + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: TargetTypeProperties + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.chaos.models.TargetTypeProperties(_Model): + description: Optional[str] + display_name: Optional[str] + properties_schema: Optional[str] + resource_types: Optional[list[str]] + + + class azure.mgmt.chaos.models.TemplateEvaluationResultItem(_Model): + evaluation_result: Union[str, RecommendationStatus] + template_id: Optional[str] + template_name: Optional[str] + + @overload + def __init__( + self, + *, + evaluation_result: Union[str, RecommendationStatus], + template_id: Optional[str] = ..., + template_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.TrackedResource(Resource): + id: str + location: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.UserAssignedIdentity(_Model): + client_id: Optional[str] + principal_id: Optional[str] + + + class azure.mgmt.chaos.models.Validation(ProxyResource): + id: str + name: str + properties: Optional[ValidationProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[ValidationProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ValidationProperties(_Model): + end_time: Optional[datetime] + errors: Optional[list[OperationError]] + excluded_resources: Optional[list[ScenarioRunResource]] + execution_plan_json: Optional[str] + resources: Optional[list[ScenarioRunResource]] + start_time: datetime + status: Union[str, ScenarioValidationState] + validation_errors: Optional[ScenarioErrors] + + @overload + def __init__( + self, + *, + execution_plan_json: Optional[str] = ..., + validation_errors: Optional[ScenarioErrors] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.Workspace(TrackedResource): + id: str + identity: Optional[ManagedServiceIdentity] + location: str + name: str + properties: WorkspaceProperties + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + location: str, + properties: WorkspaceProperties, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.WorkspaceDiscovery(ProxyResource): + id: str + name: str + properties: Optional[WorkspaceDiscoveryProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[WorkspaceDiscoveryProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.WorkspaceDiscoveryProperties(_Model): + end_time: Optional[datetime] + errors: Optional[list[OperationError]] + resource_snapshot_id: Optional[str] + start_time: Optional[datetime] + status: Union[str, WorkspaceDiscoveryStatus] + workspace_id: str + + + class azure.mgmt.chaos.models.WorkspaceDiscoveryStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + FAILED = "Failed" + IN_PROGRESS = "InProgress" + PENDING = "Pending" + QUEUED = "Queued" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.chaos.models.WorkspaceEvaluation(ProxyResource): + id: str + name: str + properties: Optional[WorkspaceEvaluationProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[WorkspaceEvaluationProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.WorkspaceEvaluationProperties(_Model): + end_time: Optional[datetime] + errors: Optional[list[OperationError]] + evaluation_result: Optional[Union[str, RecommendationStatus]] + num_templates_evaluated_cancelled: Optional[int] + num_templates_evaluated_failed: Optional[int] + num_templates_evaluated_succeeded: Optional[int] + num_templates_to_evaluate: Optional[int] + resource_snapshot_id: Optional[str] + results: Optional[list[TemplateEvaluationResultItem]] + start_time: Optional[datetime] + status: Union[str, WorkspaceEvaluationStatus] + workspace_id: str + + + class azure.mgmt.chaos.models.WorkspaceEvaluationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + FAILED = "Failed" + IN_PROGRESS = "InProgress" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + PENDING = "Pending" + QUEUED = "Queued" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.chaos.models.WorkspaceProperties(_Model): + communication_endpoint: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + scopes: list[str] + + @overload + def __init__( + self, + *, + scopes: list[str] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.WorkspaceUpdate(_Model): + identity: Optional[ManagedServiceIdentity] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.chaos.models.ZoneResolutionInfo(_Model): + mode: Union[str, ZoneResolutionMode] + requested_physical_zones: list[str] + subscription_zone_mappings: list[ZoneResolutionMapping] + + + class azure.mgmt.chaos.models.ZoneResolutionMapping(_Model): + subscription_id: str + zone_mappings: list[PhysicalToLogicalZoneMapping] + + + class azure.mgmt.chaos.models.ZoneResolutionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LOGICAL = "logical" + PHYSICAL = "physical" + + +namespace azure.mgmt.chaos.operations + + class azure.mgmt.chaos.operations.ActionVersionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'location', 'action_name', 'version_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def get( + self, + location: str, + action_name: str, + version_name: str, + **kwargs: Any + ) -> ActionVersion: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'location', 'action_name', 'continuation_token_parameter', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list( + self, + location: str, + action_name: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[ActionVersion]: ... + + + class azure.mgmt.chaos.operations.ActionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'location', 'action_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def get( + self, + location: str, + action_name: str, + **kwargs: Any + ) -> Action: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'location', 'continuation_token_parameter', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list( + self, + location: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[Action]: ... + + + class azure.mgmt.chaos.operations.CapabilitiesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + capability_name: str, + resource: Capability, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Capability: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + capability_name: str, + resource: Capability, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Capability: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + capability_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Capability: ... + + @distributed_trace + def delete( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + capability_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + capability_name: str, + **kwargs: Any + ) -> Capability: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[Capability]: ... + + + class azure.mgmt.chaos.operations.CapabilityTypesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + location: str, + target_type_name: str, + capability_type_name: str, + **kwargs: Any + ) -> CapabilityType: ... + + @distributed_trace + def list( + self, + location: str, + target_type_name: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[CapabilityType]: ... + + + class azure.mgmt.chaos.operations.ConnectionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + resource: Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Connection: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + resource: Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Connection: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Connection: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-08-01-preview', params_added_on={'2026-08-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'connection_name']}, api_versions_list=['2026-08-01-preview']) + def delete( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-08-01-preview', params_added_on={'2026-08-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'connection_name', 'accept']}, api_versions_list=['2026-08-01-preview']) + def get( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + **kwargs: Any + ) -> Connection: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-08-01-preview', params_added_on={'2026-08-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'accept']}, api_versions_list=['2026-08-01-preview']) + def list_all( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> ItemPaged[Connection]: ... + + + class azure.mgmt.chaos.operations.DiscoveredResourcesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'discovered_resource_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def get( + self, + resource_group_name: str, + workspace_name: str, + discovered_resource_name: str, + **kwargs: Any + ) -> DiscoveredResource: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list_by_workspace( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> ItemPaged[DiscoveredResource]: ... + + + class azure.mgmt.chaos.operations.ExperimentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def begin_cancel( + self, + resource_group_name: str, + experiment_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + experiment_name: str, + resource: Experiment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Experiment]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + experiment_name: str, + resource: Experiment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Experiment]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + experiment_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Experiment]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + experiment_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def begin_start( + self, + resource_group_name: str, + experiment_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + experiment_name: str, + properties: ExperimentUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Experiment]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + experiment_name: str, + properties: ExperimentUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Experiment]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + experiment_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Experiment]: ... + + @distributed_trace + def execution_details( + self, + resource_group_name: str, + experiment_name: str, + execution_id: str, + **kwargs: Any + ) -> ExperimentExecutionDetails: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + experiment_name: str, + **kwargs: Any + ) -> Experiment: ... + + @distributed_trace + def get_execution( + self, + resource_group_name: str, + experiment_name: str, + execution_id: str, + **kwargs: Any + ) -> ExperimentExecution: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + *, + continuation_token_parameter: Optional[str] = ..., + running: Optional[bool] = ..., + **kwargs: Any + ) -> ItemPaged[Experiment]: ... + + @distributed_trace + def list_all( + self, + *, + continuation_token_parameter: Optional[str] = ..., + running: Optional[bool] = ..., + **kwargs: Any + ) -> ItemPaged[Experiment]: ... + + @distributed_trace + def list_all_executions( + self, + resource_group_name: str, + experiment_name: str, + **kwargs: Any + ) -> ItemPaged[ExperimentExecution]: ... + + + class azure.mgmt.chaos.operations.OperationStatusesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + location: str, + operation_id: str, + **kwargs: Any + ) -> OperationStatusResult: ... + + + class azure.mgmt.chaos.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list_all(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + + class azure.mgmt.chaos.operations.PrivateAccessesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + private_access_name: str, + resource: PrivateAccess, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateAccess]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + private_access_name: str, + resource: PrivateAccess, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateAccess]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + private_access_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateAccess]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'private_access_name']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def begin_delete( + self, + resource_group_name: str, + private_access_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'private_access_name', 'private_endpoint_connection_name']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def begin_delete_a_private_endpoint_connection( + self, + resource_group_name: str, + private_access_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + private_access_name: str, + properties: PrivateAccessPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateAccess]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + private_access_name: str, + properties: PrivateAccessPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateAccess]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + private_access_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateAccess]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'private_access_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def get( + self, + resource_group_name: str, + private_access_name: str, + **kwargs: Any + ) -> PrivateAccess: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'private_access_name', 'private_endpoint_connection_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def get_a_private_endpoint_connection( + self, + resource_group_name: str, + private_access_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> PrivateEndpointConnection: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'private_access_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def get_private_link_resources( + self, + resource_group_name: str, + private_access_name: str, + **kwargs: Any + ) -> PrivateLinkResourceListResult: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'continuation_token_parameter', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list( + self, + resource_group_name: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[PrivateAccess]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'continuation_token_parameter', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list_all( + self, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[PrivateAccess]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'private_access_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list_private_endpoint_connections( + self, + resource_group_name: str, + private_access_name: str, + **kwargs: Any + ) -> ItemPaged[PrivateEndpointConnection]: ... + + + class azure.mgmt.chaos.operations.ScenarioConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + resource: ScenarioConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ScenarioConfiguration]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + resource: ScenarioConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ScenarioConfiguration]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ScenarioConfiguration]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'scenario_configuration_name']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def begin_delete( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'scenario_configuration_name']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def begin_execute( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + **kwargs: Any + ) -> LROPoller[ScenarioRun]: ... + + @overload + def begin_fix_resource_permissions( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + body: Optional[FixResourcePermissionsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PermissionsFix]: ... + + @overload + def begin_fix_resource_permissions( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + body: Optional[FixResourcePermissionsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PermissionsFix]: ... + + @overload + def begin_fix_resource_permissions( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PermissionsFix]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'scenario_configuration_name']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def begin_validate( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + **kwargs: Any + ) -> LROPoller[Validation]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'scenario_configuration_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def get( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + **kwargs: Any + ) -> ScenarioConfiguration: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list_all( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + **kwargs: Any + ) -> ItemPaged[ScenarioConfiguration]: ... + + + class azure.mgmt.chaos.operations.ScenarioRunsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'run_id']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def begin_cancel( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + run_id: str, + **kwargs: Any + ) -> LROPoller[ScenarioRun]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'run_id', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def get( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + run_id: str, + **kwargs: Any + ) -> ScenarioRun: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list_all( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + **kwargs: Any + ) -> ItemPaged[ScenarioRun]: ... + + + class azure.mgmt.chaos.operations.ScenariosOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + resource: Scenario, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Scenario: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + resource: Scenario, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Scenario: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Scenario: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def delete( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'scenario_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def get( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + **kwargs: Any + ) -> Scenario: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list_all( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> ItemPaged[Scenario]: ... + + + class azure.mgmt.chaos.operations.TargetTypesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + location: str, + target_type_name: str, + **kwargs: Any + ) -> TargetType: ... + + @distributed_trace + def list( + self, + location: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[TargetType]: ... + + + class azure.mgmt.chaos.operations.TargetsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + resource: Target, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Target: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + resource: Target, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Target: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Target: ... + + @distributed_trace + def delete( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + target_name: str, + **kwargs: Any + ) -> Target: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + parent_provider_namespace: str, + parent_resource_type: str, + parent_resource_name: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[Target]: ... + + + class azure.mgmt.chaos.operations.WorkspacesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + resource: Workspace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Workspace]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + resource: Workspace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Workspace]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Workspace]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def begin_delete( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-08-01-preview', params_added_on={'2026-08-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name']}, api_versions_list=['2026-08-01-preview']) + def begin_discover( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> LROPoller[WorkspaceDiscovery]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-08-01-preview', params_added_on={'2026-08-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name']}, api_versions_list=['2026-08-01-preview']) + def begin_evaluate( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> LROPoller[WorkspaceEvaluation]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + workspace_name: str, + properties: WorkspaceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Workspace]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + workspace_name: str, + properties: WorkspaceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Workspace]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + workspace_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Workspace]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def get( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> Workspace: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'continuation_token_parameter', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list( + self, + resource_group_name: str, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[Workspace]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'continuation_token_parameter', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) + def list_all( + self, + *, + continuation_token_parameter: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[Workspace]: ... + + +namespace azure.mgmt.chaos.types + + class azure.mgmt.chaos.types.ActionDependency(TypedDict, total=False): + key "name": Required[str] + key "onActionLifecycle": Union[str, ActionLifecycle] + key "type": Required[Union[str, ActionDependencyType]] + name: str + on_action_lifecycle: Union[str, ActionLifecycle] + type: Union[str, ActionDependencyType] + + + class azure.mgmt.chaos.types.Capability(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('CapabilityProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: CapabilityProperties + system_data: SystemData + type: str + + + class azure.mgmt.chaos.types.CapabilityProperties(TypedDict, total=False): + key "description": str + key "parametersSchema": str + key "provisioningState": Union[str, ProvisioningState] + key "publisher": str + key "targetType": str + key "urn": str + description: str + parameters_schema: str + provisioning_state: Union[str, ProvisioningState] + publisher: str + target_type: str + urn: str + + + class azure.mgmt.chaos.types.ChaosExperimentBranch(TypedDict, total=False): + key "actions": Required[list[ChaosExperimentAction]] + key "name": Required[str] + actions: list[ChaosExperimentAction] + name: str + + + class azure.mgmt.chaos.types.ChaosExperimentStep(TypedDict, total=False): + key "branches": Required[list[ChaosExperimentBranch]] + key "name": Required[str] + branches: list[ChaosExperimentBranch] + name: str + + + class azure.mgmt.chaos.types.ChaosTargetFilter(TypedDict, total=False): + key "parameters": ForwardRef('ChaosTargetSimpleFilterParameters', module='types') + key "type": Required[Literal[FilterType.SIMPLE]] + parameters: ChaosTargetSimpleFilterParameters + type: Literal[FilterType.SIMPLE] + + + class azure.mgmt.chaos.types.ChaosTargetListSelector(TypedDict, total=False): + key "filter": ForwardRef('ChaosTargetFilter', module='types') + key "id": Required[str] + key "targets": Required[list[TargetReference]] + key "type": Required[Literal[SelectorType.LIST]] + filter: ChaosTargetFilter + id: str + targets: list[TargetReference] + type: Literal[SelectorType.LIST] + + + class azure.mgmt.chaos.types.ChaosTargetQuerySelector(TypedDict, total=False): + key "filter": ForwardRef('ChaosTargetFilter', module='types') + key "id": Required[str] + key "queryString": Required[str] + key "subscriptionIds": Required[list[str]] + key "type": Required[Literal[SelectorType.QUERY]] + filter: ChaosTargetFilter + id: str + query_string: str + subscription_ids: list[str] + type: Literal[SelectorType.QUERY] + + + class azure.mgmt.chaos.types.ChaosTargetSimpleFilter(TypedDict, total=False): + key "parameters": ForwardRef('ChaosTargetSimpleFilterParameters', module='types') + key "type": Required[Literal[FilterType.SIMPLE]] + parameters: ChaosTargetSimpleFilterParameters + type: Literal[FilterType.SIMPLE] + + + class azure.mgmt.chaos.types.ChaosTargetSimpleFilterParameters(TypedDict, total=False): + zones: list[str] + + + class azure.mgmt.chaos.types.Connection(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('ConnectionProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: ConnectionProperties + system_data: SystemData + type: str + + + class azure.mgmt.chaos.types.ConnectionProperties(TypedDict, total=False): + key "certificateIssuer": str + key "certificateSubjectName": str + key "dataPlaneEndpoint": str + key "dstsPrincipal": str + key "kind": Required[Union[str, ConnectionKind]] + key "principalId": str + key "provisioningState": Union[str, ProvisioningState] + key "status": Union[str, ConnectionStatus] + key "targetResourceId": Required[str] + key "tenantId": str + certificate_issuer: str + certificate_subject_name: str + data_plane_endpoint: str + dsts_principal: str + kind: Union[str, ConnectionKind] + principal_id: str + provisioning_state: Union[str, ProvisioningState] + status: Union[str, ConnectionStatus] + target_resource_id: str + tenant_id: str + + + class azure.mgmt.chaos.types.ContinuousAction(TypedDict, total=False): + key "duration": Required[str] + key "name": Required[str] + key "parameters": Required[list[KeyValuePair]] + key "selectorId": Required[str] + key "type": Required[Literal[ExperimentActionType.CONTINUOUS]] + duration: str + name: str + parameters: list[KeyValuePair] + selector_id: str + type: Literal[ExperimentActionType.CONTINUOUS] + + + class azure.mgmt.chaos.types.CustomerDataStorageProperties(TypedDict, total=False): + key "blobContainerName": str + key "storageAccountResourceId": str + blob_container_name: str + storage_account_resource_id: str + + + class azure.mgmt.chaos.types.DelayAction(TypedDict, total=False): + key "duration": Required[str] + key "name": Required[str] + key "type": Required[Literal[ExperimentActionType.DELAY]] + duration: str + name: str + type: Literal[ExperimentActionType.DELAY] + + + class azure.mgmt.chaos.types.DiscreteAction(TypedDict, total=False): + key "name": Required[str] + key "parameters": Required[list[KeyValuePair]] + key "selectorId": Required[str] + key "type": Required[Literal[ExperimentActionType.DISCRETE]] + name: str + parameters: list[KeyValuePair] + selector_id: str + type: Literal[ExperimentActionType.DISCRETE] + + + class azure.mgmt.chaos.types.Experiment(TrackedResource): + key "id": str + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "location": Required[str] + key "name": str + key "properties": Required[ExperimentProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + identity: ManagedServiceIdentity + location: str + name: str + properties: ExperimentProperties + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.chaos.types.ExperimentActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTINUOUS = "continuous" + DELAY = "delay" + DISCRETE = "discrete" + + + class azure.mgmt.chaos.types.ExperimentProperties(TypedDict, total=False): + key "customerDataStorage": ForwardRef('CustomerDataStorageProperties', module='types') + key "provisioningState": Union[str, ProvisioningState] + key "selectors": Required[list[ChaosTargetSelector]] + key "steps": Required[list[ChaosExperimentStep]] + customer_data_storage: CustomerDataStorageProperties + provisioning_state: Union[str, ProvisioningState] + selectors: list[ChaosTargetSelector] + steps: list[ChaosExperimentStep] + + + class azure.mgmt.chaos.types.ExperimentUpdate(TypedDict, total=False): + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + identity: ManagedServiceIdentity + tags: dict[str, str] + + + class azure.mgmt.chaos.types.ExternalResource(TypedDict, total=False): + key "resourceId": str + resource_id: str + + + class azure.mgmt.chaos.types.FilterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SIMPLE = "Simple" + + + class azure.mgmt.chaos.types.FixResourcePermissionsRequest(TypedDict, total=False): + key "whatIf": bool + what_if: bool + + + class azure.mgmt.chaos.types.KeyValuePair(TypedDict, total=False): + key "key": Required[str] + key "value": Required[str] + key: str + value: str + + + class azure.mgmt.chaos.types.ManagedServiceIdentity(TypedDict, total=False): + key "principalId": str + key "tenantId": str + key "type": Required[Union[str, ManagedServiceIdentityType]] + principal_id: str + tenant_id: str + type: Union[str, ManagedServiceIdentityType] + userAssignedIdentities: dict[str, UserAssignedIdentity] + user_assigned_identities: dict[str, UserAssignedIdentity] + + + class azure.mgmt.chaos.types.PrivateAccess(TrackedResource): + key "id": str + key "location": Required[str] + key "name": str + key "properties": Required[PrivateAccessProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: PrivateAccessProperties + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.chaos.types.PrivateAccessPatch(TypedDict, total=False): + tags: dict[str, str] + + + class azure.mgmt.chaos.types.PrivateAccessProperties(TypedDict, total=False): + key "provisioningState": Union[str, ProvisioningState] + key "publicNetworkAccess": Union[str, PublicNetworkAccessOption] + privateEndpointConnections: list[PrivateEndpointConnection] + private_endpoint_connections: list[PrivateEndpointConnection] + provisioning_state: Union[str, ProvisioningState] + public_network_access: Union[str, PublicNetworkAccessOption] + + + class azure.mgmt.chaos.types.PrivateEndpoint(TypedDict, total=False): + key "id": str + id: str + + + class azure.mgmt.chaos.types.PrivateEndpointConnection(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('PrivateEndpointConnectionProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: PrivateEndpointConnectionProperties + system_data: SystemData + type: str + + + class azure.mgmt.chaos.types.PrivateEndpointConnectionProperties(TypedDict, total=False): + key "privateEndpoint": ForwardRef('PrivateEndpoint', module='types') + key "privateLinkServiceConnectionState": Required[PrivateLinkServiceConnectionState] + key "provisioningState": Union[str, ProvisioningState] + groupIds: list[str] + group_ids: list[str] + private_endpoint: PrivateEndpoint + private_link_service_connection_state: PrivateLinkServiceConnectionState + provisioning_state: Union[str, ProvisioningState] + + + class azure.mgmt.chaos.types.PrivateLinkServiceConnectionState(TypedDict, total=False): + key "actionsRequired": str + key "description": str + key "status": Union[str, PrivateEndpointServiceConnectionStatus] + actions_required: str + description: str + status: Union[str, PrivateEndpointServiceConnectionStatus] + + + class azure.mgmt.chaos.types.ProxyResource(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.chaos.types.Recommendation(TypedDict, total=False): + key "evaluationRunAt": str + key "recommendationStatus": Required[Union[str, RecommendationStatus]] + evaluation_run_at: str + recommendation_status: Union[str, RecommendationStatus] + + + class azure.mgmt.chaos.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.chaos.types.ResourceTargeting(TypedDict, total=False): + key "exclude": ForwardRef('ResourceTargetingCriteria', module='types') + key "include": ForwardRef('ResourceTargetingCriteria', module='types') + exclude: ResourceTargetingCriteria + include: ResourceTargetingCriteria + + + class azure.mgmt.chaos.types.ResourceTargetingCriteria(TypedDict, total=False): + locations: list[str] + physicalZones: list[str] + physical_zones: list[str] + resources: list[str] + tags: list[KeyValuePair] + types: list[str] + zones: list[str] + + + class azure.mgmt.chaos.types.RunAfter(TypedDict, total=False): + key "behavior": Union[str, RunAfterBehavior] + key "items": Required[list[ActionDependency]] + behavior: Union[str, RunAfterBehavior] + items_property: list[ActionDependency] + + + class azure.mgmt.chaos.types.Scenario(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('ScenarioProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: ScenarioProperties + system_data: SystemData + type: str + + + class azure.mgmt.chaos.types.ScenarioAction(TypedDict, total=False): + key "actionId": Required[str] + key "description": str + key "duration": Required[str] + key "externalResource": ForwardRef('ExternalResource', module='types') + key "name": Required[str] + key "runAfter": ForwardRef('RunAfter', module='types') + key "timeout": str + key "waitBefore": str + action_id: str + description: str + duration: str + external_resource: ExternalResource + name: str + parameters: list[KeyValuePair] + run_after: RunAfter + timeout: str + wait_before: str + + + class azure.mgmt.chaos.types.ScenarioConfiguration(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('ScenarioConfigurationProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: ScenarioConfigurationProperties + system_data: SystemData + type: str + + + class azure.mgmt.chaos.types.ScenarioConfigurationProperties(TypedDict, total=False): + key "provisioningState": Union[str, ProvisioningState] + key "resourceTargeting": ForwardRef('ResourceTargeting', module='types') + key "scenarioId": Required[str] + parameters: list[KeyValuePair] + provisioning_state: Union[str, ProvisioningState] + resource_targeting: ResourceTargeting + scenario_id: str + + + class azure.mgmt.chaos.types.ScenarioParameter(TypedDict, total=False): + key "default": str + key "description": str + key "name": Required[str] + key "required": bool + key "type": Required[Union[str, ParameterType]] + default: str + description: str + name: str + required: bool + type: Union[str, ParameterType] + + + class azure.mgmt.chaos.types.ScenarioProperties(TypedDict, total=False): + key "actions": Required[list[ScenarioAction]] + key "createdFrom": str + key "description": str + key "parameters": Required[list[ScenarioParameter]] + key "provisioningState": Union[str, ProvisioningState] + key "recommendation": ForwardRef('Recommendation', module='types') + key "version": str + actions: list[ScenarioAction] + created_from: str + description: str + parameters: list[ScenarioParameter] + provisioning_state: Union[str, ProvisioningState] + recommendation: Recommendation + version: str + + + class azure.mgmt.chaos.types.SelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LIST = "List" + QUERY = "Query" + + + class azure.mgmt.chaos.types.SystemData(TypedDict, total=False): + key "createdAt": str + key "createdBy": str + key "createdByType": Union[str, CreatedByType] + key "lastModifiedAt": str + key "lastModifiedBy": str + key "lastModifiedByType": Union[str, CreatedByType] + created_at: str + created_by: str + created_by_type: Union[str, CreatedByType] + last_modified_at: str + last_modified_by: str + last_modified_by_type: Union[str, CreatedByType] + + + class azure.mgmt.chaos.types.Target(ProxyResource): + key "id": str + key "location": str + key "name": str + key "properties": Required[dict[str, Any]] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: dict[str, Any] + system_data: SystemData + type: str + + + class azure.mgmt.chaos.types.TargetReference(TypedDict, total=False): + key "id": Required[str] + key "type": Required[Union[str, TargetReferenceType]] + id: str + type: Union[str, TargetReferenceType] + + + class azure.mgmt.chaos.types.TrackedResource(Resource): + key "id": str + key "location": Required[str] + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.chaos.types.UserAssignedIdentity(TypedDict, total=False): + key "clientId": str + key "principalId": str + client_id: str + principal_id: str + + + class azure.mgmt.chaos.types.Workspace(TrackedResource): + key "id": str + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "location": Required[str] + key "name": str + key "properties": Required[WorkspaceProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + identity: ManagedServiceIdentity + location: str + name: str + properties: WorkspaceProperties + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.chaos.types.WorkspaceProperties(TypedDict, total=False): + key "communicationEndpoint": str + key "provisioningState": Union[str, ProvisioningState] + key "scopes": Required[list[str]] + communication_endpoint: str + provisioning_state: Union[str, ProvisioningState] + scopes: list[str] + + + class azure.mgmt.chaos.types.WorkspaceUpdate(TypedDict, total=False): + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + identity: ManagedServiceIdentity + tags: dict[str, str] + + +``` \ No newline at end of file diff --git a/sdk/chaos/azure-mgmt-chaos/api.metadata.yml b/sdk/chaos/azure-mgmt-chaos/api.metadata.yml new file mode 100644 index 000000000000..71995f1fa4b3 --- /dev/null +++ b/sdk/chaos/azure-mgmt-chaos/api.metadata.yml @@ -0,0 +1,3 @@ +apiMdSha256: 97885e06c3036f33fe87744cf7e981c1b6a3cd27bf6884e19c4b637cdb1f9fbf +parserVersion: 0.3.30 +pythonVersion: 3.13.14 diff --git a/sdk/chaos/azure-mgmt-chaos/apiview-properties.json b/sdk/chaos/azure-mgmt-chaos/apiview-properties.json index 87ef1f6937ed..b12c152a3062 100644 --- a/sdk/chaos/azure-mgmt-chaos/apiview-properties.json +++ b/sdk/chaos/azure-mgmt-chaos/apiview-properties.json @@ -24,8 +24,8 @@ "azure.mgmt.chaos.models.ChaosTargetQuerySelector": "Microsoft.Chaos.ChaosTargetQuerySelector", "azure.mgmt.chaos.models.ChaosTargetSimpleFilter": "Microsoft.Chaos.ChaosTargetSimpleFilter", "azure.mgmt.chaos.models.ChaosTargetSimpleFilterParameters": "Microsoft.Chaos.ChaosTargetSimpleFilterParameters", - "azure.mgmt.chaos.models.ConfigurationExclusions": "Microsoft.Chaos.ConfigurationExclusions", - "azure.mgmt.chaos.models.ConfigurationFilters": "Microsoft.Chaos.ConfigurationFilters", + "azure.mgmt.chaos.models.Connection": "Microsoft.Chaos.Connection", + "azure.mgmt.chaos.models.ConnectionProperties": "Microsoft.Chaos.ConnectionProperties", "azure.mgmt.chaos.models.ContinuousAction": "Microsoft.Chaos.ContinuousAction", "azure.mgmt.chaos.models.CustomerDataStorageProperties": "Microsoft.Chaos.CustomerDataStorageProperties", "azure.mgmt.chaos.models.DelayAction": "Microsoft.Chaos.DelayAction", @@ -72,6 +72,8 @@ "azure.mgmt.chaos.models.PrivateLinkServiceConnectionState": "Microsoft.Chaos.PrivateLinkServiceConnectionState", "azure.mgmt.chaos.models.Recommendation": "Microsoft.Chaos.Recommendation", "azure.mgmt.chaos.models.ResourceStateError": "Microsoft.Chaos.ResourceStateError", + "azure.mgmt.chaos.models.ResourceTargeting": "Microsoft.Chaos.ResourceTargeting", + "azure.mgmt.chaos.models.ResourceTargetingCriteria": "Microsoft.Chaos.ResourceTargetingCriteria", "azure.mgmt.chaos.models.RoleAssignmentError": "Microsoft.Chaos.RoleAssignmentError", "azure.mgmt.chaos.models.RoleAssignmentResult": "Microsoft.Chaos.RoleAssignmentResult", "azure.mgmt.chaos.models.RunAfter": "Microsoft.Chaos.RunAfter", @@ -80,7 +82,6 @@ "azure.mgmt.chaos.models.ScenarioConfiguration": "Microsoft.Chaos.ScenarioConfiguration", "azure.mgmt.chaos.models.ScenarioConfigurationProperties": "Microsoft.Chaos.ScenarioConfigurationProperties", "azure.mgmt.chaos.models.ScenarioErrors": "Microsoft.Chaos.ScenarioErrors", - "azure.mgmt.chaos.models.ScenarioEvaluationResultItem": "Microsoft.Chaos.ScenarioEvaluationResultItem", "azure.mgmt.chaos.models.ScenarioParameter": "Microsoft.Chaos.ScenarioParameter", "azure.mgmt.chaos.models.ScenarioProperties": "Microsoft.Chaos.ScenarioProperties", "azure.mgmt.chaos.models.ScenarioRun": "Microsoft.Chaos.ScenarioRun", @@ -93,10 +94,13 @@ "azure.mgmt.chaos.models.TargetReference": "Microsoft.Chaos.TargetReference", "azure.mgmt.chaos.models.TargetType": "Microsoft.Chaos.TargetType", "azure.mgmt.chaos.models.TargetTypeProperties": "Microsoft.Chaos.TargetTypeProperties", + "azure.mgmt.chaos.models.TemplateEvaluationResultItem": "Microsoft.Chaos.TemplateEvaluationResultItem", "azure.mgmt.chaos.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", "azure.mgmt.chaos.models.Validation": "Microsoft.Chaos.Validation", "azure.mgmt.chaos.models.ValidationProperties": "Microsoft.Chaos.ValidationProperties", "azure.mgmt.chaos.models.Workspace": "Microsoft.Chaos.Workspace", + "azure.mgmt.chaos.models.WorkspaceDiscovery": "Microsoft.Chaos.WorkspaceDiscovery", + "azure.mgmt.chaos.models.WorkspaceDiscoveryProperties": "Microsoft.Chaos.WorkspaceDiscoveryProperties", "azure.mgmt.chaos.models.WorkspaceEvaluation": "Microsoft.Chaos.WorkspaceEvaluation", "azure.mgmt.chaos.models.WorkspaceEvaluationProperties": "Microsoft.Chaos.WorkspaceEvaluationProperties", "azure.mgmt.chaos.models.WorkspaceProperties": "Microsoft.Chaos.WorkspaceProperties", @@ -115,6 +119,7 @@ "azure.mgmt.chaos.models.PrivateEndpointServiceConnectionStatus": "Microsoft.Chaos.PrivateEndpointServiceConnectionStatus", "azure.mgmt.chaos.models.PublicNetworkAccessOption": "Microsoft.Chaos.PublicNetworkAccessOption", "azure.mgmt.chaos.models.ActionKind": "Microsoft.Chaos.ActionKind", + "azure.mgmt.chaos.models.WorkspaceDiscoveryStatus": "Microsoft.Chaos.WorkspaceDiscoveryStatus", "azure.mgmt.chaos.models.WorkspaceEvaluationStatus": "Microsoft.Chaos.WorkspaceEvaluationStatus", "azure.mgmt.chaos.models.RecommendationStatus": "Microsoft.Chaos.RecommendationStatus", "azure.mgmt.chaos.models.ParameterType": "Microsoft.Chaos.ParameterType", @@ -127,6 +132,8 @@ "azure.mgmt.chaos.models.ScenarioValidationState": "Microsoft.Chaos.ScenarioValidationState", "azure.mgmt.chaos.models.PermissionsFixState": "Microsoft.Chaos.PermissionsFixState", "azure.mgmt.chaos.models.RoleAssignmentStatus": "Microsoft.Chaos.RoleAssignmentStatus", + "azure.mgmt.chaos.models.ConnectionKind": "Microsoft.Chaos.ConnectionKind", + "azure.mgmt.chaos.models.ConnectionStatus": "Microsoft.Chaos.ConnectionStatus", "azure.mgmt.chaos.operations.CapabilitiesOperations.get": "Microsoft.Chaos.Capabilities.get", "azure.mgmt.chaos.aio.operations.CapabilitiesOperations.get": "Microsoft.Chaos.Capabilities.get", "azure.mgmt.chaos.operations.CapabilitiesOperations.create_or_update": "Microsoft.Chaos.Capabilities.createOrUpdate", @@ -217,8 +224,10 @@ "azure.mgmt.chaos.aio.operations.WorkspacesOperations.list": "Microsoft.Chaos.Workspaces.list", "azure.mgmt.chaos.operations.WorkspacesOperations.list_all": "Microsoft.Chaos.Workspaces.listAll", "azure.mgmt.chaos.aio.operations.WorkspacesOperations.list_all": "Microsoft.Chaos.Workspaces.listAll", - "azure.mgmt.chaos.operations.WorkspacesOperations.begin_refresh_recommendations": "Microsoft.Chaos.Workspaces.refreshRecommendations", - "azure.mgmt.chaos.aio.operations.WorkspacesOperations.begin_refresh_recommendations": "Microsoft.Chaos.Workspaces.refreshRecommendations", + "azure.mgmt.chaos.operations.WorkspacesOperations.begin_discover": "Microsoft.Chaos.Workspaces.discover", + "azure.mgmt.chaos.aio.operations.WorkspacesOperations.begin_discover": "Microsoft.Chaos.Workspaces.discover", + "azure.mgmt.chaos.operations.WorkspacesOperations.begin_evaluate": "Microsoft.Chaos.Workspaces.evaluate", + "azure.mgmt.chaos.aio.operations.WorkspacesOperations.begin_evaluate": "Microsoft.Chaos.Workspaces.evaluate", "azure.mgmt.chaos.operations.DiscoveredResourcesOperations.get": "Microsoft.Chaos.DiscoveredResources.get", "azure.mgmt.chaos.aio.operations.DiscoveredResourcesOperations.get": "Microsoft.Chaos.DiscoveredResources.get", "azure.mgmt.chaos.operations.DiscoveredResourcesOperations.list_by_workspace": "Microsoft.Chaos.DiscoveredResources.listByWorkspace", @@ -231,12 +240,6 @@ "azure.mgmt.chaos.aio.operations.ScenariosOperations.delete": "Microsoft.Chaos.Scenarios.delete", "azure.mgmt.chaos.operations.ScenariosOperations.list_all": "Microsoft.Chaos.Scenarios.listAll", "azure.mgmt.chaos.aio.operations.ScenariosOperations.list_all": "Microsoft.Chaos.Scenarios.listAll", - "azure.mgmt.chaos.operations.ScenarioRunsOperations.get": "Microsoft.Chaos.ScenarioRuns.get", - "azure.mgmt.chaos.aio.operations.ScenarioRunsOperations.get": "Microsoft.Chaos.ScenarioRuns.get", - "azure.mgmt.chaos.operations.ScenarioRunsOperations.list_all": "Microsoft.Chaos.ScenarioRuns.listAll", - "azure.mgmt.chaos.aio.operations.ScenarioRunsOperations.list_all": "Microsoft.Chaos.ScenarioRuns.listAll", - "azure.mgmt.chaos.operations.ScenarioRunsOperations.cancel": "Microsoft.Chaos.ScenarioRuns.cancel", - "azure.mgmt.chaos.aio.operations.ScenarioRunsOperations.cancel": "Microsoft.Chaos.ScenarioRuns.cancel", "azure.mgmt.chaos.operations.ScenarioConfigurationsOperations.get": "Microsoft.Chaos.ScenarioConfigurations.get", "azure.mgmt.chaos.aio.operations.ScenarioConfigurationsOperations.get": "Microsoft.Chaos.ScenarioConfigurations.get", "azure.mgmt.chaos.operations.ScenarioConfigurationsOperations.begin_create_or_update": "Microsoft.Chaos.ScenarioConfigurations.createOrUpdate", @@ -245,11 +248,26 @@ "azure.mgmt.chaos.aio.operations.ScenarioConfigurationsOperations.begin_delete": "Microsoft.Chaos.ScenarioConfigurations.delete", "azure.mgmt.chaos.operations.ScenarioConfigurationsOperations.list_all": "Microsoft.Chaos.ScenarioConfigurations.listAll", "azure.mgmt.chaos.aio.operations.ScenarioConfigurationsOperations.list_all": "Microsoft.Chaos.ScenarioConfigurations.listAll", - "azure.mgmt.chaos.operations.ScenarioConfigurationsOperations.execute": "Microsoft.Chaos.ScenarioConfigurations.execute", - "azure.mgmt.chaos.aio.operations.ScenarioConfigurationsOperations.execute": "Microsoft.Chaos.ScenarioConfigurations.execute", + "azure.mgmt.chaos.operations.ScenarioConfigurationsOperations.begin_execute": "Microsoft.Chaos.ScenarioConfigurations.execute", + "azure.mgmt.chaos.aio.operations.ScenarioConfigurationsOperations.begin_execute": "Microsoft.Chaos.ScenarioConfigurations.execute", "azure.mgmt.chaos.operations.ScenarioConfigurationsOperations.begin_validate": "Microsoft.Chaos.ScenarioConfigurations.validate", "azure.mgmt.chaos.aio.operations.ScenarioConfigurationsOperations.begin_validate": "Microsoft.Chaos.ScenarioConfigurations.validate", "azure.mgmt.chaos.operations.ScenarioConfigurationsOperations.begin_fix_resource_permissions": "Microsoft.Chaos.ScenarioConfigurations.fixResourcePermissions", - "azure.mgmt.chaos.aio.operations.ScenarioConfigurationsOperations.begin_fix_resource_permissions": "Microsoft.Chaos.ScenarioConfigurations.fixResourcePermissions" - } + "azure.mgmt.chaos.aio.operations.ScenarioConfigurationsOperations.begin_fix_resource_permissions": "Microsoft.Chaos.ScenarioConfigurations.fixResourcePermissions", + "azure.mgmt.chaos.operations.ScenarioRunsOperations.get": "Microsoft.Chaos.ScenarioRuns.get", + "azure.mgmt.chaos.aio.operations.ScenarioRunsOperations.get": "Microsoft.Chaos.ScenarioRuns.get", + "azure.mgmt.chaos.operations.ScenarioRunsOperations.list_all": "Microsoft.Chaos.ScenarioRuns.listAll", + "azure.mgmt.chaos.aio.operations.ScenarioRunsOperations.list_all": "Microsoft.Chaos.ScenarioRuns.listAll", + "azure.mgmt.chaos.operations.ScenarioRunsOperations.begin_cancel": "Microsoft.Chaos.ScenarioRuns.cancel", + "azure.mgmt.chaos.aio.operations.ScenarioRunsOperations.begin_cancel": "Microsoft.Chaos.ScenarioRuns.cancel", + "azure.mgmt.chaos.operations.ConnectionsOperations.get": "Microsoft.Chaos.Connections.get", + "azure.mgmt.chaos.aio.operations.ConnectionsOperations.get": "Microsoft.Chaos.Connections.get", + "azure.mgmt.chaos.operations.ConnectionsOperations.create_or_update": "Microsoft.Chaos.Connections.createOrUpdate", + "azure.mgmt.chaos.aio.operations.ConnectionsOperations.create_or_update": "Microsoft.Chaos.Connections.createOrUpdate", + "azure.mgmt.chaos.operations.ConnectionsOperations.delete": "Microsoft.Chaos.Connections.delete", + "azure.mgmt.chaos.aio.operations.ConnectionsOperations.delete": "Microsoft.Chaos.Connections.delete", + "azure.mgmt.chaos.operations.ConnectionsOperations.list_all": "Microsoft.Chaos.Connections.listAll", + "azure.mgmt.chaos.aio.operations.ConnectionsOperations.list_all": "Microsoft.Chaos.Connections.listAll" + }, + "CrossLanguageVersion": "23168285983f" } \ No newline at end of file diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_client.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_client.py index dd9ad5d578fc..cb4649146706 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_client.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse @@ -24,6 +24,7 @@ ActionsOperations, CapabilitiesOperations, CapabilityTypesOperations, + ConnectionsOperations, DiscoveredResourcesOperations, ExperimentsOperations, OperationStatusesOperations, @@ -37,6 +38,11 @@ WorkspacesOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -71,10 +77,12 @@ class ChaosManagementClient: # pylint: disable=too-many-instance-attributes :vartype discovered_resources: azure.mgmt.chaos.operations.DiscoveredResourcesOperations :ivar scenarios: ScenariosOperations operations :vartype scenarios: azure.mgmt.chaos.operations.ScenariosOperations - :ivar scenario_runs: ScenarioRunsOperations operations - :vartype scenario_runs: azure.mgmt.chaos.operations.ScenarioRunsOperations :ivar scenario_configurations: ScenarioConfigurationsOperations operations :vartype scenario_configurations: azure.mgmt.chaos.operations.ScenarioConfigurationsOperations + :ivar scenario_runs: ScenarioRunsOperations operations + :vartype scenario_runs: azure.mgmt.chaos.operations.ScenarioRunsOperations + :ivar connections: ConnectionsOperations operations + :vartype connections: azure.mgmt.chaos.operations.ConnectionsOperations :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. @@ -85,8 +93,9 @@ class ChaosManagementClient: # pylint: disable=too-many-instance-attributes None. :paramtype cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. 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 Retry-After header is present. @@ -160,10 +169,11 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.scenarios = ScenariosOperations(self._client, self._config, self._serialize, self._deserialize) - self.scenario_runs = ScenarioRunsOperations(self._client, self._config, self._serialize, self._deserialize) self.scenario_configurations = ScenarioConfigurationsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.scenario_runs = ScenarioRunsOperations(self._client, self._config, self._serialize, self._deserialize) + self.connections = ConnectionsOperations(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. diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_configuration.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_configuration.py index 38a1e2471ae4..90b5355cb1d0 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_configuration.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_configuration.py @@ -34,8 +34,9 @@ class ChaosManagementClientConfiguration: # pylint: disable=too-many-instance-a None. :type cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -47,7 +48,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-05-01-preview") + api_version: str = kwargs.pop("api_version", "2026-08-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_patch.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_patch.py index ea765788358a..87676c65a8f0 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_patch.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_utils/model_base.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_utils/model_base.py index eef4e52ed1a0..1934415c1369 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_utils/model_base.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_utils/model_base.py @@ -23,14 +23,19 @@ from json import JSONEncoder import xml.etree.ElementTree as ET from collections.abc import MutableMapping -from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null + from azure.core.rest import HttpResponse +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] @@ -104,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -296,6 +324,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -325,6 +359,10 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } @@ -420,21 +458,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -444,7 +482,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -479,19 +517,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -504,10 +542,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: @@ -559,7 +598,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass @@ -585,6 +624,239 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return _serialize(value, rf._format) +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated @@ -595,11 +867,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } + dict_to_pass: dict[str, typing.Any] = {} if args: if isinstance(args[0], ET.Element): dict_to_pass.update(self._init_from_xml(args[0])) @@ -619,9 +887,19 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) - def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: """Deserialize an XML element into a dict mapping rest field names to values. :param ET.Element element: The XML element to deserialize from. @@ -629,53 +907,89 @@ def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: :rtype: dict """ result: dict[str, typing.Any] = {} - model_meta = getattr(self, "_xml", {}) existed_attr_keys: list[str] = [] - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = _resolve_xml_ns(prop_meta, model_meta) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and element.get(xml_name) is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - _items_name = prop_meta.get("itemsName") - if _items_name: - xml_name = _items_name - _items_ns = prop_meta.get("itemsNs") - if _items_ns is not None: - xml_ns = _items_ns - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = element.findall(xml_name) # pyright: ignore - if len(items) > 0: + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, items) - elif not rf._is_optional: + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: existed_attr_keys.append(xml_name) - result[rf._rest_name] = [] - continue - - # text element is primitive type - if prop_meta.get("text", False): - if element.text is not None: - result[rf._rest_name] = _deserialize(rf._type, element.text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = element.find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, item) + result[rf._rest_name] = _deserialize(rf._type, item) # rest thing is additional properties for e in element: @@ -712,6 +1026,9 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: Model._get_backcompat_attribute_name(cls._attr_to_rest_field, attr): rf for attr, rf in cls._attr_to_rest_field.items() } + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -1096,6 +1413,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, original_tsp_name: typing.Optional[str] = None, ): self._type = type @@ -1109,6 +1427,7 @@ def __init__( self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._deserializer = deserializer self._original_tsp_name = original_tsp_name @property @@ -1129,7 +1448,10 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class # Use _data.get() directly to avoid triggering __getitem__ which clears the cache - item = obj._data.get(self._rest_name) + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: @@ -1142,7 +1464,11 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # Return the value from _data directly (it's been deserialized in place) return obj._data.get(self._rest_name) - deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) # For mutable types, store the deserialized value back in _data # so mutations directly affect _data @@ -1188,6 +1514,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, original_tsp_name: typing.Optional[str] = None, ) -> typing.Any: return _RestField( @@ -1198,6 +1525,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, original_tsp_name=original_tsp_name, ) @@ -1432,6 +1760,8 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_utils/serialization.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_utils/serialization.py index 81ec1de5922b..75906e2eb77f 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_utils/serialization.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_utils/serialization.py @@ -39,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -516,6 +520,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -1105,6 +1113,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1377,6 +1440,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1389,6 +1456,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: dict[str, type] = dict(classes) if classes else {} @@ -1401,7 +1472,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. @@ -1411,6 +1482,27 @@ def __call__(self, target_obj, response_data, content_type=None): :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) @@ -1929,6 +2021,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_version.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_version.py index fd5e9189cf06..6683b975dd63 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_version.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0b1" +VERSION = "3.0.0b2" diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/_client.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/_client.py index 7e2b16cf8c65..92085bbb407d 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/_client.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest @@ -24,6 +24,7 @@ ActionsOperations, CapabilitiesOperations, CapabilityTypesOperations, + ConnectionsOperations, DiscoveredResourcesOperations, ExperimentsOperations, OperationStatusesOperations, @@ -37,6 +38,11 @@ WorkspacesOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -71,11 +77,13 @@ class ChaosManagementClient: # pylint: disable=too-many-instance-attributes :vartype discovered_resources: azure.mgmt.chaos.aio.operations.DiscoveredResourcesOperations :ivar scenarios: ScenariosOperations operations :vartype scenarios: azure.mgmt.chaos.aio.operations.ScenariosOperations - :ivar scenario_runs: ScenarioRunsOperations operations - :vartype scenario_runs: azure.mgmt.chaos.aio.operations.ScenarioRunsOperations :ivar scenario_configurations: ScenarioConfigurationsOperations operations :vartype scenario_configurations: azure.mgmt.chaos.aio.operations.ScenarioConfigurationsOperations + :ivar scenario_runs: ScenarioRunsOperations operations + :vartype scenario_runs: azure.mgmt.chaos.aio.operations.ScenarioRunsOperations + :ivar connections: ConnectionsOperations operations + :vartype connections: azure.mgmt.chaos.aio.operations.ConnectionsOperations :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. @@ -86,8 +94,9 @@ class ChaosManagementClient: # pylint: disable=too-many-instance-attributes None. :paramtype cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. 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 Retry-After header is present. @@ -163,10 +172,11 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.scenarios = ScenariosOperations(self._client, self._config, self._serialize, self._deserialize) - self.scenario_runs = ScenarioRunsOperations(self._client, self._config, self._serialize, self._deserialize) self.scenario_configurations = ScenarioConfigurationsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.scenario_runs = ScenarioRunsOperations(self._client, self._config, self._serialize, self._deserialize) + self.connections = ConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/_configuration.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/_configuration.py index ce7644a94731..ca97a6f20e68 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/_configuration.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/_configuration.py @@ -34,8 +34,9 @@ class ChaosManagementClientConfiguration: # pylint: disable=too-many-instance-a None. :type cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -47,7 +48,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-05-01-preview") + api_version: str = kwargs.pop("api_version", "2026-08-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/_patch.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/_patch.py index ea765788358a..87676c65a8f0 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/_patch.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/operations/__init__.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/operations/__init__.py index f4cff5a39c7c..5ea17e03b1ec 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/operations/__init__.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/operations/__init__.py @@ -25,8 +25,9 @@ from ._operations import WorkspacesOperations # type: ignore from ._operations import DiscoveredResourcesOperations # type: ignore from ._operations import ScenariosOperations # type: ignore -from ._operations import ScenarioRunsOperations # type: ignore from ._operations import ScenarioConfigurationsOperations # type: ignore +from ._operations import ScenarioRunsOperations # type: ignore +from ._operations import ConnectionsOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -46,8 +47,9 @@ "WorkspacesOperations", "DiscoveredResourcesOperations", "ScenariosOperations", - "ScenarioRunsOperations", "ScenarioConfigurationsOperations", + "ScenarioRunsOperations", + "ConnectionsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/operations/_operations.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/operations/_operations.py index 599e897aeacc..a468ad9e811d 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/operations/_operations.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/operations/_operations.py @@ -33,7 +33,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer from ..._validation import api_version_validation @@ -48,6 +48,10 @@ build_capabilities_list_request, build_capability_types_get_request, build_capability_types_list_request, + build_connections_create_or_update_request, + build_connections_delete_request, + build_connections_get_request, + build_connections_list_all_request, build_discovered_resources_get_request, build_discovered_resources_list_by_workspace_request, build_experiments_cancel_request, @@ -95,15 +99,15 @@ build_targets_list_request, build_workspaces_create_or_update_request, build_workspaces_delete_request, + build_workspaces_discover_request, + build_workspaces_evaluate_request, build_workspaces_get_request, build_workspaces_list_all_request, build_workspaces_list_request, - build_workspaces_refresh_recommendations_request, build_workspaces_update_request, ) from .._configuration import ChaosManagementClientConfiguration -JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] List = list @@ -265,7 +269,7 @@ async def create_or_update( parent_resource_name: str, target_name: str, capability_name: str, - resource: JSON, + resource: _types.Capability, *, content_type: str = "application/json", **kwargs: Any @@ -286,7 +290,7 @@ async def create_or_update( :param capability_name: String that represents a Capability resource name. Required. :type capability_name: str :param resource: Capability resource to be created or updated. Required. - :type resource: JSON + :type resource: ~azure.mgmt.chaos.types.Capability :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -343,7 +347,7 @@ async def create_or_update( parent_resource_name: str, target_name: str, capability_name: str, - resource: Union[_models.Capability, JSON, IO[bytes]], + resource: Union[_models.Capability, _types.Capability, IO[bytes]], **kwargs: Any ) -> _models.Capability: """Create or update a Capability resource that extends a Target resource. @@ -361,9 +365,10 @@ async def create_or_update( :type target_name: str :param capability_name: String that represents a Capability resource name. Required. :type capability_name: str - :param resource: Capability resource to be created or updated. Is one of the following types: - Capability, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.chaos.models.Capability or JSON or IO[bytes] + :param resource: Capability resource to be created or updated. Is either a Capability type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.chaos.models.Capability or ~azure.mgmt.chaos.types.Capability or + IO[bytes] :return: Capability. The Capability is compatible with MutableMapping :rtype: ~azure.mgmt.chaos.models.Capability :raises ~azure.core.exceptions.HttpResponseError: @@ -595,7 +600,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -702,7 +710,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -893,7 +904,7 @@ async def create_or_update( parent_resource_type: str, parent_resource_name: str, target_name: str, - resource: JSON, + resource: _types.Target, *, content_type: str = "application/json", **kwargs: Any @@ -912,7 +923,7 @@ async def create_or_update( :param target_name: String that represents a Target resource name. Required. :type target_name: str :param resource: Target resource to be created or updated. Required. - :type resource: JSON + :type resource: ~azure.mgmt.chaos.types.Target :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -965,7 +976,7 @@ async def create_or_update( parent_resource_type: str, parent_resource_name: str, target_name: str, - resource: Union[_models.Target, JSON, IO[bytes]], + resource: Union[_models.Target, _types.Target, IO[bytes]], **kwargs: Any ) -> _models.Target: """Create or update a Target resource that extends a tracked regional resource. @@ -981,9 +992,9 @@ async def create_or_update( :type parent_resource_name: str :param target_name: String that represents a Target resource name. Required. :type target_name: str - :param resource: Target resource to be created or updated. Is one of the following types: - Target, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.chaos.models.Target or JSON or IO[bytes] + :param resource: Target resource to be created or updated. Is either a Target type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.chaos.models.Target or ~azure.mgmt.chaos.types.Target or IO[bytes] :return: Target. The Target is compatible with MutableMapping :rtype: ~azure.mgmt.chaos.models.Target :raises ~azure.core.exceptions.HttpResponseError: @@ -1206,7 +1217,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1400,7 +1414,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1534,7 +1551,7 @@ async def _create_or_update_initial( self, resource_group_name: str, experiment_name: str, - resource: Union[_models.Experiment, JSON, IO[bytes]], + resource: Union[_models.Experiment, _types.Experiment, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -1640,7 +1657,7 @@ async def begin_create_or_update( self, resource_group_name: str, experiment_name: str, - resource: JSON, + resource: _types.Experiment, *, content_type: str = "application/json", **kwargs: Any @@ -1653,7 +1670,7 @@ async def begin_create_or_update( :param experiment_name: String that represents a Experiment resource name. Required. :type experiment_name: str :param resource: Experiment resource to be created or updated. Required. - :type resource: JSON + :type resource: ~azure.mgmt.chaos.types.Experiment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1696,7 +1713,7 @@ async def begin_create_or_update( self, resource_group_name: str, experiment_name: str, - resource: Union[_models.Experiment, JSON, IO[bytes]], + resource: Union[_models.Experiment, _types.Experiment, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.Experiment]: """Create or update a Experiment resource. @@ -1706,9 +1723,10 @@ async def begin_create_or_update( :type resource_group_name: str :param experiment_name: String that represents a Experiment resource name. Required. :type experiment_name: str - :param resource: Experiment resource to be created or updated. Is one of the following types: - Experiment, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.chaos.models.Experiment or JSON or IO[bytes] + :param resource: Experiment resource to be created or updated. Is either a Experiment type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.chaos.models.Experiment or ~azure.mgmt.chaos.types.Experiment or + IO[bytes] :return: An instance of AsyncLROPoller that returns Experiment. The Experiment is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.Experiment] @@ -1770,7 +1788,7 @@ async def _update_initial( self, resource_group_name: str, experiment_name: str, - properties: Union[_models.ExperimentUpdate, JSON, IO[bytes]], + properties: Union[_models.ExperimentUpdate, _types.ExperimentUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -1851,7 +1869,7 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Experiment]: - """The operation to update an experiment. + """Update an experiment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1874,12 +1892,12 @@ async def begin_update( self, resource_group_name: str, experiment_name: str, - properties: JSON, + properties: _types.ExperimentUpdate, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Experiment]: - """The operation to update an experiment. + """Update an experiment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1887,7 +1905,7 @@ async def begin_update( :param experiment_name: String that represents a Experiment resource name. Required. :type experiment_name: str :param properties: Parameters supplied to the Update experiment operation. Required. - :type properties: JSON + :type properties: ~azure.mgmt.chaos.types.ExperimentUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1907,7 +1925,7 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Experiment]: - """The operation to update an experiment. + """Update an experiment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1930,19 +1948,20 @@ async def begin_update( self, resource_group_name: str, experiment_name: str, - properties: Union[_models.ExperimentUpdate, JSON, IO[bytes]], + properties: Union[_models.ExperimentUpdate, _types.ExperimentUpdate, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.Experiment]: - """The operation to update an experiment. + """Update an experiment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param experiment_name: String that represents a Experiment resource name. Required. :type experiment_name: str - :param properties: Parameters supplied to the Update experiment operation. Is one of the - following types: ExperimentUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.chaos.models.ExperimentUpdate or JSON or IO[bytes] + :param properties: Parameters supplied to the Update experiment operation. Is either a + ExperimentUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.chaos.models.ExperimentUpdate or + ~azure.mgmt.chaos.types.ExperimentUpdate or IO[bytes] :return: An instance of AsyncLROPoller that returns Experiment. The Experiment is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.Experiment] @@ -2186,7 +2205,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2287,7 +2309,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2695,7 +2720,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2832,6 +2860,19 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) async def get(self, resource_group_name: str, private_access_name: str, **kwargs: Any) -> _models.PrivateAccess: """Get a private access resource. @@ -2903,11 +2944,25 @@ async def get(self, resource_group_name: str, private_access_name: str, **kwargs return deserialized # type: ignore + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) async def _create_or_update_initial( self, resource_group_name: str, private_access_name: str, - resource: Union[_models.PrivateAccess, JSON, IO[bytes]], + resource: Union[_models.PrivateAccess, _types.PrivateAccess, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3015,7 +3070,7 @@ async def begin_create_or_update( self, resource_group_name: str, private_access_name: str, - resource: JSON, + resource: _types.PrivateAccess, *, content_type: str = "application/json", **kwargs: Any @@ -3030,7 +3085,7 @@ async def begin_create_or_update( characters. Required. :type private_access_name: str :param resource: private access resource to be created or updated. Required. - :type resource: JSON + :type resource: ~azure.mgmt.chaos.types.PrivateAccess :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3071,11 +3126,25 @@ async def begin_create_or_update( """ @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) async def begin_create_or_update( self, resource_group_name: str, private_access_name: str, - resource: Union[_models.PrivateAccess, JSON, IO[bytes]], + resource: Union[_models.PrivateAccess, _types.PrivateAccess, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.PrivateAccess]: """Create or update a private access. @@ -3087,9 +3156,10 @@ async def begin_create_or_update( Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. :type private_access_name: str - :param resource: private access resource to be created or updated. Is one of the following - types: PrivateAccess, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.chaos.models.PrivateAccess or JSON or IO[bytes] + :param resource: private access resource to be created or updated. Is either a PrivateAccess + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.chaos.models.PrivateAccess or ~azure.mgmt.chaos.types.PrivateAccess + or IO[bytes] :return: An instance of AsyncLROPoller that returns PrivateAccess. The PrivateAccess is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.PrivateAccess] @@ -3147,11 +3217,25 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) async def _update_initial( self, resource_group_name: str, private_access_name: str, - properties: Union[_models.PrivateAccessPatch, JSON, IO[bytes]], + properties: Union[_models.PrivateAccessPatch, _types.PrivateAccessPatch, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3257,7 +3341,7 @@ async def begin_update( self, resource_group_name: str, private_access_name: str, - properties: JSON, + properties: _types.PrivateAccessPatch, *, content_type: str = "application/json", **kwargs: Any @@ -3272,7 +3356,7 @@ async def begin_update( characters. Required. :type private_access_name: str :param properties: private access resource's tags to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.chaos.types.PrivateAccessPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3313,11 +3397,25 @@ async def begin_update( """ @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) async def begin_update( self, resource_group_name: str, private_access_name: str, - properties: Union[_models.PrivateAccessPatch, JSON, IO[bytes]], + properties: Union[_models.PrivateAccessPatch, _types.PrivateAccessPatch, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.PrivateAccess]: """Patch a private access tags. @@ -3329,9 +3427,10 @@ async def begin_update( Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. :type private_access_name: str - :param properties: private access resource's tags to be updated. Is one of the following types: - PrivateAccessPatch, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.chaos.models.PrivateAccessPatch or JSON or IO[bytes] + :param properties: private access resource's tags to be updated. Is either a PrivateAccessPatch + type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.chaos.models.PrivateAccessPatch or + ~azure.mgmt.chaos.types.PrivateAccessPatch or IO[bytes] :return: An instance of AsyncLROPoller that returns PrivateAccess. The PrivateAccess is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.PrivateAccess] @@ -3389,6 +3488,13 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "private_access_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) async def _delete_initial( self, resource_group_name: str, private_access_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: @@ -3451,6 +3557,13 @@ async def _delete_initial( return deserialized # type: ignore @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "private_access_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) async def begin_delete( self, resource_group_name: str, private_access_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: @@ -3512,6 +3625,19 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "continuation_token_parameter", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def list( self, resource_group_name: str, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.PrivateAccess"]: @@ -3569,7 +3695,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3612,6 +3741,13 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "continuation_token_parameter", "accept"] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def list_all( self, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.PrivateAccess"]: @@ -3665,7 +3801,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3708,6 +3847,19 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) async def get_private_link_resources( self, resource_group_name: str, private_access_name: str, **kwargs: Any ) -> _models.PrivateLinkResourceListResult: @@ -3783,6 +3935,20 @@ async def get_private_link_resources( return deserialized # type: ignore @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "private_endpoint_connection_name", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) async def get_a_private_endpoint_connection( self, resource_group_name: str, private_access_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> _models.PrivateEndpointConnection: @@ -3860,6 +4026,19 @@ async def get_a_private_endpoint_connection( return deserialized # type: ignore + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "private_endpoint_connection_name", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) async def _delete_a_private_endpoint_connection_initial( # pylint: disable=name-too-long self, resource_group_name: str, private_access_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: @@ -3923,6 +4102,19 @@ async def _delete_a_private_endpoint_connection_initial( # pylint: disable=name return deserialized # type: ignore @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "private_endpoint_connection_name", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) async def begin_delete_a_private_endpoint_connection( # pylint: disable=name-too-long self, resource_group_name: str, private_access_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: @@ -3987,6 +4179,19 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def list_private_endpoint_connections( self, resource_group_name: str, private_access_name: str, **kwargs: Any ) -> AsyncItemPaged["_models.PrivateEndpointConnection"]: @@ -4046,7 +4251,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4110,7 +4318,7 @@ def __init__(self, *args, **kwargs) -> None: @api_version_validation( method_added_on="2026-05-01-preview", params_added_on={"2026-05-01-preview": ["api_version", "subscription_id", "location", "action_name", "accept"]}, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def get(self, location: str, action_name: str, **kwargs: Any) -> _models.Action: """Get an Action resource for a given location. @@ -4192,7 +4400,7 @@ async def get(self, location: str, action_name: str, **kwargs: Any) -> _models.A "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def list( self, location: str, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any @@ -4250,7 +4458,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4323,7 +4534,7 @@ def __init__(self, *args, **kwargs) -> None: "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def get(self, location: str, action_name: str, version_name: str, **kwargs: Any) -> _models.ActionVersion: """Get an Action Version resource for a given location and action. @@ -4409,7 +4620,7 @@ async def get(self, location: str, action_name: str, version_name: str, **kwargs "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def list( self, location: str, action_name: str, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any @@ -4470,7 +4681,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4656,7 +4870,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4809,7 +5026,7 @@ def __init__(self, *args, **kwargs) -> None: params_added_on={ "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name", "accept"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.Workspace: """Get a Workspace resource. @@ -4892,13 +5109,13 @@ async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def _create_or_update_initial( self, resource_group_name: str, workspace_name: str, - resource: Union[_models.Workspace, JSON, IO[bytes]], + resource: Union[_models.Workspace, _types.Workspace, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -5004,7 +5221,7 @@ async def begin_create_or_update( self, resource_group_name: str, workspace_name: str, - resource: JSON, + resource: _types.Workspace, *, content_type: str = "application/json", **kwargs: Any @@ -5017,7 +5234,7 @@ async def begin_create_or_update( :param workspace_name: String that represents a Workspace resource name. Required. :type workspace_name: str :param resource: Workspace resource to be created or updated. Required. - :type resource: JSON + :type resource: ~azure.mgmt.chaos.types.Workspace :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5068,13 +5285,13 @@ async def begin_create_or_update( "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def begin_create_or_update( self, resource_group_name: str, workspace_name: str, - resource: Union[_models.Workspace, JSON, IO[bytes]], + resource: Union[_models.Workspace, _types.Workspace, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.Workspace]: """Create or update a Workspace resource. @@ -5084,9 +5301,10 @@ async def begin_create_or_update( :type resource_group_name: str :param workspace_name: String that represents a Workspace resource name. Required. :type workspace_name: str - :param resource: Workspace resource to be created or updated. Is one of the following types: - Workspace, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.chaos.models.Workspace or JSON or IO[bytes] + :param resource: Workspace resource to be created or updated. Is either a Workspace type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.chaos.models.Workspace or ~azure.mgmt.chaos.types.Workspace or + IO[bytes] :return: An instance of AsyncLROPoller that returns Workspace. The Workspace is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.Workspace] @@ -5156,13 +5374,13 @@ def get_long_running_output(pipeline_response): "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def _update_initial( self, resource_group_name: str, workspace_name: str, - properties: Union[_models.WorkspaceUpdate, JSON, IO[bytes]], + properties: Union[_models.WorkspaceUpdate, _types.WorkspaceUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -5243,7 +5461,7 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Workspace]: - """The operation to update a Workspace. + """Update a Workspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5266,12 +5484,12 @@ async def begin_update( self, resource_group_name: str, workspace_name: str, - properties: JSON, + properties: _types.WorkspaceUpdate, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Workspace]: - """The operation to update a Workspace. + """Update a Workspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5279,7 +5497,7 @@ async def begin_update( :param workspace_name: String that represents a Workspace resource name. Required. :type workspace_name: str :param properties: Parameters supplied to the Update Workspace operation. Required. - :type properties: JSON + :type properties: ~azure.mgmt.chaos.types.WorkspaceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5299,7 +5517,7 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Workspace]: - """The operation to update a Workspace. + """Update a Workspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5330,25 +5548,26 @@ async def begin_update( "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def begin_update( self, resource_group_name: str, workspace_name: str, - properties: Union[_models.WorkspaceUpdate, JSON, IO[bytes]], + properties: Union[_models.WorkspaceUpdate, _types.WorkspaceUpdate, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.Workspace]: - """The operation to update a Workspace. + """Update a Workspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param workspace_name: String that represents a Workspace resource name. Required. :type workspace_name: str - :param properties: Parameters supplied to the Update Workspace operation. Is one of the - following types: WorkspaceUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.chaos.models.WorkspaceUpdate or JSON or IO[bytes] + :param properties: Parameters supplied to the Update Workspace operation. Is either a + WorkspaceUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.chaos.models.WorkspaceUpdate or + ~azure.mgmt.chaos.types.WorkspaceUpdate or IO[bytes] :return: An instance of AsyncLROPoller that returns Workspace. The Workspace is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.Workspace] @@ -5411,7 +5630,7 @@ def get_long_running_output(pipeline_response): params_added_on={ "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def _delete_initial( self, resource_group_name: str, workspace_name: str, **kwargs: Any @@ -5480,7 +5699,7 @@ async def _delete_initial( params_added_on={ "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def begin_delete(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> AsyncLROPoller[None]: """Delete a Workspace resource. @@ -5550,7 +5769,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def list( self, resource_group_name: str, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any @@ -5609,7 +5828,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5657,7 +5879,7 @@ async def get_next(next_link=None): params_added_on={ "2026-05-01-preview": ["api_version", "subscription_id", "continuation_token_parameter", "accept"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def list_all( self, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any @@ -5712,7 +5934,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5755,13 +5980,13 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @api_version_validation( - method_added_on="2026-05-01-preview", + method_added_on="2026-08-01-preview", params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] + "2026-08-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-08-01-preview"], ) - async def _refresh_recommendations_initial( + async def _discover_initial( self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -5777,7 +6002,7 @@ async def _refresh_recommendations_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_workspaces_refresh_recommendations_request( + _request = build_workspaces_discover_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, @@ -5823,36 +6048,36 @@ async def _refresh_recommendations_initial( @distributed_trace_async @api_version_validation( - method_added_on="2026-05-01-preview", + method_added_on="2026-08-01-preview", params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] + "2026-08-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-08-01-preview"], ) - async def begin_refresh_recommendations( + async def begin_discover( self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.WorkspaceEvaluation]: - """Refreshes recommendation status for all scenarios in a given workspace. + ) -> AsyncLROPoller[_models.WorkspaceDiscovery]: + """Triggers resource discovery for the workspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param workspace_name: String that represents a Workspace resource name. Required. :type workspace_name: str - :return: An instance of AsyncLROPoller that returns WorkspaceEvaluation. The - WorkspaceEvaluation is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.WorkspaceEvaluation] + :return: An instance of AsyncLROPoller that returns WorkspaceDiscovery. The WorkspaceDiscovery + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.WorkspaceDiscovery] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.WorkspaceEvaluation] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkspaceDiscovery] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._refresh_recommendations_initial( + raw_result = await self._discover_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, cls=lambda x, y, z: x, @@ -5869,7 +6094,7 @@ def get_long_running_output(pipeline_response): response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.WorkspaceEvaluation, response.json()) + deserialized = _deserialize(_models.WorkspaceDiscovery, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized @@ -5887,65 +6112,26 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.WorkspaceEvaluation].from_continuation_token( + return AsyncLROPoller[_models.WorkspaceDiscovery].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.WorkspaceEvaluation]( + return AsyncLROPoller[_models.WorkspaceDiscovery]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - -class DiscoveredResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.chaos.aio.ChaosManagementClient`'s - :attr:`discovered_resources` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ChaosManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async @api_version_validation( - method_added_on="2026-05-01-preview", + method_added_on="2026-08-01-preview", params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "workspace_name", - "discovered_resource_name", - "accept", - ] + "2026-08-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-08-01-preview"], ) - async def get( - self, resource_group_name: str, workspace_name: str, discovered_resource_name: str, **kwargs: Any - ) -> _models.DiscoveredResource: - """Get a discovered resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: String that represents a Workspace resource name. Required. - :type workspace_name: str - :param discovered_resource_name: Name of the discovered resource. Required. - :type discovered_resource_name: str - :return: DiscoveredResource. The DiscoveredResource is compatible with MutableMapping - :rtype: ~azure.mgmt.chaos.models.DiscoveredResource - :raises ~azure.core.exceptions.HttpResponseError: - """ + async def _evaluate_initial( + self, resource_group_name: str, workspace_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5957,12 +6143,11 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DiscoveredResource] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_discovered_resources_get_request( + _request = build_workspaces_evaluate_request( resource_group_name=resource_group_name, workspace_name=workspace_name, - discovered_resource_name=discovered_resource_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -5974,19 +6159,18 @@ async def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -5994,43 +6178,227 @@ async def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DiscoveredResource, response.json()) + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace + @distributed_trace_async @api_version_validation( - method_added_on="2026-05-01-preview", + method_added_on="2026-08-01-preview", params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name", "accept"] + "2026-08-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-08-01-preview"], ) - def list_by_workspace( + async def begin_evaluate( self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DiscoveredResource"]: - """Get a list of discovered resources for a workspace. + ) -> AsyncLROPoller[_models.WorkspaceEvaluation]: + """Triggers scenario evaluation for the workspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param workspace_name: String that represents a Workspace resource name. Required. :type workspace_name: str - :return: An iterator like instance of DiscoveredResource - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.chaos.models.DiscoveredResource] + :return: An instance of AsyncLROPoller that returns WorkspaceEvaluation. The + WorkspaceEvaluation is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.WorkspaceEvaluation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.DiscoveredResource]] = kwargs.pop("cls", None) - + cls: ClsType[_models.WorkspaceEvaluation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._evaluate_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.WorkspaceEvaluation, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.WorkspaceEvaluation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.WorkspaceEvaluation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class DiscoveredResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.chaos.aio.ChaosManagementClient`'s + :attr:`discovered_resources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ChaosManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "discovered_resource_name", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) + async def get( + self, resource_group_name: str, workspace_name: str, discovered_resource_name: str, **kwargs: Any + ) -> _models.DiscoveredResource: + """Get a discovered resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param discovered_resource_name: Name of the discovered resource. Required. + :type discovered_resource_name: str + :return: DiscoveredResource. The DiscoveredResource is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.DiscoveredResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DiscoveredResource] = kwargs.pop("cls", None) + + _request = build_discovered_resources_get_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + discovered_resource_name=discovered_resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DiscoveredResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name", "accept"] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) + def list_by_workspace( + self, resource_group_name: str, workspace_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DiscoveredResource"]: + """Get a list of discovered resources for a workspace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :return: An iterator like instance of DiscoveredResource + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.chaos.models.DiscoveredResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DiscoveredResource]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -6068,7 +6436,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -6141,7 +6512,7 @@ def __init__(self, *args, **kwargs) -> None: "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def get( self, resource_group_name: str, workspace_name: str, scenario_name: str, **kwargs: Any @@ -6253,7 +6624,7 @@ async def create_or_update( resource_group_name: str, workspace_name: str, scenario_name: str, - resource: JSON, + resource: _types.Scenario, *, content_type: str = "application/json", **kwargs: Any @@ -6268,7 +6639,7 @@ async def create_or_update( :param scenario_name: Name of the scenario. Required. :type scenario_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.chaos.types.Scenario :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6321,14 +6692,14 @@ async def create_or_update( "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def create_or_update( self, resource_group_name: str, workspace_name: str, scenario_name: str, - resource: Union[_models.Scenario, JSON, IO[bytes]], + resource: Union[_models.Scenario, _types.Scenario, IO[bytes]], **kwargs: Any ) -> _models.Scenario: """Create or update a scenario. @@ -6340,9 +6711,10 @@ async def create_or_update( :type workspace_name: str :param scenario_name: Name of the scenario. Required. :type scenario_name: str - :param resource: Resource create parameters. Is one of the following types: Scenario, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.chaos.models.Scenario or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a Scenario type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.chaos.models.Scenario or ~azure.mgmt.chaos.types.Scenario or + IO[bytes] :return: Scenario. The Scenario is compatible with MutableMapping :rtype: ~azure.mgmt.chaos.models.Scenario :raises ~azure.core.exceptions.HttpResponseError: @@ -6427,7 +6799,7 @@ async def create_or_update( "scenario_name", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def delete(self, resource_group_name: str, workspace_name: str, scenario_name: str, **kwargs: Any) -> None: """Delete a scenario. @@ -6494,7 +6866,7 @@ async def delete(self, resource_group_name: str, workspace_name: str, scenario_n params_added_on={ "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name", "accept"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def list_all( self, resource_group_name: str, workspace_name: str, **kwargs: Any @@ -6552,7 +6924,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -6595,14 +6970,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class ScenarioRunsOperations: +class ScenarioConfigurationsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.chaos.aio.ChaosManagementClient`'s - :attr:`scenario_runs` attribute. + :attr:`scenario_configurations` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -6622,18 +6997,21 @@ def __init__(self, *args, **kwargs) -> None: "resource_group_name", "workspace_name", "scenario_name", - "run_id", + "scenario_configuration_name", "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def get( - self, resource_group_name: str, workspace_name: str, scenario_name: str, run_id: str, **kwargs: Any - ) -> _models.ScenarioRun: - """Get a scenario run. - - Get a scenario run. + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + **kwargs: Any + ) -> _models.ScenarioConfiguration: + """Get a scenario definition. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -6642,10 +7020,10 @@ async def get( :type workspace_name: str :param scenario_name: Name of the scenario. Required. :type scenario_name: str - :param run_id: The name of the ScenarioRun. Required. - :type run_id: str - :return: ScenarioRun. The ScenarioRun is compatible with MutableMapping - :rtype: ~azure.mgmt.chaos.models.ScenarioRun + :param scenario_configuration_name: Name of the scenario definition. Required. + :type scenario_configuration_name: str + :return: ScenarioConfiguration. The ScenarioConfiguration is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.ScenarioConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6659,13 +7037,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ScenarioRun] = kwargs.pop("cls", None) + cls: ClsType[_models.ScenarioConfiguration] = kwargs.pop("cls", None) - _request = build_scenario_runs_get_request( + _request = build_scenario_configurations_get_request( resource_group_name=resource_group_name, workspace_name=workspace_name, scenario_name=scenario_name, - run_id=run_id, + scenario_configuration_name=scenario_configuration_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -6684,7 +7062,7 @@ async def get( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -6697,22 +7075,16 @@ async def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ScenarioRun, response.json()) + deserialized = _deserialize(_models.ScenarioConfiguration, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace @api_version_validation( method_added_on="2026-05-01-preview", params_added_on={ @@ -6722,165 +7094,52 @@ async def get( "resource_group_name", "workspace_name", "scenario_name", + "scenario_configuration_name", + "content_type", "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) - def list_all( - self, resource_group_name: str, workspace_name: str, scenario_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ScenarioRun"]: - """Get a list of scenario runs. + async def _create_or_update_initial( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + resource: Union[_models.ScenarioConfiguration, _types.ScenarioConfiguration, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: String that represents a Workspace resource name. Required. - :type workspace_name: str - :param scenario_name: Name of the scenario. Required. - :type scenario_name: str - :return: An iterator like instance of ScenarioRun - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.chaos.models.ScenarioRun] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ScenarioRun]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_scenario_runs_list_all_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - scenario_name=scenario_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ScenarioRun], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "workspace_name", - "scenario_name", - "run_id", - ] - }, - api_versions_list=["2026-05-01-preview"], - ) - async def cancel( - self, resource_group_name: str, workspace_name: str, scenario_name: str, run_id: str, **kwargs: Any - ) -> None: - """Cancel the currently running scenario execution. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: String that represents a Workspace resource name. Required. - :type workspace_name: str - :param scenario_name: Name of the scenario. Required. - :type scenario_name: str - :param run_id: The name of the ScenarioRun. Required. - :type run_id: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - cls: ClsType[None] = kwargs.pop("cls", None) + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_scenario_runs_cancel_request( + _request = build_scenario_configurations_create_or_update_request( resource_group_name=resource_group_name, workspace_name=workspace_name, scenario_name=scenario_name, - run_id=run_id, + scenario_configuration_name=scenario_configuration_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -6889,14 +7148,19 @@ async def cancel( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -6905,55 +7169,32 @@ async def cancel( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) -class ScenarioConfigurationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - Instead, you should access the following operations through - :class:`~azure.mgmt.chaos.aio.ChaosManagementClient`'s - :attr:`scenario_configurations` attribute. - """ + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ChaosManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return deserialized # type: ignore - @distributed_trace_async - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "workspace_name", - "scenario_name", - "scenario_configuration_name", - "accept", - ] - }, - api_versions_list=["2026-05-01-preview"], - ) - async def get( + @overload + async def begin_create_or_update( self, resource_group_name: str, workspace_name: str, scenario_name: str, scenario_configuration_name: str, + resource: _models.ScenarioConfiguration, + *, + content_type: str = "application/json", **kwargs: Any - ) -> _models.ScenarioConfiguration: - """Get a scenario definition. + ) -> AsyncLROPoller[_models.ScenarioConfiguration]: + """Create or update a scenario definition. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -6964,233 +7205,50 @@ async def get( :type scenario_name: str :param scenario_configuration_name: Name of the scenario definition. Required. :type scenario_configuration_name: str - :return: ScenarioConfiguration. The ScenarioConfiguration is compatible with MutableMapping - :rtype: ~azure.mgmt.chaos.models.ScenarioConfiguration + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.chaos.models.ScenarioConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ScenarioConfiguration. The + ScenarioConfiguration is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.ScenarioConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + resource: _types.ScenarioConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ScenarioConfiguration]: + """Create or update a scenario definition. - cls: ClsType[_models.ScenarioConfiguration] = kwargs.pop("cls", None) - - _request = build_scenario_configurations_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - scenario_name=scenario_name, - scenario_configuration_name=scenario_configuration_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ScenarioConfiguration, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "workspace_name", - "scenario_name", - "scenario_configuration_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-05-01-preview"], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - scenario_name: str, - scenario_configuration_name: str, - resource: Union[_models.ScenarioConfiguration, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_scenario_configurations_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - scenario_name=scenario_name, - scenario_configuration_name=scenario_configuration_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - scenario_name: str, - scenario_configuration_name: str, - resource: _models.ScenarioConfiguration, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ScenarioConfiguration]: - """Create or update a scenario definition. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: String that represents a Workspace resource name. Required. - :type workspace_name: str - :param scenario_name: Name of the scenario. Required. - :type scenario_name: str - :param scenario_configuration_name: Name of the scenario definition. Required. - :type scenario_configuration_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.chaos.models.ScenarioConfiguration - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ScenarioConfiguration. The - ScenarioConfiguration is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.ScenarioConfiguration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - scenario_name: str, - scenario_configuration_name: str, - resource: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ScenarioConfiguration]: - """Create or update a scenario definition. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: String that represents a Workspace resource name. Required. - :type workspace_name: str - :param scenario_name: Name of the scenario. Required. - :type scenario_name: str - :param scenario_configuration_name: Name of the scenario definition. Required. - :type scenario_configuration_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ScenarioConfiguration. The - ScenarioConfiguration is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.ScenarioConfiguration] - :raises ~azure.core.exceptions.HttpResponseError: - """ + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param scenario_name: Name of the scenario. Required. + :type scenario_name: str + :param scenario_configuration_name: Name of the scenario definition. Required. + :type scenario_configuration_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.chaos.types.ScenarioConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ScenarioConfiguration. The + ScenarioConfiguration is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.ScenarioConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ @overload async def begin_create_or_update( @@ -7241,7 +7299,7 @@ async def begin_create_or_update( "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def begin_create_or_update( self, @@ -7249,7 +7307,7 @@ async def begin_create_or_update( workspace_name: str, scenario_name: str, scenario_configuration_name: str, - resource: Union[_models.ScenarioConfiguration, JSON, IO[bytes]], + resource: Union[_models.ScenarioConfiguration, _types.ScenarioConfiguration, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ScenarioConfiguration]: """Create or update a scenario definition. @@ -7263,9 +7321,10 @@ async def begin_create_or_update( :type scenario_name: str :param scenario_configuration_name: Name of the scenario definition. Required. :type scenario_configuration_name: str - :param resource: Resource create parameters. Is one of the following types: - ScenarioConfiguration, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.chaos.models.ScenarioConfiguration or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a ScenarioConfiguration type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.chaos.models.ScenarioConfiguration or + ~azure.mgmt.chaos.types.ScenarioConfiguration or IO[bytes] :return: An instance of AsyncLROPoller that returns ScenarioConfiguration. The ScenarioConfiguration is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.ScenarioConfiguration] @@ -7337,7 +7396,7 @@ def get_long_running_output(pipeline_response): "scenario_configuration_name", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def _delete_initial( self, @@ -7420,7 +7479,7 @@ async def _delete_initial( "scenario_configuration_name", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def begin_delete( self, @@ -7504,7 +7563,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def list_all( self, resource_group_name: str, workspace_name: str, scenario_name: str, **kwargs: Any @@ -7565,7 +7624,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -7607,7 +7669,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - @distributed_trace_async @api_version_validation( method_added_on="2026-05-01-preview", params_added_on={ @@ -7620,31 +7681,16 @@ async def get_next(next_link=None): "scenario_configuration_name", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) - async def execute( + async def _execute_initial( self, resource_group_name: str, workspace_name: str, scenario_name: str, scenario_configuration_name: str, **kwargs: Any - ) -> None: - """Execute the scenario execution with the given scenario configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: String that represents a Workspace resource name. Required. - :type workspace_name: str - :param scenario_name: Name of the scenario. Required. - :type scenario_name: str - :param scenario_configuration_name: Name of the scenario definition. Required. - :type scenario_configuration_name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7656,7 +7702,7 @@ async def execute( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_scenario_configurations_execute_request( resource_group_name=resource_group_name, @@ -7673,7 +7719,8 @@ async def execute( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -7681,6 +7728,10 @@ async def execute( response = pipeline_response.http_response if response.status_code not in [202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -7692,9 +7743,14 @@ async def execute( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @distributed_trace_async @api_version_validation( method_added_on="2026-05-01-preview", params_added_on={ @@ -7707,30 +7763,123 @@ async def execute( "scenario_configuration_name", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) - async def _validate_initial( + async def begin_execute( self, resource_group_name: str, workspace_name: str, scenario_name: str, scenario_configuration_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + ) -> AsyncLROPoller[_models.ScenarioRun]: + """Execute the scenario execution with the given scenario configuration. - _request = build_scenario_configurations_validate_request( + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param scenario_name: Name of the scenario. Required. + :type scenario_name: str + :param scenario_configuration_name: Name of the scenario definition. Required. + :type scenario_configuration_name: str + :return: An instance of AsyncLROPoller that returns ScenarioRun. The ScenarioRun is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.ScenarioRun] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ScenarioRun] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._execute_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + scenario_name=scenario_name, + scenario_configuration_name=scenario_configuration_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ScenarioRun, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ScenarioRun].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ScenarioRun]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "scenario_name", + "scenario_configuration_name", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) + async def _validate_initial( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_scenario_configurations_validate_request( resource_group_name=resource_group_name, workspace_name=workspace_name, scenario_name=scenario_name, @@ -7789,7 +7938,7 @@ async def _validate_initial( "scenario_configuration_name", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def begin_validate( self, @@ -7883,7 +8032,7 @@ def get_long_running_output(pipeline_response): "content_type", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def _fix_resource_permissions_initial( self, @@ -7891,7 +8040,9 @@ async def _fix_resource_permissions_initial( workspace_name: str, scenario_name: str, scenario_configuration_name: str, - body: Optional[Union[_models.FixResourcePermissionsRequest, JSON, IO[bytes]]] = None, + body: Optional[ + Union[_models.FixResourcePermissionsRequest, _types.FixResourcePermissionsRequest, IO[bytes]] + ] = None, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -8008,7 +8159,7 @@ async def begin_fix_resource_permissions( workspace_name: str, scenario_name: str, scenario_configuration_name: str, - body: Optional[JSON] = None, + body: Optional[_types.FixResourcePermissionsRequest] = None, *, content_type: str = "application/json", **kwargs: Any @@ -8025,7 +8176,7 @@ async def begin_fix_resource_permissions( :param scenario_configuration_name: Name of the scenario definition. Required. :type scenario_configuration_name: str :param body: Default value is None. - :type body: JSON + :type body: ~azure.mgmt.chaos.types.FixResourcePermissionsRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8083,7 +8234,7 @@ async def begin_fix_resource_permissions( "content_type", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def begin_fix_resource_permissions( self, @@ -8091,7 +8242,9 @@ async def begin_fix_resource_permissions( workspace_name: str, scenario_name: str, scenario_configuration_name: str, - body: Optional[Union[_models.FixResourcePermissionsRequest, JSON, IO[bytes]]] = None, + body: Optional[ + Union[_models.FixResourcePermissionsRequest, _types.FixResourcePermissionsRequest, IO[bytes]] + ] = None, **kwargs: Any ) -> AsyncLROPoller[_models.PermissionsFix]: """Fixes resource permissions for the given scenario configuration. @@ -8105,9 +8258,10 @@ async def begin_fix_resource_permissions( :type scenario_name: str :param scenario_configuration_name: Name of the scenario definition. Required. :type scenario_configuration_name: str - :param body: Is one of the following types: FixResourcePermissionsRequest, JSON, IO[bytes] - Default value is None. - :type body: ~azure.mgmt.chaos.models.FixResourcePermissionsRequest or JSON or IO[bytes] + :param body: Is either a FixResourcePermissionsRequest type or a IO[bytes] type. Default value + is None. + :type body: ~azure.mgmt.chaos.models.FixResourcePermissionsRequest or + ~azure.mgmt.chaos.types.FixResourcePermissionsRequest or IO[bytes] :return: An instance of AsyncLROPoller that returns PermissionsFix. The PermissionsFix is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.PermissionsFix] @@ -8171,3 +8325,897 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[_models.PermissionsFix]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + + +class ScenarioRunsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.chaos.aio.ChaosManagementClient`'s + :attr:`scenario_runs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ChaosManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "scenario_name", + "run_id", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) + async def get( + self, resource_group_name: str, workspace_name: str, scenario_name: str, run_id: str, **kwargs: Any + ) -> _models.ScenarioRun: + """Get a scenario run. + + This endpoint is also the polling target for ScenarioConfigurations.execute + and ScenarioRuns.cancel (final-state-via: location). While the run is in + progress the service returns 202 with a Location header pointing back to + this URL; clients must keep polling until they receive 200, which carries + the final ScenarioRun body. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param scenario_name: Name of the scenario. Required. + :type scenario_name: str + :param run_id: The name of the ScenarioRun. Required. + :type run_id: str + :return: ScenarioRun. The ScenarioRun is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.ScenarioRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ScenarioRun] = kwargs.pop("cls", None) + + _request = build_scenario_runs_get_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + scenario_name=scenario_name, + run_id=run_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ScenarioRun, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "scenario_name", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) + def list_all( + self, resource_group_name: str, workspace_name: str, scenario_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ScenarioRun"]: + """Get a list of scenario runs. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param scenario_name: Name of the scenario. Required. + :type scenario_name: str + :return: An iterator like instance of ScenarioRun + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.chaos.models.ScenarioRun] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ScenarioRun]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_scenario_runs_list_all_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + scenario_name=scenario_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ScenarioRun], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "scenario_name", + "run_id", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) + async def _cancel_initial( + self, resource_group_name: str, workspace_name: str, scenario_name: str, run_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_scenario_runs_cancel_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + scenario_name=scenario_name, + run_id=run_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "scenario_name", + "run_id", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) + async def begin_cancel( + self, resource_group_name: str, workspace_name: str, scenario_name: str, run_id: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ScenarioRun]: + """Cancel the currently running scenario execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param scenario_name: Name of the scenario. Required. + :type scenario_name: str + :param run_id: The name of the ScenarioRun. Required. + :type run_id: str + :return: An instance of AsyncLROPoller that returns ScenarioRun. The ScenarioRun is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.chaos.models.ScenarioRun] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ScenarioRun] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._cancel_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + scenario_name=scenario_name, + run_id=run_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ScenarioRun, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ScenarioRun].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ScenarioRun]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.chaos.aio.ChaosManagementClient`'s + :attr:`connections` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ChaosManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "connection_name", + "accept", + ] + }, + api_versions_list=["2026-08-01-preview"], + ) + async def get( + self, resource_group_name: str, workspace_name: str, connection_name: str, **kwargs: Any + ) -> _models.Connection: + """Get a connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param connection_name: Name of the connection. Required. + :type connection_name: str + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.Connection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + + _request = build_connections_get_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Connection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + resource: _models.Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Connection: + """Create or update a connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param connection_name: Name of the connection. Required. + :type connection_name: str + :param resource: Connection resource to be created or updated. Required. + :type resource: ~azure.mgmt.chaos.models.Connection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.Connection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + resource: _types.Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Connection: + """Create or update a connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param connection_name: Name of the connection. Required. + :type connection_name: str + :param resource: Connection resource to be created or updated. Required. + :type resource: ~azure.mgmt.chaos.types.Connection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.Connection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Connection: + """Create or update a connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param connection_name: Name of the connection. Required. + :type connection_name: str + :param resource: Connection resource to be created or updated. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.Connection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "connection_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-08-01-preview"], + ) + async def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + resource: Union[_models.Connection, _types.Connection, IO[bytes]], + **kwargs: Any + ) -> _models.Connection: + """Create or update a connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param connection_name: Name of the connection. Required. + :type connection_name: str + :param resource: Connection resource to be created or updated. Is either a Connection type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.chaos.models.Connection or ~azure.mgmt.chaos.types.Connection or + IO[bytes] + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.Connection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_connections_create_or_update_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Connection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "connection_name", + ] + }, + api_versions_list=["2026-08-01-preview"], + ) + async def delete(self, resource_group_name: str, workspace_name: str, connection_name: str, **kwargs: Any) -> None: + """Delete a connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param connection_name: Name of the connection. Required. + :type connection_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_connections_delete_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name", "accept"] + }, + api_versions_list=["2026-08-01-preview"], + ) + def list_all( + self, resource_group_name: str, workspace_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.Connection"]: + """Get a list of connections. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :return: An iterator like instance of Connection + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.chaos.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Connection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connections_list_all_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Connection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/operations/_patch.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/operations/_patch.py index ea765788358a..87676c65a8f0 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/operations/_patch.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/aio/operations/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/__init__.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/__init__.py index f46a02655d1b..953a17a20f5e 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/__init__.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/__init__.py @@ -35,8 +35,8 @@ ChaosTargetSelector, ChaosTargetSimpleFilter, ChaosTargetSimpleFilterParameters, - ConfigurationExclusions, - ConfigurationFilters, + Connection, + ConnectionProperties, ContinuousAction, CustomerDataStorageProperties, DelayAction, @@ -84,6 +84,8 @@ Recommendation, Resource, ResourceStateError, + ResourceTargeting, + ResourceTargetingCriteria, RoleAssignmentError, RoleAssignmentResult, RunAfter, @@ -92,7 +94,6 @@ ScenarioConfiguration, ScenarioConfigurationProperties, ScenarioErrors, - ScenarioEvaluationResultItem, ScenarioParameter, ScenarioProperties, ScenarioRun, @@ -105,11 +106,14 @@ TargetReference, TargetType, TargetTypeProperties, + TemplateEvaluationResultItem, TrackedResource, UserAssignedIdentity, Validation, ValidationProperties, Workspace, + WorkspaceDiscovery, + WorkspaceDiscoveryProperties, WorkspaceEvaluation, WorkspaceEvaluationProperties, WorkspaceProperties, @@ -123,6 +127,8 @@ ActionKind, ActionLifecycle, ActionType, + ConnectionKind, + ConnectionStatus, CreatedByType, ExperimentActionType, FilterType, @@ -141,6 +147,7 @@ ScenarioValidationState, SelectorType, TargetReferenceType, + WorkspaceDiscoveryStatus, WorkspaceEvaluationStatus, ZoneResolutionMode, ) @@ -170,8 +177,8 @@ "ChaosTargetSelector", "ChaosTargetSimpleFilter", "ChaosTargetSimpleFilterParameters", - "ConfigurationExclusions", - "ConfigurationFilters", + "Connection", + "ConnectionProperties", "ContinuousAction", "CustomerDataStorageProperties", "DelayAction", @@ -219,6 +226,8 @@ "Recommendation", "Resource", "ResourceStateError", + "ResourceTargeting", + "ResourceTargetingCriteria", "RoleAssignmentError", "RoleAssignmentResult", "RunAfter", @@ -227,7 +236,6 @@ "ScenarioConfiguration", "ScenarioConfigurationProperties", "ScenarioErrors", - "ScenarioEvaluationResultItem", "ScenarioParameter", "ScenarioProperties", "ScenarioRun", @@ -240,11 +248,14 @@ "TargetReference", "TargetType", "TargetTypeProperties", + "TemplateEvaluationResultItem", "TrackedResource", "UserAssignedIdentity", "Validation", "ValidationProperties", "Workspace", + "WorkspaceDiscovery", + "WorkspaceDiscoveryProperties", "WorkspaceEvaluation", "WorkspaceEvaluationProperties", "WorkspaceProperties", @@ -255,6 +266,8 @@ "ActionKind", "ActionLifecycle", "ActionType", + "ConnectionKind", + "ConnectionStatus", "CreatedByType", "ExperimentActionType", "FilterType", @@ -273,6 +286,7 @@ "ScenarioValidationState", "SelectorType", "TargetReferenceType", + "WorkspaceDiscoveryStatus", "WorkspaceEvaluationStatus", "ZoneResolutionMode", ] diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/_enums.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/_enums.py index de6d3728856c..4ff02061d844 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/_enums.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/_enums.py @@ -54,6 +54,33 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Actions are for internal-only APIs.""" +class ConnectionKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of connection, indicating the actor type authorized to reach the Chaos Studio data + plane for the workspace and target. + """ + + AKS_EXTENSION = "AksExtension" + """A connection backed by the Chaos AKS cluster extension.""" + CHAOS_AGENT = "ChaosAgent" + """A connection backed by the Chaos agent installed on the target resource.""" + CSFI = "Csfi" + """A connection backed by Cloud Service Fault Injection (CSFI).""" + + +class ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of a connection.""" + + PENDING = "Pending" + """The connection has been created but is not yet sending heartbeats; the trust relationship is + not yet established.""" + CONNECTED = "Connected" + """The connection is established and actively heartbeating.""" + DISCONNECTED = "Disconnected" + """The connection's heartbeat has gone stale; heartbeats are no longer being received.""" + REVOKED = "Revoked" + """The connection's credentials have been revoked.""" + + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The kind of entity that created the resource.""" @@ -320,6 +347,23 @@ class TargetReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Chaos target reference type.""" +class WorkspaceDiscoveryStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enum of the workspace discovery status.""" + + PENDING = "Pending" + """The discovery is pending and has not started.""" + QUEUED = "Queued" + """The discovery has been accepted and is queued for execution.""" + IN_PROGRESS = "InProgress" + """The discovery is in progress.""" + SUCCEEDED = "Succeeded" + """The discovery completed successfully.""" + FAILED = "Failed" + """The discovery failed.""" + CANCELED = "Canceled" + """The discovery was canceled.""" + + class WorkspaceEvaluationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Enum of the workspace evaluation status.""" diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/_models.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/_models.py index 2a0e551a465e..fa3b9a72e822 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/_models.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/_models.py @@ -965,34 +965,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ConfigurationExclusions(_Model): - """Model that represents exclusion criteria for protecting resources from fault injection. Uses - union (OR) logic - a resource is excluded if it matches ANY criteria. +class Connection(ProxyResource): + """Model that represents a connection between a workspace and a target resource. A connection + provisions and tracks the trust relationship that authorizes the actor to reach the Chaos + Studio data plane for the workspace and target during fault injection. - :ivar resources: Array of specific resource IDs to exclude from fault injection. - :vartype resources: list[str] - :ivar tags: Array of tag key-value pairs. Resources with matching tags are excluded. - :vartype tags: list[~azure.mgmt.chaos.models.KeyValuePair] - :ivar types: Array of resource types. All resources of these types are excluded. - :vartype types: list[str] + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.chaos.models.SystemData + :ivar properties: The properties of the connection. + :vartype properties: ~azure.mgmt.chaos.models.ConnectionProperties """ - resources: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Array of specific resource IDs to exclude from fault injection.""" - tags: Optional[list["_models.KeyValuePair"]] = rest_field( + properties: Optional["_models.ConnectionProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Array of tag key-value pairs. Resources with matching tags are excluded.""" - types: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Array of resource types. All resources of these types are excluded.""" + """The properties of the connection.""" @overload def __init__( self, *, - resources: Optional[list[str]] = None, - tags: Optional[list["_models.KeyValuePair"]] = None, - types: Optional[list[str]] = None, + properties: Optional["_models.ConnectionProperties"] = None, ) -> None: ... @overload @@ -1006,74 +1008,96 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ConfigurationFilters(_Model): - """Model that represents filter criteria for constraining which discovered - resources participate in fault injection. +class ConnectionProperties(_Model): + """Model that represents the properties of a connection. - Uses intersection (AND) logic — a resource is included only if it matches all criteria. + The schema is flat and discriminated by ``kind``. Optional fields form the + superset across all connection kinds; which fields are required is + validated by the service per kind. - :ivar locations: Array of Azure location strings. Only resources in these locations are - included. - - Null or omitted means all locations (no filter). Empty array means include nothing. - :vartype locations: list[str] - :ivar zones: Array of availability zone identifiers ("1", "2", "3", "zone-redundant"). - Only resources whose zones intersect this list are included. - - Null or omitted means all zones (including non-zonal). Empty array means include nothing. - - Mutually exclusive with ``physicalZones`` — set one or the other, not both. - :vartype zones: list[str] - :ivar physical_zones: Array of physical availability zone identifiers in ``{region}-az{N}`` - format - (e.g., ``"westus2-az1"``). Only resources in the corresponding logical zone - for each subscription are included. - - At execution time, each physical zone is resolved to per-subscription - logical zones via the Azure locations API. The resolved mapping is surfaced - on the scenario run response (``zoneResolution``). - - Null or omitted means physical zone targeting is not used. - Only one physical zone is supported in preview. - - Mutually exclusive with ``zones`` — set one or the other, not both. - :vartype physical_zones: list[str] + :ivar kind: The kind of connection, indicating the actor type authorized to reach the Chaos + Studio data plane for the workspace and target. Required. Known values are: "AksExtension", + "ChaosAgent", and "Csfi". + :vartype kind: str or ~azure.mgmt.chaos.models.ConnectionKind + :ivar target_resource_id: The fully qualified Azure resource ID of the target resource this + connection is established with. Required. + :vartype target_resource_id: str + :ivar principal_id: The Microsoft Entra principal (object) ID of the identity used by the + connection. + :vartype principal_id: str + :ivar tenant_id: The Microsoft Entra tenant ID that the connection identity belongs to. + :vartype tenant_id: str + :ivar certificate_subject_name: The subject name of the certificate used to authenticate the + connection. + :vartype certificate_subject_name: str + :ivar certificate_issuer: The issuer of the certificate used to authenticate the connection. + :vartype certificate_issuer: str + :ivar dsts_principal: The dSTS principal name used to authenticate the connection. + :vartype dsts_principal: str + :ivar data_plane_endpoint: The regional Chaos Studio data-plane endpoint assigned to this + connection. Clients and agents use this endpoint to reach the Chaos Studio data plane for the + connection. + :vartype data_plane_endpoint: str + :ivar status: The current status of the connection. Known values are: "Pending", "Connected", + "Disconnected", and "Revoked". + :vartype status: str or ~azure.mgmt.chaos.models.ConnectionStatus + :ivar provisioning_state: The most recent provisioning state for the connection resource. Known + values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting", and + "Running". + :vartype provisioning_state: str or ~azure.mgmt.chaos.models.ProvisioningState """ - locations: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Array of Azure location strings. Only resources in these locations are included. - - Null or omitted means all locations (no filter). Empty array means include nothing.""" - zones: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Array of availability zone identifiers (\"1\", \"2\", \"3\", \"zone-redundant\"). - Only resources whose zones intersect this list are included. - - Null or omitted means all zones (including non-zonal). Empty array means include nothing. - - Mutually exclusive with ``physicalZones`` — set one or the other, not both.""" - physical_zones: Optional[list[str]] = rest_field( - name="physicalZones", visibility=["read", "create", "update", "delete", "query"] + kind: Union[str, "_models.ConnectionKind"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The kind of connection, indicating the actor type authorized to reach the Chaos Studio data + plane for the workspace and target. Required. Known values are: \"AksExtension\", + \"ChaosAgent\", and \"Csfi\".""" + target_resource_id: str = rest_field( + name="targetResourceId", visibility=["read", "create", "update", "delete", "query"] ) - """Array of physical availability zone identifiers in ``{region}-az{N}`` format - (e.g., ``\"westus2-az1\"``). Only resources in the corresponding logical zone - for each subscription are included. - - At execution time, each physical zone is resolved to per-subscription - logical zones via the Azure locations API. The resolved mapping is surfaced - on the scenario run response (``zoneResolution``). - - Null or omitted means physical zone targeting is not used. - Only one physical zone is supported in preview. - - Mutually exclusive with ``zones`` — set one or the other, not both.""" + """The fully qualified Azure resource ID of the target resource this connection is established + with. Required.""" + principal_id: Optional[str] = rest_field( + name="principalId", visibility=["read", "create", "update", "delete", "query"] + ) + """The Microsoft Entra principal (object) ID of the identity used by the connection.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """The Microsoft Entra tenant ID that the connection identity belongs to.""" + certificate_subject_name: Optional[str] = rest_field( + name="certificateSubjectName", visibility=["read", "create", "update", "delete", "query"] + ) + """The subject name of the certificate used to authenticate the connection.""" + certificate_issuer: Optional[str] = rest_field( + name="certificateIssuer", visibility=["read", "create", "update", "delete", "query"] + ) + """The issuer of the certificate used to authenticate the connection.""" + dsts_principal: Optional[str] = rest_field( + name="dstsPrincipal", visibility=["read", "create", "update", "delete", "query"] + ) + """The dSTS principal name used to authenticate the connection.""" + data_plane_endpoint: Optional[str] = rest_field(name="dataPlaneEndpoint", visibility=["read"]) + """The regional Chaos Studio data-plane endpoint assigned to this connection. Clients and agents + use this endpoint to reach the Chaos Studio data plane for the connection.""" + status: Optional[Union[str, "_models.ConnectionStatus"]] = rest_field(visibility=["read"]) + """The current status of the connection. Known values are: \"Pending\", \"Connected\", + \"Disconnected\", and \"Revoked\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The most recent provisioning state for the connection resource. Known values are: + \"Succeeded\", \"Failed\", \"Canceled\", \"Creating\", \"Updating\", \"Deleting\", and + \"Running\".""" @overload def __init__( self, *, - locations: Optional[list[str]] = None, - zones: Optional[list[str]] = None, - physical_zones: Optional[list[str]] = None, + kind: Union[str, "_models.ConnectionKind"], + target_resource_id: str, + principal_id: Optional[str] = None, + tenant_id: Optional[str] = None, + certificate_subject_name: Optional[str] = None, + certificate_issuer: Optional[str] = None, + dsts_principal: Optional[str] = None, ) -> None: ... @overload @@ -1896,7 +1920,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class KeyValuePair(_Model): - """A map used to describe parameters for actions or configurations. + """A key-value pair used to describe parameters for actions or configurations. :ivar key: The name of the setting for the action. Required. :vartype key: str @@ -2189,6 +2213,10 @@ class PermissionError(_Model): :vartype recommended_roles: list[str] :ivar identity: The identity. :vartype identity: ~azure.mgmt.chaos.models.EntraIdentity + :ivar error_message: The error message describing the permission validation failure, when the + failure carries a distinct message (for example, when the target could not be read to evaluate + access). + :vartype error_message: str """ resource_id: str = rest_field(name="resourceId", visibility=["read"]) @@ -2201,6 +2229,9 @@ class PermissionError(_Model): """The recommended roles. Required.""" identity: Optional["_models.EntraIdentity"] = rest_field(visibility=["read"]) """The identity.""" + error_message: Optional[str] = rest_field(name="errorMessage", visibility=["read"]) + """The error message describing the permission validation failure, when the failure carries a + distinct message (for example, when the target could not be read to evaluate access).""" class PermissionsFix(ProxyResource): @@ -2765,6 +2796,134 @@ class ResourceStateError(_Model): """The remediation uri. Required.""" +class ResourceTargeting(_Model): + """Model that represents unified resource targeting with symmetric include/exclude criteria. Both + sides support the same set of dimensions. + + :ivar include: Inclusion criteria. Resources must match ALL active dimensions to be candidates. + Null or omitted means no inclusion filtering (all resources are candidates). + :vartype include: ~azure.mgmt.chaos.models.ResourceTargetingCriteria + :ivar exclude: Exclusion criteria. Resources matching ANY active dimension are removed. Null or + omitted means no exclusions applied. + :vartype exclude: ~azure.mgmt.chaos.models.ResourceTargetingCriteria + """ + + include: Optional["_models.ResourceTargetingCriteria"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Inclusion criteria. Resources must match ALL active dimensions to be candidates. Null or + omitted means no inclusion filtering (all resources are candidates).""" + exclude: Optional["_models.ResourceTargetingCriteria"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Exclusion criteria. Resources matching ANY active dimension are removed. Null or omitted means + no exclusions applied.""" + + @overload + def __init__( + self, + *, + include: Optional["_models.ResourceTargetingCriteria"] = None, + exclude: Optional["_models.ResourceTargetingCriteria"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResourceTargetingCriteria(_Model): + """Model that represents a set of targeting criteria for resource selection. + Used on both the include and exclude sides of ResourceTargeting. + + All dimensions use unified null/empty semantics: + + * Null or omitted means "no constraint" (this dimension is inactive). + * Empty array is treated the same as null (no constraint). + * Non-empty array means the dimension is active. + + :ivar locations: Array of Azure location strings (e.g., "eastus", "westeurope", "global"). + Case-insensitive, normalized form only (e.g., "eastus" not "East US"). + :vartype locations: list[str] + :ivar zones: Array of logical availability zone identifiers (e.g., "1", "2", "3", + "zone-redundant"). + + Mutually exclusive with ``physicalZones`` — set one or the other, not both. + When set, ``locations`` must also be set on the same side (zone IDs are only meaningful within + a region). + :vartype zones: list[str] + :ivar physical_zones: Array of physical datacenter zone identifiers in ``{region}-az{N}`` + format + (e.g., "westus2-az1"). Resolved to logical zones per-subscription at execution time. + + Mutually exclusive with ``zones`` — set one or the other, not both. + :vartype physical_zones: list[str] + :ivar types: Array of Azure resource type strings (e.g., "Microsoft.Compute/virtualMachines"). + Case-insensitive equality. Supports trailing wildcard (e.g., "Microsoft.Compute/*"). + :vartype types: list[str] + :ivar tags: Array of tag key-value pairs for filtering by Azure resource tags. Key and value + are matched case-insensitively. Use "*" as value to match any value for a key. + :vartype tags: list[~azure.mgmt.chaos.models.KeyValuePair] + :ivar resources: Array of fully qualified Azure resource IDs. Case-insensitive equality. + :vartype resources: list[str] + """ + + locations: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Array of Azure location strings (e.g., \"eastus\", \"westeurope\", \"global\"). + Case-insensitive, normalized form only (e.g., \"eastus\" not \"East US\").""" + zones: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Array of logical availability zone identifiers (e.g., \"1\", \"2\", \"3\", \"zone-redundant\"). + + Mutually exclusive with ``physicalZones`` — set one or the other, not both. + When set, ``locations`` must also be set on the same side (zone IDs are only meaningful within + a region).""" + physical_zones: Optional[list[str]] = rest_field( + name="physicalZones", visibility=["read", "create", "update", "delete", "query"] + ) + """Array of physical datacenter zone identifiers in ``{region}-az{N}`` format + (e.g., \"westus2-az1\"). Resolved to logical zones per-subscription at execution time. + + Mutually exclusive with ``zones`` — set one or the other, not both.""" + types: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Array of Azure resource type strings (e.g., \"Microsoft.Compute/virtualMachines\"). + Case-insensitive equality. Supports trailing wildcard (e.g., \"Microsoft.Compute/*\").""" + tags: Optional[list["_models.KeyValuePair"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Array of tag key-value pairs for filtering by Azure resource tags. Key and value are matched + case-insensitively. Use \"*\" as value to match any value for a key.""" + resources: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Array of fully qualified Azure resource IDs. Case-insensitive equality.""" + + @overload + def __init__( + self, + *, + locations: Optional[list[str]] = None, + zones: Optional[list[str]] = None, + physical_zones: Optional[list[str]] = None, + types: Optional[list[str]] = None, + tags: Optional[list["_models.KeyValuePair"]] = None, + resources: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class RoleAssignmentError(_Model): """Error details for a failed role assignment. @@ -2937,7 +3096,7 @@ class ScenarioAction(_Model): """Human-readable description of what this action does.""" duration: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """ISO 8601 duration for how long the action runs (e.g., PT30M for 30 minutes). Supports template - macro syntax (%%\{parameters.\\}%%). Required.""" + macro syntax (%%\\{parameters.\\\\}%%). Required.""" parameters: Optional[list["_models.KeyValuePair"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -3033,15 +3192,21 @@ class ScenarioConfigurationProperties(_Model): :ivar parameters: Runtime parameter values for the scenario. Keys must match parameter names defined in the scenario. :vartype parameters: list[~azure.mgmt.chaos.models.KeyValuePair] - :ivar exclusions: Exclusion criteria for protecting resources from fault injection. - :vartype exclusions: ~azure.mgmt.chaos.models.ConfigurationExclusions :ivar provisioning_state: Most recent provisioning state for the given scenario resource. Known values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting", and "Running". :vartype provisioning_state: str or ~azure.mgmt.chaos.models.ProvisioningState - :ivar filters: Filter criteria used to constrain which discovered resources participate in - fault injection. - :vartype filters: ~azure.mgmt.chaos.models.ConfigurationFilters + :ivar resource_targeting: Unified resource targeting policy that controls which discovered + resources participate + in fault injection. Replaces the separate ``exclusions`` and ``filters`` properties with + symmetric include/exclude criteria. + + Include uses AND logic — a resource must match ALL active include dimensions. + Exclude uses OR logic — a resource is removed if it matches ANY exclude dimension. + When include and exclude conflict on the same resource, exclude wins. + + Null or omitted means all discovered resources participate (no targeting constraints). + :vartype resource_targeting: ~azure.mgmt.chaos.models.ResourceTargeting """ scenario_id: str = rest_field(name="scenarioId", visibility=["read", "create", "update", "delete", "query"]) @@ -3051,20 +3216,24 @@ class ScenarioConfigurationProperties(_Model): ) """Runtime parameter values for the scenario. Keys must match parameter names defined in the scenario.""" - exclusions: Optional["_models.ConfigurationExclusions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Exclusion criteria for protecting resources from fault injection.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) """Most recent provisioning state for the given scenario resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", \"Creating\", \"Updating\", \"Deleting\", and \"Running\".""" - filters: Optional["_models.ConfigurationFilters"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + resource_targeting: Optional["_models.ResourceTargeting"] = rest_field( + name="resourceTargeting", visibility=["read", "create", "update", "delete", "query"] ) - """Filter criteria used to constrain which discovered resources participate in fault injection.""" + """Unified resource targeting policy that controls which discovered resources participate + in fault injection. Replaces the separate ``exclusions`` and ``filters`` properties with + symmetric include/exclude criteria. + + Include uses AND logic — a resource must match ALL active include dimensions. + Exclude uses OR logic — a resource is removed if it matches ANY exclude dimension. + When include and exclude conflict on the same resource, exclude wins. + + Null or omitted means all discovered resources participate (no targeting constraints).""" @overload def __init__( @@ -3072,8 +3241,7 @@ def __init__( *, scenario_id: str, parameters: Optional[list["_models.KeyValuePair"]] = None, - exclusions: Optional["_models.ConfigurationExclusions"] = None, - filters: Optional["_models.ConfigurationFilters"] = None, + resource_targeting: Optional["_models.ResourceTargeting"] = None, ) -> None: ... @overload @@ -3130,45 +3298,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ScenarioEvaluationResultItem(_Model): - """Model that represents a single scenario evaluation result. - - :ivar scenario_name: The name of the scenario that was evaluated. Required. - :vartype scenario_name: str - :ivar evaluation_result: The evaluation result for this scenario. Required. Known values are: - "NotEvaluated", "Recommended", "NotApplicable", "Evaluating", "EvaluationFailed", and - "EvaluationCancelled". - :vartype evaluation_result: str or ~azure.mgmt.chaos.models.RecommendationStatus - """ - - scenario_name: str = rest_field(name="scenarioName", visibility=["read", "create", "update", "delete", "query"]) - """The name of the scenario that was evaluated. Required.""" - evaluation_result: Union[str, "_models.RecommendationStatus"] = rest_field( - name="evaluationResult", visibility=["read", "create", "update", "delete", "query"] - ) - """The evaluation result for this scenario. Required. Known values are: \"NotEvaluated\", - \"Recommended\", \"NotApplicable\", \"Evaluating\", \"EvaluationFailed\", and - \"EvaluationCancelled\".""" - - @overload - def __init__( - self, - *, - scenario_name: str, - evaluation_result: Union[str, "_models.RecommendationStatus"], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class ScenarioParameter(_Model): """Model that represents a single scenario parameter definition. @@ -3335,12 +3464,21 @@ class ScenarioRunProperties(_Model): :ivar managed_identity_principal_id: The principal id for the managed identity used for the run. Required. :vartype managed_identity_principal_id: str + :ivar resource_snapshot_id: The resource snapshot ID this run is pinned to. Resolved from the + scenario's pinned evaluation snapshot (template scenarios) or the latest discovery snapshot + (custom scenarios) at run creation, ensuring the run executes against the same set of + discovered resources that produced the recommendation. + :vartype resource_snapshot_id: str :ivar status: The scenario run status. Required. Known values are: "Queued", "Resolving", "Generating", "Validating", "ValidationSucceeded", "Starting", "Preparing", "Running", "CleaningUp", "Canceling", "Canceled", "Succeeded", and "Failed". :vartype status: str or ~azure.mgmt.chaos.models.ScenarioRunState :ivar resources: All resources discovered for the scenario run. Required. :vartype resources: list[~azure.mgmt.chaos.models.ScenarioRunResource] + :ivar excluded_resources: Resources that matched the scenario's target resource types but were + excluded from fault injection by the configuration's resource-targeting filters (for example + zone, location, or explicit exclusions). These resources will not be impacted by the run. + :vartype excluded_resources: list[~azure.mgmt.chaos.models.ScenarioRunResource] :ivar errors: System or infrastructure errors encountered during the scenario run. :vartype errors: list[~azure.mgmt.chaos.models.OperationError] :ivar execution_errors: Business errors from fault injection — permission and resource state @@ -3368,12 +3506,23 @@ class ScenarioRunProperties(_Model): """The scenario configuration name. Required.""" managed_identity_principal_id: str = rest_field(name="managedIdentityPrincipalId", visibility=["read"]) """The principal id for the managed identity used for the run. Required.""" + resource_snapshot_id: Optional[str] = rest_field(name="resourceSnapshotId", visibility=["read"]) + """The resource snapshot ID this run is pinned to. Resolved from the scenario's pinned evaluation + snapshot (template scenarios) or the latest discovery snapshot (custom scenarios) at run + creation, ensuring the run executes against the same set of discovered resources that produced + the recommendation.""" status: Union[str, "_models.ScenarioRunState"] = rest_field(visibility=["read"]) """The scenario run status. Required. Known values are: \"Queued\", \"Resolving\", \"Generating\", \"Validating\", \"ValidationSucceeded\", \"Starting\", \"Preparing\", \"Running\", \"CleaningUp\", \"Canceling\", \"Canceled\", \"Succeeded\", and \"Failed\".""" resources: list["_models.ScenarioRunResource"] = rest_field(visibility=["read"]) """All resources discovered for the scenario run. Required.""" + excluded_resources: Optional[list["_models.ScenarioRunResource"]] = rest_field( + name="excludedResources", visibility=["read"] + ) + """Resources that matched the scenario's target resource types but were excluded from fault + injection by the configuration's resource-targeting filters (for example zone, location, or + explicit exclusions). These resources will not be impacted by the run.""" errors: Optional[list["_models.OperationError"]] = rest_field(visibility=["read"]) """System or infrastructure errors encountered during the scenario run.""" execution_errors: Optional["_models.ScenarioErrors"] = rest_field(name="executionErrors", visibility=["read"]) @@ -3687,6 +3836,61 @@ class TargetTypeProperties(_Model): """List of resource types this Target Type can extend.""" +class TemplateEvaluationResultItem(_Model): + """Model that represents a single template evaluation result. + + :ivar template_id: The template ID that was evaluated. Optional because the underlying BE field + may be null for legacy evaluations created before template-centric persistence landed; the GW + falls back to ``scenarioName`` in that case (``scenario.Id == templateId`` by BE convention), + so ARM responses are typically populated in practice. + :vartype template_id: str + :ivar template_name: The template name that was evaluated. Optional for the same reason as + ``templateId``. + :vartype template_name: str + :ivar evaluation_result: The evaluation result for this template. Required. Known values are: + "NotEvaluated", "Recommended", "NotApplicable", "Evaluating", "EvaluationFailed", and + "EvaluationCancelled". + :vartype evaluation_result: str or ~azure.mgmt.chaos.models.RecommendationStatus + """ + + template_id: Optional[str] = rest_field( + name="templateId", visibility=["read", "create", "update", "delete", "query"] + ) + """The template ID that was evaluated. Optional because the underlying BE field may be null for + legacy evaluations created before template-centric persistence landed; the GW falls back to + ``scenarioName`` in that case (``scenario.Id == templateId`` by BE convention), so ARM + responses are typically populated in practice.""" + template_name: Optional[str] = rest_field( + name="templateName", visibility=["read", "create", "update", "delete", "query"] + ) + """The template name that was evaluated. Optional for the same reason as ``templateId``.""" + evaluation_result: Union[str, "_models.RecommendationStatus"] = rest_field( + name="evaluationResult", visibility=["read", "create", "update", "delete", "query"] + ) + """The evaluation result for this template. Required. Known values are: \"NotEvaluated\", + \"Recommended\", \"NotApplicable\", \"Evaluating\", \"EvaluationFailed\", and + \"EvaluationCancelled\".""" + + @overload + def __init__( + self, + *, + evaluation_result: Union[str, "_models.RecommendationStatus"], + template_id: Optional[str] = None, + template_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class UserAssignedIdentity(_Model): """User assigned identity properties. @@ -3758,6 +3962,13 @@ class ValidationProperties(_Model): :vartype execution_plan_json: str :ivar end_time: The scenario validation UTC end time. :vartype end_time: ~datetime.datetime + :ivar resources: Resources that matched the scenario's target resource types and will be + impacted by the run, resolved after applying the configuration's resource-targeting filters. + :vartype resources: list[~azure.mgmt.chaos.models.ScenarioRunResource] + :ivar excluded_resources: Resources that matched the scenario's target resource types but were + excluded from fault injection by the configuration's resource-targeting filters (for example + zone, location, or explicit exclusions). These resources will not be impacted. + :vartype excluded_resources: list[~azure.mgmt.chaos.models.ScenarioRunResource] :ivar errors: System or infrastructure errors encountered during validation. :vartype errors: list[~azure.mgmt.chaos.models.OperationError] :ivar validation_errors: Business errors from validation — permission and resource state @@ -3778,6 +3989,15 @@ class ValidationProperties(_Model): execution.""" end_time: Optional[datetime.datetime] = rest_field(name="endTime", visibility=["read"], format="rfc3339") """The scenario validation UTC end time.""" + resources: Optional[list["_models.ScenarioRunResource"]] = rest_field(visibility=["read"]) + """Resources that matched the scenario's target resource types and will be impacted by the run, + resolved after applying the configuration's resource-targeting filters.""" + excluded_resources: Optional[list["_models.ScenarioRunResource"]] = rest_field( + name="excludedResources", visibility=["read"] + ) + """Resources that matched the scenario's target resource types but were excluded from fault + injection by the configuration's resource-targeting filters (for example zone, location, or + explicit exclusions). These resources will not be impacted.""" errors: Optional[list["_models.OperationError"]] = rest_field(visibility=["read"]) """System or infrastructure errors encountered during validation.""" validation_errors: Optional["_models.ScenarioErrors"] = rest_field( @@ -3856,6 +4076,80 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class WorkspaceDiscovery(ProxyResource): + """Model that represents the latest workspace discovery result. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.chaos.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.chaos.models.WorkspaceDiscoveryProperties + """ + + properties: Optional["_models.WorkspaceDiscoveryProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.WorkspaceDiscoveryProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class WorkspaceDiscoveryProperties(_Model): + """Model that represents the properties of the workspace discovery. + + :ivar status: The discovery status. Required. Known values are: "Pending", "Queued", + "InProgress", "Succeeded", "Failed", and "Canceled". + :vartype status: str or ~azure.mgmt.chaos.models.WorkspaceDiscoveryStatus + :ivar start_time: The discovery UTC start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: The discovery UTC end time. + :vartype end_time: ~datetime.datetime + :ivar errors: System or infrastructure errors encountered during discovery. + :vartype errors: list[~azure.mgmt.chaos.models.OperationError] + :ivar workspace_id: The workspace ID this discovery belongs to. Required. + :vartype workspace_id: str + :ivar resource_snapshot_id: The resource snapshot ID produced by this discovery. + :vartype resource_snapshot_id: str + """ + + status: Union[str, "_models.WorkspaceDiscoveryStatus"] = rest_field(visibility=["read"]) + """The discovery status. Required. Known values are: \"Pending\", \"Queued\", \"InProgress\", + \"Succeeded\", \"Failed\", and \"Canceled\".""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """The discovery UTC start time.""" + end_time: Optional[datetime.datetime] = rest_field(name="endTime", visibility=["read"], format="rfc3339") + """The discovery UTC end time.""" + errors: Optional[list["_models.OperationError"]] = rest_field(visibility=["read"]) + """System or infrastructure errors encountered during discovery.""" + workspace_id: str = rest_field(name="workspaceId", visibility=["read"]) + """The workspace ID this discovery belongs to. Required.""" + resource_snapshot_id: Optional[str] = rest_field(name="resourceSnapshotId", visibility=["read"]) + """The resource snapshot ID produced by this discovery.""" + + class WorkspaceEvaluation(ProxyResource): """Model that represents the latest workspace evaluation result. @@ -3911,20 +4205,22 @@ class WorkspaceEvaluationProperties(_Model): :vartype errors: list[~azure.mgmt.chaos.models.OperationError] :ivar workspace_id: The workspace ID this evaluation belongs to. Required. :vartype workspace_id: str - :ivar num_scenarios_to_evaluate: The number of scenarios to evaluate. - :vartype num_scenarios_to_evaluate: int - :ivar num_scenarios_evaluated_succeeded: The number of scenarios that evaluated successfully. - :vartype num_scenarios_evaluated_succeeded: int - :ivar num_scenarios_evaluated_failed: The number of scenarios that failed evaluation. - :vartype num_scenarios_evaluated_failed: int - :ivar num_scenarios_evaluated_cancelled: The number of scenarios that were cancelled during + :ivar resource_snapshot_id: The resource snapshot ID used for this evaluation. + :vartype resource_snapshot_id: str + :ivar num_templates_to_evaluate: The number of templates to evaluate. + :vartype num_templates_to_evaluate: int + :ivar num_templates_evaluated_succeeded: The number of templates that evaluated successfully. + :vartype num_templates_evaluated_succeeded: int + :ivar num_templates_evaluated_failed: The number of templates that failed evaluation. + :vartype num_templates_evaluated_failed: int + :ivar num_templates_evaluated_cancelled: The number of templates that were cancelled during evaluation. - :vartype num_scenarios_evaluated_cancelled: int + :vartype num_templates_evaluated_cancelled: int :ivar evaluation_result: The overall evaluation result. Known values are: "NotEvaluated", "Recommended", "NotApplicable", "Evaluating", "EvaluationFailed", and "EvaluationCancelled". :vartype evaluation_result: str or ~azure.mgmt.chaos.models.RecommendationStatus - :ivar results: Per-scenario evaluation results. - :vartype results: list[~azure.mgmt.chaos.models.ScenarioEvaluationResultItem] + :ivar results: Per-template evaluation results. + :vartype results: list[~azure.mgmt.chaos.models.TemplateEvaluationResultItem] """ status: Union[str, "_models.WorkspaceEvaluationStatus"] = rest_field(visibility=["read"]) @@ -3938,25 +4234,27 @@ class WorkspaceEvaluationProperties(_Model): """System or infrastructure errors encountered during evaluation.""" workspace_id: str = rest_field(name="workspaceId", visibility=["read"]) """The workspace ID this evaluation belongs to. Required.""" - num_scenarios_to_evaluate: Optional[int] = rest_field(name="numScenariosToEvaluate", visibility=["read"]) - """The number of scenarios to evaluate.""" - num_scenarios_evaluated_succeeded: Optional[int] = rest_field( - name="numScenariosEvaluatedSucceeded", visibility=["read"] - ) - """The number of scenarios that evaluated successfully.""" - num_scenarios_evaluated_failed: Optional[int] = rest_field(name="numScenariosEvaluatedFailed", visibility=["read"]) - """The number of scenarios that failed evaluation.""" - num_scenarios_evaluated_cancelled: Optional[int] = rest_field( - name="numScenariosEvaluatedCancelled", visibility=["read"] - ) - """The number of scenarios that were cancelled during evaluation.""" + resource_snapshot_id: Optional[str] = rest_field(name="resourceSnapshotId", visibility=["read"]) + """The resource snapshot ID used for this evaluation.""" + num_templates_to_evaluate: Optional[int] = rest_field(name="numTemplatesToEvaluate", visibility=["read"]) + """The number of templates to evaluate.""" + num_templates_evaluated_succeeded: Optional[int] = rest_field( + name="numTemplatesEvaluatedSucceeded", visibility=["read"] + ) + """The number of templates that evaluated successfully.""" + num_templates_evaluated_failed: Optional[int] = rest_field(name="numTemplatesEvaluatedFailed", visibility=["read"]) + """The number of templates that failed evaluation.""" + num_templates_evaluated_cancelled: Optional[int] = rest_field( + name="numTemplatesEvaluatedCancelled", visibility=["read"] + ) + """The number of templates that were cancelled during evaluation.""" evaluation_result: Optional[Union[str, "_models.RecommendationStatus"]] = rest_field( name="evaluationResult", visibility=["read"] ) """The overall evaluation result. Known values are: \"NotEvaluated\", \"Recommended\", \"NotApplicable\", \"Evaluating\", \"EvaluationFailed\", and \"EvaluationCancelled\".""" - results: Optional[list["_models.ScenarioEvaluationResultItem"]] = rest_field(visibility=["read"]) - """Per-scenario evaluation results.""" + results: Optional[list["_models.TemplateEvaluationResultItem"]] = rest_field(visibility=["read"]) + """Per-template evaluation results.""" class WorkspaceProperties(_Model): diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/_patch.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/_patch.py index ea765788358a..87676c65a8f0 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/_patch.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/operations/__init__.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/operations/__init__.py index f4cff5a39c7c..5ea17e03b1ec 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/operations/__init__.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/operations/__init__.py @@ -25,8 +25,9 @@ from ._operations import WorkspacesOperations # type: ignore from ._operations import DiscoveredResourcesOperations # type: ignore from ._operations import ScenariosOperations # type: ignore -from ._operations import ScenarioRunsOperations # type: ignore from ._operations import ScenarioConfigurationsOperations # type: ignore +from ._operations import ScenarioRunsOperations # type: ignore +from ._operations import ConnectionsOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -46,8 +47,9 @@ "WorkspacesOperations", "DiscoveredResourcesOperations", "ScenariosOperations", - "ScenarioRunsOperations", "ScenarioConfigurationsOperations", + "ScenarioRunsOperations", + "ConnectionsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/operations/_operations.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/operations/_operations.py index de195cc50f0c..d9db2d16d2a9 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/operations/_operations.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/operations/_operations.py @@ -32,13 +32,12 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import ChaosManagementClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer from .._validation import api_version_validation -JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] List = list @@ -60,7 +59,7 @@ def build_capabilities_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +99,7 @@ def build_capabilities_create_or_update_request( # pylint: disable=name-too-lon _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +139,7 @@ def build_capabilities_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}" path_format_arguments = { @@ -175,7 +174,7 @@ def build_capabilities_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +207,7 @@ def build_operations_list_all_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -235,7 +234,7 @@ def build_targets_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +272,7 @@ def build_targets_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -311,7 +310,7 @@ def build_targets_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}" path_format_arguments = { @@ -344,7 +343,7 @@ def build_targets_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -378,7 +377,7 @@ def build_capability_types_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -412,7 +411,7 @@ def build_capability_types_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -444,7 +443,7 @@ def build_experiments_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -473,7 +472,7 @@ def build_experiments_create_or_update_request( # pylint: disable=name-too-long _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -504,7 +503,7 @@ def build_experiments_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -533,7 +532,7 @@ def build_experiments_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}" path_format_arguments = { @@ -561,7 +560,7 @@ def build_experiments_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -598,7 +597,7 @@ def build_experiments_list_all_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -629,7 +628,7 @@ def build_experiments_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/cancel" path_format_arguments = { @@ -651,7 +650,7 @@ def build_experiments_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/start" path_format_arguments = { @@ -674,7 +673,7 @@ def build_experiments_get_execution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -703,7 +702,7 @@ def build_experiments_list_all_executions_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -731,7 +730,7 @@ def build_experiments_execution_details_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -760,7 +759,7 @@ def build_private_accesses_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -789,7 +788,7 @@ def build_private_accesses_create_or_update_request( # pylint: disable=name-too _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -820,7 +819,7 @@ def build_private_accesses_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -849,7 +848,7 @@ def build_private_accesses_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}" path_format_arguments = { @@ -872,7 +871,7 @@ def build_private_accesses_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -905,7 +904,7 @@ def build_private_accesses_list_all_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -935,7 +934,7 @@ def build_private_accesses_get_private_link_resources_request( # pylint: disabl _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -967,7 +966,7 @@ def build_private_accesses_get_a_private_endpoint_connection_request( # pylint: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1001,7 +1000,7 @@ def build_private_accesses_delete_a_private_endpoint_connection_request( # pyli ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}/privateEndpointConnections/{privateEndpointConnectionName}" path_format_arguments = { @@ -1027,7 +1026,7 @@ def build_private_accesses_list_private_endpoint_connections_request( # pylint: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1053,7 +1052,7 @@ def build_actions_get_request(location: str, action_name: str, subscription_id: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1081,7 +1080,7 @@ def build_actions_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1112,7 +1111,7 @@ def build_action_versions_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1146,7 +1145,7 @@ def build_action_versions_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1180,7 +1179,7 @@ def build_target_types_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1208,7 +1207,7 @@ def build_target_types_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1239,7 +1238,7 @@ def build_operation_statuses_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1269,7 +1268,7 @@ def build_workspaces_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1298,7 +1297,7 @@ def build_workspaces_create_or_update_request( # pylint: disable=name-too-long _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1329,7 +1328,7 @@ def build_workspaces_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1358,7 +1357,7 @@ def build_workspaces_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}" path_format_arguments = { @@ -1381,7 +1380,7 @@ def build_workspaces_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1412,7 +1411,7 @@ def build_workspaces_list_all_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1436,14 +1435,36 @@ def build_workspaces_list_all_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_workspaces_refresh_recommendations_request( # pylint: disable=name-too-long +def build_workspaces_discover_request( resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/refreshRecommendations" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/discover" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_workspaces_evaluate_request( + resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/evaluate" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1464,7 +1485,7 @@ def build_discovered_resources_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1493,7 +1514,7 @@ def build_discovered_resources_list_by_workspace_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1521,7 +1542,7 @@ def build_scenarios_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1551,7 +1572,7 @@ def build_scenarios_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1581,7 +1602,7 @@ def build_scenarios_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}" path_format_arguments = { @@ -1605,7 +1626,7 @@ def build_scenarios_list_all_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1627,23 +1648,28 @@ def build_scenarios_list_all_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_scenario_runs_get_request( - resource_group_name: str, workspace_name: str, scenario_name: str, run_id: str, subscription_id: str, **kwargs: Any +def build_scenario_configurations_get_request( # pylint: disable=name-too-long + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/runs/{runId}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/configurations/{scenarioConfigurationName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), "scenarioName": _SERIALIZER.url("scenario_name", scenario_name, "str"), - "runId": _SERIALIZER.url("run_id", run_id, "str"), + "scenarioConfigurationName": _SERIALIZER.url("scenario_configuration_name", scenario_configuration_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1657,17 +1683,84 @@ def build_scenario_runs_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_scenario_runs_list_all_request( +def build_scenario_configurations_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/configurations/{scenarioConfigurationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), + "scenarioName": _SERIALIZER.url("scenario_name", scenario_name, "str"), + "scenarioConfigurationName": _SERIALIZER.url("scenario_configuration_name", scenario_configuration_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_scenario_configurations_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/configurations/{scenarioConfigurationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), + "scenarioName": _SERIALIZER.url("scenario_name", scenario_name, "str"), + "scenarioConfigurationName": _SERIALIZER.url("scenario_configuration_name", scenario_configuration_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_scenario_configurations_list_all_request( # pylint: disable=name-too-long resource_group_name: str, workspace_name: str, scenario_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/runs" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/configurations" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1686,20 +1779,25 @@ def build_scenario_runs_list_all_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_scenario_runs_cancel_request( - resource_group_name: str, workspace_name: str, scenario_name: str, run_id: str, subscription_id: str, **kwargs: Any +def build_scenario_configurations_execute_request( # pylint: disable=name-too-long + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/runs/{runId}/cancel" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/configurations/{scenarioConfigurationName}/execute" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), "scenarioName": _SERIALIZER.url("scenario_name", scenario_name, "str"), - "runId": _SERIALIZER.url("run_id", run_id, "str"), + "scenarioConfigurationName": _SERIALIZER.url("scenario_configuration_name", scenario_configuration_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1710,7 +1808,7 @@ def build_scenario_runs_cancel_request( return HttpRequest(method="POST", url=_url, params=_params, **kwargs) -def build_scenario_configurations_get_request( # pylint: disable=name-too-long +def build_scenario_configurations_validate_request( # pylint: disable=name-too-long resource_group_name: str, workspace_name: str, scenario_name: str, @@ -1718,14 +1816,11 @@ def build_scenario_configurations_get_request( # pylint: disable=name-too-long subscription_id: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/configurations/{scenarioConfigurationName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/configurations/{scenarioConfigurationName}/validate" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1739,13 +1834,10 @@ def build_scenario_configurations_get_request( # pylint: disable=name-too-long # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) -def build_scenario_configurations_create_or_update_request( # pylint: disable=name-too-long +def build_scenario_configurations_fix_resource_permissions_request( # pylint: disable=name-too-long resource_group_name: str, workspace_name: str, scenario_name: str, @@ -1757,11 +1849,9 @@ def build_scenario_configurations_create_or_update_request( # pylint: disable=n _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/configurations/{scenarioConfigurationName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/configurations/{scenarioConfigurationName}/fixResourcePermissions" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1778,30 +1868,27 @@ def build_scenario_configurations_create_or_update_request( # pylint: disable=n # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_scenario_configurations_delete_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - scenario_name: str, - scenario_configuration_name: str, - subscription_id: str, - **kwargs: Any +def build_scenario_runs_get_request( + resource_group_name: str, workspace_name: str, scenario_name: str, run_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/configurations/{scenarioConfigurationName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/runs/{runId}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), "scenarioName": _SERIALIZER.url("scenario_name", scenario_name, "str"), - "scenarioConfigurationName": _SERIALIZER.url("scenario_configuration_name", scenario_configuration_name, "str"), + "runId": _SERIALIZER.url("run_id", run_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1809,20 +1896,23 @@ def build_scenario_configurations_delete_request( # pylint: disable=name-too-lo # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_scenario_configurations_list_all_request( # pylint: disable=name-too-long + +def build_scenario_runs_list_all_request( resource_group_name: str, workspace_name: str, scenario_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/configurations" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/runs" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1841,25 +1931,20 @@ def build_scenario_configurations_list_all_request( # pylint: disable=name-too- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_scenario_configurations_execute_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - scenario_name: str, - scenario_configuration_name: str, - subscription_id: str, - **kwargs: Any +def build_scenario_runs_cancel_request( + resource_group_name: str, workspace_name: str, scenario_name: str, run_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/configurations/{scenarioConfigurationName}/execute" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/runs/{runId}/cancel" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), "scenarioName": _SERIALIZER.url("scenario_name", scenario_name, "str"), - "scenarioConfigurationName": _SERIALIZER.url("scenario_configuration_name", scenario_configuration_name, "str"), + "runId": _SERIALIZER.url("run_id", run_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1870,25 +1955,22 @@ def build_scenario_configurations_execute_request( # pylint: disable=name-too-l return HttpRequest(method="POST", url=_url, params=_params, **kwargs) -def build_scenario_configurations_validate_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - scenario_name: str, - scenario_configuration_name: str, - subscription_id: str, - **kwargs: Any +def build_connections_get_request( + resource_group_name: str, workspace_name: str, connection_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/configurations/{scenarioConfigurationName}/validate" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/connections/{connectionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "scenarioName": _SERIALIZER.url("scenario_name", scenario_name, "str"), - "scenarioConfigurationName": _SERIALIZER.url("scenario_configuration_name", scenario_configuration_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1896,30 +1978,29 @@ def build_scenario_configurations_validate_request( # pylint: disable=name-too- # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_scenario_configurations_fix_resource_permissions_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - scenario_name: str, - scenario_configuration_name: str, - subscription_id: str, - **kwargs: Any + +def build_connections_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, workspace_name: str, connection_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}/configurations/{scenarioConfigurationName}/fixResourcePermissions" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/connections/{connectionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "scenarioName": _SERIALIZER.url("scenario_name", scenario_name, "str"), - "scenarioConfigurationName": _SERIALIZER.url("scenario_configuration_name", scenario_configuration_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1930,8 +2011,60 @@ def build_scenario_configurations_fix_resource_permissions_request( # pylint: d # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connections_delete_request( + resource_group_name: str, workspace_name: str, connection_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/connections/{connectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_connections_list_all_request( + resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/connections" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) class CapabilitiesOperations: @@ -2090,7 +2223,7 @@ def create_or_update( parent_resource_name: str, target_name: str, capability_name: str, - resource: JSON, + resource: _types.Capability, *, content_type: str = "application/json", **kwargs: Any @@ -2111,7 +2244,7 @@ def create_or_update( :param capability_name: String that represents a Capability resource name. Required. :type capability_name: str :param resource: Capability resource to be created or updated. Required. - :type resource: JSON + :type resource: ~azure.mgmt.chaos.types.Capability :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2168,7 +2301,7 @@ def create_or_update( parent_resource_name: str, target_name: str, capability_name: str, - resource: Union[_models.Capability, JSON, IO[bytes]], + resource: Union[_models.Capability, _types.Capability, IO[bytes]], **kwargs: Any ) -> _models.Capability: """Create or update a Capability resource that extends a Target resource. @@ -2186,9 +2319,10 @@ def create_or_update( :type target_name: str :param capability_name: String that represents a Capability resource name. Required. :type capability_name: str - :param resource: Capability resource to be created or updated. Is one of the following types: - Capability, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.chaos.models.Capability or JSON or IO[bytes] + :param resource: Capability resource to be created or updated. Is either a Capability type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.chaos.models.Capability or ~azure.mgmt.chaos.types.Capability or + IO[bytes] :return: Capability. The Capability is compatible with MutableMapping :rtype: ~azure.mgmt.chaos.models.Capability :raises ~azure.core.exceptions.HttpResponseError: @@ -2420,7 +2554,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2527,7 +2664,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2718,7 +2858,7 @@ def create_or_update( parent_resource_type: str, parent_resource_name: str, target_name: str, - resource: JSON, + resource: _types.Target, *, content_type: str = "application/json", **kwargs: Any @@ -2737,7 +2877,7 @@ def create_or_update( :param target_name: String that represents a Target resource name. Required. :type target_name: str :param resource: Target resource to be created or updated. Required. - :type resource: JSON + :type resource: ~azure.mgmt.chaos.types.Target :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2790,7 +2930,7 @@ def create_or_update( parent_resource_type: str, parent_resource_name: str, target_name: str, - resource: Union[_models.Target, JSON, IO[bytes]], + resource: Union[_models.Target, _types.Target, IO[bytes]], **kwargs: Any ) -> _models.Target: """Create or update a Target resource that extends a tracked regional resource. @@ -2806,9 +2946,9 @@ def create_or_update( :type parent_resource_name: str :param target_name: String that represents a Target resource name. Required. :type target_name: str - :param resource: Target resource to be created or updated. Is one of the following types: - Target, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.chaos.models.Target or JSON or IO[bytes] + :param resource: Target resource to be created or updated. Is either a Target type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.chaos.models.Target or ~azure.mgmt.chaos.types.Target or IO[bytes] :return: Target. The Target is compatible with MutableMapping :rtype: ~azure.mgmt.chaos.models.Target :raises ~azure.core.exceptions.HttpResponseError: @@ -3031,7 +3171,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3225,7 +3368,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3359,7 +3505,7 @@ def _create_or_update_initial( self, resource_group_name: str, experiment_name: str, - resource: Union[_models.Experiment, JSON, IO[bytes]], + resource: Union[_models.Experiment, _types.Experiment, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3465,7 +3611,7 @@ def begin_create_or_update( self, resource_group_name: str, experiment_name: str, - resource: JSON, + resource: _types.Experiment, *, content_type: str = "application/json", **kwargs: Any @@ -3478,7 +3624,7 @@ def begin_create_or_update( :param experiment_name: String that represents a Experiment resource name. Required. :type experiment_name: str :param resource: Experiment resource to be created or updated. Required. - :type resource: JSON + :type resource: ~azure.mgmt.chaos.types.Experiment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3521,7 +3667,7 @@ def begin_create_or_update( self, resource_group_name: str, experiment_name: str, - resource: Union[_models.Experiment, JSON, IO[bytes]], + resource: Union[_models.Experiment, _types.Experiment, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.Experiment]: """Create or update a Experiment resource. @@ -3531,9 +3677,10 @@ def begin_create_or_update( :type resource_group_name: str :param experiment_name: String that represents a Experiment resource name. Required. :type experiment_name: str - :param resource: Experiment resource to be created or updated. Is one of the following types: - Experiment, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.chaos.models.Experiment or JSON or IO[bytes] + :param resource: Experiment resource to be created or updated. Is either a Experiment type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.chaos.models.Experiment or ~azure.mgmt.chaos.types.Experiment or + IO[bytes] :return: An instance of LROPoller that returns Experiment. The Experiment is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.Experiment] @@ -3595,7 +3742,7 @@ def _update_initial( self, resource_group_name: str, experiment_name: str, - properties: Union[_models.ExperimentUpdate, JSON, IO[bytes]], + properties: Union[_models.ExperimentUpdate, _types.ExperimentUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3676,7 +3823,7 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Experiment]: - """The operation to update an experiment. + """Update an experiment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3699,12 +3846,12 @@ def begin_update( self, resource_group_name: str, experiment_name: str, - properties: JSON, + properties: _types.ExperimentUpdate, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Experiment]: - """The operation to update an experiment. + """Update an experiment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3712,7 +3859,7 @@ def begin_update( :param experiment_name: String that represents a Experiment resource name. Required. :type experiment_name: str :param properties: Parameters supplied to the Update experiment operation. Required. - :type properties: JSON + :type properties: ~azure.mgmt.chaos.types.ExperimentUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3732,7 +3879,7 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Experiment]: - """The operation to update an experiment. + """Update an experiment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3755,19 +3902,20 @@ def begin_update( self, resource_group_name: str, experiment_name: str, - properties: Union[_models.ExperimentUpdate, JSON, IO[bytes]], + properties: Union[_models.ExperimentUpdate, _types.ExperimentUpdate, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.Experiment]: - """The operation to update an experiment. + """Update an experiment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param experiment_name: String that represents a Experiment resource name. Required. :type experiment_name: str - :param properties: Parameters supplied to the Update experiment operation. Is one of the - following types: ExperimentUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.chaos.models.ExperimentUpdate or JSON or IO[bytes] + :param properties: Parameters supplied to the Update experiment operation. Is either a + ExperimentUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.chaos.models.ExperimentUpdate or + ~azure.mgmt.chaos.types.ExperimentUpdate or IO[bytes] :return: An instance of LROPoller that returns Experiment. The Experiment is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.Experiment] @@ -4009,7 +4157,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4110,7 +4261,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4514,7 +4668,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4651,6 +4808,19 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def get(self, resource_group_name: str, private_access_name: str, **kwargs: Any) -> _models.PrivateAccess: """Get a private access resource. @@ -4722,11 +4892,25 @@ def get(self, resource_group_name: str, private_access_name: str, **kwargs: Any) return deserialized # type: ignore + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def _create_or_update_initial( self, resource_group_name: str, private_access_name: str, - resource: Union[_models.PrivateAccess, JSON, IO[bytes]], + resource: Union[_models.PrivateAccess, _types.PrivateAccess, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -4834,7 +5018,7 @@ def begin_create_or_update( self, resource_group_name: str, private_access_name: str, - resource: JSON, + resource: _types.PrivateAccess, *, content_type: str = "application/json", **kwargs: Any @@ -4849,7 +5033,7 @@ def begin_create_or_update( characters. Required. :type private_access_name: str :param resource: private access resource to be created or updated. Required. - :type resource: JSON + :type resource: ~azure.mgmt.chaos.types.PrivateAccess :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4890,11 +5074,25 @@ def begin_create_or_update( """ @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def begin_create_or_update( self, resource_group_name: str, private_access_name: str, - resource: Union[_models.PrivateAccess, JSON, IO[bytes]], + resource: Union[_models.PrivateAccess, _types.PrivateAccess, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.PrivateAccess]: """Create or update a private access. @@ -4906,9 +5104,10 @@ def begin_create_or_update( Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. :type private_access_name: str - :param resource: private access resource to be created or updated. Is one of the following - types: PrivateAccess, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.chaos.models.PrivateAccess or JSON or IO[bytes] + :param resource: private access resource to be created or updated. Is either a PrivateAccess + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.chaos.models.PrivateAccess or ~azure.mgmt.chaos.types.PrivateAccess + or IO[bytes] :return: An instance of LROPoller that returns PrivateAccess. The PrivateAccess is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.PrivateAccess] @@ -4966,11 +5165,25 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def _update_initial( self, resource_group_name: str, private_access_name: str, - properties: Union[_models.PrivateAccessPatch, JSON, IO[bytes]], + properties: Union[_models.PrivateAccessPatch, _types.PrivateAccessPatch, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -5076,7 +5289,7 @@ def begin_update( self, resource_group_name: str, private_access_name: str, - properties: JSON, + properties: _types.PrivateAccessPatch, *, content_type: str = "application/json", **kwargs: Any @@ -5091,7 +5304,7 @@ def begin_update( characters. Required. :type private_access_name: str :param properties: private access resource's tags to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.chaos.types.PrivateAccessPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5132,11 +5345,25 @@ def begin_update( """ @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def begin_update( self, resource_group_name: str, private_access_name: str, - properties: Union[_models.PrivateAccessPatch, JSON, IO[bytes]], + properties: Union[_models.PrivateAccessPatch, _types.PrivateAccessPatch, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.PrivateAccess]: """Patch a private access tags. @@ -5148,9 +5375,10 @@ def begin_update( Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. :type private_access_name: str - :param properties: private access resource's tags to be updated. Is one of the following types: - PrivateAccessPatch, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.chaos.models.PrivateAccessPatch or JSON or IO[bytes] + :param properties: private access resource's tags to be updated. Is either a PrivateAccessPatch + type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.chaos.models.PrivateAccessPatch or + ~azure.mgmt.chaos.types.PrivateAccessPatch or IO[bytes] :return: An instance of LROPoller that returns PrivateAccess. The PrivateAccess is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.PrivateAccess] @@ -5208,6 +5436,13 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "private_access_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def _delete_initial(self, resource_group_name: str, private_access_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5268,6 +5503,13 @@ def _delete_initial(self, resource_group_name: str, private_access_name: str, ** return deserialized # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "private_access_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def begin_delete(self, resource_group_name: str, private_access_name: str, **kwargs: Any) -> LROPoller[None]: """Delete a private access. @@ -5327,6 +5569,19 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "continuation_token_parameter", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def list( self, resource_group_name: str, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.PrivateAccess"]: @@ -5384,7 +5639,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5427,6 +5685,13 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "continuation_token_parameter", "accept"] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def list_all( self, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.PrivateAccess"]: @@ -5480,7 +5745,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5523,6 +5791,19 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def get_private_link_resources( self, resource_group_name: str, private_access_name: str, **kwargs: Any ) -> _models.PrivateLinkResourceListResult: @@ -5598,6 +5879,20 @@ def get_private_link_resources( return deserialized # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "private_endpoint_connection_name", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def get_a_private_endpoint_connection( self, resource_group_name: str, private_access_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> _models.PrivateEndpointConnection: @@ -5675,6 +5970,19 @@ def get_a_private_endpoint_connection( return deserialized # type: ignore + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "private_endpoint_connection_name", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def _delete_a_private_endpoint_connection_initial( # pylint: disable=name-too-long self, resource_group_name: str, private_access_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> Iterator[bytes]: @@ -5738,6 +6046,19 @@ def _delete_a_private_endpoint_connection_initial( # pylint: disable=name-too-l return deserialized # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "private_endpoint_connection_name", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def begin_delete_a_private_endpoint_connection( # pylint: disable=name-too-long self, resource_group_name: str, private_access_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> LROPoller[None]: @@ -5802,6 +6123,19 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "private_access_name", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) def list_private_endpoint_connections( self, resource_group_name: str, private_access_name: str, **kwargs: Any ) -> ItemPaged["_models.PrivateEndpointConnection"]: @@ -5860,7 +6194,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5924,7 +6261,7 @@ def __init__(self, *args, **kwargs) -> None: @api_version_validation( method_added_on="2026-05-01-preview", params_added_on={"2026-05-01-preview": ["api_version", "subscription_id", "location", "action_name", "accept"]}, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def get(self, location: str, action_name: str, **kwargs: Any) -> _models.Action: """Get an Action resource for a given location. @@ -6006,7 +6343,7 @@ def get(self, location: str, action_name: str, **kwargs: Any) -> _models.Action: "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def list( self, location: str, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any @@ -6064,7 +6401,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -6137,7 +6477,7 @@ def __init__(self, *args, **kwargs) -> None: "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def get(self, location: str, action_name: str, version_name: str, **kwargs: Any) -> _models.ActionVersion: """Get an Action Version resource for a given location and action. @@ -6223,7 +6563,7 @@ def get(self, location: str, action_name: str, version_name: str, **kwargs: Any) "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def list( self, location: str, action_name: str, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any @@ -6284,7 +6624,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -6470,7 +6813,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -6623,7 +6969,7 @@ def __init__(self, *args, **kwargs) -> None: params_added_on={ "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name", "accept"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.Workspace: """Get a Workspace resource. @@ -6706,13 +7052,13 @@ def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _ "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def _create_or_update_initial( self, resource_group_name: str, workspace_name: str, - resource: Union[_models.Workspace, JSON, IO[bytes]], + resource: Union[_models.Workspace, _types.Workspace, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -6818,7 +7164,7 @@ def begin_create_or_update( self, resource_group_name: str, workspace_name: str, - resource: JSON, + resource: _types.Workspace, *, content_type: str = "application/json", **kwargs: Any @@ -6831,7 +7177,7 @@ def begin_create_or_update( :param workspace_name: String that represents a Workspace resource name. Required. :type workspace_name: str :param resource: Workspace resource to be created or updated. Required. - :type resource: JSON + :type resource: ~azure.mgmt.chaos.types.Workspace :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6882,13 +7228,13 @@ def begin_create_or_update( "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def begin_create_or_update( self, resource_group_name: str, workspace_name: str, - resource: Union[_models.Workspace, JSON, IO[bytes]], + resource: Union[_models.Workspace, _types.Workspace, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.Workspace]: """Create or update a Workspace resource. @@ -6898,9 +7244,10 @@ def begin_create_or_update( :type resource_group_name: str :param workspace_name: String that represents a Workspace resource name. Required. :type workspace_name: str - :param resource: Workspace resource to be created or updated. Is one of the following types: - Workspace, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.chaos.models.Workspace or JSON or IO[bytes] + :param resource: Workspace resource to be created or updated. Is either a Workspace type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.chaos.models.Workspace or ~azure.mgmt.chaos.types.Workspace or + IO[bytes] :return: An instance of LROPoller that returns Workspace. The Workspace is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.Workspace] @@ -6970,13 +7317,13 @@ def get_long_running_output(pipeline_response): "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def _update_initial( self, resource_group_name: str, workspace_name: str, - properties: Union[_models.WorkspaceUpdate, JSON, IO[bytes]], + properties: Union[_models.WorkspaceUpdate, _types.WorkspaceUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -7057,7 +7404,7 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Workspace]: - """The operation to update a Workspace. + """Update a Workspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -7080,12 +7427,12 @@ def begin_update( self, resource_group_name: str, workspace_name: str, - properties: JSON, + properties: _types.WorkspaceUpdate, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Workspace]: - """The operation to update a Workspace. + """Update a Workspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -7093,7 +7440,7 @@ def begin_update( :param workspace_name: String that represents a Workspace resource name. Required. :type workspace_name: str :param properties: Parameters supplied to the Update Workspace operation. Required. - :type properties: JSON + :type properties: ~azure.mgmt.chaos.types.WorkspaceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7113,7 +7460,7 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Workspace]: - """The operation to update a Workspace. + """Update a Workspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -7144,25 +7491,26 @@ def begin_update( "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def begin_update( self, resource_group_name: str, workspace_name: str, - properties: Union[_models.WorkspaceUpdate, JSON, IO[bytes]], + properties: Union[_models.WorkspaceUpdate, _types.WorkspaceUpdate, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.Workspace]: - """The operation to update a Workspace. + """Update a Workspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param workspace_name: String that represents a Workspace resource name. Required. :type workspace_name: str - :param properties: Parameters supplied to the Update Workspace operation. Is one of the - following types: WorkspaceUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.chaos.models.WorkspaceUpdate or JSON or IO[bytes] + :param properties: Parameters supplied to the Update Workspace operation. Is either a + WorkspaceUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.chaos.models.WorkspaceUpdate or + ~azure.mgmt.chaos.types.WorkspaceUpdate or IO[bytes] :return: An instance of LROPoller that returns Workspace. The Workspace is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.Workspace] @@ -7225,7 +7573,7 @@ def get_long_running_output(pipeline_response): params_added_on={ "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def _delete_initial(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { @@ -7292,7 +7640,7 @@ def _delete_initial(self, resource_group_name: str, workspace_name: str, **kwarg params_added_on={ "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def begin_delete(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> LROPoller[None]: """Delete a Workspace resource. @@ -7362,7 +7710,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def list( self, resource_group_name: str, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any @@ -7421,7 +7769,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -7469,7 +7820,7 @@ def get_next(next_link=None): params_added_on={ "2026-05-01-preview": ["api_version", "subscription_id", "continuation_token_parameter", "accept"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def list_all( self, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any @@ -7524,7 +7875,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -7567,15 +7921,13 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @api_version_validation( - method_added_on="2026-05-01-preview", + method_added_on="2026-08-01-preview", params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] + "2026-08-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-08-01-preview"], ) - def _refresh_recommendations_initial( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> Iterator[bytes]: + def _discover_initial(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7589,7 +7941,7 @@ def _refresh_recommendations_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_workspaces_refresh_recommendations_request( + _request = build_workspaces_discover_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, @@ -7635,36 +7987,36 @@ def _refresh_recommendations_initial( @distributed_trace @api_version_validation( - method_added_on="2026-05-01-preview", + method_added_on="2026-08-01-preview", params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] + "2026-08-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-08-01-preview"], ) - def begin_refresh_recommendations( + def begin_discover( self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> LROPoller[_models.WorkspaceEvaluation]: - """Refreshes recommendation status for all scenarios in a given workspace. + ) -> LROPoller[_models.WorkspaceDiscovery]: + """Triggers resource discovery for the workspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param workspace_name: String that represents a Workspace resource name. Required. :type workspace_name: str - :return: An instance of LROPoller that returns WorkspaceEvaluation. The WorkspaceEvaluation is + :return: An instance of LROPoller that returns WorkspaceDiscovery. The WorkspaceDiscovery is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.WorkspaceEvaluation] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.WorkspaceDiscovery] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.WorkspaceEvaluation] = kwargs.pop("cls", None) + cls: ClsType[_models.WorkspaceDiscovery] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._refresh_recommendations_initial( + raw_result = self._discover_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, cls=lambda x, y, z: x, @@ -7681,7 +8033,7 @@ def get_long_running_output(pipeline_response): response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.WorkspaceEvaluation, response.json()) + deserialized = _deserialize(_models.WorkspaceDiscovery, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized @@ -7699,65 +8051,24 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.WorkspaceEvaluation].from_continuation_token( + return LROPoller[_models.WorkspaceDiscovery].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.WorkspaceEvaluation]( + return LROPoller[_models.WorkspaceDiscovery]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - -class DiscoveredResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.chaos.ChaosManagementClient`'s - :attr:`discovered_resources` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ChaosManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace @api_version_validation( - method_added_on="2026-05-01-preview", + method_added_on="2026-08-01-preview", params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "workspace_name", - "discovered_resource_name", - "accept", - ] + "2026-08-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-08-01-preview"], ) - def get( - self, resource_group_name: str, workspace_name: str, discovered_resource_name: str, **kwargs: Any - ) -> _models.DiscoveredResource: - """Get a discovered resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: String that represents a Workspace resource name. Required. - :type workspace_name: str - :param discovered_resource_name: Name of the discovered resource. Required. - :type discovered_resource_name: str - :return: DiscoveredResource. The DiscoveredResource is compatible with MutableMapping - :rtype: ~azure.mgmt.chaos.models.DiscoveredResource - :raises ~azure.core.exceptions.HttpResponseError: - """ + def _evaluate_initial(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7769,12 +8080,11 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DiscoveredResource] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_discovered_resources_get_request( + _request = build_workspaces_evaluate_request( resource_group_name=resource_group_name, workspace_name=workspace_name, - discovered_resource_name=discovered_resource_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -7786,19 +8096,18 @@ def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -7806,53 +8115,237 @@ def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DiscoveredResource, response.json()) + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace @api_version_validation( - method_added_on="2026-05-01-preview", + method_added_on="2026-08-01-preview", params_added_on={ - "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name", "accept"] + "2026-08-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-08-01-preview"], ) - def list_by_workspace( + def begin_evaluate( self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> ItemPaged["_models.DiscoveredResource"]: - """Get a list of discovered resources for a workspace. + ) -> LROPoller[_models.WorkspaceEvaluation]: + """Triggers scenario evaluation for the workspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param workspace_name: String that represents a Workspace resource name. Required. :type workspace_name: str - :return: An iterator like instance of DiscoveredResource - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.chaos.models.DiscoveredResource] + :return: An instance of LROPoller that returns WorkspaceEvaluation. The WorkspaceEvaluation is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.WorkspaceEvaluation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.DiscoveredResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: + cls: ClsType[_models.WorkspaceEvaluation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._evaluate_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.WorkspaceEvaluation, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.WorkspaceEvaluation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.WorkspaceEvaluation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class DiscoveredResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.chaos.ChaosManagementClient`'s + :attr:`discovered_resources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ChaosManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "discovered_resource_name", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) + def get( + self, resource_group_name: str, workspace_name: str, discovered_resource_name: str, **kwargs: Any + ) -> _models.DiscoveredResource: + """Get a discovered resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param discovered_resource_name: Name of the discovered resource. Required. + :type discovered_resource_name: str + :return: DiscoveredResource. The DiscoveredResource is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.DiscoveredResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DiscoveredResource] = kwargs.pop("cls", None) + + _request = build_discovered_resources_get_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + discovered_resource_name=discovered_resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DiscoveredResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name", "accept"] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) + def list_by_workspace( + self, resource_group_name: str, workspace_name: str, **kwargs: Any + ) -> ItemPaged["_models.DiscoveredResource"]: + """Get a list of discovered resources for a workspace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :return: An iterator like instance of DiscoveredResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.chaos.models.DiscoveredResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DiscoveredResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: _request = build_discovered_resources_list_by_workspace_request( resource_group_name=resource_group_name, @@ -7880,7 +8373,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -7953,7 +8449,7 @@ def __init__(self, *args, **kwargs) -> None: "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def get(self, resource_group_name: str, workspace_name: str, scenario_name: str, **kwargs: Any) -> _models.Scenario: """Get a scenario. @@ -8063,7 +8559,7 @@ def create_or_update( resource_group_name: str, workspace_name: str, scenario_name: str, - resource: JSON, + resource: _types.Scenario, *, content_type: str = "application/json", **kwargs: Any @@ -8078,7 +8574,7 @@ def create_or_update( :param scenario_name: Name of the scenario. Required. :type scenario_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.chaos.types.Scenario :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8131,14 +8627,14 @@ def create_or_update( "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def create_or_update( self, resource_group_name: str, workspace_name: str, scenario_name: str, - resource: Union[_models.Scenario, JSON, IO[bytes]], + resource: Union[_models.Scenario, _types.Scenario, IO[bytes]], **kwargs: Any ) -> _models.Scenario: """Create or update a scenario. @@ -8150,9 +8646,10 @@ def create_or_update( :type workspace_name: str :param scenario_name: Name of the scenario. Required. :type scenario_name: str - :param resource: Resource create parameters. Is one of the following types: Scenario, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.chaos.models.Scenario or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a Scenario type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.chaos.models.Scenario or ~azure.mgmt.chaos.types.Scenario or + IO[bytes] :return: Scenario. The Scenario is compatible with MutableMapping :rtype: ~azure.mgmt.chaos.models.Scenario :raises ~azure.core.exceptions.HttpResponseError: @@ -8237,7 +8734,7 @@ def create_or_update( "scenario_name", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, scenario_name: str, **kwargs: Any @@ -8306,7 +8803,7 @@ def delete( # pylint: disable=inconsistent-return-statements params_added_on={ "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name", "accept"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def list_all(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> ItemPaged["_models.Scenario"]: """Get a list of scenarios. @@ -8362,7 +8859,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -8405,14 +8905,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ScenarioRunsOperations: +class ScenarioConfigurationsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.chaos.ChaosManagementClient`'s - :attr:`scenario_runs` attribute. + :attr:`scenario_configurations` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -8432,18 +8932,21 @@ def __init__(self, *args, **kwargs) -> None: "resource_group_name", "workspace_name", "scenario_name", - "run_id", + "scenario_configuration_name", "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def get( - self, resource_group_name: str, workspace_name: str, scenario_name: str, run_id: str, **kwargs: Any - ) -> _models.ScenarioRun: - """Get a scenario run. - - Get a scenario run. + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + **kwargs: Any + ) -> _models.ScenarioConfiguration: + """Get a scenario definition. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -8452,10 +8955,10 @@ def get( :type workspace_name: str :param scenario_name: Name of the scenario. Required. :type scenario_name: str - :param run_id: The name of the ScenarioRun. Required. - :type run_id: str - :return: ScenarioRun. The ScenarioRun is compatible with MutableMapping - :rtype: ~azure.mgmt.chaos.models.ScenarioRun + :param scenario_configuration_name: Name of the scenario definition. Required. + :type scenario_configuration_name: str + :return: ScenarioConfiguration. The ScenarioConfiguration is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.ScenarioConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8469,13 +8972,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ScenarioRun] = kwargs.pop("cls", None) + cls: ClsType[_models.ScenarioConfiguration] = kwargs.pop("cls", None) - _request = build_scenario_runs_get_request( + _request = build_scenario_configurations_get_request( resource_group_name=resource_group_name, workspace_name=workspace_name, scenario_name=scenario_name, - run_id=run_id, + scenario_configuration_name=scenario_configuration_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -8494,7 +8997,7 @@ def get( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -8507,22 +9010,16 @@ def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ScenarioRun, response.json()) + deserialized = _deserialize(_models.ScenarioConfiguration, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace @api_version_validation( method_added_on="2026-05-01-preview", params_added_on={ @@ -8532,145 +9029,22 @@ def get( "resource_group_name", "workspace_name", "scenario_name", + "scenario_configuration_name", + "content_type", "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) - def list_all( - self, resource_group_name: str, workspace_name: str, scenario_name: str, **kwargs: Any - ) -> ItemPaged["_models.ScenarioRun"]: - """Get a list of scenario runs. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: String that represents a Workspace resource name. Required. - :type workspace_name: str - :param scenario_name: Name of the scenario. Required. - :type scenario_name: str - :return: An iterator like instance of ScenarioRun - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.chaos.models.ScenarioRun] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ScenarioRun]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_scenario_runs_list_all_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - scenario_name=scenario_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ScenarioRun], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "workspace_name", - "scenario_name", - "run_id", - ] - }, - api_versions_list=["2026-05-01-preview"], - ) - def cancel( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, scenario_name: str, run_id: str, **kwargs: Any - ) -> None: - """Cancel the currently running scenario execution. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: String that represents a Workspace resource name. Required. - :type workspace_name: str - :param scenario_name: Name of the scenario. Required. - :type scenario_name: str - :param run_id: The name of the ScenarioRun. Required. - :type run_id: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ + def _create_or_update_initial( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + resource: Union[_models.ScenarioConfiguration, _types.ScenarioConfiguration, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -8679,18 +9053,28 @@ def cancel( # pylint: disable=inconsistent-return-statements } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_scenario_runs_cancel_request( + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_scenario_configurations_create_or_update_request( resource_group_name=resource_group_name, workspace_name=workspace_name, scenario_name=scenario_name, - run_id=run_id, + scenario_configuration_name=scenario_configuration_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -8699,14 +9083,19 @@ def cancel( # pylint: disable=inconsistent-return-statements } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -8715,55 +9104,32 @@ def cancel( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) -class ScenarioConfigurationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - Instead, you should access the following operations through - :class:`~azure.mgmt.chaos.ChaosManagementClient`'s - :attr:`scenario_configurations` attribute. - """ + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ChaosManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return deserialized # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "workspace_name", - "scenario_name", - "scenario_configuration_name", - "accept", - ] - }, - api_versions_list=["2026-05-01-preview"], - ) - def get( + @overload + def begin_create_or_update( self, resource_group_name: str, workspace_name: str, scenario_name: str, scenario_configuration_name: str, + resource: _models.ScenarioConfiguration, + *, + content_type: str = "application/json", **kwargs: Any - ) -> _models.ScenarioConfiguration: - """Get a scenario definition. + ) -> LROPoller[_models.ScenarioConfiguration]: + """Create or update a scenario definition. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -8774,233 +9140,50 @@ def get( :type scenario_name: str :param scenario_configuration_name: Name of the scenario definition. Required. :type scenario_configuration_name: str - :return: ScenarioConfiguration. The ScenarioConfiguration is compatible with MutableMapping - :rtype: ~azure.mgmt.chaos.models.ScenarioConfiguration + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.chaos.models.ScenarioConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ScenarioConfiguration. The ScenarioConfiguration + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.ScenarioConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + @overload + def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + resource: _types.ScenarioConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ScenarioConfiguration]: + """Create or update a scenario definition. - cls: ClsType[_models.ScenarioConfiguration] = kwargs.pop("cls", None) - - _request = build_scenario_configurations_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - scenario_name=scenario_name, - scenario_configuration_name=scenario_configuration_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ScenarioConfiguration, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={ - "2026-05-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "workspace_name", - "scenario_name", - "scenario_configuration_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-05-01-preview"], - ) - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - scenario_name: str, - scenario_configuration_name: str, - resource: Union[_models.ScenarioConfiguration, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_scenario_configurations_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - scenario_name=scenario_name, - scenario_configuration_name=scenario_configuration_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - scenario_name: str, - scenario_configuration_name: str, - resource: _models.ScenarioConfiguration, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ScenarioConfiguration]: - """Create or update a scenario definition. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: String that represents a Workspace resource name. Required. - :type workspace_name: str - :param scenario_name: Name of the scenario. Required. - :type scenario_name: str - :param scenario_configuration_name: Name of the scenario definition. Required. - :type scenario_configuration_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.chaos.models.ScenarioConfiguration - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ScenarioConfiguration. The ScenarioConfiguration - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.ScenarioConfiguration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - scenario_name: str, - scenario_configuration_name: str, - resource: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ScenarioConfiguration]: - """Create or update a scenario definition. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: String that represents a Workspace resource name. Required. - :type workspace_name: str - :param scenario_name: Name of the scenario. Required. - :type scenario_name: str - :param scenario_configuration_name: Name of the scenario definition. Required. - :type scenario_configuration_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ScenarioConfiguration. The ScenarioConfiguration - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.ScenarioConfiguration] - :raises ~azure.core.exceptions.HttpResponseError: - """ + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param scenario_name: Name of the scenario. Required. + :type scenario_name: str + :param scenario_configuration_name: Name of the scenario definition. Required. + :type scenario_configuration_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.chaos.types.ScenarioConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ScenarioConfiguration. The ScenarioConfiguration + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.ScenarioConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ @overload def begin_create_or_update( @@ -9051,7 +9234,7 @@ def begin_create_or_update( "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def begin_create_or_update( self, @@ -9059,7 +9242,7 @@ def begin_create_or_update( workspace_name: str, scenario_name: str, scenario_configuration_name: str, - resource: Union[_models.ScenarioConfiguration, JSON, IO[bytes]], + resource: Union[_models.ScenarioConfiguration, _types.ScenarioConfiguration, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ScenarioConfiguration]: """Create or update a scenario definition. @@ -9073,9 +9256,10 @@ def begin_create_or_update( :type scenario_name: str :param scenario_configuration_name: Name of the scenario definition. Required. :type scenario_configuration_name: str - :param resource: Resource create parameters. Is one of the following types: - ScenarioConfiguration, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.chaos.models.ScenarioConfiguration or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a ScenarioConfiguration type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.chaos.models.ScenarioConfiguration or + ~azure.mgmt.chaos.types.ScenarioConfiguration or IO[bytes] :return: An instance of LROPoller that returns ScenarioConfiguration. The ScenarioConfiguration is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.ScenarioConfiguration] @@ -9147,7 +9331,7 @@ def get_long_running_output(pipeline_response): "scenario_configuration_name", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def _delete_initial( self, @@ -9230,7 +9414,7 @@ def _delete_initial( "scenario_configuration_name", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def begin_delete( self, @@ -9314,7 +9498,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def list_all( self, resource_group_name: str, workspace_name: str, scenario_name: str, **kwargs: Any @@ -9375,7 +9559,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -9417,7 +9604,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - @distributed_trace @api_version_validation( method_added_on="2026-05-01-preview", params_added_on={ @@ -9430,31 +9616,16 @@ def get_next(next_link=None): "scenario_configuration_name", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) - def execute( # pylint: disable=inconsistent-return-statements + def _execute_initial( self, resource_group_name: str, workspace_name: str, scenario_name: str, scenario_configuration_name: str, **kwargs: Any - ) -> None: - """Execute the scenario execution with the given scenario configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: String that represents a Workspace resource name. Required. - :type workspace_name: str - :param scenario_name: Name of the scenario. Required. - :type scenario_name: str - :param scenario_configuration_name: Name of the scenario definition. Required. - :type scenario_configuration_name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -9466,7 +9637,7 @@ def execute( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_scenario_configurations_execute_request( resource_group_name=resource_group_name, @@ -9483,7 +9654,8 @@ def execute( # pylint: disable=inconsistent-return-statements } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -9491,6 +9663,10 @@ def execute( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -9502,9 +9678,14 @@ def execute( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @distributed_trace @api_version_validation( method_added_on="2026-05-01-preview", params_added_on={ @@ -9517,32 +9698,125 @@ def execute( # pylint: disable=inconsistent-return-statements "scenario_configuration_name", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) - def _validate_initial( + def begin_execute( self, resource_group_name: str, workspace_name: str, scenario_name: str, scenario_configuration_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + ) -> LROPoller[_models.ScenarioRun]: + """Execute the scenario execution with the given scenario configuration. - _request = build_scenario_configurations_validate_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param scenario_name: Name of the scenario. Required. + :type scenario_name: str + :param scenario_configuration_name: Name of the scenario definition. Required. + :type scenario_configuration_name: str + :return: An instance of LROPoller that returns ScenarioRun. The ScenarioRun is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.ScenarioRun] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ScenarioRun] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._execute_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + scenario_name=scenario_name, + scenario_configuration_name=scenario_configuration_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ScenarioRun, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ScenarioRun].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ScenarioRun]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "scenario_name", + "scenario_configuration_name", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) + def _validate_initial( + self, + resource_group_name: str, + workspace_name: str, + scenario_name: str, + scenario_configuration_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_scenario_configurations_validate_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, scenario_name=scenario_name, scenario_configuration_name=scenario_configuration_name, subscription_id=self._config.subscription_id, @@ -9599,7 +9873,7 @@ def _validate_initial( "scenario_configuration_name", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def begin_validate( self, @@ -9693,7 +9967,7 @@ def get_long_running_output(pipeline_response): "content_type", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def _fix_resource_permissions_initial( self, @@ -9701,7 +9975,9 @@ def _fix_resource_permissions_initial( workspace_name: str, scenario_name: str, scenario_configuration_name: str, - body: Optional[Union[_models.FixResourcePermissionsRequest, JSON, IO[bytes]]] = None, + body: Optional[ + Union[_models.FixResourcePermissionsRequest, _types.FixResourcePermissionsRequest, IO[bytes]] + ] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -9818,7 +10094,7 @@ def begin_fix_resource_permissions( workspace_name: str, scenario_name: str, scenario_configuration_name: str, - body: Optional[JSON] = None, + body: Optional[_types.FixResourcePermissionsRequest] = None, *, content_type: str = "application/json", **kwargs: Any @@ -9835,7 +10111,7 @@ def begin_fix_resource_permissions( :param scenario_configuration_name: Name of the scenario definition. Required. :type scenario_configuration_name: str :param body: Default value is None. - :type body: JSON + :type body: ~azure.mgmt.chaos.types.FixResourcePermissionsRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9893,7 +10169,7 @@ def begin_fix_resource_permissions( "content_type", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def begin_fix_resource_permissions( self, @@ -9901,7 +10177,9 @@ def begin_fix_resource_permissions( workspace_name: str, scenario_name: str, scenario_configuration_name: str, - body: Optional[Union[_models.FixResourcePermissionsRequest, JSON, IO[bytes]]] = None, + body: Optional[ + Union[_models.FixResourcePermissionsRequest, _types.FixResourcePermissionsRequest, IO[bytes]] + ] = None, **kwargs: Any ) -> LROPoller[_models.PermissionsFix]: """Fixes resource permissions for the given scenario configuration. @@ -9915,9 +10193,10 @@ def begin_fix_resource_permissions( :type scenario_name: str :param scenario_configuration_name: Name of the scenario definition. Required. :type scenario_configuration_name: str - :param body: Is one of the following types: FixResourcePermissionsRequest, JSON, IO[bytes] - Default value is None. - :type body: ~azure.mgmt.chaos.models.FixResourcePermissionsRequest or JSON or IO[bytes] + :param body: Is either a FixResourcePermissionsRequest type or a IO[bytes] type. Default value + is None. + :type body: ~azure.mgmt.chaos.models.FixResourcePermissionsRequest or + ~azure.mgmt.chaos.types.FixResourcePermissionsRequest or IO[bytes] :return: An instance of LROPoller that returns PermissionsFix. The PermissionsFix is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.PermissionsFix] @@ -9981,3 +10260,897 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.PermissionsFix]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + + +class ScenarioRunsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.chaos.ChaosManagementClient`'s + :attr:`scenario_runs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ChaosManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "scenario_name", + "run_id", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) + def get( + self, resource_group_name: str, workspace_name: str, scenario_name: str, run_id: str, **kwargs: Any + ) -> _models.ScenarioRun: + """Get a scenario run. + + This endpoint is also the polling target for ScenarioConfigurations.execute + and ScenarioRuns.cancel (final-state-via: location). While the run is in + progress the service returns 202 with a Location header pointing back to + this URL; clients must keep polling until they receive 200, which carries + the final ScenarioRun body. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param scenario_name: Name of the scenario. Required. + :type scenario_name: str + :param run_id: The name of the ScenarioRun. Required. + :type run_id: str + :return: ScenarioRun. The ScenarioRun is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.ScenarioRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ScenarioRun] = kwargs.pop("cls", None) + + _request = build_scenario_runs_get_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + scenario_name=scenario_name, + run_id=run_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ScenarioRun, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "scenario_name", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) + def list_all( + self, resource_group_name: str, workspace_name: str, scenario_name: str, **kwargs: Any + ) -> ItemPaged["_models.ScenarioRun"]: + """Get a list of scenario runs. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param scenario_name: Name of the scenario. Required. + :type scenario_name: str + :return: An iterator like instance of ScenarioRun + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.chaos.models.ScenarioRun] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ScenarioRun]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_scenario_runs_list_all_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + scenario_name=scenario_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ScenarioRun], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "scenario_name", + "run_id", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) + def _cancel_initial( + self, resource_group_name: str, workspace_name: str, scenario_name: str, run_id: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_scenario_runs_cancel_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + scenario_name=scenario_name, + run_id=run_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "scenario_name", + "run_id", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], + ) + def begin_cancel( + self, resource_group_name: str, workspace_name: str, scenario_name: str, run_id: str, **kwargs: Any + ) -> LROPoller[_models.ScenarioRun]: + """Cancel the currently running scenario execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param scenario_name: Name of the scenario. Required. + :type scenario_name: str + :param run_id: The name of the ScenarioRun. Required. + :type run_id: str + :return: An instance of LROPoller that returns ScenarioRun. The ScenarioRun is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.chaos.models.ScenarioRun] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ScenarioRun] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._cancel_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + scenario_name=scenario_name, + run_id=run_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ScenarioRun, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ScenarioRun].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ScenarioRun]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.chaos.ChaosManagementClient`'s + :attr:`connections` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ChaosManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "connection_name", + "accept", + ] + }, + api_versions_list=["2026-08-01-preview"], + ) + def get( + self, resource_group_name: str, workspace_name: str, connection_name: str, **kwargs: Any + ) -> _models.Connection: + """Get a connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param connection_name: Name of the connection. Required. + :type connection_name: str + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.Connection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + + _request = build_connections_get_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Connection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + resource: _models.Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Connection: + """Create or update a connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param connection_name: Name of the connection. Required. + :type connection_name: str + :param resource: Connection resource to be created or updated. Required. + :type resource: ~azure.mgmt.chaos.models.Connection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.Connection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + resource: _types.Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Connection: + """Create or update a connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param connection_name: Name of the connection. Required. + :type connection_name: str + :param resource: Connection resource to be created or updated. Required. + :type resource: ~azure.mgmt.chaos.types.Connection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.Connection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Connection: + """Create or update a connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param connection_name: Name of the connection. Required. + :type connection_name: str + :param resource: Connection resource to be created or updated. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.Connection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "connection_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-08-01-preview"], + ) + def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + resource: Union[_models.Connection, _types.Connection, IO[bytes]], + **kwargs: Any + ) -> _models.Connection: + """Create or update a connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param connection_name: Name of the connection. Required. + :type connection_name: str + :param resource: Connection resource to be created or updated. Is either a Connection type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.chaos.models.Connection or ~azure.mgmt.chaos.types.Connection or + IO[bytes] + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.mgmt.chaos.models.Connection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_connections_create_or_update_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Connection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "connection_name", + ] + }, + api_versions_list=["2026-08-01-preview"], + ) + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, workspace_name: str, connection_name: str, **kwargs: Any + ) -> None: + """Delete a connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :param connection_name: Name of the connection. Required. + :type connection_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_connections_delete_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": ["api_version", "subscription_id", "resource_group_name", "workspace_name", "accept"] + }, + api_versions_list=["2026-08-01-preview"], + ) + def list_all(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> ItemPaged["_models.Connection"]: + """Get a list of connections. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: String that represents a Workspace resource name. Required. + :type workspace_name: str + :return: An iterator like instance of Connection + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.chaos.models.Connection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Connection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_connections_list_all_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Connection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/operations/_patch.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/operations/_patch.py index ea765788358a..87676c65a8f0 100644 --- a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/operations/_patch.py +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/operations/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/types.py b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/types.py new file mode 100644 index 000000000000..8bb18bca1e80 --- /dev/null +++ b/sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/types.py @@ -0,0 +1,1247 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Literal, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +from .models._enums import ExperimentActionType, FilterType, SelectorType + +if TYPE_CHECKING: + from .models import ( + ActionDependencyType, + ActionLifecycle, + ConnectionKind, + ConnectionStatus, + CreatedByType, + ManagedServiceIdentityType, + ParameterType, + PrivateEndpointServiceConnectionStatus, + ProvisioningState, + PublicNetworkAccessOption, + RecommendationStatus, + RunAfterBehavior, + TargetReferenceType, + ) + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + """ + + +class ActionDependency(TypedDict, total=False): + """Model that represents an action dependency. + + :ivar type: The type of dependency. Required. "Action" + :vartype type: Union[str, "ActionDependencyType"] + :ivar name: Name of the action this depends on. Required. + :vartype name: str + :ivar on_action_lifecycle: The lifecycle state of the dependency action that triggers this + action to start. Known values are: "AnyTerminal", "Start", "Running", "Success", "Failure", and + "Skipped". + :vartype on_action_lifecycle: Union[str, "ActionLifecycle"] + """ + + type: Required[Union[str, "ActionDependencyType"]] + """The type of dependency. Required. \"Action\"""" + name: Required[str] + """Name of the action this depends on. Required.""" + onActionLifecycle: Union[str, "ActionLifecycle"] + """The lifecycle state of the dependency action that triggers this action to start. Known values + are: \"AnyTerminal\", \"Start\", \"Running\", \"Success\", \"Failure\", and \"Skipped\".""" + + +class Capability(ProxyResource): + """Model that represents a Capability resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: The properties of a capability resource. + :vartype properties: "CapabilityProperties" + """ + + properties: "CapabilityProperties" + """The properties of a capability resource.""" + + +class CapabilityProperties(TypedDict, total=False): + """Model that represents the Capability properties model. + + :ivar publisher: String of the Publisher that this Capability extends. + :vartype publisher: str + :ivar target_type: String of the Target Type that this Capability extends. + :vartype target_type: str + :ivar description: Localized string of the description. + :vartype description: str + :ivar parameters_schema: URL to retrieve JSON schema of the Capability parameters. + :vartype parameters_schema: str + :ivar urn: String of the URN for this Capability Type. + :vartype urn: str + :ivar provisioning_state: Resource provisioning state. Not currently in use because resource is + created synchronously. Known values are: "Succeeded", "Failed", "Canceled", "Creating", + "Updating", "Deleting", and "Running". + :vartype provisioning_state: Union[str, "ProvisioningState"] + """ + + publisher: str + """String of the Publisher that this Capability extends.""" + targetType: str + """String of the Target Type that this Capability extends.""" + description: str + """Localized string of the description.""" + parametersSchema: str + """URL to retrieve JSON schema of the Capability parameters.""" + urn: str + """String of the URN for this Capability Type.""" + provisioningState: Union[str, "ProvisioningState"] + """Resource provisioning state. Not currently in use because resource is created synchronously. + Known values are: \"Succeeded\", \"Failed\", \"Canceled\", \"Creating\", \"Updating\", + \"Deleting\", and \"Running\".""" + + +class ChaosExperimentBranch(TypedDict, total=False): + """Model that represents a branch in the step. 9 total per experiment. + + :ivar name: String of the branch name. Required. + :vartype name: str + :ivar actions: List of actions. Required. + :vartype actions: list["ChaosExperimentAction"] + """ + + name: Required[str] + """String of the branch name. Required.""" + actions: Required[list["ChaosExperimentAction"]] + """List of actions. Required.""" + + +class ChaosExperimentStep(TypedDict, total=False): + """Model that represents a step in the Experiment resource. + + :ivar name: String of the step name. Required. + :vartype name: str + :ivar branches: List of branches. Required. + :vartype branches: list["ChaosExperimentBranch"] + """ + + name: Required[str] + """String of the step name. Required.""" + branches: Required[list["ChaosExperimentBranch"]] + """List of branches. Required.""" + + +class ChaosTargetListSelector(TypedDict, total=False): + """Model that represents a list selector. + + :ivar id: String of the selector ID. Required. + :vartype id: str + :ivar filter: Model that represents available filter types that can be applied to a targets + list. + :vartype filter: "ChaosTargetFilter" + :ivar targets: List of Target references. Required. + :vartype targets: list["TargetReference"] + :ivar type: Enum of the selector type. Required. List selector type. + :vartype type: Literal[SelectorType.LIST] + """ + + id: Required[str] + """String of the selector ID. Required.""" + filter: "ChaosTargetFilter" + """Model that represents available filter types that can be applied to a targets list.""" + targets: Required[list["TargetReference"]] + """List of Target references. Required.""" + type: Required[Literal[SelectorType.LIST]] + """Enum of the selector type. Required. List selector type.""" + + +class ChaosTargetQuerySelector(TypedDict, total=False): + """Model that represents a query selector. + + :ivar id: String of the selector ID. Required. + :vartype id: str + :ivar filter: Model that represents available filter types that can be applied to a targets + list. + :vartype filter: "ChaosTargetFilter" + :ivar query_string: Azure Resource Graph (ARG) Query Language query for target resources. + Required. + :vartype query_string: str + :ivar subscription_ids: Subscription id list to scope resource query. Required. + :vartype subscription_ids: list[str] + :ivar type: Enum of the selector type. Required. Query selector type. + :vartype type: Literal[SelectorType.QUERY] + """ + + id: Required[str] + """String of the selector ID. Required.""" + filter: "ChaosTargetFilter" + """Model that represents available filter types that can be applied to a targets list.""" + queryString: Required[str] + """Azure Resource Graph (ARG) Query Language query for target resources. Required.""" + subscriptionIds: Required[list[str]] + """Subscription id list to scope resource query. Required.""" + type: Required[Literal[SelectorType.QUERY]] + """Enum of the selector type. Required. Query selector type.""" + + +class ChaosTargetSimpleFilter(TypedDict, total=False): + """Model that represents a simple target filter. + + :ivar parameters: Model that represents the Simple filter parameters. + :vartype parameters: "ChaosTargetSimpleFilterParameters" + :ivar type: Enum that discriminates between filter types. Currently only ``Simple`` type is + supported. Required. Simple filter type. + :vartype type: Literal[FilterType.SIMPLE] + """ + + parameters: "ChaosTargetSimpleFilterParameters" + """Model that represents the Simple filter parameters.""" + type: Required[Literal[FilterType.SIMPLE]] + """Enum that discriminates between filter types. Currently only ``Simple`` type is supported. + Required. Simple filter type.""" + + +class ChaosTargetSimpleFilterParameters(TypedDict, total=False): + """Model that represents the Simple filter parameters. + + :ivar zones: List of Azure availability zones to filter targets by. + :vartype zones: list[str] + """ + + zones: list[str] + """List of Azure availability zones to filter targets by.""" + + +class Connection(ProxyResource): + """Model that represents a connection between a workspace and a target resource. A connection + provisions and tracks the trust relationship that authorizes the actor to reach the Chaos + Studio data plane for the workspace and target during fault injection. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: The properties of the connection. + :vartype properties: "ConnectionProperties" + """ + + properties: "ConnectionProperties" + """The properties of the connection.""" + + +class ConnectionProperties(TypedDict, total=False): + """Model that represents the properties of a connection. + + The schema is flat and discriminated by ``kind``. Optional fields form the + superset across all connection kinds; which fields are required is + validated by the service per kind. + + :ivar kind: The kind of connection, indicating the actor type authorized to reach the Chaos + Studio data plane for the workspace and target. Required. Known values are: "AksExtension", + "ChaosAgent", and "Csfi". + :vartype kind: Union[str, "ConnectionKind"] + :ivar target_resource_id: The fully qualified Azure resource ID of the target resource this + connection is established with. Required. + :vartype target_resource_id: str + :ivar principal_id: The Microsoft Entra principal (object) ID of the identity used by the + connection. + :vartype principal_id: str + :ivar tenant_id: The Microsoft Entra tenant ID that the connection identity belongs to. + :vartype tenant_id: str + :ivar certificate_subject_name: The subject name of the certificate used to authenticate the + connection. + :vartype certificate_subject_name: str + :ivar certificate_issuer: The issuer of the certificate used to authenticate the connection. + :vartype certificate_issuer: str + :ivar dsts_principal: The dSTS principal name used to authenticate the connection. + :vartype dsts_principal: str + :ivar data_plane_endpoint: The regional Chaos Studio data-plane endpoint assigned to this + connection. Clients and agents use this endpoint to reach the Chaos Studio data plane for the + connection. + :vartype data_plane_endpoint: str + :ivar status: The current status of the connection. Known values are: "Pending", "Connected", + "Disconnected", and "Revoked". + :vartype status: Union[str, "ConnectionStatus"] + :ivar provisioning_state: The most recent provisioning state for the connection resource. Known + values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting", and + "Running". + :vartype provisioning_state: Union[str, "ProvisioningState"] + """ + + kind: Required[Union[str, "ConnectionKind"]] + """The kind of connection, indicating the actor type authorized to reach the Chaos Studio data + plane for the workspace and target. Required. Known values are: \"AksExtension\", + \"ChaosAgent\", and \"Csfi\".""" + targetResourceId: Required[str] + """The fully qualified Azure resource ID of the target resource this connection is established + with. Required.""" + principalId: str + """The Microsoft Entra principal (object) ID of the identity used by the connection.""" + tenantId: str + """The Microsoft Entra tenant ID that the connection identity belongs to.""" + certificateSubjectName: str + """The subject name of the certificate used to authenticate the connection.""" + certificateIssuer: str + """The issuer of the certificate used to authenticate the connection.""" + dstsPrincipal: str + """The dSTS principal name used to authenticate the connection.""" + dataPlaneEndpoint: str + """The regional Chaos Studio data-plane endpoint assigned to this connection. Clients and agents + use this endpoint to reach the Chaos Studio data plane for the connection.""" + status: Union[str, "ConnectionStatus"] + """The current status of the connection. Known values are: \"Pending\", \"Connected\", + \"Disconnected\", and \"Revoked\".""" + provisioningState: Union[str, "ProvisioningState"] + """The most recent provisioning state for the connection resource. Known values are: + \"Succeeded\", \"Failed\", \"Canceled\", \"Creating\", \"Updating\", \"Deleting\", and + \"Running\".""" + + +class ContinuousAction(TypedDict, total=False): + """Model that represents a continuous action. + + :ivar name: String that represents a Capability URN. Required. + :vartype name: str + :ivar duration: ISO8601 formatted string that represents a duration. Required. + :vartype duration: str + :ivar parameters: List of key value pairs. Required. + :vartype parameters: list["KeyValuePair"] + :ivar selector_id: String that represents a selector. Required. + :vartype selector_id: str + :ivar type: Enum that discriminates between action models. Required. CONTINUOUS. + :vartype type: Literal[ExperimentActionType.CONTINUOUS] + """ + + name: Required[str] + """String that represents a Capability URN. Required.""" + duration: Required[str] + """ISO8601 formatted string that represents a duration. Required.""" + parameters: Required[list["KeyValuePair"]] + """List of key value pairs. Required.""" + selectorId: Required[str] + """String that represents a selector. Required.""" + type: Required[Literal[ExperimentActionType.CONTINUOUS]] + """Enum that discriminates between action models. Required. CONTINUOUS.""" + + +class CustomerDataStorageProperties(TypedDict, total=False): + """Model that represents the Customer Managed Storage for an Experiment. + + :ivar storage_account_resource_id: Azure Resource ID of the Storage account to use for Customer + Data storage. + :vartype storage_account_resource_id: str + :ivar blob_container_name: Name of the Azure Blob Storage container to use or create. + :vartype blob_container_name: str + """ + + storageAccountResourceId: str + """Azure Resource ID of the Storage account to use for Customer Data storage.""" + blobContainerName: str + """Name of the Azure Blob Storage container to use or create.""" + + +class DelayAction(TypedDict, total=False): + """Model that represents a delay action. + + :ivar name: String that represents a Capability URN. Required. + :vartype name: str + :ivar duration: ISO8601 formatted string that represents a duration. Required. + :vartype duration: str + :ivar type: Enum that discriminates between action models. Required. DELAY. + :vartype type: Literal[ExperimentActionType.DELAY] + """ + + name: Required[str] + """String that represents a Capability URN. Required.""" + duration: Required[str] + """ISO8601 formatted string that represents a duration. Required.""" + type: Required[Literal[ExperimentActionType.DELAY]] + """Enum that discriminates between action models. Required. DELAY.""" + + +class DiscreteAction(TypedDict, total=False): + """Model that represents a discrete action. + + :ivar name: String that represents a Capability URN. Required. + :vartype name: str + :ivar parameters: List of key value pairs. Required. + :vartype parameters: list["KeyValuePair"] + :ivar selector_id: String that represents a selector. Required. + :vartype selector_id: str + :ivar type: Enum that discriminates between action models. Required. DISCRETE. + :vartype type: Literal[ExperimentActionType.DISCRETE] + """ + + name: Required[str] + """String that represents a Capability URN. Required.""" + parameters: Required[list["KeyValuePair"]] + """List of key value pairs. Required.""" + selectorId: Required[str] + """String that represents a selector. Required.""" + type: Required[Literal[ExperimentActionType.DISCRETE]] + """Enum that discriminates between action models. Required. DISCRETE.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: dict[str, str] + """Resource tags.""" + location: Required[str] + """The geo-location where the resource lives. Required.""" + + +class Experiment(TrackedResource): + """Model that represents a Experiment resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + :ivar properties: The properties of the experiment resource. Required. + :vartype properties: "ExperimentProperties" + """ + + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + properties: Required["ExperimentProperties"] + """The properties of the experiment resource. Required.""" + + +class ExperimentProperties(TypedDict, total=False): + """Model that represents the Experiment properties model. + + :ivar provisioning_state: Most recent provisioning state for the given experiment resource. + Known values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting", and + "Running". + :vartype provisioning_state: Union[str, "ProvisioningState"] + :ivar steps: List of steps. Required. + :vartype steps: list["ChaosExperimentStep"] + :ivar selectors: List of selectors. Required. + :vartype selectors: list["ChaosTargetSelector"] + :ivar customer_data_storage: Optional customer-managed Storage account where Experiment schema + will be stored. + :vartype customer_data_storage: "CustomerDataStorageProperties" + """ + + provisioningState: Union[str, "ProvisioningState"] + """Most recent provisioning state for the given experiment resource. Known values are: + \"Succeeded\", \"Failed\", \"Canceled\", \"Creating\", \"Updating\", \"Deleting\", and + \"Running\".""" + steps: Required[list["ChaosExperimentStep"]] + """List of steps. Required.""" + selectors: Required[list["ChaosTargetSelector"]] + """List of selectors. Required.""" + customerDataStorage: "CustomerDataStorageProperties" + """Optional customer-managed Storage account where Experiment schema will be stored.""" + + +class ExperimentUpdate(TypedDict, total=False): + """Describes an experiment update. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + tags: dict[str, str] + """Resource tags.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +class ExternalResource(TypedDict, total=False): + """Model that represents an external resource reference. + + :ivar resource_id: The resource ID of the external resource. + :vartype resource_id: str + """ + + resourceId: str + """The resource ID of the external resource.""" + + +class FixResourcePermissionsRequest(TypedDict, total=False): + """Request body for fixing resource permissions. + + :ivar what_if: Optional value that indicates whether to run a "dry run" of fixing resource + permissions. + :vartype what_if: bool + """ + + whatIf: bool + """Optional value that indicates whether to run a \"dry run\" of fixing resource permissions.""" + + +class KeyValuePair(TypedDict, total=False): + """A key-value pair used to describe parameters for actions or configurations. + + :ivar key: The name of the setting for the action. Required. + :vartype key: str + :ivar value: The value of the setting for the action. Required. + :vartype value: str + """ + + key: Required[str] + """The name of the setting for the action. Required.""" + value: Required[str] + """The value of the setting for the action. Required.""" + + +class ManagedServiceIdentity(TypedDict, total=False): + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: Union[str, "ManagedServiceIdentityType"] + :ivar user_assigned_identities: The identities assigned to this resource by the user. + :vartype user_assigned_identities: dict[str, "UserAssignedIdentity"] + """ + + principalId: str + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenantId: str + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Required[Union[str, "ManagedServiceIdentityType"]] + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """The identities assigned to this resource by the user.""" + + +class PrivateAccess(TrackedResource): + """PrivateAccesses tracked resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. Required. + :vartype properties: "PrivateAccessProperties" + """ + + properties: Required["PrivateAccessProperties"] + """The resource-specific properties for this resource. Required.""" + + +class PrivateAccessPatch(TypedDict, total=False): + """Describes a private access update. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + tags: dict[str, str] + """Resource tags.""" + + +class PrivateAccessProperties(TypedDict, total=False): + """The properties of a private access resource. + + :ivar provisioning_state: Most recent provisioning state for the given privateAccess resource. + Known values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting", and + "Running". + :vartype provisioning_state: Union[str, "ProvisioningState"] + :ivar private_endpoint_connections: A readonly collection of private endpoint connection. + Currently only one endpoint connection is supported. + :vartype private_endpoint_connections: list["PrivateEndpointConnection"] + :ivar public_network_access: Public Network Access Control for PrivateAccess resource. Known + values are: "Enabled" and "Disabled". + :vartype public_network_access: Union[str, "PublicNetworkAccessOption"] + """ + + provisioningState: Union[str, "ProvisioningState"] + """Most recent provisioning state for the given privateAccess resource. Known values are: + \"Succeeded\", \"Failed\", \"Canceled\", \"Creating\", \"Updating\", \"Deleting\", and + \"Running\".""" + privateEndpointConnections: list["PrivateEndpointConnection"] + """A readonly collection of private endpoint connection. Currently only one endpoint connection is + supported.""" + publicNetworkAccess: Union[str, "PublicNetworkAccessOption"] + """Public Network Access Control for PrivateAccess resource. Known values are: \"Enabled\" and + \"Disabled\".""" + + +class PrivateEndpoint(TypedDict, total=False): + """The private endpoint resource. + + :ivar id: The Azure identifier for private endpoint. + :vartype id: str + """ + + id: str + """The Azure identifier for private endpoint.""" + + +class PrivateEndpointConnection(ProxyResource): + """The private endpoint connection resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: Resource properties. + :vartype properties: "PrivateEndpointConnectionProperties" + """ + + properties: "PrivateEndpointConnectionProperties" + """Resource properties.""" + + +class PrivateEndpointConnectionProperties(TypedDict, total=False): + """Properties of the private endpoint connection. + + :ivar group_ids: The group ids for the private endpoint resource. + :vartype group_ids: list[str] + :ivar private_endpoint: The private endpoint resource. + :vartype private_endpoint: "PrivateEndpoint" + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. Required. + :vartype private_link_service_connection_state: "PrivateLinkServiceConnectionState" + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Known values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting", and + "Running". + :vartype provisioning_state: Union[str, "ProvisioningState"] + """ + + groupIds: list[str] + """The group ids for the private endpoint resource.""" + privateEndpoint: "PrivateEndpoint" + """The private endpoint resource.""" + privateLinkServiceConnectionState: Required["PrivateLinkServiceConnectionState"] + """A collection of information about the state of the connection between service consumer and + provider. Required.""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of the private endpoint connection resource. Known values are: + \"Succeeded\", \"Failed\", \"Canceled\", \"Creating\", \"Updating\", \"Deleting\", and + \"Running\".""" + + +class PrivateLinkServiceConnectionState(TypedDict, total=False): + """A collection of information about the state of the connection between service consumer and + provider. + + :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Known values are: "Pending", "Approved", and "Rejected". + :vartype status: Union[str, "PrivateEndpointServiceConnectionStatus"] + :ivar description: The reason for approval/rejection of the connection. + :vartype description: str + :ivar actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :vartype actions_required: str + """ + + status: Union[str, "PrivateEndpointServiceConnectionStatus"] + """Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + service. Known values are: \"Pending\", \"Approved\", and \"Rejected\".""" + description: str + """The reason for approval/rejection of the connection.""" + actionsRequired: str + """A message indicating if changes on the service provider require any updates on the consumer.""" + + +class Recommendation(TypedDict, total=False): + """Model that represents a scenario recommendation. + + :ivar recommendation_status: The recommendation status. Required. Known values are: + "NotEvaluated", "Recommended", "NotApplicable", "Evaluating", "EvaluationFailed", and + "EvaluationCancelled". + :vartype recommendation_status: Union[str, "RecommendationStatus"] + :ivar evaluation_run_at: The UTC time when the recommendation was evaluated. + :vartype evaluation_run_at: str + """ + + recommendationStatus: Required[Union[str, "RecommendationStatus"]] + """The recommendation status. Required. Known values are: \"NotEvaluated\", \"Recommended\", + \"NotApplicable\", \"Evaluating\", \"EvaluationFailed\", and \"EvaluationCancelled\".""" + evaluationRunAt: str + """The UTC time when the recommendation was evaluated.""" + + +class ResourceTargeting(TypedDict, total=False): + """Model that represents unified resource targeting with symmetric include/exclude criteria. Both + sides support the same set of dimensions. + + :ivar include: Inclusion criteria. Resources must match ALL active dimensions to be candidates. + Null or omitted means no inclusion filtering (all resources are candidates). + :vartype include: "ResourceTargetingCriteria" + :ivar exclude: Exclusion criteria. Resources matching ANY active dimension are removed. Null or + omitted means no exclusions applied. + :vartype exclude: "ResourceTargetingCriteria" + """ + + include: "ResourceTargetingCriteria" + """Inclusion criteria. Resources must match ALL active dimensions to be candidates. Null or + omitted means no inclusion filtering (all resources are candidates).""" + exclude: "ResourceTargetingCriteria" + """Exclusion criteria. Resources matching ANY active dimension are removed. Null or omitted means + no exclusions applied.""" + + +class ResourceTargetingCriteria(TypedDict, total=False): + """Model that represents a set of targeting criteria for resource selection. + Used on both the include and exclude sides of ResourceTargeting. + + All dimensions use unified null/empty semantics: + + * Null or omitted means "no constraint" (this dimension is inactive). + * Empty array is treated the same as null (no constraint). + * Non-empty array means the dimension is active. + + :ivar locations: Array of Azure location strings (e.g., "eastus", "westeurope", "global"). + Case-insensitive, normalized form only (e.g., "eastus" not "East US"). + :vartype locations: list[str] + :ivar zones: Array of logical availability zone identifiers (e.g., "1", "2", "3", + "zone-redundant"). + + Mutually exclusive with ``physicalZones`` — set one or the other, not both. + When set, ``locations`` must also be set on the same side (zone IDs are only meaningful within + a region). + :vartype zones: list[str] + :ivar physical_zones: Array of physical datacenter zone identifiers in ``{region}-az{N}`` + format + (e.g., "westus2-az1"). Resolved to logical zones per-subscription at execution time. + + Mutually exclusive with ``zones`` — set one or the other, not both. + :vartype physical_zones: list[str] + :ivar types: Array of Azure resource type strings (e.g., "Microsoft.Compute/virtualMachines"). + Case-insensitive equality. Supports trailing wildcard (e.g., "Microsoft.Compute/*"). + :vartype types: list[str] + :ivar tags: Array of tag key-value pairs for filtering by Azure resource tags. Key and value + are matched case-insensitively. Use "*" as value to match any value for a key. + :vartype tags: list["KeyValuePair"] + :ivar resources: Array of fully qualified Azure resource IDs. Case-insensitive equality. + :vartype resources: list[str] + """ + + locations: list[str] + """Array of Azure location strings (e.g., \"eastus\", \"westeurope\", \"global\"). + Case-insensitive, normalized form only (e.g., \"eastus\" not \"East US\").""" + zones: list[str] + """Array of logical availability zone identifiers (e.g., \"1\", \"2\", \"3\", \"zone-redundant\"). + + Mutually exclusive with ``physicalZones`` — set one or the other, not both. + When set, ``locations`` must also be set on the same side (zone IDs are only meaningful within + a region).""" + physicalZones: list[str] + """Array of physical datacenter zone identifiers in ``{region}-az{N}`` format + (e.g., \"westus2-az1\"). Resolved to logical zones per-subscription at execution time. + + Mutually exclusive with ``zones`` — set one or the other, not both.""" + types: list[str] + """Array of Azure resource type strings (e.g., \"Microsoft.Compute/virtualMachines\"). + Case-insensitive equality. Supports trailing wildcard (e.g., \"Microsoft.Compute/*\").""" + tags: list["KeyValuePair"] + """Array of tag key-value pairs for filtering by Azure resource tags. Key and value are matched + case-insensitively. Use \"*\" as value to match any value for a key.""" + resources: list[str] + """Array of fully qualified Azure resource IDs. Case-insensitive equality.""" + + +class RunAfter(TypedDict, total=False): + """Model that represents action dependencies. + + :ivar behavior: Defines how multiple dependencies are evaluated. Known values are: "Any", + "All", and "AtLeastOne". + :vartype behavior: Union[str, "RunAfterBehavior"] + :ivar items_property: Array of action dependencies. Required. + :vartype items_property: list["ActionDependency"] + """ + + behavior: Union[str, "RunAfterBehavior"] + """Defines how multiple dependencies are evaluated. Known values are: \"Any\", \"All\", and + \"AtLeastOne\".""" + items: Required[list["ActionDependency"]] + """Array of action dependencies. Required.""" + + +class Scenario(ProxyResource): + """Model that represents the scenario. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: The properties of scenario. + :vartype properties: "ScenarioProperties" + """ + + properties: "ScenarioProperties" + """The properties of scenario.""" + + +class ScenarioAction(TypedDict, total=False): + """Model that represents a scenario action. + + :ivar name: Unique name for the action. Required. + :vartype name: str + :ivar action_id: Identifier of the action and version (e.g., "microsoft-compute-shutdown/1.0"). + Required. + :vartype action_id: str + :ivar description: Human-readable description of what this action does. + :vartype description: str + :ivar duration: ISO 8601 duration for how long the action runs (e.g., PT30M for 30 minutes). + Supports template macro syntax (%%\\{parameters.\\\\}%%). Required. + :vartype duration: str + :ivar parameters: Action-specific parameter values. + :vartype parameters: list["KeyValuePair"] + :ivar run_after: Action dependencies that control when this action starts. + :vartype run_after: "RunAfter" + :ivar wait_before: ISO 8601 duration to wait before action starts (e.g., PT30S for 30 seconds). + Supports template macro syntax. + :vartype wait_before: str + :ivar timeout: ISO 8601 duration for maximum action execution time. Supports template macro + syntax. + :vartype timeout: str + :ivar external_resource: External resource reference for the action. + :vartype external_resource: "ExternalResource" + """ + + name: Required[str] + """Unique name for the action. Required.""" + actionId: Required[str] + """Identifier of the action and version (e.g., \"microsoft-compute-shutdown/1.0\"). Required.""" + description: str + """Human-readable description of what this action does.""" + duration: Required[str] + """ISO 8601 duration for how long the action runs (e.g., PT30M for 30 minutes). Supports template + macro syntax (%%\\{parameters.\\\\}%%). Required.""" + parameters: list["KeyValuePair"] + """Action-specific parameter values.""" + runAfter: "RunAfter" + """Action dependencies that control when this action starts.""" + waitBefore: str + """ISO 8601 duration to wait before action starts (e.g., PT30S for 30 seconds). Supports template + macro syntax.""" + timeout: str + """ISO 8601 duration for maximum action execution time. Supports template macro syntax.""" + externalResource: "ExternalResource" + """External resource reference for the action.""" + + +class ScenarioConfiguration(ProxyResource): + """Model that represents the scenario. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: The properties of scenario definition. + :vartype properties: "ScenarioConfigurationProperties" + """ + + properties: "ScenarioConfigurationProperties" + """The properties of scenario definition.""" + + +class ScenarioConfigurationProperties(TypedDict, total=False): + """Model that represents the properties of the scenario configuration. + + :ivar scenario_id: Resource ID of the scenario this configuration applies to. Required. + :vartype scenario_id: str + :ivar parameters: Runtime parameter values for the scenario. Keys must match parameter names + defined in the scenario. + :vartype parameters: list["KeyValuePair"] + :ivar provisioning_state: Most recent provisioning state for the given scenario resource. Known + values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting", and + "Running". + :vartype provisioning_state: Union[str, "ProvisioningState"] + :ivar resource_targeting: Unified resource targeting policy that controls which discovered + resources participate + in fault injection. Replaces the separate ``exclusions`` and ``filters`` properties with + symmetric include/exclude criteria. + + Include uses AND logic — a resource must match ALL active include dimensions. + Exclude uses OR logic — a resource is removed if it matches ANY exclude dimension. + When include and exclude conflict on the same resource, exclude wins. + + Null or omitted means all discovered resources participate (no targeting constraints). + :vartype resource_targeting: "ResourceTargeting" + """ + + scenarioId: Required[str] + """Resource ID of the scenario this configuration applies to. Required.""" + parameters: list["KeyValuePair"] + """Runtime parameter values for the scenario. Keys must match parameter names defined in the + scenario.""" + provisioningState: Union[str, "ProvisioningState"] + """Most recent provisioning state for the given scenario resource. Known values are: + \"Succeeded\", \"Failed\", \"Canceled\", \"Creating\", \"Updating\", \"Deleting\", and + \"Running\".""" + resourceTargeting: "ResourceTargeting" + """Unified resource targeting policy that controls which discovered resources participate + in fault injection. Replaces the separate ``exclusions`` and ``filters`` properties with + symmetric include/exclude criteria. + + Include uses AND logic — a resource must match ALL active include dimensions. + Exclude uses OR logic — a resource is removed if it matches ANY exclude dimension. + When include and exclude conflict on the same resource, exclude wins. + + Null or omitted means all discovered resources participate (no targeting constraints).""" + + +class ScenarioParameter(TypedDict, total=False): + """Model that represents a single scenario parameter definition. + + :ivar name: The name of the parameter. Required. + :vartype name: str + :ivar type: Parameter data type. Required. Known values are: "string", "number", "boolean", + "object", and "array". + :vartype type: Union[str, "ParameterType"] + :ivar default: Default value for the parameter. + :vartype default: str + :ivar required: Whether this parameter is required. + :vartype required: bool + :ivar description: Description of the parameter. + :vartype description: str + """ + + name: Required[str] + """The name of the parameter. Required.""" + type: Required[Union[str, "ParameterType"]] + """Parameter data type. Required. Known values are: \"string\", \"number\", \"boolean\", + \"object\", and \"array\".""" + default: str + """Default value for the parameter.""" + required: bool + """Whether this parameter is required.""" + description: str + """Description of the parameter.""" + + +class ScenarioProperties(TypedDict, total=False): + """Model that represents the properties of the scenario. + + :ivar provisioning_state: Most recent provisioning state for the given scenario resource. Known + values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting", and + "Running". + :vartype provisioning_state: Union[str, "ProvisioningState"] + :ivar created_from: Resource ID of the template version this scenario was created from + (optional). + :vartype created_from: str + :ivar version: Version of the scenario. + :vartype version: str + :ivar description: Description of what this scenario does (optional). + :vartype description: str + :ivar parameters: Parameter definitions for the scenario. Required. + :vartype parameters: list["ScenarioParameter"] + :ivar actions: Array of actions that define the scenario's orchestration. Required. + :vartype actions: list["ScenarioAction"] + :ivar recommendation: The recommendation information for this scenario. + :vartype recommendation: "Recommendation" + """ + + provisioningState: Union[str, "ProvisioningState"] + """Most recent provisioning state for the given scenario resource. Known values are: + \"Succeeded\", \"Failed\", \"Canceled\", \"Creating\", \"Updating\", \"Deleting\", and + \"Running\".""" + createdFrom: str + """Resource ID of the template version this scenario was created from (optional).""" + version: str + """Version of the scenario.""" + description: str + """Description of what this scenario does (optional).""" + parameters: Required[list["ScenarioParameter"]] + """Parameter definitions for the scenario. Required.""" + actions: Required[list["ScenarioAction"]] + """Array of actions that define the scenario's orchestration. Required.""" + recommendation: "Recommendation" + """The recommendation information for this scenario.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: Union[str, "CreatedByType"] + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: str + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: Union[str, "CreatedByType"] + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" + + +class Target(ProxyResource): + """Model that represents a Target resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: The properties of the target resource. Required. + :vartype properties: dict[str, Any] + :ivar location: Azure resource location. + :vartype location: str + """ + + properties: Required[dict[str, Any]] + """The properties of the target resource. Required.""" + location: str + """Azure resource location.""" + + +class TargetReference(TypedDict, total=False): + """Model that represents a reference to a Target in the selector. + + :ivar type: Enum of the Target reference type. Required. "ChaosTarget" + :vartype type: Union[str, "TargetReferenceType"] + :ivar id: String of the resource ID of a Target resource. Required. + :vartype id: str + """ + + type: Required[Union[str, "TargetReferenceType"]] + """Enum of the Target reference type. Required. \"ChaosTarget\"""" + id: Required[str] + """String of the resource ID of a Target resource. Required.""" + + +class UserAssignedIdentity(TypedDict, total=False): + """User assigned identity properties. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + principalId: str + """The principal ID of the assigned identity.""" + clientId: str + """The client ID of the assigned identity.""" + + +class Workspace(TrackedResource): + """Model that represents a Workspace resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + :ivar properties: The properties of the Workspace resource. Required. + :vartype properties: "WorkspaceProperties" + """ + + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + properties: Required["WorkspaceProperties"] + """The properties of the Workspace resource. Required.""" + + +class WorkspaceProperties(TypedDict, total=False): + """Model that represents the Workspace properties model. + + :ivar provisioning_state: Most recent provisioning state for the given Workspace resource. + Known values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting", and + "Running". + :vartype provisioning_state: Union[str, "ProvisioningState"] + :ivar communication_endpoint: The communication endpoint used to connect and communicate with + the workspace for fault-injection orchestration. + :vartype communication_endpoint: str + :ivar scopes: The intended workspace-level resource scope to be used by child scenarios. + Required. + :vartype scopes: list[str] + """ + + provisioningState: Union[str, "ProvisioningState"] + """Most recent provisioning state for the given Workspace resource. Known values are: + \"Succeeded\", \"Failed\", \"Canceled\", \"Creating\", \"Updating\", \"Deleting\", and + \"Running\".""" + communicationEndpoint: str + """The communication endpoint used to connect and communicate with the workspace for + fault-injection orchestration.""" + scopes: Required[list[str]] + """The intended workspace-level resource scope to be used by child scenarios. Required.""" + + +class WorkspaceUpdate(TypedDict, total=False): + """Describes a workspace update. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + tags: dict[str, str] + """Resource tags.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +ChaosExperimentAction = Union[ContinuousAction, DelayAction, DiscreteAction] +ChaosTargetFilter = Union[ChaosTargetSimpleFilter] +ChaosTargetSelector = Union[ChaosTargetListSelector, ChaosTargetQuerySelector] diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/action_versions_get.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/action_versions_get.py index d6f2e9e64e5f..86d493931176 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/action_versions_get.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/action_versions_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/ActionVersions_Get.json +# x-ms-original-file: 2026-08-01-preview/ActionVersions_Get.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/action_versions_list.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/action_versions_list.py index 62ade65c85c7..53b0f07c0652 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/action_versions_list.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/action_versions_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/ActionVersions_List.json +# x-ms-original-file: 2026-08-01-preview/ActionVersions_List.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/actions_get.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/actions_get.py index 054b9fe78b58..04ba68d2e5ef 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/actions_get.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/actions_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/Actions_Get.json +# x-ms-original-file: 2026-08-01-preview/Actions_Get.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/actions_list.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/actions_list.py index 9e9451c84264..4b19df1b9f0e 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/actions_list.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/actions_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/Actions_List.json +# x-ms-original-file: 2026-08-01-preview/Actions_List.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_create_or_update.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_create_or_update.py index 1300b904bce1..343441fa3585 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_create_or_update.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_create_or_update.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/Capabilities_CreateOrUpdate.json +# x-ms-original-file: 2026-08-01-preview/Capabilities_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_delete.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_delete.py index 168f7b26b5a2..77cf69fdb723 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_delete.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_delete.py @@ -40,6 +40,6 @@ def main(): ) -# x-ms-original-file: 2026-05-01-preview/Capabilities_Delete.json +# x-ms-original-file: 2026-08-01-preview/Capabilities_Delete.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_get.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_get.py index 4921422922c7..e19130b2763d 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_get.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_get.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/Capabilities_Get.json +# x-ms-original-file: 2026-08-01-preview/Capabilities_Get.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_list.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_list.py index 4b9c52f7bb37..bea85de0537d 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_list.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/capabilities_list.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/Capabilities_List.json +# x-ms-original-file: 2026-08-01-preview/Capabilities_List.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/capability_types_get.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/capability_types_get.py index 2b6e686610a8..fc70a010de79 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/capability_types_get.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/capability_types_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/CapabilityTypes_Get.json +# x-ms-original-file: 2026-08-01-preview/CapabilityTypes_Get.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/capability_types_list.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/capability_types_list.py index 9d28e3738128..9b21327f1bed 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/capability_types_list.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/capability_types_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/CapabilityTypes_List.json +# x-ms-original-file: 2026-08-01-preview/CapabilityTypes_List.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/connections_create_or_update.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/connections_create_or_update.py new file mode 100644 index 000000000000..33837b676b90 --- /dev/null +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/connections_create_or_update.py @@ -0,0 +1,52 @@ +# pylint: disable=line-too-long,useless-suppression +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.chaos import ChaosManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-chaos +# USAGE + python connections_create_or_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ChaosManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.connections.create_or_update( + resource_group_name="exampleRG", + workspace_name="exampleWorkspace", + connection_name="aksClusterConnection", + resource={ + "properties": { + "kind": "AksExtension", + "principalId": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d", + "targetResourceId": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.ContainerService/managedClusters/exampleCluster", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + } + }, + ) + print(response) + + +# x-ms-original-file: 2026-08-01-preview/Connections_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/connections_delete.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/connections_delete.py new file mode 100644 index 000000000000..89d3384e5335 --- /dev/null +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/connections_delete.py @@ -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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.chaos import ChaosManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-chaos +# USAGE + python connections_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ChaosManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.connections.delete( + resource_group_name="exampleRG", + workspace_name="exampleWorkspace", + connection_name="aksClusterConnection", + ) + + +# x-ms-original-file: 2026-08-01-preview/Connections_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/connections_get.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/connections_get.py new file mode 100644 index 000000000000..db43bbbc46f0 --- /dev/null +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/connections_get.py @@ -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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.chaos import ChaosManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-chaos +# USAGE + python connections_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ChaosManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.connections.get( + resource_group_name="exampleRG", + workspace_name="exampleWorkspace", + connection_name="aksClusterConnection", + ) + print(response) + + +# x-ms-original-file: 2026-08-01-preview/Connections_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/connections_list_all.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/connections_list_all.py new file mode 100644 index 000000000000..1eb7c65131d6 --- /dev/null +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/connections_list_all.py @@ -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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.chaos import ChaosManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-chaos +# USAGE + python connections_list_all.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ChaosManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.connections.list_all( + resource_group_name="exampleRG", + workspace_name="exampleWorkspace", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-08-01-preview/Connections_ListAll.json +if __name__ == "__main__": + main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/discovered_resources_get.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/discovered_resources_get.py index 378fc13ed79e..a0322f95b52e 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/discovered_resources_get.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/discovered_resources_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/DiscoveredResources_Get.json +# x-ms-original-file: 2026-08-01-preview/DiscoveredResources_Get.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/discovered_resources_list_by_workspace.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/discovered_resources_list_by_workspace.py index f1e5e93daafc..da633550089c 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/discovered_resources_list_by_workspace.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/discovered_resources_list_by_workspace.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/DiscoveredResources_ListByWorkspace.json +# x-ms-original-file: 2026-08-01-preview/DiscoveredResources_ListByWorkspace.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_cancel.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_cancel.py index 2e560e6eeb8a..4330773756d4 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_cancel.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_cancel.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-05-01-preview/Experiments_Cancel.json +# x-ms-original-file: 2026-08-01-preview/Experiments_Cancel.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_create_or_update.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_create_or_update.py index f2d3a69cfeaf..b098148eb280 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_create_or_update.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_create_or_update.py @@ -80,6 +80,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/Experiments_CreateOrUpdate.json +# x-ms-original-file: 2026-08-01-preview/Experiments_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_delete.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_delete.py index 7d562609bc06..36bc06ef19d4 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_delete.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-05-01-preview/Experiments_Delete.json +# x-ms-original-file: 2026-08-01-preview/Experiments_Delete.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_execution_details.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_execution_details.py index 08783089ba31..49e47ca42a8d 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_execution_details.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_execution_details.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/Experiments_ExecutionDetails.json +# x-ms-original-file: 2026-08-01-preview/Experiments_ExecutionDetails.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_get.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_get.py index 1fdaab7c77ec..2acba97f9a0e 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_get.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/Experiments_Get.json +# x-ms-original-file: 2026-08-01-preview/Experiments_Get.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_get_execution.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_get_execution.py index baa7365864e7..6b834bda8956 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_get_execution.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_get_execution.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/Experiments_GetExecution.json +# x-ms-original-file: 2026-08-01-preview/Experiments_GetExecution.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_list.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_list.py index 297eb517625b..e4204ce7af98 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_list.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/Experiments_List.json +# x-ms-original-file: 2026-08-01-preview/Experiments_List.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_list_all.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_list_all.py index c25edb72d12f..a3b4fb4af754 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_list_all.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_list_all.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/Experiments_ListAll.json +# x-ms-original-file: 2026-08-01-preview/Experiments_ListAll.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_list_all_executions.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_list_all_executions.py index 221e549a4caf..163f967fa4e0 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_list_all_executions.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_list_all_executions.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/Experiments_ListAllExecutions.json +# x-ms-original-file: 2026-08-01-preview/Experiments_ListAllExecutions.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_start.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_start.py index e68730dd50d2..b7f6eab3f1a8 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_start.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_start.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-05-01-preview/Experiments_Start.json +# x-ms-original-file: 2026-08-01-preview/Experiments_Start.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_update.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_update.py index d0c36eb08a0f..7b0114685281 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_update.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/experiments_update.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/Experiments_Update.json +# x-ms-original-file: 2026-08-01-preview/Experiments_Update.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/operation_statuses_get.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/operation_statuses_get.py index 8f1fc1a78f17..b41612e76952 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/operation_statuses_get.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/operation_statuses_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/OperationStatuses_Get.json +# x-ms-original-file: 2026-08-01-preview/OperationStatuses_Get.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/operations_list.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/operations_list.py index 6e6c028cb614..f02e284c3be1 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/operations_list.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/Operations_List.json +# x-ms-original-file: 2026-08-01-preview/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_create_or_update_create_or_update_a_private_access_resource.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_create_or_update_create_or_update_a_private_access_resource.py index efaa666db71b..370b46d719ec 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_create_or_update_create_or_update_a_private_access_resource.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_create_or_update_create_or_update_a_private_access_resource.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/PrivateAccesses_CreateOrUpdate_Create_Or_Update_A_Private_Access_Resource.json +# x-ms-original-file: 2026-08-01-preview/PrivateAccesses_CreateOrUpdate_Create_Or_Update_A_Private_Access_Resource.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_create_or_update_create_or_update_a_private_access_resource_with_public_network_access.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_create_or_update_create_or_update_a_private_access_resource_with_public_network_access.py index 83a49c180eb9..146ab7f96368 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_create_or_update_create_or_update_a_private_access_resource_with_public_network_access.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_create_or_update_create_or_update_a_private_access_resource_with_public_network_access.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/PrivateAccesses_CreateOrUpdate_Create_Or_Update_A_Private_Access_Resource_With_Public_Network_Access.json +# x-ms-original-file: 2026-08-01-preview/PrivateAccesses_CreateOrUpdate_Create_Or_Update_A_Private_Access_Resource_With_Public_Network_Access.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_delete.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_delete.py index 56696c34725b..60ac663cfef1 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_delete.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-05-01-preview/PrivateAccesses_Delete.json +# x-ms-original-file: 2026-08-01-preview/PrivateAccesses_Delete.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_delete_aprivate_endpoint_connection.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_delete_aprivate_endpoint_connection.py index 2e32397542a9..40669807fe72 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_delete_aprivate_endpoint_connection.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_delete_aprivate_endpoint_connection.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-05-01-preview/PrivateAccesses_DeleteAPrivateEndpointConnection.json +# x-ms-original-file: 2026-08-01-preview/PrivateAccesses_DeleteAPrivateEndpointConnection.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_aprivate_endpoint_connection.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_aprivate_endpoint_connection.py index 1845873bb2d1..f1ca5fcd96fc 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_aprivate_endpoint_connection.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_aprivate_endpoint_connection.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/PrivateAccesses_GetAPrivateEndpointConnection.json +# x-ms-original-file: 2026-08-01-preview/PrivateAccesses_GetAPrivateEndpointConnection.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_get_a_private_access_resource.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_get_a_private_access_resource.py index e0b187690f93..9710dc2ba8bc 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_get_a_private_access_resource.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_get_a_private_access_resource.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/PrivateAccesses_Get_Get_A_Private_Access_Resource.json +# x-ms-original-file: 2026-08-01-preview/PrivateAccesses_Get_Get_A_Private_Access_Resource.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_get_a_private_access_resource_with_private_endpoint.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_get_a_private_access_resource_with_private_endpoint.py index 6b3dd1f8f3cd..b90f001dcc9b 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_get_a_private_access_resource_with_private_endpoint.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_get_a_private_access_resource_with_private_endpoint.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/PrivateAccesses_Get_Get_A_Private_Access_Resource_With_Private_Endpoint.json +# x-ms-original-file: 2026-08-01-preview/PrivateAccesses_Get_Get_A_Private_Access_Resource_With_Private_Endpoint.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_private_link_resources.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_private_link_resources.py index f93b5b4b78b2..6537a2b8bbc7 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_private_link_resources.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_get_private_link_resources.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/PrivateAccesses_GetPrivateLinkResources.json +# x-ms-original-file: 2026-08-01-preview/PrivateAccesses_GetPrivateLinkResources.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_list.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_list.py index 8eb5152aceb1..e08ff3ac9147 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_list.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/PrivateAccesses_List.json +# x-ms-original-file: 2026-08-01-preview/PrivateAccesses_List.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_list_all.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_list_all.py index 1a0576283958..b8942c76c7a4 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_list_all.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_list_all.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/PrivateAccesses_ListAll.json +# x-ms-original-file: 2026-08-01-preview/PrivateAccesses_ListAll.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_list_private_endpoint_connections.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_list_private_endpoint_connections.py index ad21e20375c7..8295b7e73358 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_list_private_endpoint_connections.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_list_private_endpoint_connections.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/PrivateAccesses_ListPrivateEndpointConnections.json +# x-ms-original-file: 2026-08-01-preview/PrivateAccesses_ListPrivateEndpointConnections.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_update.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_update.py index 432adea345af..6db25c3a11ee 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_update.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/private_accesses_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/PrivateAccesses_Update.json +# x-ms-original-file: 2026-08-01-preview/PrivateAccesses_Update.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_create_or_update.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_create_or_update.py index 035995973b53..b55921cc7817 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_create_or_update.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_create_or_update.py @@ -38,14 +38,6 @@ def main(): scenario_configuration_name="config-5678-9012-3456-789012345678", resource={ "properties": { - "exclusions": { - "resources": [ - "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/protectedVM" - ], - "tags": [{"key": "environment", "value": "production"}], - "types": ["Microsoft.Compute/virtualMachineScaleSets"], - }, - "filters": {"locations": ["eastus"], "zones": ["1"]}, "parameters": [ {"key": "duration", "value": "PT10M"}, { @@ -53,6 +45,16 @@ def main(): "value": '["/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/vm1","/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/vm2"]', }, ], + "resourceTargeting": { + "exclude": { + "resources": [ + "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/protectedVM" + ], + "tags": [{"key": "environment", "value": "production"}], + "types": ["Microsoft.Compute/virtualMachineScaleSets"], + }, + "include": {"locations": ["eastus"], "zones": ["1"]}, + }, "scenarioId": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/workspaces/exampleWorkspace/scenarios/12345678-1234-1234-1234-123456789012", } }, @@ -60,6 +62,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/ScenarioConfigurations_CreateOrUpdate.json +# x-ms-original-file: 2026-08-01-preview/ScenarioConfigurations_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_create_or_update_with_physical_zones.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_create_or_update_with_physical_zones.py index 414f4edb2a1d..032f3472c399 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_create_or_update_with_physical_zones.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_create_or_update_with_physical_zones.py @@ -38,13 +38,15 @@ def main(): scenario_configuration_name="config-physical-zone", resource={ "properties": { - "exclusions": { - "resources": [ - "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/protectedVM" - ] - }, - "filters": {"locations": ["westus2"], "physicalZones": ["westus2-az1"]}, "parameters": [{"key": "duration", "value": "PT10M"}], + "resourceTargeting": { + "exclude": { + "resources": [ + "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/protectedVM" + ] + }, + "include": {"physicalZones": ["westus2-az1"]}, + }, "scenarioId": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/workspaces/exampleWorkspace/scenarios/12345678-1234-1234-1234-123456789012", } }, @@ -52,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/ScenarioConfigurations_CreateOrUpdate_With_Physical_Zones.json +# x-ms-original-file: 2026-08-01-preview/ScenarioConfigurations_CreateOrUpdate_With_Physical_Zones.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_delete.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_delete.py index f93f1bcf4419..44a90ded8c8c 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_delete.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-05-01-preview/ScenarioConfigurations_Delete.json +# x-ms-original-file: 2026-08-01-preview/ScenarioConfigurations_Delete.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_execute.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_execute.py index 51eab993185b..3fffeca80a62 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_execute.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_execute.py @@ -30,14 +30,15 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.scenario_configurations.execute( + response = client.scenario_configurations.begin_execute( resource_group_name="exampleRG", workspace_name="exampleWorkspace", scenario_name="12345678-1234-1234-1234-123456789012", scenario_configuration_name="config-5678-9012-3456-789012345678", - ) + ).result() + print(response) -# x-ms-original-file: 2026-05-01-preview/ScenarioConfigurations_Execute.json +# x-ms-original-file: 2026-08-01-preview/ScenarioConfigurations_Execute.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_fix_resource_permissions.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_fix_resource_permissions.py index e0f0dc82e0a0..f2fa8cb64f27 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_fix_resource_permissions.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_fix_resource_permissions.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/ScenarioConfigurations_FixResourcePermissions.json +# x-ms-original-file: 2026-08-01-preview/ScenarioConfigurations_FixResourcePermissions.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_get.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_get.py index 7a7e815d57aa..821b1c7d2660 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_get.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/ScenarioConfigurations_Get.json +# x-ms-original-file: 2026-08-01-preview/ScenarioConfigurations_Get.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_list_all.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_list_all.py index 2a27c72e72ad..3a3e3caa2b44 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_list_all.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_list_all.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/ScenarioConfigurations_ListAll.json +# x-ms-original-file: 2026-08-01-preview/ScenarioConfigurations_ListAll.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_validate.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_validate.py index 02df12e8465d..7a73723f932e 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_validate.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_configurations_validate.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/ScenarioConfigurations_Validate.json +# x-ms-original-file: 2026-08-01-preview/ScenarioConfigurations_Validate.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_runs_cancel.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_runs_cancel.py index b1c94d1f9d1c..f812dba8d51e 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_runs_cancel.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_runs_cancel.py @@ -30,14 +30,15 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.scenario_runs.cancel( + response = client.scenario_runs.begin_cancel( resource_group_name="exampleRG", workspace_name="exampleWorkspace", scenario_name="12345678-1234-1234-1234-123456789012", run_id="abcd1234-5678-9012-3456-789012345678", - ) + ).result() + print(response) -# x-ms-original-file: 2026-05-01-preview/ScenarioRuns_Cancel.json +# x-ms-original-file: 2026-08-01-preview/ScenarioRuns_Cancel.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_runs_get.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_runs_get.py index 777976aea12d..51fc013b9dce 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_runs_get.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_runs_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/ScenarioRuns_Get.json +# x-ms-original-file: 2026-08-01-preview/ScenarioRuns_Get.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_runs_list_all.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_runs_list_all.py index 105c3b6dccbf..49e118a3ae0b 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_runs_list_all.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenario_runs_list_all.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/ScenarioRuns_ListAll.json +# x-ms-original-file: 2026-08-01-preview/ScenarioRuns_ListAll.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_create_or_update.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_create_or_update.py index 1821f16ed67a..80287e80959a 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_create_or_update.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_create_or_update.py @@ -101,6 +101,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/Scenarios_CreateOrUpdate.json +# x-ms-original-file: 2026-08-01-preview/Scenarios_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_delete.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_delete.py index 59ba4a0fc9d0..4afbf4093181 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_delete.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: 2026-05-01-preview/Scenarios_Delete.json +# x-ms-original-file: 2026-08-01-preview/Scenarios_Delete.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_get.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_get.py index 8b613b4da4e7..5c15325d8cf8 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_get.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/Scenarios_Get.json +# x-ms-original-file: 2026-08-01-preview/Scenarios_Get.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_list_all.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_list_all.py index 5b7c0540145e..9085013cf136 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_list_all.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/scenarios_list_all.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/Scenarios_ListAll.json +# x-ms-original-file: 2026-08-01-preview/Scenarios_ListAll.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/target_types_get.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/target_types_get.py index 5a7402d07810..a60f7dcf769a 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/target_types_get.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/target_types_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/TargetTypes_Get.json +# x-ms-original-file: 2026-08-01-preview/TargetTypes_Get.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/target_types_list.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/target_types_list.py index 283b6e550afb..78ea350ba561 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/target_types_list.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/target_types_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/TargetTypes_List.json +# x-ms-original-file: 2026-08-01-preview/TargetTypes_List.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_create_or_update.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_create_or_update.py index 0a021cfa21cd..a0fceb12aed8 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_create_or_update.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_create_or_update.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/Targets_CreateOrUpdate.json +# x-ms-original-file: 2026-08-01-preview/Targets_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_delete.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_delete.py index 86c4d1dfab65..b910d2beed01 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_delete.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_delete.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: 2026-05-01-preview/Targets_Delete.json +# x-ms-original-file: 2026-08-01-preview/Targets_Delete.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_get.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_get.py index 13e40b478aac..be2392e30e69 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_get.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/Targets_Get.json +# x-ms-original-file: 2026-08-01-preview/Targets_Get.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_list.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_list.py index d2dd5b18f87f..31208eca6f05 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_list.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/targets_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/Targets_List.json +# x-ms-original-file: 2026-08-01-preview/Targets_List.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_create_or_update.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_create_or_update.py index 2e72b33d8d52..55bfc69fd93a 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_create_or_update.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_create_or_update.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/Workspaces_CreateOrUpdate.json +# x-ms-original-file: 2026-08-01-preview/Workspaces_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_delete.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_delete.py index 5eb610332121..fd6b02494c55 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_delete.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-05-01-preview/Workspaces_Delete.json +# x-ms-original-file: 2026-08-01-preview/Workspaces_Delete.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_refresh_recommendations.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_discover.py similarity index 87% rename from sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_refresh_recommendations.py rename to sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_discover.py index be83e4bc45fc..0c7e51a5f5c2 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_refresh_recommendations.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_discover.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-chaos # USAGE - python workspaces_refresh_recommendations.py + python workspaces_discover.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,13 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.workspaces.begin_refresh_recommendations( + response = client.workspaces.begin_discover( resource_group_name="exampleRG", workspace_name="exampleWorkspace", ).result() print(response) -# x-ms-original-file: 2026-05-01-preview/Workspaces_RefreshRecommendations.json +# x-ms-original-file: 2026-08-01-preview/Workspaces_Discover.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_evaluate.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_evaluate.py new file mode 100644 index 000000000000..66ca8c0b174e --- /dev/null +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_evaluate.py @@ -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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.chaos import ChaosManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-chaos +# USAGE + python workspaces_evaluate.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ChaosManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.workspaces.begin_evaluate( + resource_group_name="exampleRG", + workspace_name="exampleWorkspace", + ).result() + print(response) + + +# x-ms-original-file: 2026-08-01-preview/Workspaces_Evaluate.json +if __name__ == "__main__": + main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_get.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_get.py index f84ce327848c..62c20b8e7ac2 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_get.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/Workspaces_Get.json +# x-ms-original-file: 2026-08-01-preview/Workspaces_Get.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_list.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_list.py index 03c6fbe9e930..d9d91653a63a 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_list.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/Workspaces_List.json +# x-ms-original-file: 2026-08-01-preview/Workspaces_List.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_list_all.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_list_all.py index e2f87aa8fa92..e0a0519097a4 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_list_all.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_list_all.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-05-01-preview/Workspaces_ListAll.json +# x-ms-original-file: 2026-08-01-preview/Workspaces_ListAll.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_update.py b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_update.py index da22c382b9cc..e452d2bbca83 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_update.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_samples/workspaces_update.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: 2026-05-01-preview/Workspaces_Update.json +# x-ms-original-file: 2026-08-01-preview/Workspaces_Update.json if __name__ == "__main__": main() diff --git a/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_connections_operations.py b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_connections_operations.py new file mode 100644 index 000000000000..1c9bf482fdf2 --- /dev/null +++ b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_connections_operations.py @@ -0,0 +1,91 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.chaos import ChaosManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestChaosManagementConnectionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ChaosManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_connections_get(self, resource_group): + response = self.client.connections.get( + resource_group_name=resource_group.name, + workspace_name="str", + connection_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_connections_create_or_update(self, resource_group): + response = self.client.connections.create_or_update( + resource_group_name=resource_group.name, + workspace_name="str", + connection_name="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "kind": "str", + "targetResourceId": "str", + "certificateIssuer": "str", + "certificateSubjectName": "str", + "dataPlaneEndpoint": "str", + "dstsPrincipal": "str", + "principalId": "str", + "provisioningState": "str", + "status": "str", + "tenantId": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_connections_delete(self, resource_group): + response = self.client.connections.delete( + resource_group_name=resource_group.name, + workspace_name="str", + connection_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_connections_list_all(self, resource_group): + response = self.client.connections.list_all( + resource_group_name=resource_group.name, + workspace_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_connections_operations_async.py b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_connections_operations_async.py new file mode 100644 index 000000000000..8ce7aa26e887 --- /dev/null +++ b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_connections_operations_async.py @@ -0,0 +1,92 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.chaos.aio import ChaosManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestChaosManagementConnectionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ChaosManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_connections_get(self, resource_group): + response = await self.client.connections.get( + resource_group_name=resource_group.name, + workspace_name="str", + connection_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_connections_create_or_update(self, resource_group): + response = await self.client.connections.create_or_update( + resource_group_name=resource_group.name, + workspace_name="str", + connection_name="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "kind": "str", + "targetResourceId": "str", + "certificateIssuer": "str", + "certificateSubjectName": "str", + "dataPlaneEndpoint": "str", + "dstsPrincipal": "str", + "principalId": "str", + "provisioningState": "str", + "status": "str", + "tenantId": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_connections_delete(self, resource_group): + response = await self.client.connections.delete( + resource_group_name=resource_group.name, + workspace_name="str", + connection_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_connections_list_all(self, resource_group): + response = self.client.connections.list_all( + resource_group_name=resource_group.name, + workspace_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_configurations_operations.py b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_configurations_operations.py index 99d272299ed8..7a888155fcb8 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_configurations_operations.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_configurations_operations.py @@ -44,10 +44,26 @@ def test_scenario_configurations_begin_create_or_update(self, resource_group): "name": "str", "properties": { "scenarioId": "str", - "exclusions": {"resources": ["str"], "tags": [{"key": "str", "value": "str"}], "types": ["str"]}, - "filters": {"locations": ["str"], "physicalZones": ["str"], "zones": ["str"]}, "parameters": [{"key": "str", "value": "str"}], "provisioningState": "str", + "resourceTargeting": { + "exclude": { + "locations": ["str"], + "physicalZones": ["str"], + "resources": ["str"], + "tags": [{"key": "str", "value": "str"}], + "types": ["str"], + "zones": ["str"], + }, + "include": { + "locations": ["str"], + "physicalZones": ["str"], + "resources": ["str"], + "tags": [{"key": "str", "value": "str"}], + "types": ["str"], + "zones": ["str"], + }, + }, }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -91,13 +107,13 @@ def test_scenario_configurations_list_all(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_scenario_configurations_execute(self, resource_group): - response = self.client.scenario_configurations.execute( + def test_scenario_configurations_begin_execute(self, resource_group): + response = self.client.scenario_configurations.begin_execute( resource_group_name=resource_group.name, workspace_name="str", scenario_name="str", scenario_configuration_name="str", - ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... diff --git a/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_configurations_operations_async.py b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_configurations_operations_async.py index ceb0794f9b66..a7ced19b4cfe 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_configurations_operations_async.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_configurations_operations_async.py @@ -46,14 +46,26 @@ async def test_scenario_configurations_begin_create_or_update(self, resource_gro "name": "str", "properties": { "scenarioId": "str", - "exclusions": { - "resources": ["str"], - "tags": [{"key": "str", "value": "str"}], - "types": ["str"], - }, - "filters": {"locations": ["str"], "physicalZones": ["str"], "zones": ["str"]}, "parameters": [{"key": "str", "value": "str"}], "provisioningState": "str", + "resourceTargeting": { + "exclude": { + "locations": ["str"], + "physicalZones": ["str"], + "resources": ["str"], + "tags": [{"key": "str", "value": "str"}], + "types": ["str"], + "zones": ["str"], + }, + "include": { + "locations": ["str"], + "physicalZones": ["str"], + "resources": ["str"], + "tags": [{"key": "str", "value": "str"}], + "types": ["str"], + "zones": ["str"], + }, + }, }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -100,13 +112,15 @@ async def test_scenario_configurations_list_all(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_scenario_configurations_execute(self, resource_group): - response = await self.client.scenario_configurations.execute( - resource_group_name=resource_group.name, - workspace_name="str", - scenario_name="str", - scenario_configuration_name="str", - ) + async def test_scenario_configurations_begin_execute(self, resource_group): + response = await ( + await self.client.scenario_configurations.begin_execute( + resource_group_name=resource_group.name, + workspace_name="str", + scenario_name="str", + scenario_configuration_name="str", + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... diff --git a/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_runs_operations.py b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_runs_operations.py index a5e908c91380..7f0c220eb4e3 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_runs_operations.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_runs_operations.py @@ -45,13 +45,13 @@ def test_scenario_runs_list_all(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_scenario_runs_cancel(self, resource_group): - response = self.client.scenario_runs.cancel( + def test_scenario_runs_begin_cancel(self, resource_group): + response = self.client.scenario_runs.begin_cancel( resource_group_name=resource_group.name, workspace_name="str", scenario_name="str", run_id="str", - ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... diff --git a/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_runs_operations_async.py b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_runs_operations_async.py index bdacf411d94c..2d2a7533ac92 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_runs_operations_async.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_scenario_runs_operations_async.py @@ -46,13 +46,15 @@ async def test_scenario_runs_list_all(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_scenario_runs_cancel(self, resource_group): - response = await self.client.scenario_runs.cancel( - resource_group_name=resource_group.name, - workspace_name="str", - scenario_name="str", - run_id="str", - ) + async def test_scenario_runs_begin_cancel(self, resource_group): + response = await ( + await self.client.scenario_runs.begin_cancel( + resource_group_name=resource_group.name, + workspace_name="str", + scenario_name="str", + run_id="str", + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... diff --git a/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_workspaces_operations.py b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_workspaces_operations.py index 7760d976eff2..c83572fe7c40 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_workspaces_operations.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_workspaces_operations.py @@ -113,8 +113,19 @@ def test_workspaces_list_all(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_workspaces_begin_refresh_recommendations(self, resource_group): - response = self.client.workspaces.begin_refresh_recommendations( + def test_workspaces_begin_discover(self, resource_group): + response = self.client.workspaces.begin_discover( + resource_group_name=resource_group.name, + workspace_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_workspaces_begin_evaluate(self, resource_group): + response = self.client.workspaces.begin_evaluate( resource_group_name=resource_group.name, workspace_name="str", ).result() # call '.result()' to poll until service return final result diff --git a/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_workspaces_operations_async.py b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_workspaces_operations_async.py index 5ece17636bf9..9dacdd1ad057 100644 --- a/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_workspaces_operations_async.py +++ b/sdk/chaos/azure-mgmt-chaos/generated_tests/test_chaos_management_workspaces_operations_async.py @@ -120,9 +120,22 @@ async def test_workspaces_list_all(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_workspaces_begin_refresh_recommendations(self, resource_group): + async def test_workspaces_begin_discover(self, resource_group): response = await ( - await self.client.workspaces.begin_refresh_recommendations( + await self.client.workspaces.begin_discover( + resource_group_name=resource_group.name, + workspace_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_workspaces_begin_evaluate(self, resource_group): + response = await ( + await self.client.workspaces.begin_evaluate( resource_group_name=resource_group.name, workspace_name="str", ) diff --git a/sdk/chaos/azure-mgmt-chaos/pyproject.toml b/sdk/chaos/azure-mgmt-chaos/pyproject.toml index fd3f7f2a784b..512623dd3d0b 100644 --- a/sdk/chaos/azure-mgmt-chaos/pyproject.toml +++ b/sdk/chaos/azure-mgmt-chaos/pyproject.toml @@ -17,13 +17,13 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] -requires-python = ">=3.9" +requires-python = ">=3.10" keywords = [ "azure", "azure sdk", diff --git a/sdk/chaos/azure-mgmt-chaos/tsp-location.yaml b/sdk/chaos/azure-mgmt-chaos/tsp-location.yaml index fd4d4340510d..b7553457a79e 100644 --- a/sdk/chaos/azure-mgmt-chaos/tsp-location.yaml +++ b/sdk/chaos/azure-mgmt-chaos/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/chaos/resource-manager/Microsoft.Chaos/Chaos -commit: 84d40416fbb3d2416cb7abe7ec82e63c76832963 +commit: dd0a22906855bb0582ef763a37187de5e5605d54 repo: Azure/azure-rest-api-specs additionalDirectories: