selectors) {
this.selectors = selectors;
return this;
}
- /**
- * Get the startOnCreation property: A boolean value that indicates if experiment should be started on creation or
- * not.
- *
- * @return the startOnCreation value.
- */
- public Boolean startOnCreation() {
- return this.startOnCreation;
- }
-
- /**
- * Set the startOnCreation property: A boolean value that indicates if experiment should be started on creation or
- * not.
- *
- * @param startOnCreation the startOnCreation value to set.
- * @return the ExperimentProperties object itself.
- */
- public ExperimentProperties withStartOnCreation(Boolean startOnCreation) {
- this.startOnCreation = startOnCreation;
- return this;
- }
-
/**
* Validates the instance.
*
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStartOperationResultInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStartOperationResultInner.java
deleted file mode 100644
index 03dc806d31cd5..0000000000000
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStartOperationResultInner.java
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.chaos.fluent.models;
-
-import com.azure.core.annotation.Immutable;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-/** Model that represents the result of a start Experiment operation. */
-@Immutable
-public final class ExperimentStartOperationResultInner {
- /*
- * String of the Experiment name.
- */
- @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
- private String name;
-
- /*
- * URL to retrieve the Experiment status.
- */
- @JsonProperty(value = "statusUrl", access = JsonProperty.Access.WRITE_ONLY)
- private String statusUrl;
-
- /** Creates an instance of ExperimentStartOperationResultInner class. */
- public ExperimentStartOperationResultInner() {
- }
-
- /**
- * Get the name property: String of the Experiment name.
- *
- * @return the name value.
- */
- public String name() {
- return this.name;
- }
-
- /**
- * Get the statusUrl property: URL to retrieve the Experiment status.
- *
- * @return the statusUrl value.
- */
- public String statusUrl() {
- return this.statusUrl;
- }
-
- /**
- * Validates the instance.
- *
- * @throws IllegalArgumentException thrown if the instance is not valid.
- */
- public void validate() {
- }
-}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationStatusInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationStatusInner.java
new file mode 100644
index 0000000000000..3468d9ffca75f
--- /dev/null
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationStatusInner.java
@@ -0,0 +1,187 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.chaos.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.exception.ManagementError;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The status of operation. */
+@Fluent
+public final class OperationStatusInner {
+ /*
+ * The operation Id.
+ */
+ @JsonProperty(value = "id")
+ private String id;
+
+ /*
+ * The operation name.
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /*
+ * The start time of the operation.
+ */
+ @JsonProperty(value = "startTime")
+ private String startTime;
+
+ /*
+ * The end time of the operation.
+ */
+ @JsonProperty(value = "endTime")
+ private String endTime;
+
+ /*
+ * The status of the operation.
+ */
+ @JsonProperty(value = "status")
+ private String status;
+
+ /*
+ * Error response
+ *
+ * The error detail of the operation if any.
+ */
+ @JsonProperty(value = "error")
+ private ManagementError error;
+
+ /** Creates an instance of OperationStatusInner class. */
+ public OperationStatusInner() {
+ }
+
+ /**
+ * Get the id property: The operation Id.
+ *
+ * @return the id value.
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Set the id property: The operation Id.
+ *
+ * @param id the id value to set.
+ * @return the OperationStatusInner object itself.
+ */
+ public OperationStatusInner withId(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get the name property: The operation name.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: The operation name.
+ *
+ * @param name the name value to set.
+ * @return the OperationStatusInner object itself.
+ */
+ public OperationStatusInner withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the startTime property: The start time of the operation.
+ *
+ * @return the startTime value.
+ */
+ public String startTime() {
+ return this.startTime;
+ }
+
+ /**
+ * Set the startTime property: The start time of the operation.
+ *
+ * @param startTime the startTime value to set.
+ * @return the OperationStatusInner object itself.
+ */
+ public OperationStatusInner withStartTime(String startTime) {
+ this.startTime = startTime;
+ return this;
+ }
+
+ /**
+ * Get the endTime property: The end time of the operation.
+ *
+ * @return the endTime value.
+ */
+ public String endTime() {
+ return this.endTime;
+ }
+
+ /**
+ * Set the endTime property: The end time of the operation.
+ *
+ * @param endTime the endTime value to set.
+ * @return the OperationStatusInner object itself.
+ */
+ public OperationStatusInner withEndTime(String endTime) {
+ this.endTime = endTime;
+ return this;
+ }
+
+ /**
+ * Get the status property: The status of the operation.
+ *
+ * @return the status value.
+ */
+ public String status() {
+ return this.status;
+ }
+
+ /**
+ * Set the status property: The status of the operation.
+ *
+ * @param status the status value to set.
+ * @return the OperationStatusInner object itself.
+ */
+ public OperationStatusInner withStatus(String status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * Get the error property: Error response
+ *
+ * The error detail of the operation if any.
+ *
+ * @return the error value.
+ */
+ public ManagementError error() {
+ return this.error;
+ }
+
+ /**
+ * Set the error property: Error response
+ *
+ *
The error detail of the operation if any.
+ *
+ * @param error the error value to set.
+ * @return the OperationStatusInner object itself.
+ */
+ public OperationStatusInner withError(ManagementError error) {
+ this.error = error;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientBuilder.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientBuilder.java
index ed74ff20611a7..866e2f6186acd 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientBuilder.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientBuilder.java
@@ -137,7 +137,7 @@ public ChaosManagementClientImpl buildClient() {
localSerializerAdapter,
localDefaultPollInterval,
localEnvironment,
- subscriptionId,
+ this.subscriptionId,
localEndpoint);
return client;
}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientImpl.java
index c07707c92a9db..50dbd8d26d262 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientImpl.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientImpl.java
@@ -26,6 +26,7 @@
import com.azure.resourcemanager.chaos.fluent.CapabilityTypesClient;
import com.azure.resourcemanager.chaos.fluent.ChaosManagementClient;
import com.azure.resourcemanager.chaos.fluent.ExperimentsClient;
+import com.azure.resourcemanager.chaos.fluent.OperationStatusesClient;
import com.azure.resourcemanager.chaos.fluent.OperationsClient;
import com.azure.resourcemanager.chaos.fluent.TargetTypesClient;
import com.azure.resourcemanager.chaos.fluent.TargetsClient;
@@ -185,6 +186,18 @@ public TargetsClient getTargets() {
return this.targets;
}
+ /** The OperationStatusesClient object to access its operations. */
+ private final OperationStatusesClient operationStatuses;
+
+ /**
+ * Gets the OperationStatusesClient object to access its operations.
+ *
+ * @return the OperationStatusesClient object.
+ */
+ public OperationStatusesClient getOperationStatuses() {
+ return this.operationStatuses;
+ }
+
/**
* Initializes an instance of ChaosManagementClient client.
*
@@ -207,13 +220,14 @@ public TargetsClient getTargets() {
this.defaultPollInterval = defaultPollInterval;
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
- this.apiVersion = "2023-04-15-preview";
+ this.apiVersion = "2023-09-01-preview";
this.capabilities = new CapabilitiesClientImpl(this);
this.capabilityTypes = new CapabilityTypesClientImpl(this);
this.experiments = new ExperimentsClientImpl(this);
this.operations = new OperationsClientImpl(this);
this.targetTypes = new TargetTypesClientImpl(this);
this.targets = new TargetsClientImpl(this);
+ this.operationStatuses = new OperationStatusesClientImpl(this);
}
/**
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentCancelOperationResultImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentCancelOperationResultImpl.java
deleted file mode 100644
index ab9f6c580516b..0000000000000
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentCancelOperationResultImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.chaos.implementation;
-
-import com.azure.resourcemanager.chaos.fluent.models.ExperimentCancelOperationResultInner;
-import com.azure.resourcemanager.chaos.models.ExperimentCancelOperationResult;
-
-public final class ExperimentCancelOperationResultImpl implements ExperimentCancelOperationResult {
- private ExperimentCancelOperationResultInner innerObject;
-
- private final com.azure.resourcemanager.chaos.ChaosManager serviceManager;
-
- ExperimentCancelOperationResultImpl(
- ExperimentCancelOperationResultInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) {
- this.innerObject = innerObject;
- this.serviceManager = serviceManager;
- }
-
- public String name() {
- return this.innerModel().name();
- }
-
- public String statusUrl() {
- return this.innerModel().statusUrl();
- }
-
- public ExperimentCancelOperationResultInner innerModel() {
- return this.innerObject;
- }
-
- private com.azure.resourcemanager.chaos.ChaosManager manager() {
- return this.serviceManager;
- }
-}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentImpl.java
index d48f0bfa66a59..6681415751dd6 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentImpl.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentImpl.java
@@ -4,18 +4,16 @@
package com.azure.resourcemanager.chaos.implementation;
-import com.azure.core.http.rest.Response;
import com.azure.core.management.Region;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.chaos.fluent.models.ExperimentInner;
+import com.azure.resourcemanager.chaos.models.ChaosExperimentStep;
+import com.azure.resourcemanager.chaos.models.ChaosTargetSelector;
import com.azure.resourcemanager.chaos.models.Experiment;
-import com.azure.resourcemanager.chaos.models.ExperimentCancelOperationResult;
-import com.azure.resourcemanager.chaos.models.ExperimentStartOperationResult;
import com.azure.resourcemanager.chaos.models.ExperimentUpdate;
+import com.azure.resourcemanager.chaos.models.ProvisioningState;
import com.azure.resourcemanager.chaos.models.ResourceIdentity;
-import com.azure.resourcemanager.chaos.models.Selector;
-import com.azure.resourcemanager.chaos.models.Step;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -58,8 +56,12 @@ public ResourceIdentity identity() {
return this.innerModel().identity();
}
- public List steps() {
- List inner = this.innerModel().steps();
+ public ProvisioningState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public List steps() {
+ List inner = this.innerModel().steps();
if (inner != null) {
return Collections.unmodifiableList(inner);
} else {
@@ -67,8 +69,8 @@ public List steps() {
}
}
- public List selectors() {
- List inner = this.innerModel().selectors();
+ public List selectors() {
+ List inner = this.innerModel().selectors();
if (inner != null) {
return Collections.unmodifiableList(inner);
} else {
@@ -76,10 +78,6 @@ public List selectors() {
}
}
- public Boolean startOnCreation() {
- return this.innerModel().startOnCreation();
- }
-
public Region region() {
return Region.fromName(this.regionName());
}
@@ -116,8 +114,7 @@ public Experiment create() {
serviceManager
.serviceClient()
.getExperiments()
- .createOrUpdateWithResponse(resourceGroupName, experimentName, this.innerModel(), Context.NONE)
- .getValue();
+ .createOrUpdate(resourceGroupName, experimentName, this.innerModel(), Context.NONE);
return this;
}
@@ -126,8 +123,7 @@ public Experiment create(Context context) {
serviceManager
.serviceClient()
.getExperiments()
- .createOrUpdateWithResponse(resourceGroupName, experimentName, this.innerModel(), context)
- .getValue();
+ .createOrUpdate(resourceGroupName, experimentName, this.innerModel(), context);
return this;
}
@@ -147,8 +143,7 @@ public Experiment apply() {
serviceManager
.serviceClient()
.getExperiments()
- .updateWithResponse(resourceGroupName, experimentName, updateExperiment, Context.NONE)
- .getValue();
+ .update(resourceGroupName, experimentName, updateExperiment, Context.NONE);
return this;
}
@@ -157,8 +152,7 @@ public Experiment apply(Context context) {
serviceManager
.serviceClient()
.getExperiments()
- .updateWithResponse(resourceGroupName, experimentName, updateExperiment, context)
- .getValue();
+ .update(resourceGroupName, experimentName, updateExperiment, context);
return this;
}
@@ -189,20 +183,20 @@ public Experiment refresh(Context context) {
return this;
}
- public Response cancelWithResponse(Context context) {
- return serviceManager.experiments().cancelWithResponse(resourceGroupName, experimentName, context);
+ public void cancel() {
+ serviceManager.experiments().cancel(resourceGroupName, experimentName);
}
- public ExperimentCancelOperationResult cancel() {
- return serviceManager.experiments().cancel(resourceGroupName, experimentName);
+ public void cancel(Context context) {
+ serviceManager.experiments().cancel(resourceGroupName, experimentName, context);
}
- public Response startWithResponse(Context context) {
- return serviceManager.experiments().startWithResponse(resourceGroupName, experimentName, context);
+ public void start() {
+ serviceManager.experiments().start(resourceGroupName, experimentName);
}
- public ExperimentStartOperationResult start() {
- return serviceManager.experiments().start(resourceGroupName, experimentName);
+ public void start(Context context) {
+ serviceManager.experiments().start(resourceGroupName, experimentName, context);
}
public ExperimentImpl withRegion(Region location) {
@@ -215,12 +209,12 @@ public ExperimentImpl withRegion(String location) {
return this;
}
- public ExperimentImpl withSteps(List steps) {
+ public ExperimentImpl withSteps(List steps) {
this.innerModel().withSteps(steps);
return this;
}
- public ExperimentImpl withSelectors(List selectors) {
+ public ExperimentImpl withSelectors(List selectors) {
this.innerModel().withSelectors(selectors);
return this;
}
@@ -240,11 +234,6 @@ public ExperimentImpl withIdentity(ResourceIdentity identity) {
}
}
- public ExperimentImpl withStartOnCreation(Boolean startOnCreation) {
- this.innerModel().withStartOnCreation(startOnCreation);
- return this;
- }
-
private boolean isInCreateMode() {
return this.innerModel().id() == null;
}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStartOperationResultImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStartOperationResultImpl.java
deleted file mode 100644
index 8fa3ca1fcc2c6..0000000000000
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStartOperationResultImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.chaos.implementation;
-
-import com.azure.resourcemanager.chaos.fluent.models.ExperimentStartOperationResultInner;
-import com.azure.resourcemanager.chaos.models.ExperimentStartOperationResult;
-
-public final class ExperimentStartOperationResultImpl implements ExperimentStartOperationResult {
- private ExperimentStartOperationResultInner innerObject;
-
- private final com.azure.resourcemanager.chaos.ChaosManager serviceManager;
-
- ExperimentStartOperationResultImpl(
- ExperimentStartOperationResultInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) {
- this.innerObject = innerObject;
- this.serviceManager = serviceManager;
- }
-
- public String name() {
- return this.innerModel().name();
- }
-
- public String statusUrl() {
- return this.innerModel().statusUrl();
- }
-
- public ExperimentStartOperationResultInner innerModel() {
- return this.innerObject;
- }
-
- private com.azure.resourcemanager.chaos.ChaosManager manager() {
- return this.serviceManager;
- }
-}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsClientImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsClientImpl.java
index dcf3d6a39bc9f..8fd267f90d45c 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsClientImpl.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsClientImpl.java
@@ -28,18 +28,21 @@
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.chaos.fluent.ExperimentsClient;
-import com.azure.resourcemanager.chaos.fluent.models.ExperimentCancelOperationResultInner;
import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionDetailsInner;
import com.azure.resourcemanager.chaos.fluent.models.ExperimentInner;
-import com.azure.resourcemanager.chaos.fluent.models.ExperimentStartOperationResultInner;
import com.azure.resourcemanager.chaos.fluent.models.ExperimentStatusInner;
import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetailsListResult;
import com.azure.resourcemanager.chaos.models.ExperimentListResult;
import com.azure.resourcemanager.chaos.models.ExperimentStatusListResult;
import com.azure.resourcemanager.chaos.models.ExperimentUpdate;
+import java.nio.ByteBuffer;
+import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/** An instance of this class provides access to all the operations defined in ExperimentsClient. */
@@ -98,9 +101,9 @@ Mono> listByResourceGroup(
@Headers({"Content-Type: application/json"})
@Delete(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}")
- @ExpectedResponses({200, 204})
+ @ExpectedResponses({202})
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> delete(
+ Mono>> delete(
@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@@ -126,9 +129,9 @@ Mono> getByResourceGroup(
@Headers({"Content-Type: application/json"})
@Put(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}")
- @ExpectedResponses({200})
+ @ExpectedResponses({201})
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> createOrUpdate(
+ Mono>> createOrUpdate(
@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@@ -141,9 +144,9 @@ Mono> createOrUpdate(
@Headers({"Content-Type: application/json"})
@Patch(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}")
- @ExpectedResponses({200})
+ @ExpectedResponses({202})
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> update(
+ Mono>> update(
@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@@ -158,7 +161,7 @@ Mono> update(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/cancel")
@ExpectedResponses({202})
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> cancel(
+ Mono>> cancel(
@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@@ -172,7 +175,7 @@ Mono> cancel(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/start")
@ExpectedResponses({202})
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> start(
+ Mono>> start(
@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@@ -682,7 +685,7 @@ public PagedIterable listByResourceGroup(
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> deleteWithResponseAsync(String resourceGroupName, String experimentName) {
+ private Mono>> deleteWithResponseAsync(String resourceGroupName, String experimentName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
@@ -730,7 +733,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> deleteWithResponseAsync(
+ private Mono>> deleteWithResponseAsync(
String resourceGroupName, String experimentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
@@ -764,6 +767,78 @@ private Mono> deleteWithResponseAsync(
context);
}
+ /**
+ * Delete a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String experimentName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, experimentName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Delete a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String experimentName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, experimentName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Delete a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String experimentName) {
+ return this.beginDeleteAsync(resourceGroupName, experimentName).getSyncPoller();
+ }
+
+ /**
+ * Delete a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String experimentName, Context context) {
+ return this.beginDeleteAsync(resourceGroupName, experimentName, context).getSyncPoller();
+ }
+
/**
* Delete a Experiment resource.
*
@@ -776,7 +851,9 @@ private Mono> deleteWithResponseAsync(
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteAsync(String resourceGroupName, String experimentName) {
- return deleteWithResponseAsync(resourceGroupName, experimentName).flatMap(ignored -> Mono.empty());
+ return beginDeleteAsync(resourceGroupName, experimentName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -788,11 +865,13 @@ private Mono deleteAsync(String resourceGroupName, String experimentName)
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the {@link Response}.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response deleteWithResponse(String resourceGroupName, String experimentName, Context context) {
- return deleteWithResponseAsync(resourceGroupName, experimentName, context).block();
+ private Mono deleteAsync(String resourceGroupName, String experimentName, Context context) {
+ return beginDeleteAsync(resourceGroupName, experimentName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -806,7 +885,22 @@ public Response deleteWithResponse(String resourceGroupName, String experi
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void delete(String resourceGroupName, String experimentName) {
- deleteWithResponse(resourceGroupName, experimentName, Context.NONE);
+ deleteAsync(resourceGroupName, experimentName).block();
+ }
+
+ /**
+ * Delete a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String experimentName, Context context) {
+ deleteAsync(resourceGroupName, experimentName, context).block();
}
/**
@@ -964,7 +1058,7 @@ public ExperimentInner getByResourceGroup(String resourceGroupName, String exper
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> createOrUpdateWithResponseAsync(
+ private Mono>> createOrUpdateWithResponseAsync(
String resourceGroupName, String experimentName, ExperimentInner experiment) {
if (this.client.getEndpoint() == null) {
return Mono
@@ -1021,7 +1115,7 @@ private Mono> createOrUpdateWithResponseAsync(
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> createOrUpdateWithResponseAsync(
+ private Mono>> createOrUpdateWithResponseAsync(
String resourceGroupName, String experimentName, ExperimentInner experiment, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
@@ -1061,6 +1155,91 @@ private Mono> createOrUpdateWithResponseAsync(
context);
}
+ /**
+ * Create or update a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Experiment resource to be created or updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ExperimentInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String experimentName, ExperimentInner experiment) {
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, experimentName, experiment);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ ExperimentInner.class,
+ ExperimentInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Create or update a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Experiment resource to be created or updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ExperimentInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String experimentName, ExperimentInner experiment, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, experimentName, experiment, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), ExperimentInner.class, ExperimentInner.class, context);
+ }
+
+ /**
+ * Create or update a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Experiment resource to be created or updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ExperimentInner> beginCreateOrUpdate(
+ String resourceGroupName, String experimentName, ExperimentInner experiment) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, experimentName, experiment).getSyncPoller();
+ }
+
+ /**
+ * Create or update a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Experiment resource to be created or updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ExperimentInner> beginCreateOrUpdate(
+ String resourceGroupName, String experimentName, ExperimentInner experiment, Context context) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, experimentName, experiment, context).getSyncPoller();
+ }
+
/**
* Create or update a Experiment resource.
*
@@ -1075,8 +1254,9 @@ private Mono> createOrUpdateWithResponseAsync(
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(
String resourceGroupName, String experimentName, ExperimentInner experiment) {
- return createOrUpdateWithResponseAsync(resourceGroupName, experimentName, experiment)
- .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ return beginCreateOrUpdateAsync(resourceGroupName, experimentName, experiment)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -1089,12 +1269,14 @@ private Mono createOrUpdateAsync(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents a Experiment resource along with {@link Response}.
+ * @return model that represents a Experiment resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response createOrUpdateWithResponse(
+ private Mono createOrUpdateAsync(
String resourceGroupName, String experimentName, ExperimentInner experiment, Context context) {
- return createOrUpdateWithResponseAsync(resourceGroupName, experimentName, experiment, context).block();
+ return beginCreateOrUpdateAsync(resourceGroupName, experimentName, experiment, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -1110,7 +1292,25 @@ public Response createOrUpdateWithResponse(
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExperimentInner createOrUpdate(String resourceGroupName, String experimentName, ExperimentInner experiment) {
- return createOrUpdateWithResponse(resourceGroupName, experimentName, experiment, Context.NONE).getValue();
+ return createOrUpdateAsync(resourceGroupName, experimentName, experiment).block();
+ }
+
+ /**
+ * Create or update a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Experiment resource to be created or updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ExperimentInner createOrUpdate(
+ String resourceGroupName, String experimentName, ExperimentInner experiment, Context context) {
+ return createOrUpdateAsync(resourceGroupName, experimentName, experiment, context).block();
}
/**
@@ -1126,7 +1326,7 @@ public ExperimentInner createOrUpdate(String resourceGroupName, String experimen
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> updateWithResponseAsync(
+ private Mono>> updateWithResponseAsync(
String resourceGroupName, String experimentName, ExperimentUpdate experiment) {
if (this.client.getEndpoint() == null) {
return Mono
@@ -1183,7 +1383,7 @@ private Mono> updateWithResponseAsync(
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> updateWithResponseAsync(
+ private Mono>> updateWithResponseAsync(
String resourceGroupName, String experimentName, ExperimentUpdate experiment, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
@@ -1223,6 +1423,90 @@ private Mono> updateWithResponseAsync(
context);
}
+ /**
+ * The operation to update an experiment.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Parameters supplied to the Update experiment operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ExperimentInner> beginUpdateAsync(
+ String resourceGroupName, String experimentName, ExperimentUpdate experiment) {
+ Mono>> mono = updateWithResponseAsync(resourceGroupName, experimentName, experiment);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ ExperimentInner.class,
+ ExperimentInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * The operation to update an experiment.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Parameters supplied to the Update experiment operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ExperimentInner> beginUpdateAsync(
+ String resourceGroupName, String experimentName, ExperimentUpdate experiment, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ updateWithResponseAsync(resourceGroupName, experimentName, experiment, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), ExperimentInner.class, ExperimentInner.class, context);
+ }
+
+ /**
+ * The operation to update an experiment.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Parameters supplied to the Update experiment operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ExperimentInner> beginUpdate(
+ String resourceGroupName, String experimentName, ExperimentUpdate experiment) {
+ return this.beginUpdateAsync(resourceGroupName, experimentName, experiment).getSyncPoller();
+ }
+
+ /**
+ * The operation to update an experiment.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Parameters supplied to the Update experiment operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ExperimentInner> beginUpdate(
+ String resourceGroupName, String experimentName, ExperimentUpdate experiment, Context context) {
+ return this.beginUpdateAsync(resourceGroupName, experimentName, experiment, context).getSyncPoller();
+ }
+
/**
* The operation to update an experiment.
*
@@ -1237,8 +1521,9 @@ private Mono> updateWithResponseAsync(
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(
String resourceGroupName, String experimentName, ExperimentUpdate experiment) {
- return updateWithResponseAsync(resourceGroupName, experimentName, experiment)
- .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ return beginUpdateAsync(resourceGroupName, experimentName, experiment)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -1251,12 +1536,14 @@ private Mono updateAsync(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents a Experiment resource along with {@link Response}.
+ * @return model that represents a Experiment resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response updateWithResponse(
+ private Mono updateAsync(
String resourceGroupName, String experimentName, ExperimentUpdate experiment, Context context) {
- return updateWithResponseAsync(resourceGroupName, experimentName, experiment, context).block();
+ return beginUpdateAsync(resourceGroupName, experimentName, experiment, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -1272,7 +1559,25 @@ public Response updateWithResponse(
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExperimentInner update(String resourceGroupName, String experimentName, ExperimentUpdate experiment) {
- return updateWithResponse(resourceGroupName, experimentName, experiment, Context.NONE).getValue();
+ return updateAsync(resourceGroupName, experimentName, experiment).block();
+ }
+
+ /**
+ * The operation to update an experiment.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Parameters supplied to the Update experiment operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ExperimentInner update(
+ String resourceGroupName, String experimentName, ExperimentUpdate experiment, Context context) {
+ return updateAsync(resourceGroupName, experimentName, experiment, context).block();
}
/**
@@ -1283,12 +1588,10 @@ public ExperimentInner update(String resourceGroupName, String experimentName, E
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a cancel Experiment operation along with {@link Response} on
- * successful completion of {@link Mono}.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> cancelWithResponseAsync(
- String resourceGroupName, String experimentName) {
+ private Mono>> cancelWithResponseAsync(String resourceGroupName, String experimentName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
@@ -1333,11 +1636,10 @@ private Mono> cancelWithResponseA
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a cancel Experiment operation along with {@link Response} on
- * successful completion of {@link Mono}.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> cancelWithResponseAsync(
+ private Mono>> cancelWithResponseAsync(
String resourceGroupName, String experimentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
@@ -1379,13 +1681,85 @@ private Mono> cancelWithResponseA
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a cancel Experiment operation on successful completion of {@link
- * Mono}.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String experimentName) {
+ Mono>> mono = cancelWithResponseAsync(resourceGroupName, experimentName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Cancel a running Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginCancelAsync(
+ String resourceGroupName, String experimentName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = cancelWithResponseAsync(resourceGroupName, experimentName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Cancel a running Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginCancel(String resourceGroupName, String experimentName) {
+ return this.beginCancelAsync(resourceGroupName, experimentName).getSyncPoller();
+ }
+
+ /**
+ * Cancel a running Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginCancel(
+ String resourceGroupName, String experimentName, Context context) {
+ return this.beginCancelAsync(resourceGroupName, experimentName, context).getSyncPoller();
+ }
+
+ /**
+ * Cancel a running Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono cancelAsync(String resourceGroupName, String experimentName) {
- return cancelWithResponseAsync(resourceGroupName, experimentName)
- .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ private Mono cancelAsync(String resourceGroupName, String experimentName) {
+ return beginCancelAsync(resourceGroupName, experimentName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -1397,12 +1771,27 @@ private Mono cancelAsync(String resourceGr
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a cancel Experiment operation along with {@link Response}.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response cancelWithResponse(
- String resourceGroupName, String experimentName, Context context) {
- return cancelWithResponseAsync(resourceGroupName, experimentName, context).block();
+ private Mono cancelAsync(String resourceGroupName, String experimentName, Context context) {
+ return beginCancelAsync(resourceGroupName, experimentName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Cancel a running Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void cancel(String resourceGroupName, String experimentName) {
+ cancelAsync(resourceGroupName, experimentName).block();
}
/**
@@ -1410,14 +1799,14 @@ public Response cancelWithResponse(
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a cancel Experiment operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public ExperimentCancelOperationResultInner cancel(String resourceGroupName, String experimentName) {
- return cancelWithResponse(resourceGroupName, experimentName, Context.NONE).getValue();
+ public void cancel(String resourceGroupName, String experimentName, Context context) {
+ cancelAsync(resourceGroupName, experimentName, context).block();
}
/**
@@ -1428,12 +1817,10 @@ public ExperimentCancelOperationResultInner cancel(String resourceGroupName, Str
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a start Experiment operation along with {@link Response} on
- * successful completion of {@link Mono}.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> startWithResponseAsync(
- String resourceGroupName, String experimentName) {
+ private Mono>> startWithResponseAsync(String resourceGroupName, String experimentName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
@@ -1478,11 +1865,10 @@ private Mono> startWithResponseAsy
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a start Experiment operation along with {@link Response} on
- * successful completion of {@link Mono}.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> startWithResponseAsync(
+ private Mono>> startWithResponseAsync(
String resourceGroupName, String experimentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
@@ -1524,13 +1910,83 @@ private Mono> startWithResponseAsy
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a start Experiment operation on successful completion of {@link
- * Mono}.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginStartAsync(String resourceGroupName, String experimentName) {
+ Mono>> mono = startWithResponseAsync(resourceGroupName, experimentName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Start a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginStartAsync(
+ String resourceGroupName, String experimentName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = startWithResponseAsync(resourceGroupName, experimentName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Start a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginStart(String resourceGroupName, String experimentName) {
+ return this.beginStartAsync(resourceGroupName, experimentName).getSyncPoller();
+ }
+
+ /**
+ * Start a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginStart(
+ String resourceGroupName, String experimentName, Context context) {
+ return this.beginStartAsync(resourceGroupName, experimentName, context).getSyncPoller();
+ }
+
+ /**
+ * Start a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono startAsync(String resourceGroupName, String experimentName) {
- return startWithResponseAsync(resourceGroupName, experimentName)
- .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ private Mono startAsync(String resourceGroupName, String experimentName) {
+ return beginStartAsync(resourceGroupName, experimentName).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -1542,12 +1998,27 @@ private Mono startAsync(String resourceGrou
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a start Experiment operation along with {@link Response}.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response startWithResponse(
- String resourceGroupName, String experimentName, Context context) {
- return startWithResponseAsync(resourceGroupName, experimentName, context).block();
+ private Mono startAsync(String resourceGroupName, String experimentName, Context context) {
+ return beginStartAsync(resourceGroupName, experimentName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Start a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void start(String resourceGroupName, String experimentName) {
+ startAsync(resourceGroupName, experimentName).block();
}
/**
@@ -1555,14 +2026,14 @@ public Response startWithResponse(
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a start Experiment operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public ExperimentStartOperationResultInner start(String resourceGroupName, String experimentName) {
- return startWithResponse(resourceGroupName, experimentName, Context.NONE).getValue();
+ public void start(String resourceGroupName, String experimentName, Context context) {
+ startAsync(resourceGroupName, experimentName, context).block();
}
/**
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsImpl.java
index 66d80202a470f..b81ad91e4bbe7 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsImpl.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsImpl.java
@@ -10,15 +10,11 @@
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.chaos.fluent.ExperimentsClient;
-import com.azure.resourcemanager.chaos.fluent.models.ExperimentCancelOperationResultInner;
import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionDetailsInner;
import com.azure.resourcemanager.chaos.fluent.models.ExperimentInner;
-import com.azure.resourcemanager.chaos.fluent.models.ExperimentStartOperationResultInner;
import com.azure.resourcemanager.chaos.fluent.models.ExperimentStatusInner;
import com.azure.resourcemanager.chaos.models.Experiment;
-import com.azure.resourcemanager.chaos.models.ExperimentCancelOperationResult;
import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetails;
-import com.azure.resourcemanager.chaos.models.ExperimentStartOperationResult;
import com.azure.resourcemanager.chaos.models.ExperimentStatus;
import com.azure.resourcemanager.chaos.models.Experiments;
@@ -56,15 +52,14 @@ public PagedIterable listByResourceGroup(
return Utils.mapPage(inner, inner1 -> new ExperimentImpl(inner1, this.manager()));
}
- public Response deleteByResourceGroupWithResponse(
- String resourceGroupName, String experimentName, Context context) {
- return this.serviceClient().deleteWithResponse(resourceGroupName, experimentName, context);
- }
-
public void deleteByResourceGroup(String resourceGroupName, String experimentName) {
this.serviceClient().delete(resourceGroupName, experimentName);
}
+ public void delete(String resourceGroupName, String experimentName, Context context) {
+ this.serviceClient().delete(resourceGroupName, experimentName, context);
+ }
+
public Response getByResourceGroupWithResponse(
String resourceGroupName, String experimentName, Context context) {
Response inner =
@@ -89,52 +84,20 @@ public Experiment getByResourceGroup(String resourceGroupName, String experiment
}
}
- public Response cancelWithResponse(
- String resourceGroupName, String experimentName, Context context) {
- Response inner =
- this.serviceClient().cancelWithResponse(resourceGroupName, experimentName, context);
- if (inner != null) {
- return new SimpleResponse<>(
- inner.getRequest(),
- inner.getStatusCode(),
- inner.getHeaders(),
- new ExperimentCancelOperationResultImpl(inner.getValue(), this.manager()));
- } else {
- return null;
- }
+ public void cancel(String resourceGroupName, String experimentName) {
+ this.serviceClient().cancel(resourceGroupName, experimentName);
}
- public ExperimentCancelOperationResult cancel(String resourceGroupName, String experimentName) {
- ExperimentCancelOperationResultInner inner = this.serviceClient().cancel(resourceGroupName, experimentName);
- if (inner != null) {
- return new ExperimentCancelOperationResultImpl(inner, this.manager());
- } else {
- return null;
- }
+ public void cancel(String resourceGroupName, String experimentName, Context context) {
+ this.serviceClient().cancel(resourceGroupName, experimentName, context);
}
- public Response startWithResponse(
- String resourceGroupName, String experimentName, Context context) {
- Response inner =
- this.serviceClient().startWithResponse(resourceGroupName, experimentName, context);
- if (inner != null) {
- return new SimpleResponse<>(
- inner.getRequest(),
- inner.getStatusCode(),
- inner.getHeaders(),
- new ExperimentStartOperationResultImpl(inner.getValue(), this.manager()));
- } else {
- return null;
- }
+ public void start(String resourceGroupName, String experimentName) {
+ this.serviceClient().start(resourceGroupName, experimentName);
}
- public ExperimentStartOperationResult start(String resourceGroupName, String experimentName) {
- ExperimentStartOperationResultInner inner = this.serviceClient().start(resourceGroupName, experimentName);
- if (inner != null) {
- return new ExperimentStartOperationResultImpl(inner, this.manager());
- } else {
- return null;
- }
+ public void start(String resourceGroupName, String experimentName, Context context) {
+ this.serviceClient().start(resourceGroupName, experimentName, context);
}
public PagedIterable listAllStatuses(String resourceGroupName, String experimentName) {
@@ -270,10 +233,10 @@ public void deleteById(String id) {
new IllegalArgumentException(
String.format("The resource ID '%s' is not valid. Missing path segment 'experiments'.", id)));
}
- this.deleteByResourceGroupWithResponse(resourceGroupName, experimentName, Context.NONE);
+ this.delete(resourceGroupName, experimentName, Context.NONE);
}
- public Response deleteByIdWithResponse(String id, Context context) {
+ public void deleteByIdWithResponse(String id, Context context) {
String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
if (resourceGroupName == null) {
throw LOGGER
@@ -289,7 +252,7 @@ public Response deleteByIdWithResponse(String id, Context context) {
new IllegalArgumentException(
String.format("The resource ID '%s' is not valid. Missing path segment 'experiments'.", id)));
}
- return this.deleteByResourceGroupWithResponse(resourceGroupName, experimentName, context);
+ this.delete(resourceGroupName, experimentName, context);
}
private ExperimentsClient serviceClient() {
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusImpl.java
new file mode 100644
index 0000000000000..09adcaaa1102d
--- /dev/null
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusImpl.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.chaos.implementation;
+
+import com.azure.core.management.exception.ManagementError;
+import com.azure.resourcemanager.chaos.fluent.models.OperationStatusInner;
+import com.azure.resourcemanager.chaos.models.OperationStatus;
+
+public final class OperationStatusImpl implements OperationStatus {
+ private OperationStatusInner innerObject;
+
+ private final com.azure.resourcemanager.chaos.ChaosManager serviceManager;
+
+ OperationStatusImpl(OperationStatusInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String startTime() {
+ return this.innerModel().startTime();
+ }
+
+ public String endTime() {
+ return this.innerModel().endTime();
+ }
+
+ public String status() {
+ return this.innerModel().status();
+ }
+
+ public ManagementError error() {
+ return this.innerModel().error();
+ }
+
+ public OperationStatusInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.chaos.ChaosManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusesClientImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusesClientImpl.java
new file mode 100644
index 0000000000000..9fd0d252fbaa7
--- /dev/null
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusesClientImpl.java
@@ -0,0 +1,209 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.chaos.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.chaos.fluent.OperationStatusesClient;
+import com.azure.resourcemanager.chaos.fluent.models.OperationStatusInner;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in OperationStatusesClient. */
+public final class OperationStatusesClientImpl implements OperationStatusesClient {
+ /** The proxy service used to perform REST calls. */
+ private final OperationStatusesService service;
+
+ /** The service client containing this operation class. */
+ private final ChaosManagementClientImpl client;
+
+ /**
+ * Initializes an instance of OperationStatusesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationStatusesClientImpl(ChaosManagementClientImpl client) {
+ this.service =
+ RestProxy.create(OperationStatusesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ChaosManagementClientOperationStatuses to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "ChaosManagementClien")
+ public interface OperationStatusesService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/operationsStatuses/{asyncOperationId}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @PathParam("location") String location,
+ @PathParam("asyncOperationId") String asyncOperationId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Get the status of a long running azure asynchronous operation.
+ *
+ * @param location The region name of operation.
+ * @param asyncOperationId The operation Id.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the status of a long running azure asynchronous operation along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String location, String asyncOperationId) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (location == null) {
+ return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
+ }
+ if (asyncOperationId == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter asyncOperationId is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ location,
+ asyncOperationId,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the status of a long running azure asynchronous operation.
+ *
+ * @param location The region name of operation.
+ * @param asyncOperationId The operation Id.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the status of a long running azure asynchronous operation along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String location, String asyncOperationId, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (location == null) {
+ return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
+ }
+ if (asyncOperationId == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter asyncOperationId is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ location,
+ asyncOperationId,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context);
+ }
+
+ /**
+ * Get the status of a long running azure asynchronous operation.
+ *
+ * @param location The region name of operation.
+ * @param asyncOperationId The operation Id.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the status of a long running azure asynchronous operation on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String location, String asyncOperationId) {
+ return getWithResponseAsync(location, asyncOperationId).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get the status of a long running azure asynchronous operation.
+ *
+ * @param location The region name of operation.
+ * @param asyncOperationId The operation Id.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the status of a long running azure asynchronous operation along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(String location, String asyncOperationId, Context context) {
+ return getWithResponseAsync(location, asyncOperationId, context).block();
+ }
+
+ /**
+ * Get the status of a long running azure asynchronous operation.
+ *
+ * @param location The region name of operation.
+ * @param asyncOperationId The operation Id.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the status of a long running azure asynchronous operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public OperationStatusInner get(String location, String asyncOperationId) {
+ return getWithResponse(location, asyncOperationId, Context.NONE).getValue();
+ }
+}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusesImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusesImpl.java
new file mode 100644
index 0000000000000..8ae63088b7b05
--- /dev/null
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusesImpl.java
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.chaos.implementation;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.chaos.fluent.OperationStatusesClient;
+import com.azure.resourcemanager.chaos.fluent.models.OperationStatusInner;
+import com.azure.resourcemanager.chaos.models.OperationStatus;
+import com.azure.resourcemanager.chaos.models.OperationStatuses;
+
+public final class OperationStatusesImpl implements OperationStatuses {
+ private static final ClientLogger LOGGER = new ClientLogger(OperationStatusesImpl.class);
+
+ private final OperationStatusesClient innerClient;
+
+ private final com.azure.resourcemanager.chaos.ChaosManager serviceManager;
+
+ public OperationStatusesImpl(
+ OperationStatusesClient innerClient, com.azure.resourcemanager.chaos.ChaosManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response getWithResponse(String location, String asyncOperationId, Context context) {
+ Response inner =
+ this.serviceClient().getWithResponse(location, asyncOperationId, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new OperationStatusImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public OperationStatus get(String location, String asyncOperationId) {
+ OperationStatusInner inner = this.serviceClient().get(location, asyncOperationId);
+ if (inner != null) {
+ return new OperationStatusImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private OperationStatusesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.chaos.ChaosManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Action.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosExperimentAction.java
similarity index 76%
rename from sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Action.java
rename to sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosExperimentAction.java
index b66cd0a8ffc2d..5c2a51835a735 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Action.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosExperimentAction.java
@@ -16,23 +16,23 @@
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
property = "type",
- defaultImpl = Action.class)
-@JsonTypeName("Action")
+ defaultImpl = ChaosExperimentAction.class)
+@JsonTypeName("ChaosExperimentAction")
@JsonSubTypes({
@JsonSubTypes.Type(name = "delay", value = DelayAction.class),
@JsonSubTypes.Type(name = "discrete", value = DiscreteAction.class),
@JsonSubTypes.Type(name = "continuous", value = ContinuousAction.class)
})
@Fluent
-public class Action {
+public class ChaosExperimentAction {
/*
* String that represents a Capability URN.
*/
@JsonProperty(value = "name", required = true)
private String name;
- /** Creates an instance of Action class. */
- public Action() {
+ /** Creates an instance of ChaosExperimentAction class. */
+ public ChaosExperimentAction() {
}
/**
@@ -48,9 +48,9 @@ public String name() {
* Set the name property: String that represents a Capability URN.
*
* @param name the name value to set.
- * @return the Action object itself.
+ * @return the ChaosExperimentAction object itself.
*/
- public Action withName(String name) {
+ public ChaosExperimentAction withName(String name) {
this.name = name;
return this;
}
@@ -63,9 +63,10 @@ public Action withName(String name) {
public void validate() {
if (name() == null) {
throw LOGGER
- .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Action"));
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property name in model ChaosExperimentAction"));
}
}
- private static final ClientLogger LOGGER = new ClientLogger(Action.class);
+ private static final ClientLogger LOGGER = new ClientLogger(ChaosExperimentAction.class);
}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Branch.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosExperimentBranch.java
similarity index 67%
rename from sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Branch.java
rename to sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosExperimentBranch.java
index 6cb88d39d96ce..f2c7c9c6bc183 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Branch.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosExperimentBranch.java
@@ -11,7 +11,7 @@
/** Model that represents a branch in the step. */
@Fluent
-public final class Branch {
+public final class ChaosExperimentBranch {
/*
* String of the branch name.
*/
@@ -22,10 +22,10 @@ public final class Branch {
* List of actions.
*/
@JsonProperty(value = "actions", required = true)
- private List actions;
+ private List actions;
- /** Creates an instance of Branch class. */
- public Branch() {
+ /** Creates an instance of ChaosExperimentBranch class. */
+ public ChaosExperimentBranch() {
}
/**
@@ -41,9 +41,9 @@ public String name() {
* Set the name property: String of the branch name.
*
* @param name the name value to set.
- * @return the Branch object itself.
+ * @return the ChaosExperimentBranch object itself.
*/
- public Branch withName(String name) {
+ public ChaosExperimentBranch withName(String name) {
this.name = name;
return this;
}
@@ -53,7 +53,7 @@ public Branch withName(String name) {
*
* @return the actions value.
*/
- public List actions() {
+ public List actions() {
return this.actions;
}
@@ -61,9 +61,9 @@ public List actions() {
* Set the actions property: List of actions.
*
* @param actions the actions value to set.
- * @return the Branch object itself.
+ * @return the ChaosExperimentBranch object itself.
*/
- public Branch withActions(List actions) {
+ public ChaosExperimentBranch withActions(List actions) {
this.actions = actions;
return this;
}
@@ -76,15 +76,17 @@ public Branch withActions(List actions) {
public void validate() {
if (name() == null) {
throw LOGGER
- .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Branch"));
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property name in model ChaosExperimentBranch"));
}
if (actions() == null) {
throw LOGGER
- .logExceptionAsError(new IllegalArgumentException("Missing required property actions in model Branch"));
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property actions in model ChaosExperimentBranch"));
} else {
actions().forEach(e -> e.validate());
}
}
- private static final ClientLogger LOGGER = new ClientLogger(Branch.class);
+ private static final ClientLogger LOGGER = new ClientLogger(ChaosExperimentBranch.class);
}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Step.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosExperimentStep.java
similarity index 68%
rename from sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Step.java
rename to sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosExperimentStep.java
index a8e01d2246e06..f8b09bda8fc63 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Step.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosExperimentStep.java
@@ -11,7 +11,7 @@
/** Model that represents a step in the Experiment resource. */
@Fluent
-public final class Step {
+public final class ChaosExperimentStep {
/*
* String of the step name.
*/
@@ -22,10 +22,10 @@ public final class Step {
* List of branches.
*/
@JsonProperty(value = "branches", required = true)
- private List branches;
+ private List branches;
- /** Creates an instance of Step class. */
- public Step() {
+ /** Creates an instance of ChaosExperimentStep class. */
+ public ChaosExperimentStep() {
}
/**
@@ -41,9 +41,9 @@ public String name() {
* Set the name property: String of the step name.
*
* @param name the name value to set.
- * @return the Step object itself.
+ * @return the ChaosExperimentStep object itself.
*/
- public Step withName(String name) {
+ public ChaosExperimentStep withName(String name) {
this.name = name;
return this;
}
@@ -53,7 +53,7 @@ public Step withName(String name) {
*
* @return the branches value.
*/
- public List branches() {
+ public List branches() {
return this.branches;
}
@@ -61,9 +61,9 @@ public List branches() {
* Set the branches property: List of branches.
*
* @param branches the branches value to set.
- * @return the Step object itself.
+ * @return the ChaosExperimentStep object itself.
*/
- public Step withBranches(List branches) {
+ public ChaosExperimentStep withBranches(List branches) {
this.branches = branches;
return this;
}
@@ -76,15 +76,17 @@ public Step withBranches(List branches) {
public void validate() {
if (name() == null) {
throw LOGGER
- .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Step"));
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property name in model ChaosExperimentStep"));
}
if (branches() == null) {
throw LOGGER
- .logExceptionAsError(new IllegalArgumentException("Missing required property branches in model Step"));
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property branches in model ChaosExperimentStep"));
} else {
branches().forEach(e -> e.validate());
}
}
- private static final ClientLogger LOGGER = new ClientLogger(Step.class);
+ private static final ClientLogger LOGGER = new ClientLogger(ChaosExperimentStep.class);
}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Filter.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetFilter.java
similarity index 73%
rename from sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Filter.java
rename to sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetFilter.java
index de171a32c6939..725dd624f89dd 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Filter.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetFilter.java
@@ -14,13 +14,13 @@
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
property = "type",
- defaultImpl = Filter.class)
-@JsonTypeName("Filter")
-@JsonSubTypes({@JsonSubTypes.Type(name = "Simple", value = SimpleFilter.class)})
+ defaultImpl = ChaosTargetFilter.class)
+@JsonTypeName("ChaosTargetFilter")
+@JsonSubTypes({@JsonSubTypes.Type(name = "Simple", value = ChaosTargetSimpleFilter.class)})
@Immutable
-public class Filter {
- /** Creates an instance of Filter class. */
- public Filter() {
+public class ChaosTargetFilter {
+ /** Creates an instance of ChaosTargetFilter class. */
+ public ChaosTargetFilter() {
}
/**
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ListSelector.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetListSelector.java
similarity index 78%
rename from sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ListSelector.java
rename to sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetListSelector.java
index 60dbb9084e660..86d992203dfce 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ListSelector.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetListSelector.java
@@ -15,15 +15,15 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("List")
@Fluent
-public final class ListSelector extends Selector {
+public final class ChaosTargetListSelector extends ChaosTargetSelector {
/*
* List of Target references.
*/
@JsonProperty(value = "targets", required = true)
private List targets;
- /** Creates an instance of ListSelector class. */
- public ListSelector() {
+ /** Creates an instance of ChaosTargetListSelector class. */
+ public ChaosTargetListSelector() {
}
/**
@@ -39,23 +39,23 @@ public List targets() {
* Set the targets property: List of Target references.
*
* @param targets the targets value to set.
- * @return the ListSelector object itself.
+ * @return the ChaosTargetListSelector object itself.
*/
- public ListSelector withTargets(List targets) {
+ public ChaosTargetListSelector withTargets(List targets) {
this.targets = targets;
return this;
}
/** {@inheritDoc} */
@Override
- public ListSelector withId(String id) {
+ public ChaosTargetListSelector withId(String id) {
super.withId(id);
return this;
}
/** {@inheritDoc} */
@Override
- public ListSelector withFilter(Filter filter) {
+ public ChaosTargetListSelector withFilter(ChaosTargetFilter filter) {
super.withFilter(filter);
return this;
}
@@ -71,11 +71,11 @@ public void validate() {
if (targets() == null) {
throw LOGGER
.logExceptionAsError(
- new IllegalArgumentException("Missing required property targets in model ListSelector"));
+ new IllegalArgumentException("Missing required property targets in model ChaosTargetListSelector"));
} else {
targets().forEach(e -> e.validate());
}
}
- private static final ClientLogger LOGGER = new ClientLogger(ListSelector.class);
+ private static final ClientLogger LOGGER = new ClientLogger(ChaosTargetListSelector.class);
}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/QuerySelector.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetQuerySelector.java
similarity index 74%
rename from sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/QuerySelector.java
rename to sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetQuerySelector.java
index ce9014ce3401f..be471aaf91b9b 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/QuerySelector.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetQuerySelector.java
@@ -15,7 +15,7 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("Query")
@Fluent
-public final class QuerySelector extends Selector {
+public final class ChaosTargetQuerySelector extends ChaosTargetSelector {
/*
* Azure Resource Graph (ARG) Query Language query for target resources.
*/
@@ -28,8 +28,8 @@ public final class QuerySelector extends Selector {
@JsonProperty(value = "subscriptionIds", required = true)
private List subscriptionIds;
- /** Creates an instance of QuerySelector class. */
- public QuerySelector() {
+ /** Creates an instance of ChaosTargetQuerySelector class. */
+ public ChaosTargetQuerySelector() {
}
/**
@@ -45,9 +45,9 @@ public String queryString() {
* Set the queryString property: Azure Resource Graph (ARG) Query Language query for target resources.
*
* @param queryString the queryString value to set.
- * @return the QuerySelector object itself.
+ * @return the ChaosTargetQuerySelector object itself.
*/
- public QuerySelector withQueryString(String queryString) {
+ public ChaosTargetQuerySelector withQueryString(String queryString) {
this.queryString = queryString;
return this;
}
@@ -65,23 +65,23 @@ public List subscriptionIds() {
* Set the subscriptionIds property: Subscription id list to scope resource query.
*
* @param subscriptionIds the subscriptionIds value to set.
- * @return the QuerySelector object itself.
+ * @return the ChaosTargetQuerySelector object itself.
*/
- public QuerySelector withSubscriptionIds(List subscriptionIds) {
+ public ChaosTargetQuerySelector withSubscriptionIds(List subscriptionIds) {
this.subscriptionIds = subscriptionIds;
return this;
}
/** {@inheritDoc} */
@Override
- public QuerySelector withId(String id) {
+ public ChaosTargetQuerySelector withId(String id) {
super.withId(id);
return this;
}
/** {@inheritDoc} */
@Override
- public QuerySelector withFilter(Filter filter) {
+ public ChaosTargetQuerySelector withFilter(ChaosTargetFilter filter) {
super.withFilter(filter);
return this;
}
@@ -97,14 +97,16 @@ public void validate() {
if (queryString() == null) {
throw LOGGER
.logExceptionAsError(
- new IllegalArgumentException("Missing required property queryString in model QuerySelector"));
+ new IllegalArgumentException(
+ "Missing required property queryString in model ChaosTargetQuerySelector"));
}
if (subscriptionIds() == null) {
throw LOGGER
.logExceptionAsError(
- new IllegalArgumentException("Missing required property subscriptionIds in model QuerySelector"));
+ new IllegalArgumentException(
+ "Missing required property subscriptionIds in model ChaosTargetQuerySelector"));
}
}
- private static final ClientLogger LOGGER = new ClientLogger(QuerySelector.class);
+ private static final ClientLogger LOGGER = new ClientLogger(ChaosTargetQuerySelector.class);
}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Selector.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSelector.java
similarity index 76%
rename from sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Selector.java
rename to sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSelector.java
index 441ca3a984e3c..422350c2e38ac 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Selector.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSelector.java
@@ -21,14 +21,14 @@
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
property = "type",
- defaultImpl = Selector.class)
-@JsonTypeName("Selector")
+ defaultImpl = ChaosTargetSelector.class)
+@JsonTypeName("ChaosTargetSelector")
@JsonSubTypes({
- @JsonSubTypes.Type(name = "List", value = ListSelector.class),
- @JsonSubTypes.Type(name = "Query", value = QuerySelector.class)
+ @JsonSubTypes.Type(name = "List", value = ChaosTargetListSelector.class),
+ @JsonSubTypes.Type(name = "Query", value = ChaosTargetQuerySelector.class)
})
@Fluent
-public class Selector {
+public class ChaosTargetSelector {
/*
* String of the selector ID.
*/
@@ -39,15 +39,15 @@ public class Selector {
* Model that represents available filter types that can be applied to a targets list.
*/
@JsonProperty(value = "filter")
- private Filter filter;
+ private ChaosTargetFilter filter;
/*
* Model that represents a selector in the Experiment resource.
*/
@JsonIgnore private Map additionalProperties;
- /** Creates an instance of Selector class. */
- public Selector() {
+ /** Creates an instance of ChaosTargetSelector class. */
+ public ChaosTargetSelector() {
}
/**
@@ -63,9 +63,9 @@ public String id() {
* Set the id property: String of the selector ID.
*
* @param id the id value to set.
- * @return the Selector object itself.
+ * @return the ChaosTargetSelector object itself.
*/
- public Selector withId(String id) {
+ public ChaosTargetSelector withId(String id) {
this.id = id;
return this;
}
@@ -75,7 +75,7 @@ public Selector withId(String id) {
*
* @return the filter value.
*/
- public Filter filter() {
+ public ChaosTargetFilter filter() {
return this.filter;
}
@@ -83,9 +83,9 @@ public Filter filter() {
* Set the filter property: Model that represents available filter types that can be applied to a targets list.
*
* @param filter the filter value to set.
- * @return the Selector object itself.
+ * @return the ChaosTargetSelector object itself.
*/
- public Selector withFilter(Filter filter) {
+ public ChaosTargetSelector withFilter(ChaosTargetFilter filter) {
this.filter = filter;
return this;
}
@@ -104,9 +104,9 @@ public Map additionalProperties() {
* Set the additionalProperties property: Model that represents a selector in the Experiment resource.
*
* @param additionalProperties the additionalProperties value to set.
- * @return the Selector object itself.
+ * @return the ChaosTargetSelector object itself.
*/
- public Selector withAdditionalProperties(Map additionalProperties) {
+ public ChaosTargetSelector withAdditionalProperties(Map additionalProperties) {
this.additionalProperties = additionalProperties;
return this;
}
@@ -127,12 +127,13 @@ void withAdditionalProperties(String key, Object value) {
public void validate() {
if (id() == null) {
throw LOGGER
- .logExceptionAsError(new IllegalArgumentException("Missing required property id in model Selector"));
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property id in model ChaosTargetSelector"));
}
if (filter() != null) {
filter().validate();
}
}
- private static final ClientLogger LOGGER = new ClientLogger(Selector.class);
+ private static final ClientLogger LOGGER = new ClientLogger(ChaosTargetSelector.class);
}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SimpleFilter.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSimpleFilter.java
similarity index 76%
rename from sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SimpleFilter.java
rename to sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSimpleFilter.java
index 46ff007cc7ab9..6f122cddcad79 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SimpleFilter.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSimpleFilter.java
@@ -13,15 +13,15 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("Simple")
@Fluent
-public final class SimpleFilter extends Filter {
+public final class ChaosTargetSimpleFilter extends ChaosTargetFilter {
/*
* Model that represents the Simple filter parameters.
*/
@JsonProperty(value = "parameters")
- private SimpleFilterParameters parameters;
+ private ChaosTargetSimpleFilterParameters parameters;
- /** Creates an instance of SimpleFilter class. */
- public SimpleFilter() {
+ /** Creates an instance of ChaosTargetSimpleFilter class. */
+ public ChaosTargetSimpleFilter() {
}
/**
@@ -29,7 +29,7 @@ public SimpleFilter() {
*
* @return the parameters value.
*/
- public SimpleFilterParameters parameters() {
+ public ChaosTargetSimpleFilterParameters parameters() {
return this.parameters;
}
@@ -37,9 +37,9 @@ public SimpleFilterParameters parameters() {
* Set the parameters property: Model that represents the Simple filter parameters.
*
* @param parameters the parameters value to set.
- * @return the SimpleFilter object itself.
+ * @return the ChaosTargetSimpleFilter object itself.
*/
- public SimpleFilter withParameters(SimpleFilterParameters parameters) {
+ public ChaosTargetSimpleFilter withParameters(ChaosTargetSimpleFilterParameters parameters) {
this.parameters = parameters;
return this;
}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SimpleFilterParameters.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSimpleFilterParameters.java
similarity index 77%
rename from sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SimpleFilterParameters.java
rename to sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSimpleFilterParameters.java
index b3b08c559efe0..73e4ed26ad56c 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SimpleFilterParameters.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSimpleFilterParameters.java
@@ -10,15 +10,15 @@
/** Model that represents the Simple filter parameters. */
@Fluent
-public final class SimpleFilterParameters {
+public final class ChaosTargetSimpleFilterParameters {
/*
* List of Azure availability zones to filter targets by.
*/
@JsonProperty(value = "zones")
private List zones;
- /** Creates an instance of SimpleFilterParameters class. */
- public SimpleFilterParameters() {
+ /** Creates an instance of ChaosTargetSimpleFilterParameters class. */
+ public ChaosTargetSimpleFilterParameters() {
}
/**
@@ -34,9 +34,9 @@ public List zones() {
* Set the zones property: List of Azure availability zones to filter targets by.
*
* @param zones the zones value to set.
- * @return the SimpleFilterParameters object itself.
+ * @return the ChaosTargetSimpleFilterParameters object itself.
*/
- public SimpleFilterParameters withZones(List zones) {
+ public ChaosTargetSimpleFilterParameters withZones(List zones) {
this.zones = zones;
return this;
}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ContinuousAction.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ContinuousAction.java
index b42856c08bfd0..a8abd196a3ae4 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ContinuousAction.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ContinuousAction.java
@@ -16,7 +16,7 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("continuous")
@Fluent
-public final class ContinuousAction extends Action {
+public final class ContinuousAction extends ChaosExperimentAction {
/*
* ISO8601 formatted string that represents a duration.
*/
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DelayAction.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DelayAction.java
index b704318eccab5..5a6ac12c212b7 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DelayAction.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DelayAction.java
@@ -15,7 +15,7 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("delay")
@Fluent
-public final class DelayAction extends Action {
+public final class DelayAction extends ChaosExperimentAction {
/*
* ISO8601 formatted string that represents a duration.
*/
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DiscreteAction.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DiscreteAction.java
index 148c4c785fe74..6eda3392ddab2 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DiscreteAction.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DiscreteAction.java
@@ -15,7 +15,7 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("discrete")
@Fluent
-public final class DiscreteAction extends Action {
+public final class DiscreteAction extends ChaosExperimentAction {
/*
* List of key value pairs.
*/
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiment.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiment.java
index 6802361fc65b0..13394954bf23c 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiment.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiment.java
@@ -4,7 +4,6 @@
package com.azure.resourcemanager.chaos.models;
-import com.azure.core.http.rest.Response;
import com.azure.core.management.Region;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
@@ -64,26 +63,25 @@ public interface Experiment {
ResourceIdentity identity();
/**
- * Gets the steps property: List of steps.
+ * Gets the provisioningState property: Most recent provisioning state for the given experiment resource.
*
- * @return the steps value.
+ * @return the provisioningState value.
*/
- List steps();
+ ProvisioningState provisioningState();
/**
- * Gets the selectors property: List of selectors.
+ * Gets the steps property: List of steps.
*
- * @return the selectors value.
+ * @return the steps value.
*/
- List selectors();
+ List steps();
/**
- * Gets the startOnCreation property: A boolean value that indicates if experiment should be started on creation or
- * not.
+ * Gets the selectors property: List of selectors.
*
- * @return the startOnCreation value.
+ * @return the selectors value.
*/
- Boolean startOnCreation();
+ List selectors();
/**
* Gets the region of the resource.
@@ -167,7 +165,7 @@ interface WithSteps {
* @param steps List of steps.
* @return the next definition stage.
*/
- WithSelectors withSteps(List steps);
+ WithSelectors withSteps(List steps);
}
/** The stage of the Experiment definition allowing to specify selectors. */
@@ -178,15 +176,14 @@ interface WithSelectors {
* @param selectors List of selectors.
* @return the next definition stage.
*/
- WithCreate withSelectors(List selectors);
+ WithCreate withSelectors(List selectors);
}
/**
* The stage of the Experiment definition which contains all the minimum required properties for the resource to
* be created, but also allows for any other optional properties to be specified.
*/
- interface WithCreate
- extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithStartOnCreation {
+ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity {
/**
* Executes the create request.
*
@@ -224,18 +221,6 @@ interface WithIdentity {
*/
WithCreate withIdentity(ResourceIdentity identity);
}
-
- /** The stage of the Experiment definition allowing to specify startOnCreation. */
- interface WithStartOnCreation {
- /**
- * Specifies the startOnCreation property: A boolean value that indicates if experiment should be started on
- * creation or not..
- *
- * @param startOnCreation A boolean value that indicates if experiment should be started on creation or not.
- * @return the next definition stage.
- */
- WithCreate withStartOnCreation(Boolean startOnCreation);
- }
}
/**
@@ -295,40 +280,36 @@ interface WithIdentity {
/**
* Cancel a running Experiment resource.
*
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a cancel Experiment operation along with {@link Response}.
*/
- Response