diff --git a/sdk/storage/mgmt-v2019_06_01/pom.xml b/sdk/storage/mgmt-v2019_06_01/pom.xml index 3f831c08f482..1ce26f37d839 100644 --- a/sdk/storage/mgmt-v2019_06_01/pom.xml +++ b/sdk/storage/mgmt-v2019_06_01/pom.xml @@ -11,11 +11,11 @@ com.microsoft.azure azure-arm-parent - 1.2.0 + 1.1.0 ../../../pom.management.xml azure-mgmt-storage - 1.0.0-beta-2 + 1.0.0-beta jar Microsoft Azure SDK for Storage Management This package contains Microsoft Storage Management SDK. diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreParameters.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreParameters.java new file mode 100644 index 000000000000..9908a3552e18 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreParameters.java @@ -0,0 +1,71 @@ +/** + * 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.v2019_06_01; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Blob restore parameters. + */ +public class BlobRestoreParameters { + /** + * Restore blob to the specified time. + */ + @JsonProperty(value = "timeToRestore", required = true) + private DateTime timeToRestore; + + /** + * Blob ranges to restore. + */ + @JsonProperty(value = "blobRanges", required = true) + private List blobRanges; + + /** + * Get restore blob to the specified time. + * + * @return the timeToRestore value + */ + public DateTime timeToRestore() { + return this.timeToRestore; + } + + /** + * Set restore blob to the specified time. + * + * @param timeToRestore the timeToRestore value to set + * @return the BlobRestoreParameters object itself. + */ + public BlobRestoreParameters withTimeToRestore(DateTime timeToRestore) { + this.timeToRestore = timeToRestore; + return this; + } + + /** + * Get blob ranges to restore. + * + * @return the blobRanges value + */ + public List blobRanges() { + return this.blobRanges; + } + + /** + * Set blob ranges to restore. + * + * @param blobRanges the blobRanges value to set + * @return the BlobRestoreParameters object itself. + */ + public BlobRestoreParameters withBlobRanges(List blobRanges) { + this.blobRanges = blobRanges; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreProgressStatus.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreProgressStatus.java new file mode 100644 index 000000000000..20dd148cca51 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreProgressStatus.java @@ -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.v2019_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BlobRestoreProgressStatus. + */ +public final class BlobRestoreProgressStatus extends ExpandableStringEnum { + /** Static value InProgress for BlobRestoreProgressStatus. */ + public static final BlobRestoreProgressStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Complete for BlobRestoreProgressStatus. */ + public static final BlobRestoreProgressStatus COMPLETE = fromString("Complete"); + + /** Static value Failed for BlobRestoreProgressStatus. */ + public static final BlobRestoreProgressStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a BlobRestoreProgressStatus from its string representation. + * @param name a name to look for + * @return the corresponding BlobRestoreProgressStatus + */ + @JsonCreator + public static BlobRestoreProgressStatus fromString(String name) { + return fromString(name, BlobRestoreProgressStatus.class); + } + + /** + * @return known BlobRestoreProgressStatus values + */ + public static Collection values() { + return values(BlobRestoreProgressStatus.class); + } +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreRange.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreRange.java new file mode 100644 index 000000000000..1569b651a761 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreRange.java @@ -0,0 +1,69 @@ +/** + * 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.v2019_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Blob range. + */ +public class BlobRestoreRange { + /** + * Blob start range. Empty means account start. + */ + @JsonProperty(value = "startRange", required = true) + private String startRange; + + /** + * Blob end range. Empty means account end. + */ + @JsonProperty(value = "endRange", required = true) + private String endRange; + + /** + * Get blob start range. Empty means account start. + * + * @return the startRange value + */ + public String startRange() { + return this.startRange; + } + + /** + * Set blob start range. Empty means account start. + * + * @param startRange the startRange value to set + * @return the BlobRestoreRange object itself. + */ + public BlobRestoreRange withStartRange(String startRange) { + this.startRange = startRange; + return this; + } + + /** + * Get blob end range. Empty means account end. + * + * @return the endRange value + */ + public String endRange() { + return this.endRange; + } + + /** + * Set blob end range. Empty means account end. + * + * @param endRange the endRange value to set + * @return the BlobRestoreRange object itself. + */ + public BlobRestoreRange withEndRange(String endRange) { + this.endRange = endRange; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreStatus.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreStatus.java new file mode 100644 index 000000000000..6f0d56f2b46e --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreStatus.java @@ -0,0 +1,40 @@ +/** + * 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.v2019_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.BlobRestoreStatusInner; + +/** + * Type representing BlobRestoreStatus. + */ +public interface BlobRestoreStatus extends HasInner, HasManager { + /** + * @return the failureReason value. + */ + String failureReason(); + + /** + * @return the parameters value. + */ + BlobRestoreParameters parameters(); + + /** + * @return the restoreId value. + */ + String restoreId(); + + /** + * @return the status value. + */ + BlobRestoreProgressStatus status(); + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobServiceProperties.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobServiceProperties.java index a17747a01972..70ca25de06b3 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobServiceProperties.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobServiceProperties.java @@ -17,7 +17,6 @@ import com.microsoft.azure.arm.model.Creatable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageManager; -import com.microsoft.azure.management.storage.v2019_06_01.implementation.SkuInner; /** * Type representing BlobServiceProperties. @@ -58,6 +57,11 @@ public interface BlobServiceProperties extends HasInner, DefinitionStages.WithAutomaticSnapshotPolicyEnabled, DefinitionStages.WithChangeFeed, DefinitionStages.WithCors, DefinitionStages.WithDefaultServiceVersion, DefinitionStages.WithDeleteRetentionPolicy { + interface WithCreate extends Creatable, DefinitionStages.WithAutomaticSnapshotPolicyEnabled, DefinitionStages.WithChangeFeed, DefinitionStages.WithCors, DefinitionStages.WithDefaultServiceVersion, DefinitionStages.WithDeleteRetentionPolicy, DefinitionStages.WithRestorePolicy { } } /** * The template for a BlobServiceProperties update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithAutomaticSnapshotPolicyEnabled, UpdateStages.WithChangeFeed, UpdateStages.WithCors, UpdateStages.WithDefaultServiceVersion, UpdateStages.WithDeleteRetentionPolicy { + interface Update extends Appliable, UpdateStages.WithAutomaticSnapshotPolicyEnabled, UpdateStages.WithChangeFeed, UpdateStages.WithCors, UpdateStages.WithDefaultServiceVersion, UpdateStages.WithDeleteRetentionPolicy, UpdateStages.WithRestorePolicy { } /** @@ -235,5 +251,17 @@ interface WithDeleteRetentionPolicy { Update withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy); } + /** + * The stage of the blobserviceproperties update allowing to specify RestorePolicy. + */ + interface WithRestorePolicy { + /** + * Specifies restorePolicy. + * @param restorePolicy The blob service properties for blob restore policy + * @return the next update stage + */ + Update withRestorePolicy(RestorePolicyProperties restorePolicy); + } + } } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileServiceProperties.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileServiceProperties.java index 468c2d586e70..8bd2a2d90470 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileServiceProperties.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileServiceProperties.java @@ -17,7 +17,6 @@ import com.microsoft.azure.arm.model.Creatable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageManager; -import com.microsoft.azure.management.storage.v2019_06_01.implementation.SkuInner; import java.util.List; /** diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/RestorePolicyProperties.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/RestorePolicyProperties.java new file mode 100644 index 000000000000..4c8f0cb6e149 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/RestorePolicyProperties.java @@ -0,0 +1,70 @@ +/** + * 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.v2019_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The blob service properties for blob restore policy. + */ +public class RestorePolicyProperties { + /** + * Blob restore is enabled if set to true. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * how long this blob can be restored. It should be great than zero and + * less than DeleteRetentionPolicy.days. + */ + @JsonProperty(value = "days") + private Integer days; + + /** + * Get blob restore is enabled if set to true. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set blob restore is enabled if set to true. + * + * @param enabled the enabled value to set + * @return the RestorePolicyProperties object itself. + */ + public RestorePolicyProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. + * + * @return the days value + */ + public Integer days() { + return this.days; + } + + /** + * Set how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. + * + * @param days the days value to set + * @return the RestorePolicyProperties object itself. + */ + public RestorePolicyProperties withDays(Integer days) { + this.days = days; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccount.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccount.java index f267ead85fef..51c2cbdb5b3b 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccount.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccount.java @@ -37,6 +37,11 @@ public interface StorageAccount extends HasInner, Resource, */ AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication(); + /** + * @return the blobRestoreStatus value. + */ + BlobRestoreStatus blobRestoreStatus(); + /** * @return the creationTime value. */ diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountExpand.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountExpand.java index 67e8dfb26e37..e658122256a8 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountExpand.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountExpand.java @@ -16,7 +16,10 @@ */ public enum StorageAccountExpand { /** Enum value geoReplicationStats. */ - GEO_REPLICATION_STATS("geoReplicationStats"); + GEO_REPLICATION_STATS("geoReplicationStats"), + + /** Enum value blobRestoreStatus. */ + BLOB_RESTORE_STATUS("blobRestoreStatus"); /** The actual serialized value for a StorageAccountExpand instance. */ private String value; diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccounts.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccounts.java index c60ca1c8a4ee..886bf0fc5166 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccounts.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccounts.java @@ -16,6 +16,8 @@ import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; import com.microsoft.azure.arm.collection.SupportsListing; import rx.Completable; +import org.joda.time.DateTime; +import java.util.List; import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageAccountsInner; import com.microsoft.azure.arm.model.HasInner; @@ -76,6 +78,18 @@ public interface StorageAccounts extends SupportsCreating restoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges); + /** * Revoke user delegation keys. * diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobRestoreStatusImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobRestoreStatusImpl.java new file mode 100644 index 000000000000..b2c69ef4b581 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobRestoreStatusImpl.java @@ -0,0 +1,48 @@ +/** + * 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.v2019_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreParameters; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreProgressStatus; + +class BlobRestoreStatusImpl extends WrapperImpl implements BlobRestoreStatus { + private final StorageManager manager; + BlobRestoreStatusImpl(BlobRestoreStatusInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String failureReason() { + return this.inner().failureReason(); + } + + @Override + public BlobRestoreParameters parameters() { + return this.inner().parameters(); + } + + @Override + public String restoreId() { + return this.inner().restoreId(); + } + + @Override + public BlobRestoreProgressStatus status() { + return this.inner().status(); + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobRestoreStatusInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobRestoreStatusInner.java new file mode 100644 index 000000000000..9a6fb7113920 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobRestoreStatusInner.java @@ -0,0 +1,83 @@ +/** + * 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.v2019_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreProgressStatus; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Blob restore status. + */ +public class BlobRestoreStatusInner { + /** + * The status of blob restore progress. Possible values are: - InProgress: + * Indicates that blob restore is ongoing. - Complete: Indicates that blob + * restore has been completed successfully. - Failed: Indicates that blob + * restore is failed. Possible values include: 'InProgress', 'Complete', + * 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private BlobRestoreProgressStatus status; + + /** + * Failure reason when blob restore is failed. + */ + @JsonProperty(value = "failureReason", access = JsonProperty.Access.WRITE_ONLY) + private String failureReason; + + /** + * Id for tracking blob restore request. + */ + @JsonProperty(value = "restoreId", access = JsonProperty.Access.WRITE_ONLY) + private String restoreId; + + /** + * Blob restore request parameters. + */ + @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) + private BlobRestoreParameters parameters; + + /** + * Get the status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed. Possible values include: 'InProgress', 'Complete', 'Failed'. + * + * @return the status value + */ + public BlobRestoreProgressStatus status() { + return this.status; + } + + /** + * Get failure reason when blob restore is failed. + * + * @return the failureReason value + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Get id for tracking blob restore request. + * + * @return the restoreId value + */ + public String restoreId() { + return this.restoreId; + } + + /** + * Get blob restore request parameters. + * + * @return the parameters value + */ + public BlobRestoreParameters parameters() { + return this.parameters; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesImpl.java index 0526306ae443..57884a6967a0 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesImpl.java @@ -14,6 +14,7 @@ import com.microsoft.azure.management.storage.v2019_06_01.CorsRules; import com.microsoft.azure.management.storage.v2019_06_01.DeleteRetentionPolicy; import com.microsoft.azure.management.storage.v2019_06_01.ChangeFeed; +import com.microsoft.azure.management.storage.v2019_06_01.RestorePolicyProperties; class BlobServicePropertiesImpl extends CreatableUpdatableImpl implements BlobServiceProperties, BlobServiceProperties.Definition, BlobServiceProperties.Update { private final StorageManager manager; @@ -105,6 +106,11 @@ public String name() { return this.inner().name(); } + @Override + public RestorePolicyProperties restorePolicy() { + return this.inner().restorePolicy(); + } + @Override public SkuInner sku() { return this.inner().sku(); @@ -152,4 +158,10 @@ public BlobServicePropertiesImpl withDeleteRetentionPolicy(DeleteRetentionPolicy return this; } + @Override + public BlobServicePropertiesImpl withRestorePolicy(RestorePolicyProperties restorePolicy) { + this.inner().withRestorePolicy(restorePolicy); + return this; + } + } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesInner.java index 44d7a9080569..4a55fb90ecc8 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesInner.java @@ -11,6 +11,7 @@ import com.microsoft.azure.management.storage.v2019_06_01.CorsRules; import com.microsoft.azure.management.storage.v2019_06_01.DeleteRetentionPolicy; import com.microsoft.azure.management.storage.v2019_06_01.ChangeFeed; +import com.microsoft.azure.management.storage.v2019_06_01.RestorePolicyProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.ProxyResource; @@ -55,6 +56,12 @@ public class BlobServicePropertiesInner extends ProxyResource { @JsonProperty(value = "properties.changeFeed") private ChangeFeed changeFeed; + /** + * The blob service properties for blob restore policy. + */ + @JsonProperty(value = "properties.restorePolicy") + private RestorePolicyProperties restorePolicy; + /** * Sku name and tier. */ @@ -161,6 +168,26 @@ public BlobServicePropertiesInner withChangeFeed(ChangeFeed changeFeed) { return this; } + /** + * Get the blob service properties for blob restore policy. + * + * @return the restorePolicy value + */ + public RestorePolicyProperties restorePolicy() { + return this.restorePolicy; + } + + /** + * Set the blob service properties for blob restore policy. + * + * @param restorePolicy the restorePolicy value to set + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withRestorePolicy(RestorePolicyProperties restorePolicy) { + this.restorePolicy = restorePolicy; + return this; + } + /** * Get sku name and tier. * diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountImpl.java index 00dd985713b2..985236d8be2c 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountImpl.java @@ -15,6 +15,7 @@ import com.microsoft.azure.management.storage.v2019_06_01.StorageAccountCreateParameters; import com.microsoft.azure.management.storage.v2019_06_01.AccessTier; import com.microsoft.azure.management.storage.v2019_06_01.AzureFilesIdentityBasedAuthentication; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreStatus; import org.joda.time.DateTime; import com.microsoft.azure.management.storage.v2019_06_01.CustomDomain; import com.microsoft.azure.management.storage.v2019_06_01.Encryption; @@ -97,6 +98,16 @@ public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthenticati return this.inner().azureFilesIdentityBasedAuthentication(); } + @Override + public BlobRestoreStatus blobRestoreStatus() { + BlobRestoreStatusInner inner = this.inner().blobRestoreStatus(); + if (inner != null) { + return new BlobRestoreStatusImpl(inner, manager()); + } else { + return null; + } + } + @Override public DateTime creationTime() { return this.inner().creationTime(); diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountInner.java index d043744a2032..b56f7d38739b 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountInner.java @@ -199,6 +199,12 @@ public class StorageAccountInner extends Resource { @JsonProperty(value = "properties.routingPreference") private RoutingPreference routingPreference; + /** + * Blob restore status. + */ + @JsonProperty(value = "properties.blobRestoreStatus", access = JsonProperty.Access.WRITE_ONLY) + private BlobRestoreStatusInner blobRestoreStatus; + /** * Get gets the SKU. * @@ -481,4 +487,13 @@ public StorageAccountInner withRoutingPreference(RoutingPreference routingPrefer return this; } + /** + * Get blob restore status. + * + * @return the blobRestoreStatus value + */ + public BlobRestoreStatusInner blobRestoreStatus() { + return this.blobRestoreStatus; + } + } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsImpl.java index 4a1bc5209367..f4f9ae8130df 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsImpl.java @@ -25,9 +25,13 @@ import com.microsoft.azure.management.storage.v2019_06_01.StorageAccountListKeysResult; import com.microsoft.azure.management.storage.v2019_06_01.ListAccountSasResponse; import com.microsoft.azure.management.storage.v2019_06_01.ListServiceSasResponse; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreStatus; import com.microsoft.azure.management.storage.v2019_06_01.CheckNameAvailabilityResult; import com.microsoft.azure.management.storage.v2019_06_01.AccountSasParameters; import com.microsoft.azure.management.storage.v2019_06_01.ServiceSasParameters; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreRange; class StorageAccountsImpl extends GroupableResourcesCoreImpl implements StorageAccounts { protected StorageAccountsImpl(StorageManager manager) { @@ -185,6 +189,18 @@ public Completable failoverAsync(String resourceGroupName, String accountName) { return client.failoverAsync(resourceGroupName, accountName).toCompletable(); } + @Override + public Observable restoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges) { + StorageAccountsInner client = this.inner(); + return client.restoreBlobRangesAsync(resourceGroupName, accountName, timeToRestore, blobRanges) + .map(new Func1() { + @Override + public BlobRestoreStatus call(BlobRestoreStatusInner inner) { + return new BlobRestoreStatusImpl(inner, manager()); + } + }); + } + @Override public Completable revokeUserDelegationKeysAsync(String resourceGroupName, String accountName) { StorageAccountsInner client = this.inner(); diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsInner.java index 0d7fc6552572..a375750d66cb 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsInner.java @@ -17,6 +17,8 @@ import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.management.storage.v2019_06_01.AccountSasParameters; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreParameters; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreRange; import com.microsoft.azure.management.storage.v2019_06_01.ListKeyExpand; import com.microsoft.azure.management.storage.v2019_06_01.ServiceSasParameters; import com.microsoft.azure.management.storage.v2019_06_01.StorageAccountCheckNameAvailabilityParameters; @@ -33,6 +35,7 @@ import java.io.IOException; import java.util.List; import okhttp3.ResponseBody; +import org.joda.time.DateTime; import retrofit2.http.Body; import retrofit2.http.GET; import retrofit2.http.Header; @@ -132,6 +135,14 @@ interface StorageAccountsService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover") Observable> beginFailover(@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); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.StorageAccounts restoreBlobRanges" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges") + Observable> restoreBlobRanges(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BlobRestoreParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.StorageAccounts beginRestoreBlobRanges" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges") + Observable> beginRestoreBlobRanges(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BlobRestoreParameters parameters, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.StorageAccounts revokeUserDelegationKeys" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys") Observable> revokeUserDelegationKeys(@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); @@ -566,7 +577,7 @@ public Observable> call(Response getByResourceGroupAsync(String resourc * * @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 fetching properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats' + * @param expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. Possible values include: 'geoReplicationStats', 'blobRestoreStatus' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the StorageAccountInner object */ @@ -613,7 +624,7 @@ public StorageAccountInner call(ServiceResponse response) { * * @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 fetching properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats' + * @param expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. Possible values include: 'geoReplicationStats', 'blobRestoreStatus' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the StorageAccountInner object */ @@ -1547,6 +1558,198 @@ private ServiceResponse beginFailoverDelegate(Response respo .build(response); } + /** + * Restore blobs in the specified blob ranges. + * + * @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 timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @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 BlobRestoreStatusInner object if successful. + */ + public BlobRestoreStatusInner restoreBlobRanges(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges) { + return restoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges).toBlocking().last().body(); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @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 timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @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 restoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges), serviceCallback); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @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 timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable restoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges) { + return restoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges).map(new Func1, BlobRestoreStatusInner>() { + @Override + public BlobRestoreStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @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 timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> restoreBlobRangesWithServiceResponseAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges) { + 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (timeToRestore == null) { + throw new IllegalArgumentException("Parameter timeToRestore is required and cannot be null."); + } + if (blobRanges == null) { + throw new IllegalArgumentException("Parameter blobRanges is required and cannot be null."); + } + Validator.validate(blobRanges); + BlobRestoreParameters parameters = new BlobRestoreParameters(); + parameters.withTimeToRestore(timeToRestore); + parameters.withBlobRanges(blobRanges); + Observable> observable = service.restoreBlobRanges(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @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 timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @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 BlobRestoreStatusInner object if successful. + */ + public BlobRestoreStatusInner beginRestoreBlobRanges(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges) { + return beginRestoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges).toBlocking().single().body(); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @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 timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @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 beginRestoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRestoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges), serviceCallback); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @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 timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobRestoreStatusInner object + */ + public Observable beginRestoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges) { + return beginRestoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges).map(new Func1, BlobRestoreStatusInner>() { + @Override + public BlobRestoreStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @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 timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobRestoreStatusInner object + */ + public Observable> beginRestoreBlobRangesWithServiceResponseAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges) { + 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (timeToRestore == null) { + throw new IllegalArgumentException("Parameter timeToRestore is required and cannot be null."); + } + if (blobRanges == null) { + throw new IllegalArgumentException("Parameter blobRanges is required and cannot be null."); + } + Validator.validate(blobRanges); + BlobRestoreParameters parameters = new BlobRestoreParameters(); + parameters.withTimeToRestore(timeToRestore); + parameters.withBlobRanges(blobRanges); + return service.beginRestoreBlobRanges(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRestoreBlobRangesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRestoreBlobRangesDelegate(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); + } + /** * Revoke user delegation keys. *