From 3c43b9b8dc57b74f97eaba6aa725db8eb792692f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 17 Nov 2020 09:50:26 +0000 Subject: [PATCH] CodeGen from PR 11649 in Azure/azure-rest-api-specs Microsoft.OperationalInsights: Updating property name + Adding a new resource (#11649) * Updating property name. * example update. * Adding force cmk to workspace. * Adding default error response. * Removing redundant examples. * adding workspace capping to example per code review request. * Per review request. Co-authored-by: Dudi Likvornik --- sdk/loganalytics/mgmt-v2015_03_20/pom.xml | 6 +- .../v2015_03_20/AvailableServiceTier.java | 56 +++ .../v2015_03_20/SavedSearches.java | 11 - .../loganalytics/v2015_03_20/SkuNameEnum.java | 56 +++ .../loganalytics/v2015_03_20/Workspaces.java | 29 +- .../AvailableServiceTierImpl.java | 67 ++++ .../AvailableServiceTierInner.java | 128 ++++++ .../implementation/SavedSearchesImpl.java | 23 +- .../implementation/SavedSearchesInner.java | 97 ----- .../SavedSearchesListResultInner.java | 6 +- .../implementation/StorageInsightsImpl.java | 10 +- .../implementation/WorkspacesImpl.java | 62 +-- .../implementation/WorkspacesInner.java | 372 +++++------------- 13 files changed, 464 insertions(+), 459 deletions(-) create mode 100644 sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/AvailableServiceTier.java create mode 100644 sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SkuNameEnum.java create mode 100644 sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/AvailableServiceTierImpl.java create mode 100644 sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/AvailableServiceTierInner.java diff --git a/sdk/loganalytics/mgmt-v2015_03_20/pom.xml b/sdk/loganalytics/mgmt-v2015_03_20/pom.xml index 4fbb1c6ca3ef7..6ed9701f08bca 100644 --- a/sdk/loganalytics/mgmt-v2015_03_20/pom.xml +++ b/sdk/loganalytics/mgmt-v2015_03_20/pom.xml @@ -11,8 +11,8 @@ com.microsoft.azure azure-arm-parent - 1.2.0 - ../../parents/azure-arm-parent + 1.1.0 + ../../../pom.management.xml azure-mgmt-loganalytics 1.0.0-beta @@ -71,6 +71,8 @@ azure-arm-client-runtime test-jar test + + 1.6.5 diff --git a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/AvailableServiceTier.java b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/AvailableServiceTier.java new file mode 100644 index 0000000000000..98e4f7214d495 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/AvailableServiceTier.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2015_03_20; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.AvailableServiceTierInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.LogAnalyticsManager; +import org.joda.time.DateTime; + +/** + * Type representing AvailableServiceTier. + */ +public interface AvailableServiceTier extends HasInner, HasManager { + /** + * @return the capacityReservationLevel value. + */ + Long capacityReservationLevel(); + + /** + * @return the defaultRetention value. + */ + Long defaultRetention(); + + /** + * @return the enabled value. + */ + Boolean enabled(); + + /** + * @return the lastSkuUpdate value. + */ + DateTime lastSkuUpdate(); + + /** + * @return the maximumRetention value. + */ + Long maximumRetention(); + + /** + * @return the minimumRetention value. + */ + Long minimumRetention(); + + /** + * @return the serviceTier value. + */ + SkuNameEnum serviceTier(); + +} diff --git a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearches.java b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearches.java index 65c490f4b94d6..764c4b3aa4a22 100644 --- a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearches.java +++ b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearches.java @@ -50,15 +50,4 @@ public interface SavedSearches extends SupportsCreating getResultsAsync(String resourceGroupName, String workspaceName, String savedSearchId); - } diff --git a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SkuNameEnum.java b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SkuNameEnum.java new file mode 100644 index 0000000000000..3282e66fdae48 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SkuNameEnum.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2015_03_20; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuNameEnum. + */ +public final class SkuNameEnum extends ExpandableStringEnum { + /** Static value Free for SkuNameEnum. */ + public static final SkuNameEnum FREE = fromString("Free"); + + /** Static value Standard for SkuNameEnum. */ + public static final SkuNameEnum STANDARD = fromString("Standard"); + + /** Static value Premium for SkuNameEnum. */ + public static final SkuNameEnum PREMIUM = fromString("Premium"); + + /** Static value PerNode for SkuNameEnum. */ + public static final SkuNameEnum PER_NODE = fromString("PerNode"); + + /** Static value PerGB2018 for SkuNameEnum. */ + public static final SkuNameEnum PER_GB2018 = fromString("PerGB2018"); + + /** Static value Standalone for SkuNameEnum. */ + public static final SkuNameEnum STANDALONE = fromString("Standalone"); + + /** Static value CapacityReservation for SkuNameEnum. */ + public static final SkuNameEnum CAPACITY_RESERVATION = fromString("CapacityReservation"); + + /** + * Creates or finds a SkuNameEnum from its string representation. + * @param name a name to look for + * @return the corresponding SkuNameEnum + */ + @JsonCreator + public static SkuNameEnum fromString(String name) { + return fromString(name, SkuNameEnum.class); + } + + /** + * @return known SkuNameEnum values + */ + public static Collection values() { + return values(SkuNameEnum.class); + } +} diff --git a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/Workspaces.java b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/Workspaces.java index 252665de9318b..cad21f9fc4920 100644 --- a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/Workspaces.java +++ b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/Workspaces.java @@ -9,56 +9,47 @@ package com.microsoft.azure.management.loganalytics.v2015_03_20; import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.WorkspacesInner; +import com.microsoft.azure.arm.model.HasInner; import rx.Completable; /** * Type representing Workspaces. */ -public interface Workspaces { +public interface Workspaces extends HasInner { /** - * Gets status of an ongoing purge operation. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable getPurgeStatusAsync(String resourceGroupName, String workspaceName); - - /** - * Gets the schema for a given workspace. + * Gets the available service tiers for the workspace. * * @param resourceGroupName The Resource Group name. * @param workspaceName The Log Analytics Workspace name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable getSchemaAsync(String resourceGroupName, String workspaceName); + Observable availableServiceTiersAsync(String resourceGroupName, String workspaceName); /** - * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. + * Gets status of an ongoing purge operation. * * @param resourceGroupName The Resource Group name. * @param workspaceName The Log Analytics Workspace name. - * @param parameters The parameters required to execute a search query. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable getSearchResultsAsync(String resourceGroupName, String workspaceName, SearchParameters parameters); + Observable getPurgeStatusAsync(String resourceGroupName, String workspaceName); /** - * Gets updated search results for a given search query. + * Gets the schema for a given workspace. * * @param resourceGroupName The Resource Group name. * @param workspaceName The Log Analytics Workspace name. - * @param id The id of the search that will have results updated. You can get the id from the response of the GetResults call. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable updateSearchResultsAsync(String resourceGroupName, String workspaceName, String id); + Observable getSchemaAsync(String resourceGroupName, String workspaceName); /** * Purges data in an Log Analytics workspace by a set of user-defined filters. + In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected. * * @param resourceGroupName The Resource Group name. * @param workspaceName The Log Analytics Workspace name. diff --git a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/AvailableServiceTierImpl.java b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/AvailableServiceTierImpl.java new file mode 100644 index 0000000000000..8bb0202556796 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/AvailableServiceTierImpl.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.AvailableServiceTier; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SkuNameEnum; + +class AvailableServiceTierImpl extends WrapperImpl implements AvailableServiceTier { + private final LogAnalyticsManager manager; + + AvailableServiceTierImpl(AvailableServiceTierInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + + + @Override + public Long capacityReservationLevel() { + return this.inner().capacityReservationLevel(); + } + + @Override + public Long defaultRetention() { + return this.inner().defaultRetention(); + } + + @Override + public Boolean enabled() { + return this.inner().enabled(); + } + + @Override + public DateTime lastSkuUpdate() { + return this.inner().lastSkuUpdate(); + } + + @Override + public Long maximumRetention() { + return this.inner().maximumRetention(); + } + + @Override + public Long minimumRetention() { + return this.inner().minimumRetention(); + } + + @Override + public SkuNameEnum serviceTier() { + return this.inner().serviceTier(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/AvailableServiceTierInner.java b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/AvailableServiceTierInner.java new file mode 100644 index 0000000000000..9a309afe5fe17 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/AvailableServiceTierInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.SkuNameEnum; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service Tier details. + */ +public class AvailableServiceTierInner { + /** + * The name of the Service Tier. Possible values include: 'Free', + * 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone', + * 'CapacityReservation'. + */ + @JsonProperty(value = "ServiceTier", access = JsonProperty.Access.WRITE_ONLY) + private SkuNameEnum serviceTier; + + /** + * True if the Service Tier is enabled for the workspace. + */ + @JsonProperty(value = "Enabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean enabled; + + /** + * The minimum retention for the Service Tier, in days. + */ + @JsonProperty(value = "MinimumRetention", access = JsonProperty.Access.WRITE_ONLY) + private Long minimumRetention; + + /** + * The maximum retention for the Service Tier, in days. + */ + @JsonProperty(value = "MaximumRetention", access = JsonProperty.Access.WRITE_ONLY) + private Long maximumRetention; + + /** + * The default retention for the Service Tier, in days. + */ + @JsonProperty(value = "DefaultRetention", access = JsonProperty.Access.WRITE_ONLY) + private Long defaultRetention; + + /** + * The capacity reservation level in GB per day. Returned for the Capacity + * Reservation Service Tier. + */ + @JsonProperty(value = "CapacityReservationLevel", access = JsonProperty.Access.WRITE_ONLY) + private Long capacityReservationLevel; + + /** + * Time when the sku was last updated for the workspace. Returned for the + * Capacity Reservation Service Tier. + */ + @JsonProperty(value = "LastSkuUpdate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastSkuUpdate; + + /** + * Get the name of the Service Tier. Possible values include: 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone', 'CapacityReservation'. + * + * @return the serviceTier value + */ + public SkuNameEnum serviceTier() { + return this.serviceTier; + } + + /** + * Get true if the Service Tier is enabled for the workspace. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Get the minimum retention for the Service Tier, in days. + * + * @return the minimumRetention value + */ + public Long minimumRetention() { + return this.minimumRetention; + } + + /** + * Get the maximum retention for the Service Tier, in days. + * + * @return the maximumRetention value + */ + public Long maximumRetention() { + return this.maximumRetention; + } + + /** + * Get the default retention for the Service Tier, in days. + * + * @return the defaultRetention value + */ + public Long defaultRetention() { + return this.defaultRetention; + } + + /** + * Get the capacity reservation level in GB per day. Returned for the Capacity Reservation Service Tier. + * + * @return the capacityReservationLevel value + */ + public Long capacityReservationLevel() { + return this.capacityReservationLevel; + } + + /** + * Get time when the sku was last updated for the workspace. Returned for the Capacity Reservation Service Tier. + * + * @return the lastSkuUpdate value + */ + public DateTime lastSkuUpdate() { + return this.lastSkuUpdate; + } + +} diff --git a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesImpl.java b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesImpl.java index 9238b4e9b60ff..4215f1c6a7fab 100644 --- a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesImpl.java +++ b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesImpl.java @@ -16,7 +16,6 @@ import rx.functions.Func1; import com.microsoft.azure.management.loganalytics.v2015_03_20.SavedSearchesListResult; import com.microsoft.azure.management.loganalytics.v2015_03_20.SavedSearch; -import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchResultsResponse; class SavedSearchesImpl extends WrapperImpl implements SavedSearches { private final LogAnalyticsManager manager; @@ -59,10 +58,14 @@ public SavedSearchesListResult call(SavedSearchesListResultInner inner) { public Observable getAsync(String resourceGroupName, String workspaceName, String savedSearchId) { SavedSearchesInner client = this.inner(); return client.getAsync(resourceGroupName, workspaceName, savedSearchId) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public SavedSearch call(SavedSearchInner inner) { - return wrapModel(inner); + public Observable call(SavedSearchInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SavedSearch)wrapModel(inner)); + } } }); } @@ -73,16 +76,4 @@ public Completable deleteAsync(String resourceGroupName, String workspaceName, S return client.deleteAsync(resourceGroupName, workspaceName, savedSearchId).toCompletable(); } - @Override - public Observable getResultsAsync(String resourceGroupName, String workspaceName, String savedSearchId) { - SavedSearchesInner client = this.inner(); - return client.getResultsAsync(resourceGroupName, workspaceName, savedSearchId) - .map(new Func1() { - @Override - public SearchResultsResponse call(SearchResultsResponseInner inner) { - return new SearchResultsResponseImpl(inner, manager()); - } - }); - } - } diff --git a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesInner.java b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesInner.java index f43d480451766..e14cb7af75a47 100644 --- a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesInner.java +++ b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesInner.java @@ -71,10 +71,6 @@ interface SavedSearchesService { @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches") Observable> listByWorkspace(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2015_03_20.SavedSearches getResults" }) - @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}/results") - Observable> getResults(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("savedSearchId") String savedSearchId, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - } /** @@ -449,97 +445,4 @@ private ServiceResponse listByWorkspaceDelegate(Re .build(response); } - /** - * Gets the results from a saved search for a given workspace. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param savedSearchId The id of the saved search. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the SearchResultsResponseInner object if successful. - */ - public SearchResultsResponseInner getResults(String resourceGroupName, String workspaceName, String savedSearchId) { - return getResultsWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId).toBlocking().single().body(); - } - - /** - * Gets the results from a saved search for a given workspace. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param savedSearchId The id of the saved search. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getResultsAsync(String resourceGroupName, String workspaceName, String savedSearchId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getResultsWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId), serviceCallback); - } - - /** - * Gets the results from a saved search for a given workspace. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param savedSearchId The id of the saved search. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SearchResultsResponseInner object - */ - public Observable getResultsAsync(String resourceGroupName, String workspaceName, String savedSearchId) { - return getResultsWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId).map(new Func1, SearchResultsResponseInner>() { - @Override - public SearchResultsResponseInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Gets the results from a saved search for a given workspace. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param savedSearchId The id of the saved search. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SearchResultsResponseInner object - */ - public Observable> getResultsWithServiceResponseAsync(String resourceGroupName, String workspaceName, String savedSearchId) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (workspaceName == null) { - throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); - } - if (savedSearchId == null) { - throw new IllegalArgumentException("Parameter savedSearchId is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.getResults(resourceGroupName, workspaceName, savedSearchId, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getResultsDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getResultsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - } diff --git a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesListResultInner.java b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesListResultInner.java index f05701c02df36..e3ad8c72b1a13 100644 --- a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesListResultInner.java +++ b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesListResultInner.java @@ -17,7 +17,7 @@ */ public class SavedSearchesListResultInner { /** - * The metadata from search results. + * Unused legacy property, kept here for backward compatibility. */ @JsonProperty(value = "__metadata") private SearchMetadata metadata; @@ -29,7 +29,7 @@ public class SavedSearchesListResultInner { private List value; /** - * Get the metadata from search results. + * Get unused legacy property, kept here for backward compatibility. * * @return the metadata value */ @@ -38,7 +38,7 @@ public SearchMetadata metadata() { } /** - * Set the metadata from search results. + * Set unused legacy property, kept here for backward compatibility. * * @param metadata the metadata value to set * @return the SavedSearchesListResultInner object itself. diff --git a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightsImpl.java b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightsImpl.java index e8af7084fa6ad..a0267fe8c2eca 100644 --- a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightsImpl.java +++ b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightsImpl.java @@ -64,10 +64,14 @@ public StorageInsight call(StorageInsightInner inner) { public Observable getAsync(String resourceGroupName, String workspaceName, String storageInsightName) { StorageInsightsInner client = this.inner(); return client.getAsync(resourceGroupName, workspaceName, storageInsightName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public StorageInsight call(StorageInsightInner inner) { - return wrapModel(inner); + public Observable call(StorageInsightInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((StorageInsight)wrapModel(inner)); + } } }); } diff --git a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesImpl.java b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesImpl.java index 6edd662bb152e..a5018afa738ae 100644 --- a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesImpl.java +++ b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesImpl.java @@ -4,7 +4,7 @@ * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * abc + * */ package com.microsoft.azure.management.loganalytics.v2015_03_20.implementation; @@ -13,14 +13,14 @@ import com.microsoft.azure.management.loganalytics.v2015_03_20.Workspaces; import rx.Observable; import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2015_03_20.AvailableServiceTier; import com.microsoft.azure.management.loganalytics.v2015_03_20.WorkspacePurgeStatusResponse; import com.microsoft.azure.Page; import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchGetSchemaResponse; -import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchResultsResponse; import com.microsoft.azure.management.loganalytics.v2015_03_20.WorkspacePurgeResponse; import com.microsoft.azure.management.loganalytics.v2015_03_20.SharedKeys; import com.microsoft.azure.management.loganalytics.v2015_03_20.LinkTarget; -import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchParameters; import com.microsoft.azure.management.loganalytics.v2015_03_20.WorkspacePurgeBody; import rx.Completable; @@ -36,6 +36,28 @@ public LogAnalyticsManager manager() { return this.manager; } + private AvailableServiceTierImpl wrapModel(AvailableServiceTierInner inner) { + return new AvailableServiceTierImpl(inner, manager()); + } + + @Override + public Observable availableServiceTiersAsync(String resourceGroupName, String workspaceName) { + WorkspacesInner client = this.inner(); + return client.availableServiceTiersAsync(resourceGroupName, workspaceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public AvailableServiceTier call(AvailableServiceTierInner inner) { + return wrapModel(inner); + } + }); + } + private WorkspacePurgeStatusResponseImpl wrapWorkspacePurgeStatusResponseModel(WorkspacePurgeStatusResponseInner inner) { return new WorkspacePurgeStatusResponseImpl(inner, manager()); } @@ -51,10 +73,14 @@ private Observable getWorkspacePurgeStatusRes public Observable getPurgeStatusAsync(String resourceGroupName, String workspaceName) { WorkspacesInner client = this.inner(); return client.getPurgeStatusAsync(resourceGroupName, workspaceName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public WorkspacePurgeStatusResponse call(WorkspacePurgeStatusResponseInner inner) { - return wrapWorkspacePurgeStatusResponseModel(inner); + public Observable call(WorkspacePurgeStatusResponseInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((WorkspacePurgeStatusResponse)wrapWorkspacePurgeStatusResponseModel(inner)); + } } }); } @@ -71,30 +97,6 @@ public SearchGetSchemaResponse call(SearchGetSchemaResponseInner inner) { }); } - @Override - public Observable getSearchResultsAsync(String resourceGroupName, String workspaceName, SearchParameters parameters) { - WorkspacesInner client = this.inner(); - return client.getSearchResultsAsync(resourceGroupName, workspaceName, parameters) - .map(new Func1() { - @Override - public SearchResultsResponse call(SearchResultsResponseInner inner) { - return new SearchResultsResponseImpl(inner, manager()); - } - }); - } - - @Override - public Observable updateSearchResultsAsync(String resourceGroupName, String workspaceName, String id) { - WorkspacesInner client = this.inner(); - return client.updateSearchResultsAsync(resourceGroupName, workspaceName, id) - .map(new Func1() { - @Override - public SearchResultsResponse call(SearchResultsResponseInner inner) { - return new SearchResultsResponseImpl(inner, manager()); - } - }); - } - @Override public Observable purgeAsync(String resourceGroupName, String workspaceName, WorkspacePurgeBody body) { WorkspacesInner client = this.inner(); diff --git a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesInner.java b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesInner.java index d6ad5964f8db8..f666c9a683b6f 100644 --- a/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesInner.java +++ b/sdk/loganalytics/mgmt-v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesInner.java @@ -11,7 +11,6 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; -import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchParameters; import com.microsoft.azure.management.loganalytics.v2015_03_20.WorkspacePurgeBody; import com.microsoft.azure.management.loganalytics.v2015_03_20.WorkspacesPurgeHeaders; import com.microsoft.azure.Page; @@ -70,18 +69,6 @@ interface WorkspacesService { @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema") Observable> getSchema(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2015_03_20.Workspaces getSearchResults" }) - @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/search") - Observable> getSearchResults(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Body SearchParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2015_03_20.Workspaces beginGetSearchResults" }) - @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/search") - Observable> beginGetSearchResults(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Body SearchParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2015_03_20.Workspaces updateSearchResults" }) - @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/search/{id}") - Observable> updateSearchResults(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("id") String id, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2015_03_20.Workspaces purge" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge") Observable> purge(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Body WorkspacePurgeBody body, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -102,6 +89,10 @@ interface WorkspacesService { @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}", method = "DELETE", hasBody = true) Observable> deleteGateways(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("gatewayId") String gatewayId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2015_03_20.Workspaces availableServiceTiers" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers") + Observable> availableServiceTiers(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -271,273 +262,9 @@ private ServiceResponse getSchemaDelegate(Response .build(response); } - /** - * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param parameters The parameters required to execute a search query. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the SearchResultsResponseInner object if successful. - */ - public SearchResultsResponseInner getSearchResults(String resourceGroupName, String workspaceName, SearchParameters parameters) { - return getSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, parameters).toBlocking().last().body(); - } - - /** - * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param parameters The parameters required to execute a search query. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getSearchResultsAsync(String resourceGroupName, String workspaceName, SearchParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, parameters), serviceCallback); - } - - /** - * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param parameters The parameters required to execute a search query. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable getSearchResultsAsync(String resourceGroupName, String workspaceName, SearchParameters parameters) { - return getSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, parameters).map(new Func1, SearchResultsResponseInner>() { - @Override - public SearchResultsResponseInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param parameters The parameters required to execute a search query. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> getSearchResultsWithServiceResponseAsync(String resourceGroupName, String workspaceName, SearchParameters parameters) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (workspaceName == null) { - throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - Observable> observable = service.getSearchResults(resourceGroupName, workspaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param parameters The parameters required to execute a search query. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the SearchResultsResponseInner object if successful. - */ - public SearchResultsResponseInner beginGetSearchResults(String resourceGroupName, String workspaceName, SearchParameters parameters) { - return beginGetSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, parameters).toBlocking().single().body(); - } - - /** - * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param parameters The parameters required to execute a search query. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginGetSearchResultsAsync(String resourceGroupName, String workspaceName, SearchParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginGetSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, parameters), serviceCallback); - } - - /** - * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param parameters The parameters required to execute a search query. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SearchResultsResponseInner object - */ - public Observable beginGetSearchResultsAsync(String resourceGroupName, String workspaceName, SearchParameters parameters) { - return beginGetSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, parameters).map(new Func1, SearchResultsResponseInner>() { - @Override - public SearchResultsResponseInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param parameters The parameters required to execute a search query. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SearchResultsResponseInner object - */ - public Observable> beginGetSearchResultsWithServiceResponseAsync(String resourceGroupName, String workspaceName, SearchParameters parameters) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (workspaceName == null) { - throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.beginGetSearchResults(resourceGroupName, workspaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginGetSearchResultsDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginGetSearchResultsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - - /** - * Gets updated search results for a given search query. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param id The id of the search that will have results updated. You can get the id from the response of the GetResults call. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the SearchResultsResponseInner object if successful. - */ - public SearchResultsResponseInner updateSearchResults(String resourceGroupName, String workspaceName, String id) { - return updateSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, id).toBlocking().single().body(); - } - - /** - * Gets updated search results for a given search query. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param id The id of the search that will have results updated. You can get the id from the response of the GetResults call. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture updateSearchResultsAsync(String resourceGroupName, String workspaceName, String id, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, id), serviceCallback); - } - - /** - * Gets updated search results for a given search query. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param id The id of the search that will have results updated. You can get the id from the response of the GetResults call. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SearchResultsResponseInner object - */ - public Observable updateSearchResultsAsync(String resourceGroupName, String workspaceName, String id) { - return updateSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, id).map(new Func1, SearchResultsResponseInner>() { - @Override - public SearchResultsResponseInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Gets updated search results for a given search query. - * - * @param resourceGroupName The Resource Group name. - * @param workspaceName The Log Analytics Workspace name. - * @param id The id of the search that will have results updated. You can get the id from the response of the GetResults call. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SearchResultsResponseInner object - */ - public Observable> updateSearchResultsWithServiceResponseAsync(String resourceGroupName, String workspaceName, String id) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (workspaceName == null) { - throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); - } - if (id == null) { - throw new IllegalArgumentException("Parameter id is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.updateSearchResults(resourceGroupName, workspaceName, id, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = updateSearchResultsDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse updateSearchResultsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** * Purges data in an Log Analytics workspace by a set of user-defined filters. + In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected. * * @param resourceGroupName The Resource Group name. * @param workspaceName The Log Analytics Workspace name. @@ -553,6 +280,7 @@ public WorkspacePurgeResponseInner purge(String resourceGroupName, String worksp /** * Purges data in an Log Analytics workspace by a set of user-defined filters. + In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected. * * @param resourceGroupName The Resource Group name. * @param workspaceName The Log Analytics Workspace name. @@ -567,6 +295,7 @@ public ServiceFuture purgeAsync(String resourceGrou /** * Purges data in an Log Analytics workspace by a set of user-defined filters. + In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected. * * @param resourceGroupName The Resource Group name. * @param workspaceName The Log Analytics Workspace name. @@ -585,6 +314,7 @@ public WorkspacePurgeResponseInner call(ServiceResponseWithHeaders deleteGatewaysDelegate(Response resp .build(response); } + /** + * Gets the available service tiers for the workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<AvailableServiceTierInner> object if successful. + */ + public List availableServiceTiers(String resourceGroupName, String workspaceName) { + return availableServiceTiersWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets the available service tiers for the workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> availableServiceTiersAsync(String resourceGroupName, String workspaceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(availableServiceTiersWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets the available service tiers for the workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AvailableServiceTierInner> object + */ + public Observable> availableServiceTiersAsync(String resourceGroupName, String workspaceName) { + return availableServiceTiersWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the available service tiers for the workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AvailableServiceTierInner> object + */ + public Observable>> availableServiceTiersWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.availableServiceTiers(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = availableServiceTiersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> availableServiceTiersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + }