diff --git a/sdk/elastic/azure-resourcemanager-elastic/CHANGELOG.md b/sdk/elastic/azure-resourcemanager-elastic/CHANGELOG.md
index 0b9b14f6a2ea1..485e659e2823c 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/CHANGELOG.md
+++ b/sdk/elastic/azure-resourcemanager-elastic/CHANGELOG.md
@@ -1,7 +1,8 @@
# Release History
-## 1.0.0-beta.2 (Unreleased)
+## 1.0.0-beta.1 (2022-06-14)
+- Azure Resource Manager elastic client library for Java. This package contains Microsoft Azure SDK for elastic Management SDK. Package tag package-2020-07-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
## 1.0.0-beta.1 (2021-07-08)
diff --git a/sdk/elastic/azure-resourcemanager-elastic/README.md b/sdk/elastic/azure-resourcemanager-elastic/README.md
index 25abdf94f102f..195d1d931b0df 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/README.md
+++ b/sdk/elastic/azure-resourcemanager-elastic/README.md
@@ -2,7 +2,7 @@
Azure Resource Manager elastic client library for Java.
-This package contains Microsoft Azure SDK for elastic Management SDK. Package tag package-2020-07-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
+This package contains Microsoft Azure SDK for elastic Management SDK. Package tag package-2020-07-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
## We'd love to hear your feedback
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
com.azure.resourcemanagerazure-resourcemanager-elastic
- 1.0.0-beta.1
+ 1.0.0-beta.2
```
[//]: # ({x-version-update-end})
diff --git a/sdk/elastic/azure-resourcemanager-elastic/SAMPLE.md b/sdk/elastic/azure-resourcemanager-elastic/SAMPLE.md
index e27b9e719bb0e..49912b0cfa1a6 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/SAMPLE.md
+++ b/sdk/elastic/azure-resourcemanager-elastic/SAMPLE.md
@@ -1,42 +1,382 @@
# Code snippets and samples
-### DeploymentInfo
+## DeploymentInfo
-- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/DeploymentInfoListSamples.java)
+- [List](#deploymentinfo_list)
-### MonitoredResources
+## MonitoredResources
-- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/MonitoredResourcesListSamples.java)
+- [List](#monitoredresources_list)
-### Monitors
+## Monitors
-- [Create](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/MonitorsCreateSamples.java)
-- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/MonitorsDeleteSamples.java)
-- [GetByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/MonitorsGetByResourceGroupSamples.java)
-- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/MonitorsListSamples.java)
-- [ListByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/MonitorsListByResourceGroupSamples.java)
-- [Update](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/MonitorsUpdateSamples.java)
+- [Create](#monitors_create)
+- [Delete](#monitors_delete)
+- [GetByResourceGroup](#monitors_getbyresourcegroup)
+- [List](#monitors_list)
+- [ListByResourceGroup](#monitors_listbyresourcegroup)
+- [Update](#monitors_update)
-### Operations
+## Operations
-- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/OperationsListSamples.java)
+- [List](#operations_list)
-### TagRules
+## TagRules
-- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/TagRulesCreateOrUpdateSamples.java)
-- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/TagRulesDeleteSamples.java)
-- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/TagRulesGetSamples.java)
-- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/TagRulesListSamples.java)
+- [CreateOrUpdate](#tagrules_createorupdate)
+- [Delete](#tagrules_delete)
+- [Get](#tagrules_get)
+- [List](#tagrules_list)
-### VMCollection
+## VMCollection
-- [Update](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/VMCollectionUpdateSamples.java)
+- [Update](#vmcollection_update)
-### VMHost
+## VMHost
-- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/VMHostListSamples.java)
+- [List](#vmhost_list)
-### VMIngestion
+## VMIngestion
+
+- [Details](#vmingestion_details)
+### DeploymentInfo_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DeploymentInfo List. */
+public final class DeploymentInfoListSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/DeploymentInfo_List.json
+ */
+ /**
+ * Sample code: DeploymentInfo_List.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void deploymentInfoList(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ manager.deploymentInfoes().listWithResponse("myResourceGroup", "myMonitor", Context.NONE);
+ }
+}
+```
+
+### MonitoredResources_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for MonitoredResources List. */
+public final class MonitoredResourcesListSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/MonitoredResources_List.json
+ */
+ /**
+ * Sample code: MonitoredResources_List.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void monitoredResourcesList(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ manager.monitoredResources().list("myResourceGroup", "myMonitor", Context.NONE);
+ }
+}
+```
+
+### Monitors_Create
+
+```java
+/** Samples for Monitors Create. */
+public final class MonitorsCreateSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/Monitors_Create.json
+ */
+ /**
+ * Sample code: Monitors_Create.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void monitorsCreate(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ manager
+ .monitors()
+ .define("myMonitor")
+ .withRegion((String) null)
+ .withExistingResourceGroup("myResourceGroup")
+ .create();
+ }
+}
+```
+
+### Monitors_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Monitors Delete. */
+public final class MonitorsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/Monitors_Delete.json
+ */
+ /**
+ * Sample code: Monitors_Delete.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void monitorsDelete(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ manager.monitors().delete("myResourceGroup", "myMonitor", Context.NONE);
+ }
+}
+```
+
+### Monitors_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Monitors GetByResourceGroup. */
+public final class MonitorsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/Monitors_Get.json
+ */
+ /**
+ * Sample code: Monitors_Get.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void monitorsGet(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ manager.monitors().getByResourceGroupWithResponse("myResourceGroup", "myMonitor", Context.NONE);
+ }
+}
+```
+
+### Monitors_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Monitors List. */
+public final class MonitorsListSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/Monitors_List.json
+ */
+ /**
+ * Sample code: Monitors_List.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void monitorsList(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ manager.monitors().list(Context.NONE);
+ }
+}
+```
+
+### Monitors_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Monitors ListByResourceGroup. */
+public final class MonitorsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/Monitors_ListByResourceGroup.json
+ */
+ /**
+ * Sample code: Monitors_ListByResourceGroup.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void monitorsListByResourceGroup(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ manager.monitors().listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
+```
+
+### Monitors_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.elastic.models.ElasticMonitorResource;
+
+/** Samples for Monitors Update. */
+public final class MonitorsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/Monitors_Update.json
+ */
+ /**
+ * Sample code: Monitors_Update.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void monitorsUpdate(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ ElasticMonitorResource resource =
+ manager.monitors().getByResourceGroupWithResponse("myResourceGroup", "myMonitor", Context.NONE).getValue();
+ resource.update().apply();
+ }
+}
+```
+
+### Operations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Operations List. */
+public final class OperationsListSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/Operations_List.json
+ */
+ /**
+ * Sample code: Operations_List.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void operationsList(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ manager.operations().list(Context.NONE);
+ }
+}
+```
+
+### TagRules_CreateOrUpdate
+
+```java
+/** Samples for TagRules CreateOrUpdate. */
+public final class TagRulesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/TagRules_CreateOrUpdate.json
+ */
+ /**
+ * Sample code: TagRules_CreateOrUpdate.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void tagRulesCreateOrUpdate(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ manager.tagRules().define("default").withExistingMonitor("myResourceGroup", "myMonitor").create();
+ }
+}
+```
+
+### TagRules_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for TagRules Delete. */
+public final class TagRulesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/TagRules_Delete.json
+ */
+ /**
+ * Sample code: TagRules_Delete.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void tagRulesDelete(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ manager.tagRules().delete("myResourceGroup", "myMonitor", "default", Context.NONE);
+ }
+}
+```
+
+### TagRules_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for TagRules Get. */
+public final class TagRulesGetSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/TagRules_Get.json
+ */
+ /**
+ * Sample code: TagRules_Get.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void tagRulesGet(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ manager.tagRules().getWithResponse("myResourceGroup", "myMonitor", "default", Context.NONE);
+ }
+}
+```
+
+### TagRules_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for TagRules List. */
+public final class TagRulesListSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/TagRules_List.json
+ */
+ /**
+ * Sample code: TagRules_List.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void tagRulesList(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ manager.tagRules().list("myResourceGroup", "myMonitor", Context.NONE);
+ }
+}
+```
+
+### VMCollection_Update
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VMCollection Update. */
+public final class VMCollectionUpdateSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/VMCollection_Update.json
+ */
+ /**
+ * Sample code: VMCollection_Update.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void vMCollectionUpdate(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ manager.vMCollections().updateWithResponse("myResourceGroup", "myMonitor", null, Context.NONE);
+ }
+}
+```
+
+### VMHost_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VMHost List. */
+public final class VMHostListSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/VMHost_List.json
+ */
+ /**
+ * Sample code: VMHost_List.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void vMHostList(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ manager.vMHosts().list("myResourceGroup", "myMonitor", Context.NONE);
+ }
+}
+```
+
+### VMIngestion_Details
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VMIngestion Details. */
+public final class VMIngestionDetailsSamples {
+ /*
+ * x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2020-07-01-preview/examples/VMIngestion_Details.json
+ */
+ /**
+ * Sample code: VMIngestion_Details.
+ *
+ * @param manager Entry point to ElasticManager.
+ */
+ public static void vMIngestionDetails(com.azure.resourcemanager.elastic.ElasticManager manager) {
+ manager.vMIngestions().detailsWithResponse("myResourceGroup", "myMonitor", Context.NONE);
+ }
+}
+```
-- [Details](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/elastic/azure-resourcemanager-elastic/src/samples/java/com/azure/resourcemanager/elastic/VMIngestionDetailsSamples.java)
diff --git a/sdk/elastic/azure-resourcemanager-elastic/pom.xml b/sdk/elastic/azure-resourcemanager-elastic/pom.xml
index 08a36cc4106e4..0e062c9b2907c 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/pom.xml
+++ b/sdk/elastic/azure-resourcemanager-elastic/pom.xml
@@ -13,7 +13,7 @@
jarMicrosoft Azure SDK for elastic Management
- This package contains Microsoft Azure SDK for elastic Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2020-07-01.
+ This package contains Microsoft Azure SDK for elastic Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2020-07-01-preview.https://github.com/Azure/azure-sdk-for-java
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/ElasticManager.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/ElasticManager.java
index 0ffa7f088f5ba..c5de5f1213496 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/ElasticManager.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/ElasticManager.java
@@ -8,12 +8,15 @@
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
+import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
+import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
@@ -43,6 +46,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
+import java.util.stream.Collectors;
/** Entry point to ElasticManager. */
public final class ElasticManager {
@@ -89,6 +93,19 @@ public static ElasticManager authenticate(TokenCredential credential, AzureProfi
return configure().authenticate(credential, profile);
}
+ /**
+ * Creates an instance of elastic service API entry point.
+ *
+ * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
+ * @param profile the Azure profile for client.
+ * @return the elastic service API instance.
+ */
+ public static ElasticManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
+ Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+ return new ElasticManager(httpPipeline, profile, null);
+ }
+
/**
* Gets a Configurable instance that can be used to create ElasticManager with optional configuration.
*
@@ -100,13 +117,14 @@ public static Configurable configure() {
/** The Configurable allowing configurations to be set. */
public static final class Configurable {
- private final ClientLogger logger = new ClientLogger(Configurable.class);
+ private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
private final List policies = new ArrayList<>();
private final List scopes = new ArrayList<>();
private RetryPolicy retryPolicy;
+ private RetryOptions retryOptions;
private Duration defaultPollInterval;
private Configurable() {
@@ -167,6 +185,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
return this;
}
+ /**
+ * Sets the retry options for the HTTP pipeline retry policy.
+ *
+ *
This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
+ *
+ * @param retryOptions the retry options for the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryOptions(RetryOptions retryOptions) {
+ this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
+ return this;
+ }
+
/**
* Sets the default poll interval, used when service does not provide "Retry-After" header.
*
@@ -174,9 +205,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
* @return the configurable object itself.
*/
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
- this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
+ this.defaultPollInterval =
+ Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
if (this.defaultPollInterval.isNegative()) {
- throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
+ throw LOGGER
+ .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
}
return this;
}
@@ -216,16 +249,34 @@ public ElasticManager authenticate(TokenCredential credential, AzureProfile prof
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
}
if (retryPolicy == null) {
- retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ if (retryOptions != null) {
+ retryPolicy = new RetryPolicy(retryOptions);
+ } else {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
}
List policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new AddHeadersFromContextPolicy());
policies.add(new RequestIdPolicy());
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .collect(Collectors.toList()));
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
- policies.addAll(this.policies);
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .collect(Collectors.toList()));
HttpPolicyProviders.addAfterRetryPolicies(policies);
policies.add(new HttpLoggingPolicy(httpLogOptions));
HttpPipeline httpPipeline =
@@ -237,7 +288,11 @@ public ElasticManager authenticate(TokenCredential credential, AzureProfile prof
}
}
- /** @return Resource collection API of Operations. */
+ /**
+ * Gets the resource collection API of Operations.
+ *
+ * @return Resource collection API of Operations.
+ */
public Operations operations() {
if (this.operations == null) {
this.operations = new OperationsImpl(clientObject.getOperations(), this);
@@ -245,7 +300,11 @@ public Operations operations() {
return operations;
}
- /** @return Resource collection API of Monitors. */
+ /**
+ * Gets the resource collection API of Monitors. It manages ElasticMonitorResource.
+ *
+ * @return Resource collection API of Monitors.
+ */
public Monitors monitors() {
if (this.monitors == null) {
this.monitors = new MonitorsImpl(clientObject.getMonitors(), this);
@@ -253,7 +312,11 @@ public Monitors monitors() {
return monitors;
}
- /** @return Resource collection API of MonitoredResources. */
+ /**
+ * Gets the resource collection API of MonitoredResources.
+ *
+ * @return Resource collection API of MonitoredResources.
+ */
public MonitoredResources monitoredResources() {
if (this.monitoredResources == null) {
this.monitoredResources = new MonitoredResourcesImpl(clientObject.getMonitoredResources(), this);
@@ -261,7 +324,11 @@ public MonitoredResources monitoredResources() {
return monitoredResources;
}
- /** @return Resource collection API of DeploymentInfoes. */
+ /**
+ * Gets the resource collection API of DeploymentInfoes.
+ *
+ * @return Resource collection API of DeploymentInfoes.
+ */
public DeploymentInfoes deploymentInfoes() {
if (this.deploymentInfoes == null) {
this.deploymentInfoes = new DeploymentInfoesImpl(clientObject.getDeploymentInfoes(), this);
@@ -269,7 +336,11 @@ public DeploymentInfoes deploymentInfoes() {
return deploymentInfoes;
}
- /** @return Resource collection API of TagRules. */
+ /**
+ * Gets the resource collection API of TagRules. It manages MonitoringTagRules.
+ *
+ * @return Resource collection API of TagRules.
+ */
public TagRules tagRules() {
if (this.tagRules == null) {
this.tagRules = new TagRulesImpl(clientObject.getTagRules(), this);
@@ -277,7 +348,11 @@ public TagRules tagRules() {
return tagRules;
}
- /** @return Resource collection API of VMHosts. */
+ /**
+ * Gets the resource collection API of VMHosts.
+ *
+ * @return Resource collection API of VMHosts.
+ */
public VMHosts vMHosts() {
if (this.vMHosts == null) {
this.vMHosts = new VMHostsImpl(clientObject.getVMHosts(), this);
@@ -285,7 +360,11 @@ public VMHosts vMHosts() {
return vMHosts;
}
- /** @return Resource collection API of VMIngestions. */
+ /**
+ * Gets the resource collection API of VMIngestions.
+ *
+ * @return Resource collection API of VMIngestions.
+ */
public VMIngestions vMIngestions() {
if (this.vMIngestions == null) {
this.vMIngestions = new VMIngestionsImpl(clientObject.getVMIngestions(), this);
@@ -293,7 +372,11 @@ public VMIngestions vMIngestions() {
return vMIngestions;
}
- /** @return Resource collection API of VMCollections. */
+ /**
+ * Gets the resource collection API of VMCollections.
+ *
+ * @return Resource collection API of VMCollections.
+ */
public VMCollections vMCollections() {
if (this.vMCollections == null) {
this.vMCollections = new VMCollectionsImpl(clientObject.getVMCollections(), this);
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/DeploymentInfoesClient.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/DeploymentInfoesClient.java
index c027f56d2d6c8..0b2d3a6510b0b 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/DeploymentInfoesClient.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/DeploymentInfoesClient.java
@@ -34,7 +34,8 @@ public interface DeploymentInfoesClient {
* @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 the properties of deployment in Elastic cloud corresponding to the Elastic monitor resource.
+ * @return the properties of deployment in Elastic cloud corresponding to the Elastic monitor resource along with
+ * {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response listWithResponse(
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/MonitoredResourcesClient.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/MonitoredResourcesClient.java
index 7f195abd1304b..468b1fc389189 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/MonitoredResourcesClient.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/MonitoredResourcesClient.java
@@ -20,7 +20,7 @@ public interface MonitoredResourcesClient {
* @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 response of a list operation.
+ * @return response of a list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(String resourceGroupName, String monitorName);
@@ -34,7 +34,7 @@ public interface MonitoredResourcesClient {
* @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 response of a list operation.
+ * @return response of a list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(String resourceGroupName, String monitorName, Context context);
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/MonitorsClient.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/MonitorsClient.java
index 9a354fb207f21..0385d5b8f5045 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/MonitorsClient.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/MonitorsClient.java
@@ -21,7 +21,7 @@ public interface MonitorsClient {
*
* @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 response of a list operation.
+ * @return response of a list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list();
@@ -33,7 +33,7 @@ public interface MonitorsClient {
* @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 response of a list operation.
+ * @return response of a list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(Context context);
@@ -45,7 +45,7 @@ public interface MonitorsClient {
* @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 response of a list operation.
+ * @return response of a list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable listByResourceGroup(String resourceGroupName);
@@ -58,7 +58,7 @@ public interface MonitorsClient {
* @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 response of a list operation.
+ * @return response of a list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable listByResourceGroup(String resourceGroupName, Context context);
@@ -85,7 +85,7 @@ public interface MonitorsClient {
* @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 the properties of a specific monitor resource.
+ * @return the properties of a specific monitor resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response getByResourceGroupWithResponse(
@@ -100,9 +100,9 @@ Response getByResourceGroupWithResponse(
* @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 monitor resource.
+ * @return the {@link SyncPoller} for polling of monitor resource.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller, ElasticMonitorResourceInner> beginCreate(
String resourceGroupName, String monitorName, ElasticMonitorResourceInner body);
@@ -116,9 +116,9 @@ SyncPoller, ElasticMonitorResourceInner>
* @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 monitor resource.
+ * @return the {@link SyncPoller} for polling of monitor resource.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller, ElasticMonitorResourceInner> beginCreate(
String resourceGroupName, String monitorName, ElasticMonitorResourceInner body, Context context);
@@ -188,7 +188,7 @@ ElasticMonitorResourceInner create(
* @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 monitor resource.
+ * @return monitor resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response updateWithResponse(
@@ -202,9 +202,9 @@ Response updateWithResponse(
* @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 the completion.
+ * @return the {@link SyncPoller} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName);
/**
@@ -216,9 +216,9 @@ Response updateWithResponse(
* @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 the completion.
+ * @return the {@link SyncPoller} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, Context context);
/**
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/OperationsClient.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/OperationsClient.java
index 94862fd1bb962..34a1b520b487c 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/OperationsClient.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/OperationsClient.java
@@ -17,7 +17,8 @@ public interface OperationsClient {
*
* @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 result of GET request to list the Microsoft.
+ * @return result of GET request to list the Microsoft.Elastic operations as paginated response with {@link
+ * PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list();
@@ -29,7 +30,8 @@ public interface OperationsClient {
* @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 result of GET request to list the Microsoft.
+ * @return result of GET request to list the Microsoft.Elastic operations as paginated response with {@link
+ * PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(Context context);
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/TagRulesClient.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/TagRulesClient.java
index 03c5d68403002..a38bae3beb9fb 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/TagRulesClient.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/TagRulesClient.java
@@ -23,7 +23,7 @@ public interface TagRulesClient {
* @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 response of a list operation.
+ * @return response of a list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(String resourceGroupName, String monitorName);
@@ -37,7 +37,7 @@ public interface TagRulesClient {
* @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 response of a list operation.
+ * @return response of a list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(String resourceGroupName, String monitorName, Context context);
@@ -67,7 +67,7 @@ public interface TagRulesClient {
* @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 capture logs and metrics of Azure resources based on ARM tags.
+ * @return capture logs and metrics of Azure resources based on ARM tags along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response createOrUpdateWithResponse(
@@ -101,7 +101,7 @@ Response createOrUpdateWithResponse(
* @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 a tag rule set for a given monitor resource.
+ * @return a tag rule set for a given monitor resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response getWithResponse(
@@ -116,9 +116,9 @@ Response getWithResponse(
* @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 the completion.
+ * @return the {@link SyncPoller} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, String ruleSetName);
/**
@@ -131,9 +131,9 @@ Response getWithResponse(
* @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 the completion.
+ * @return the {@link SyncPoller} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller, Void> beginDelete(
String resourceGroupName, String monitorName, String ruleSetName, Context context);
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/VMCollectionsClient.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/VMCollectionsClient.java
index 59f77620ffd56..b17e99a5bff14 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/VMCollectionsClient.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/VMCollectionsClient.java
@@ -34,7 +34,7 @@ public interface VMCollectionsClient {
* @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 the response.
+ * @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response updateWithResponse(
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/VMHostsClient.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/VMHostsClient.java
index a1345f3e7e8f9..2c1f478a1a89a 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/VMHostsClient.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/VMHostsClient.java
@@ -20,7 +20,7 @@ public interface VMHostsClient {
* @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 response of a list operation.
+ * @return response of a list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(String resourceGroupName, String monitorName);
@@ -34,7 +34,7 @@ public interface VMHostsClient {
* @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 response of a list operation.
+ * @return response of a list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(String resourceGroupName, String monitorName, Context context);
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/VMIngestionsClient.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/VMIngestionsClient.java
index 5931eb2ed95fb..c61d84cd3cd65 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/VMIngestionsClient.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/VMIngestionsClient.java
@@ -34,7 +34,7 @@ public interface VMIngestionsClient {
* @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 the vm ingestion details to install an agent.
+ * @return the vm ingestion details to install an agent along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response detailsWithResponse(
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/DeploymentInfoResponseInner.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/DeploymentInfoResponseInner.java
index 4294c587e4bb5..519288dc02f11 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/DeploymentInfoResponseInner.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/DeploymentInfoResponseInner.java
@@ -5,16 +5,12 @@
package com.azure.resourcemanager.elastic.fluent.models;
import com.azure.core.annotation.Immutable;
-import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.elastic.models.ElasticDeploymentStatus;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/** The properties of deployment in Elastic cloud corresponding to the Elastic monitor resource. */
@Immutable
public final class DeploymentInfoResponseInner {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentInfoResponseInner.class);
-
/*
* The Elastic deployment status.
*/
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/ElasticMonitorResourceInner.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/ElasticMonitorResourceInner.java
index e13ebb3f8d72c..80456f935a077 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/ElasticMonitorResourceInner.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/ElasticMonitorResourceInner.java
@@ -7,19 +7,15 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
-import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.elastic.models.IdentityProperties;
import com.azure.resourcemanager.elastic.models.MonitorProperties;
import com.azure.resourcemanager.elastic.models.ResourceSku;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;
/** Monitor resource. */
@Fluent
public final class ElasticMonitorResourceInner extends Resource {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(ElasticMonitorResourceInner.class);
-
/*
* SKU of the monitor resource.
*/
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/MonitoredResourceInner.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/MonitoredResourceInner.java
index a8a92699d6f0f..fb8e00e6c5bc4 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/MonitoredResourceInner.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/MonitoredResourceInner.java
@@ -5,16 +5,12 @@
package com.azure.resourcemanager.elastic.fluent.models;
import com.azure.core.annotation.Fluent;
-import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.elastic.models.SendingLogs;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/** The properties of a resource currently being monitored by the Elastic monitor resource. */
@Fluent
public final class MonitoredResourceInner {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(MonitoredResourceInner.class);
-
/*
* The ARM id of the resource.
*/
@@ -22,8 +18,8 @@ public final class MonitoredResourceInner {
private String id;
/*
- * Flag indicating the status of the resource for sending logs operation to
- * Elastic.
+ * SendingLogs Flag indicating the status of the resource for sending logs
+ * operation to Elastic.
*/
@JsonProperty(value = "sendingLogs")
private SendingLogs sendingLogs;
@@ -55,7 +51,8 @@ public MonitoredResourceInner withId(String id) {
}
/**
- * Get the sendingLogs property: Flag indicating the status of the resource for sending logs operation to Elastic.
+ * Get the sendingLogs property: SendingLogs Flag indicating the status of the resource for sending logs operation
+ * to Elastic.
*
* @return the sendingLogs value.
*/
@@ -64,7 +61,8 @@ public SendingLogs sendingLogs() {
}
/**
- * Set the sendingLogs property: Flag indicating the status of the resource for sending logs operation to Elastic.
+ * Set the sendingLogs property: SendingLogs Flag indicating the status of the resource for sending logs operation
+ * to Elastic.
*
* @param sendingLogs the sendingLogs value to set.
* @return the MonitoredResourceInner object itself.
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/MonitoringTagRulesInner.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/MonitoringTagRulesInner.java
index dafad0b8105e0..0842c35dcae51 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/MonitoringTagRulesInner.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/MonitoringTagRulesInner.java
@@ -7,16 +7,12 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
-import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.elastic.models.MonitoringTagRulesProperties;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/** Capture logs and metrics of Azure resources based on ARM tags. */
@Fluent
public final class MonitoringTagRulesInner extends ProxyResource {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(MonitoringTagRulesInner.class);
-
/*
* Properties of the monitoring tag rules.
*/
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/OperationResultInner.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/OperationResultInner.java
index 2dd5a884ac17a..db0898e272f88 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/OperationResultInner.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/OperationResultInner.java
@@ -5,16 +5,12 @@
package com.azure.resourcemanager.elastic.fluent.models;
import com.azure.core.annotation.Fluent;
-import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.elastic.models.OperationDisplay;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/** A Microsoft.Elastic REST API operation. */
@Fluent
public final class OperationResultInner {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResultInner.class);
-
/*
* Operation name, i.e., {provider}/{resource}/{operation}.
*/
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/VMIngestionDetailsResponseInner.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/VMIngestionDetailsResponseInner.java
index 98bde0fc6cc64..7dfbac2c18ca4 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/VMIngestionDetailsResponseInner.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/VMIngestionDetailsResponseInner.java
@@ -5,15 +5,11 @@
package com.azure.resourcemanager.elastic.fluent.models;
import com.azure.core.annotation.Fluent;
-import com.azure.core.util.logging.ClientLogger;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/** The vm ingestion details to install an agent. */
@Fluent
public final class VMIngestionDetailsResponseInner {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(VMIngestionDetailsResponseInner.class);
-
/*
* The cloudId of given Elastic monitor resource.
*/
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/VMResourcesInner.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/VMResourcesInner.java
index a22401c7ef624..715241c7c3fe4 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/VMResourcesInner.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/fluent/models/VMResourcesInner.java
@@ -5,15 +5,11 @@
package com.azure.resourcemanager.elastic.fluent.models;
import com.azure.core.annotation.Fluent;
-import com.azure.core.util.logging.ClientLogger;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/** The vm resource properties that is currently being monitored by the Elastic monitor resource. */
@Fluent
public final class VMResourcesInner {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(VMResourcesInner.class);
-
/*
* The ARM id of the VM resource.
*/
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/DeploymentInfoesClientImpl.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/DeploymentInfoesClientImpl.java
index aa856890cd9fe..fe4b09a13ac14 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/DeploymentInfoesClientImpl.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/DeploymentInfoesClientImpl.java
@@ -21,15 +21,12 @@
import com.azure.core.management.exception.ManagementException;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
-import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.elastic.fluent.DeploymentInfoesClient;
import com.azure.resourcemanager.elastic.fluent.models.DeploymentInfoResponseInner;
import reactor.core.publisher.Mono;
/** An instance of this class provides access to all the operations defined in DeploymentInfoesClient. */
public final class DeploymentInfoesClientImpl implements DeploymentInfoesClient {
- private final ClientLogger logger = new ClientLogger(DeploymentInfoesClientImpl.class);
-
/** The proxy service used to perform REST calls. */
private final DeploymentInfoesService service;
@@ -78,7 +75,8 @@ Mono> list(
* @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 properties of deployment in Elastic cloud corresponding to the Elastic monitor resource.
+ * @return the properties of deployment in Elastic cloud corresponding to the Elastic monitor resource along with
+ * {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listWithResponseAsync(
@@ -127,7 +125,8 @@ private Mono> listWithResponseAsync(
* @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 properties of deployment in Elastic cloud corresponding to the Elastic monitor resource.
+ * @return the properties of deployment in Elastic cloud corresponding to the Elastic monitor resource along with
+ * {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listWithResponseAsync(
@@ -172,19 +171,12 @@ private Mono> listWithResponseAsync(
* @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 properties of deployment in Elastic cloud corresponding to the Elastic monitor resource.
+ * @return the properties of deployment in Elastic cloud corresponding to the Elastic monitor resource on successful
+ * completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono listAsync(String resourceGroupName, String monitorName) {
- return listWithResponseAsync(resourceGroupName, monitorName)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
+ return listWithResponseAsync(resourceGroupName, monitorName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
@@ -211,7 +203,8 @@ public DeploymentInfoResponseInner list(String resourceGroupName, String monitor
* @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 properties of deployment in Elastic cloud corresponding to the Elastic monitor resource.
+ * @return the properties of deployment in Elastic cloud corresponding to the Elastic monitor resource along with
+ * {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response listWithResponse(
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/DeploymentInfoesImpl.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/DeploymentInfoesImpl.java
index 53ccb8f9bac81..4a3438aacbdd2 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/DeploymentInfoesImpl.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/DeploymentInfoesImpl.java
@@ -12,10 +12,9 @@
import com.azure.resourcemanager.elastic.fluent.models.DeploymentInfoResponseInner;
import com.azure.resourcemanager.elastic.models.DeploymentInfoResponse;
import com.azure.resourcemanager.elastic.models.DeploymentInfoes;
-import com.fasterxml.jackson.annotation.JsonIgnore;
public final class DeploymentInfoesImpl implements DeploymentInfoes {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentInfoesImpl.class);
+ private static final ClientLogger LOGGER = new ClientLogger(DeploymentInfoesImpl.class);
private final DeploymentInfoesClient innerClient;
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/ElasticMonitorResourceImpl.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/ElasticMonitorResourceImpl.java
index 7572db6dafac0..5b1099b40e138 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/ElasticMonitorResourceImpl.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/ElasticMonitorResourceImpl.java
@@ -71,6 +71,10 @@ public String regionName() {
return this.location();
}
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
public ElasticMonitorResourceInner innerModel() {
return this.innerObject;
}
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/MicrosoftElasticBuilder.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/MicrosoftElasticBuilder.java
index f9c2a3fc8d5be..5bc76a98eee3d 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/MicrosoftElasticBuilder.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/MicrosoftElasticBuilder.java
@@ -7,7 +7,6 @@
import com.azure.core.annotation.ServiceClientBuilder;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
-import com.azure.core.http.policy.CookiePolicy;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.AzureEnvironment;
@@ -68,34 +67,34 @@ public MicrosoftElasticBuilder environment(AzureEnvironment environment) {
}
/*
- * The default poll interval for long-running operation
+ * The HTTP pipeline to send requests through
*/
- private Duration defaultPollInterval;
+ private HttpPipeline pipeline;
/**
- * Sets The default poll interval for long-running operation.
+ * Sets The HTTP pipeline to send requests through.
*
- * @param defaultPollInterval the defaultPollInterval value.
+ * @param pipeline the pipeline value.
* @return the MicrosoftElasticBuilder.
*/
- public MicrosoftElasticBuilder defaultPollInterval(Duration defaultPollInterval) {
- this.defaultPollInterval = defaultPollInterval;
+ public MicrosoftElasticBuilder pipeline(HttpPipeline pipeline) {
+ this.pipeline = pipeline;
return this;
}
/*
- * The HTTP pipeline to send requests through
+ * The default poll interval for long-running operation
*/
- private HttpPipeline pipeline;
+ private Duration defaultPollInterval;
/**
- * Sets The HTTP pipeline to send requests through.
+ * Sets The default poll interval for long-running operation.
*
- * @param pipeline the pipeline value.
+ * @param defaultPollInterval the defaultPollInterval value.
* @return the MicrosoftElasticBuilder.
*/
- public MicrosoftElasticBuilder pipeline(HttpPipeline pipeline) {
- this.pipeline = pipeline;
+ public MicrosoftElasticBuilder defaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = defaultPollInterval;
return this;
}
@@ -127,15 +126,12 @@ public MicrosoftElasticImpl buildClient() {
if (environment == null) {
this.environment = AzureEnvironment.AZURE;
}
+ if (pipeline == null) {
+ this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
+ }
if (defaultPollInterval == null) {
this.defaultPollInterval = Duration.ofSeconds(30);
}
- if (pipeline == null) {
- this.pipeline =
- new HttpPipelineBuilder()
- .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
- .build();
- }
if (serializerAdapter == null) {
this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter();
}
diff --git a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/MicrosoftElasticImpl.java b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/MicrosoftElasticImpl.java
index b4e36b14be06d..83b6b6422e6e8 100644
--- a/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/MicrosoftElasticImpl.java
+++ b/sdk/elastic/azure-resourcemanager-elastic/src/main/java/com/azure/resourcemanager/elastic/implementation/MicrosoftElasticImpl.java
@@ -15,6 +15,7 @@
import com.azure.core.management.polling.PollResult;
import com.azure.core.management.polling.PollerFactory;
import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
import com.azure.core.util.polling.AsyncPollResponse;
import com.azure.core.util.polling.LongRunningOperationStatus;
@@ -36,15 +37,12 @@
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
-import java.util.Map;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/** Initializes a new instance of the MicrosoftElasticImpl type. */
@ServiceClient(builder = MicrosoftElasticBuilder.class)
public final class MicrosoftElasticImpl implements MicrosoftElastic {
- private final ClientLogger logger = new ClientLogger(MicrosoftElasticImpl.class);
-
/** The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). */
private final String subscriptionId;
@@ -236,7 +234,7 @@ public VMCollectionsClient getVMCollections() {
this.defaultPollInterval = defaultPollInterval;
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
- this.apiVersion = "2020-07-01";
+ this.apiVersion = "2020-07-01-preview";
this.operations = new OperationsClientImpl(this);
this.monitors = new MonitorsClientImpl(this);
this.monitoredResources = new MonitoredResourcesClientImpl(this);
@@ -263,10 +261,7 @@ public Context getContext() {
* @return the merged context.
*/
public Context mergeContext(Context context) {
- for (Map.Entry