Skip to content

Commit

Permalink
[Storage] Upgrade to 14.1.0 with latest swagger (#8876)
Browse files Browse the repository at this point in the history
  • Loading branch information
blueww authored and isra-fel committed Nov 25, 2019
1 parent ff1a029 commit 0c095ad
Show file tree
Hide file tree
Showing 34 changed files with 1,665 additions and 612 deletions.
6 changes: 3 additions & 3 deletions eng/mgmt/mgmtmetadata/storage_resource-manager.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Commencing code generation
Generating CSharp code
Executing AutoRest command
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/storage/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp.output-folder=C:\code\srpsdk\sdk\storage\Microsoft.Azure.Management.Storage\src\Generated
2019-10-22 03:30:43 UTC
2019-11-22 07:15:56 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: 5265b9205331da0a55f2d17eb6b436b7d67d1f09
Commit: ef5bff591188a232471a8f81d7bc02c7c9f7d68d
AutoRest information
Requested version: latest
Bootstrapper version: autorest@2.0.4283
Bootstrapper version: autorest@2.0.4407
6 changes: 6 additions & 0 deletions sdk/storage/Microsoft.Azure.Management.Storage/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## Microsoft.Azure.Management.Storage release notes

### Changes in 14.1.0

- Change the maximum limitation for share size from 5120(GB) too 100000(GB)
- Add Sku to Blob Service Properties
- Support Share Delete Retention Policy on File Service Properties

### Changes in 14.0.0

- StorageAccounts.GetProperties() will also return PrivateEndpointConnections of the Stroage account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ internal FileServicesOperations(StorageManagementClient client)
/// the request body, all CORS rules will be deleted, and CORS will be disabled
/// for the File service.
/// </param>
/// <param name='shareDeleteRetentionPolicy'>
/// The file service properties for share soft delete.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
Expand All @@ -329,7 +332,7 @@ internal FileServicesOperations(StorageManagementClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<FileServiceProperties>> SetServicePropertiesWithHttpMessagesAsync(string resourceGroupName, string accountName, CorsRules cors = default(CorsRules), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse<FileServiceProperties>> SetServicePropertiesWithHttpMessagesAsync(string resourceGroupName, string accountName, CorsRules cors = default(CorsRules), DeleteRetentionPolicy shareDeleteRetentionPolicy = default(DeleteRetentionPolicy), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
Expand Down Expand Up @@ -387,11 +390,16 @@ internal FileServicesOperations(StorageManagementClient client)
throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (shareDeleteRetentionPolicy != null)
{
shareDeleteRetentionPolicy.Validate();
}
string fileServicesName = "default";
FileServiceProperties parameters = new FileServiceProperties();
if (cors != null)
if (cors != null || shareDeleteRetentionPolicy != null)
{
parameters.Cors = cors;
parameters.ShareDeleteRetentionPolicy = shareDeleteRetentionPolicy;
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,12 @@ public static FileServiceItems List(this IFileServicesOperations operations, str
/// the request body, all CORS rules will be deleted, and CORS will be disabled
/// for the File service.
/// </param>
public static FileServiceProperties SetServiceProperties(this IFileServicesOperations operations, string resourceGroupName, string accountName, CorsRules cors = default(CorsRules))
/// <param name='shareDeleteRetentionPolicy'>
/// The file service properties for share soft delete.
/// </param>
public static FileServiceProperties SetServiceProperties(this IFileServicesOperations operations, string resourceGroupName, string accountName, CorsRules cors = default(CorsRules), DeleteRetentionPolicy shareDeleteRetentionPolicy = default(DeleteRetentionPolicy))
{
return operations.SetServicePropertiesAsync(resourceGroupName, accountName, cors).GetAwaiter().GetResult();
return operations.SetServicePropertiesAsync(resourceGroupName, accountName, cors, shareDeleteRetentionPolicy).GetAwaiter().GetResult();
}

/// <summary>
Expand All @@ -116,12 +119,15 @@ public static FileServiceItems List(this IFileServicesOperations operations, str
/// the request body, all CORS rules will be deleted, and CORS will be disabled
/// for the File service.
/// </param>
/// <param name='shareDeleteRetentionPolicy'>
/// The file service properties for share soft delete.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<FileServiceProperties> SetServicePropertiesAsync(this IFileServicesOperations operations, string resourceGroupName, string accountName, CorsRules cors = default(CorsRules), CancellationToken cancellationToken = default(CancellationToken))
public static async Task<FileServiceProperties> SetServicePropertiesAsync(this IFileServicesOperations operations, string resourceGroupName, string accountName, CorsRules cors = default(CorsRules), DeleteRetentionPolicy shareDeleteRetentionPolicy = default(DeleteRetentionPolicy), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.SetServicePropertiesWithHttpMessagesAsync(resourceGroupName, accountName, cors, null, cancellationToken).ConfigureAwait(false))
using (var _result = await operations.SetServicePropertiesWithHttpMessagesAsync(resourceGroupName, accountName, cors, shareDeleteRetentionPolicy, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ internal FileSharesOperations(StorageManagementClient client)
/// </param>
/// <param name='shareQuota'>
/// The maximum size of the share, in gigabytes. Must be greater than 0, and
/// less than or equal to 5TB (5120).
/// less than or equal to 5TB (5120). For Large File Shares, the maximum size
/// is 100000.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
Expand Down Expand Up @@ -428,9 +429,9 @@ internal FileSharesOperations(StorageManagementClient client)
throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (shareQuota > 5120)
if (shareQuota > 100000)
{
throw new ValidationException(ValidationRules.InclusiveMaximum, "shareQuota", 5120);
throw new ValidationException(ValidationRules.InclusiveMaximum, "shareQuota", 100000);
}
if (shareQuota < 1)
{
Expand Down Expand Up @@ -642,7 +643,8 @@ internal FileSharesOperations(StorageManagementClient client)
/// </param>
/// <param name='shareQuota'>
/// The maximum size of the share, in gigabytes. Must be greater than 0, and
/// less than or equal to 5TB (5120).
/// less than or equal to 5TB (5120). For Large File Shares, the maximum size
/// is 100000.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
Expand Down Expand Up @@ -738,9 +740,9 @@ internal FileSharesOperations(StorageManagementClient client)
throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (shareQuota > 5120)
if (shareQuota > 100000)
{
throw new ValidationException(ValidationRules.InclusiveMaximum, "shareQuota", 5120);
throw new ValidationException(ValidationRules.InclusiveMaximum, "shareQuota", 100000);
}
if (shareQuota < 1)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ public static partial class FileSharesOperationsExtensions
/// </param>
/// <param name='shareQuota'>
/// The maximum size of the share, in gigabytes. Must be greater than 0, and
/// less than or equal to 5TB (5120).
/// less than or equal to 5TB (5120). For Large File Shares, the maximum size
/// is 100000.
/// </param>
public static FileShare Create(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName, IDictionary<string, string> metadata = default(IDictionary<string, string>), int? shareQuota = default(int?))
{
Expand Down Expand Up @@ -148,7 +149,8 @@ public static partial class FileSharesOperationsExtensions
/// </param>
/// <param name='shareQuota'>
/// The maximum size of the share, in gigabytes. Must be greater than 0, and
/// less than or equal to 5TB (5120).
/// less than or equal to 5TB (5120). For Large File Shares, the maximum size
/// is 100000.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
Expand Down Expand Up @@ -189,7 +191,8 @@ public static partial class FileSharesOperationsExtensions
/// </param>
/// <param name='shareQuota'>
/// The maximum size of the share, in gigabytes. Must be greater than 0, and
/// less than or equal to 5TB (5120).
/// less than or equal to 5TB (5120). For Large File Shares, the maximum size
/// is 100000.
/// </param>
public static FileShare Update(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName, IDictionary<string, string> metadata = default(IDictionary<string, string>), int? shareQuota = default(int?))
{
Expand Down Expand Up @@ -224,7 +227,8 @@ public static partial class FileSharesOperationsExtensions
/// </param>
/// <param name='shareQuota'>
/// The maximum size of the share, in gigabytes. Must be greater than 0, and
/// less than or equal to 5TB (5120).
/// less than or equal to 5TB (5120). For Large File Shares, the maximum size
/// is 100000.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ public partial interface IFileServicesOperations
/// included in the request body, all CORS rules will be deleted, and
/// CORS will be disabled for the File service.
/// </param>
/// <param name='shareDeleteRetentionPolicy'>
/// The file service properties for share soft delete.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
Expand All @@ -85,7 +88,7 @@ public partial interface IFileServicesOperations
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<FileServiceProperties>> SetServicePropertiesWithHttpMessagesAsync(string resourceGroupName, string accountName, CorsRules cors = default(CorsRules), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse<FileServiceProperties>> SetServicePropertiesWithHttpMessagesAsync(string resourceGroupName, string accountName, CorsRules cors = default(CorsRules), DeleteRetentionPolicy shareDeleteRetentionPolicy = default(DeleteRetentionPolicy), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Gets the properties of file services in storage accounts, including
/// CORS (Cross-Origin Resource Sharing) rules.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public partial interface IFileSharesOperations
/// </param>
/// <param name='shareQuota'>
/// The maximum size of the share, in gigabytes. Must be greater than
/// 0, and less than or equal to 5TB (5120).
/// 0, and less than or equal to 5TB (5120). For Large File Shares, the
/// maximum size is 100000.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
Expand Down Expand Up @@ -130,7 +131,8 @@ public partial interface IFileSharesOperations
/// </param>
/// <param name='shareQuota'>
/// The maximum size of the share, in gigabytes. Must be greater than
/// 0, and less than or equal to 5TB (5120).
/// 0, and less than or equal to 5TB (5120). For Large File Shares, the
/// maximum size is 100000.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ public partial interface ISkusOperations
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<IEnumerable<Sku>>> ListWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse<IEnumerable<SkuInformation>>> ListWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,21 @@ public BlobServiceProperties()
/// incoming request’s version is not specified. Possible values
/// include version 2008-10-27 and all more recent versions.</param>
/// <param name="deleteRetentionPolicy">The blob service properties for
/// soft delete.</param>
/// blob soft delete.</param>
/// <param name="automaticSnapshotPolicyEnabled">Automatic Snapshot is
/// enabled if set to true.</param>
/// <param name="changeFeed">The blob service properties for change
/// feed events.</param>
public BlobServiceProperties(string id = default(string), string name = default(string), string type = default(string), CorsRules cors = default(CorsRules), string defaultServiceVersion = default(string), DeleteRetentionPolicy deleteRetentionPolicy = default(DeleteRetentionPolicy), bool? automaticSnapshotPolicyEnabled = default(bool?), ChangeFeed changeFeed = default(ChangeFeed))
/// <param name="sku">Sku name and tier.</param>
public BlobServiceProperties(string id = default(string), string name = default(string), string type = default(string), CorsRules cors = default(CorsRules), string defaultServiceVersion = default(string), DeleteRetentionPolicy deleteRetentionPolicy = default(DeleteRetentionPolicy), bool? automaticSnapshotPolicyEnabled = default(bool?), ChangeFeed changeFeed = default(ChangeFeed), Sku sku = default(Sku))
: base(id, name, type)
{
Cors = cors;
DefaultServiceVersion = defaultServiceVersion;
DeleteRetentionPolicy = deleteRetentionPolicy;
AutomaticSnapshotPolicyEnabled = automaticSnapshotPolicyEnabled;
ChangeFeed = changeFeed;
Sku = sku;
CustomInit();
}

Expand Down Expand Up @@ -88,7 +90,7 @@ public BlobServiceProperties()
public string DefaultServiceVersion { get; set; }

/// <summary>
/// Gets or sets the blob service properties for soft delete.
/// Gets or sets the blob service properties for blob soft delete.
/// </summary>
[JsonProperty(PropertyName = "properties.deleteRetentionPolicy")]
public DeleteRetentionPolicy DeleteRetentionPolicy { get; set; }
Expand All @@ -105,6 +107,12 @@ public BlobServiceProperties()
[JsonProperty(PropertyName = "properties.changeFeed")]
public ChangeFeed ChangeFeed { get; set; }

/// <summary>
/// Gets sku name and tier.
/// </summary>
[JsonProperty(PropertyName = "sku")]
public Sku Sku { get; private set; }

/// <summary>
/// Validate the object.
/// </summary>
Expand All @@ -117,6 +125,10 @@ public virtual void Validate()
{
DeleteRetentionPolicy.Validate();
}
if (Sku != null)
{
Sku.Validate();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.Azure.Management.Storage.Models
using System.Linq;

/// <summary>
/// The blob service properties for soft delete.
/// The service properties for soft delete.
/// </summary>
public partial class DeleteRetentionPolicy
{
Expand All @@ -31,9 +31,9 @@ public DeleteRetentionPolicy()
/// Initializes a new instance of the DeleteRetentionPolicy class.
/// </summary>
/// <param name="enabled">Indicates whether DeleteRetentionPolicy is
/// enabled for the Blob service.</param>
/// enabled.</param>
/// <param name="days">Indicates the number of days that the deleted
/// blob should be retained. The minimum specified value can be 1 and
/// item should be retained. The minimum specified value can be 1 and
/// the maximum value can be 365.</param>
public DeleteRetentionPolicy(bool? enabled = default(bool?), int? days = default(int?))
{
Expand All @@ -48,14 +48,13 @@ public DeleteRetentionPolicy()
partial void CustomInit();

/// <summary>
/// Gets or sets indicates whether DeleteRetentionPolicy is enabled for
/// the Blob service.
/// Gets or sets indicates whether DeleteRetentionPolicy is enabled.
/// </summary>
[JsonProperty(PropertyName = "enabled")]
public bool? Enabled { get; set; }

/// <summary>
/// Gets or sets indicates the number of days that the deleted blob
/// Gets or sets indicates the number of days that the deleted item
/// should be retained. The minimum specified value can be 1 and the
/// maximum value can be 365.
/// </summary>
Expand Down
Loading

0 comments on commit 0c095ad

Please sign in to comment.