Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/**
* 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.storage.v2018_07_01;

import org.joda.time.DateTime;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Statistics related to replication for storage account's Blob, Table, Queue
* and File services. It is only available when geo-redundant replication is
* enabled for the storage account.
*/
public class GeoReplicationStats {
/**
* The status of the secondary location. Possible values are: - Live:
* Indicates that the secondary location is active and operational. -
* Bootstrap: Indicates initial synchronization from the primary location
* to the secondary location is in progress.This typically occurs when
* replication is first enabled. - Unavailable: Indicates that the
* secondary location is temporarily unavailable. Possible values include:
* 'Live', 'Bootstrap', 'Unavailable'.
*/
@JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
private GeoReplicationStatus status;

/**
* All primary writes preceding this UTC date/time value are guaranteed to
* be available for read operations. Primary writes following this point in
* time may or may not be available for reads. Element may be default value
* if value of LastSyncTime is not available, this can happen if secondary
* is offline or we are in bootstrap.
*/
@JsonProperty(value = "lastSyncTime", access = JsonProperty.Access.WRITE_ONLY)
private DateTime lastSyncTime;

/**
* A boolean flag which indicates whether or not account failover is
* supported for the account.
*/
@JsonProperty(value = "canFailover", access = JsonProperty.Access.WRITE_ONLY)
private Boolean canFailover;

/**
* Get the status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location is temporarily unavailable. Possible values include: 'Live', 'Bootstrap', 'Unavailable'.
*
* @return the status value
*/
public GeoReplicationStatus status() {
return this.status;
}

/**
* Get all primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime is not available, this can happen if secondary is offline or we are in bootstrap.
*
* @return the lastSyncTime value
*/
public DateTime lastSyncTime() {
return this.lastSyncTime;
}

/**
* Get a boolean flag which indicates whether or not account failover is supported for the account.
*
* @return the canFailover value
*/
public Boolean canFailover() {
return this.canFailover;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* 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.storage.v2018_07_01;

import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;

/**
* Defines values for GeoReplicationStatus.
*/
public final class GeoReplicationStatus extends ExpandableStringEnum<GeoReplicationStatus> {
/** Static value Live for GeoReplicationStatus. */
public static final GeoReplicationStatus LIVE = fromString("Live");

/** Static value Bootstrap for GeoReplicationStatus. */
public static final GeoReplicationStatus BOOTSTRAP = fromString("Bootstrap");

/** Static value Unavailable for GeoReplicationStatus. */
public static final GeoReplicationStatus UNAVAILABLE = fromString("Unavailable");

/**
* Creates or finds a GeoReplicationStatus from its string representation.
* @param name a name to look for
* @return the corresponding GeoReplicationStatus
*/
@JsonCreator
public static GeoReplicationStatus fromString(String name) {
return fromString(name, GeoReplicationStatus.class);
}

/**
* @return known GeoReplicationStatus values
*/
public static Collection<GeoReplicationStatus> values() {
return values(GeoReplicationStatus.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public interface StorageAccount extends HasInner<StorageAccountInner>, Resource,
*/
Boolean failoverInProgress();

/**
* @return the geoReplicationStats value.
*/
GeoReplicationStats geoReplicationStats();

/**
* @return the identity value.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/**
* 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.storage.v2018_07_01;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
* Defines values for StorageAccountExpand.
*/
public enum StorageAccountExpand {
/** Enum value geoReplicationStats. */
GEO_REPLICATION_STATS("geoReplicationStats");

/** The actual serialized value for a StorageAccountExpand instance. */
private String value;

StorageAccountExpand(String value) {
this.value = value;
}

/**
* Parses a serialized value to a StorageAccountExpand instance.
*
* @param value the serialized value to parse.
* @return the parsed StorageAccountExpand object, or null if unable to parse.
*/
@JsonCreator
public static StorageAccountExpand fromString(String value) {
StorageAccountExpand[] items = StorageAccountExpand.values();
for (StorageAccountExpand item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
}

@JsonValue
@Override
public String toString() {
return this.value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.joda.time.DateTime;
import com.microsoft.azure.management.storage.v2018_07_01.CustomDomain;
import com.microsoft.azure.management.storage.v2018_07_01.Encryption;
import com.microsoft.azure.management.storage.v2018_07_01.GeoReplicationStats;
import com.microsoft.azure.management.storage.v2018_07_01.Identity;
import com.microsoft.azure.management.storage.v2018_07_01.Kind;
import com.microsoft.azure.management.storage.v2018_07_01.NetworkRuleSet;
Expand Down Expand Up @@ -116,6 +117,11 @@ public Boolean failoverInProgress() {
return this.inner().failoverInProgress();
}

@Override
public GeoReplicationStats geoReplicationStats() {
return this.inner().geoReplicationStats();
}

@Override
public Identity identity() {
return this.inner().identity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.microsoft.azure.management.storage.v2018_07_01.Encryption;
import com.microsoft.azure.management.storage.v2018_07_01.AccessTier;
import com.microsoft.azure.management.storage.v2018_07_01.NetworkRuleSet;
import com.microsoft.azure.management.storage.v2018_07_01.GeoReplicationStats;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.rest.serializer.JsonFlatten;
import com.microsoft.azure.Resource;
Expand Down Expand Up @@ -160,6 +161,12 @@ public class StorageAccountInner extends Resource {
@JsonProperty(value = "properties.isHnsEnabled")
private Boolean isHnsEnabled;

/**
* Geo Replication Stats.
*/
@JsonProperty(value = "properties.geoReplicationStats", access = JsonProperty.Access.WRITE_ONLY)
private GeoReplicationStats geoReplicationStats;

/**
* If the failover is in progress, the value will be true, otherwise, it
* will be null.
Expand Down Expand Up @@ -382,6 +389,15 @@ public StorageAccountInner withIsHnsEnabled(Boolean isHnsEnabled) {
return this;
}

/**
* Get geo Replication Stats.
*
* @return the geoReplicationStats value
*/
public GeoReplicationStats geoReplicationStats() {
return this.geoReplicationStats;
}

/**
* Get if the failover is in progress, the value will be true, otherwise, it will be null.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.microsoft.azure.management.storage.v2018_07_01.ServiceSasParameters;
import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountCheckNameAvailabilityParameters;
import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountCreateParameters;
import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountExpand;
import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountRegenerateKeyParameters;
import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountUpdateParameters;
import com.microsoft.azure.Page;
Expand Down Expand Up @@ -87,7 +88,7 @@ interface StorageAccountsService {

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts getByResourceGroup" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}")
Observable<Response<ResponseBody>> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
Observable<Response<ResponseBody>> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") StorageAccountExpand expand, @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.storage.v2018_07_01.StorageAccounts update" })
@PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}")
Expand Down Expand Up @@ -521,7 +522,89 @@ public Observable<ServiceResponse<StorageAccountInner>> getByResourceGroupWithSe
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2018-07-01";
return service.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
final StorageAccountExpand expand = null;
return service.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<StorageAccountInner>>>() {
@Override
public Observable<ServiceResponse<StorageAccountInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<StorageAccountInner> clientResponse = getByResourceGroupDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}

/**
* Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys.
*
* @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
* @param expand May be used to expand the properties within account's properties. By default, data is not included when fecthing properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats'
* @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 StorageAccountInner object if successful.
*/
public StorageAccountInner getByResourceGroup(String resourceGroupName, String accountName, StorageAccountExpand expand) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName, expand).toBlocking().single().body();
}

/**
* Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys.
*
* @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
* @param expand May be used to expand the properties within account's properties. By default, data is not included when fecthing properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats'
* @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<StorageAccountInner> getByResourceGroupAsync(String resourceGroupName, String accountName, StorageAccountExpand expand, final ServiceCallback<StorageAccountInner> serviceCallback) {
return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName, expand), serviceCallback);
}

/**
* Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys.
*
* @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
* @param expand May be used to expand the properties within account's properties. By default, data is not included when fecthing properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats'
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the StorageAccountInner object
*/
public Observable<StorageAccountInner> getByResourceGroupAsync(String resourceGroupName, String accountName, StorageAccountExpand expand) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName, expand).map(new Func1<ServiceResponse<StorageAccountInner>, StorageAccountInner>() {
@Override
public StorageAccountInner call(ServiceResponse<StorageAccountInner> response) {
return response.body();
}
});
}

/**
* Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys.
*
* @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
* @param expand May be used to expand the properties within account's properties. By default, data is not included when fecthing properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats'
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the StorageAccountInner object
*/
public Observable<ServiceResponse<StorageAccountInner>> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountExpand expand) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2018-07-01";
return service.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<StorageAccountInner>>>() {
@Override
public Observable<ServiceResponse<StorageAccountInner>> call(Response<ResponseBody> response) {
Expand Down