Skip to content

Commit 821f11b

Browse files
authored
[Storage] Update Storage.Management Track1 SDK code (#20135)
* update track1 sdk per new api version: * update tests
1 parent 97bef66 commit 821f11b

File tree

73 files changed

+2163
-1820
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2163
-1820
lines changed

src/Storage/Storage.Management.Sdk/Generated/EncryptionScopesOperations.cs

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,19 @@ internal EncryptionScopesOperations(StorageManagementClient client)
884884
/// Storage account names must be between 3 and 24 characters in length and use
885885
/// numbers and lower-case letters only.
886886
/// </param>
887+
/// <param name='maxpagesize'>
888+
/// Optional, specifies the maximum number of encryption scopes that will be
889+
/// included in the list response.
890+
/// </param>
891+
/// <param name='filter'>
892+
/// Optional. When specified, only encryption scope names starting with the
893+
/// filter will be listed.
894+
/// </param>
895+
/// <param name='include'>
896+
/// Optional, when specified, will list encryption scopes with the specific
897+
/// state. Defaults to All. Possible values include: 'All', 'Enabled',
898+
/// 'Disabled'
899+
/// </param>
887900
/// <param name='customHeaders'>
888901
/// Headers that will be added to request.
889902
/// </param>
@@ -905,7 +918,7 @@ internal EncryptionScopesOperations(StorageManagementClient client)
905918
/// <return>
906919
/// A response object containing the response body and response headers.
907920
/// </return>
908-
public async Task<AzureOperationResponse<IPage<EncryptionScope>>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
921+
public async Task<AzureOperationResponse<IPage<EncryptionScope>>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, int? maxpagesize = default(int?), string filter = default(string), string include = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
909922
{
910923
if (resourceGroupName == null)
911924
{
@@ -963,6 +976,17 @@ internal EncryptionScopesOperations(StorageManagementClient client)
963976
throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
964977
}
965978
}
979+
if (maxpagesize != null)
980+
{
981+
if (maxpagesize > 5000)
982+
{
983+
throw new ValidationException(ValidationRules.InclusiveMaximum, "maxpagesize", 5000);
984+
}
985+
if (maxpagesize < 1)
986+
{
987+
throw new ValidationException(ValidationRules.InclusiveMinimum, "maxpagesize", 1);
988+
}
989+
}
966990
// Tracing
967991
bool _shouldTrace = ServiceClientTracing.IsEnabled;
968992
string _invocationId = null;
@@ -972,6 +996,9 @@ internal EncryptionScopesOperations(StorageManagementClient client)
972996
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
973997
tracingParameters.Add("resourceGroupName", resourceGroupName);
974998
tracingParameters.Add("accountName", accountName);
999+
tracingParameters.Add("maxpagesize", maxpagesize);
1000+
tracingParameters.Add("filter", filter);
1001+
tracingParameters.Add("include", include);
9751002
tracingParameters.Add("cancellationToken", cancellationToken);
9761003
ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
9771004
}
@@ -986,6 +1013,18 @@ internal EncryptionScopesOperations(StorageManagementClient client)
9861013
{
9871014
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
9881015
}
1016+
if (maxpagesize != null)
1017+
{
1018+
_queryParameters.Add(string.Format("$maxpagesize={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxpagesize, Client.SerializationSettings).Trim('"'))));
1019+
}
1020+
if (filter != null)
1021+
{
1022+
_queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter)));
1023+
}
1024+
if (include != null)
1025+
{
1026+
_queryParameters.Add(string.Format("$include={0}", System.Uri.EscapeDataString(include)));
1027+
}
9891028
if (_queryParameters.Count > 0)
9901029
{
9911030
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);

src/Storage/Storage.Management.Sdk/Generated/EncryptionScopesOperationsExtensions.cs

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,22 @@ public static EncryptionScope Get(this IEncryptionScopesOperations operations, s
231231
/// Storage account names must be between 3 and 24 characters in length and use
232232
/// numbers and lower-case letters only.
233233
/// </param>
234-
public static IPage<EncryptionScope> List(this IEncryptionScopesOperations operations, string resourceGroupName, string accountName)
234+
/// <param name='maxpagesize'>
235+
/// Optional, specifies the maximum number of encryption scopes that will be
236+
/// included in the list response.
237+
/// </param>
238+
/// <param name='filter'>
239+
/// Optional. When specified, only encryption scope names starting with the
240+
/// filter will be listed.
241+
/// </param>
242+
/// <param name='include'>
243+
/// Optional, when specified, will list encryption scopes with the specific
244+
/// state. Defaults to All. Possible values include: 'All', 'Enabled',
245+
/// 'Disabled'
246+
/// </param>
247+
public static IPage<EncryptionScope> List(this IEncryptionScopesOperations operations, string resourceGroupName, string accountName, int? maxpagesize = default(int?), string filter = default(string), string include = default(string))
235248
{
236-
return operations.ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult();
249+
return operations.ListAsync(resourceGroupName, accountName, maxpagesize, filter, include).GetAwaiter().GetResult();
237250
}
238251

239252
/// <summary>
@@ -252,12 +265,25 @@ public static IPage<EncryptionScope> List(this IEncryptionScopesOperations opera
252265
/// Storage account names must be between 3 and 24 characters in length and use
253266
/// numbers and lower-case letters only.
254267
/// </param>
268+
/// <param name='maxpagesize'>
269+
/// Optional, specifies the maximum number of encryption scopes that will be
270+
/// included in the list response.
271+
/// </param>
272+
/// <param name='filter'>
273+
/// Optional. When specified, only encryption scope names starting with the
274+
/// filter will be listed.
275+
/// </param>
276+
/// <param name='include'>
277+
/// Optional, when specified, will list encryption scopes with the specific
278+
/// state. Defaults to All. Possible values include: 'All', 'Enabled',
279+
/// 'Disabled'
280+
/// </param>
255281
/// <param name='cancellationToken'>
256282
/// The cancellation token.
257283
/// </param>
258-
public static async Task<IPage<EncryptionScope>> ListAsync(this IEncryptionScopesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken))
284+
public static async Task<IPage<EncryptionScope>> ListAsync(this IEncryptionScopesOperations operations, string resourceGroupName, string accountName, int? maxpagesize = default(int?), string filter = default(string), string include = default(string), CancellationToken cancellationToken = default(CancellationToken))
259285
{
260-
using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false))
286+
using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, maxpagesize, filter, include, null, cancellationToken).ConfigureAwait(false))
261287
{
262288
return _result.Body;
263289
}

src/Storage/Storage.Management.Sdk/Generated/IEncryptionScopesOperations.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,19 @@ public partial interface IEncryptionScopesOperations
153153
/// group. Storage account names must be between 3 and 24 characters in
154154
/// length and use numbers and lower-case letters only.
155155
/// </param>
156+
/// <param name='maxpagesize'>
157+
/// Optional, specifies the maximum number of encryption scopes that
158+
/// will be included in the list response.
159+
/// </param>
160+
/// <param name='filter'>
161+
/// Optional. When specified, only encryption scope names starting with
162+
/// the filter will be listed.
163+
/// </param>
164+
/// <param name='include'>
165+
/// Optional, when specified, will list encryption scopes with the
166+
/// specific state. Defaults to All. Possible values include: 'All',
167+
/// 'Enabled', 'Disabled'
168+
/// </param>
156169
/// <param name='customHeaders'>
157170
/// The headers that will be added to request.
158171
/// </param>
@@ -168,7 +181,7 @@ public partial interface IEncryptionScopesOperations
168181
/// <exception cref="Microsoft.Rest.ValidationException">
169182
/// Thrown when a required parameter is null
170183
/// </exception>
171-
Task<AzureOperationResponse<IPage<EncryptionScope>>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
184+
Task<AzureOperationResponse<IPage<EncryptionScope>>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, int? maxpagesize = default(int?), string filter = default(string), string include = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
172185
/// <summary>
173186
/// Lists all the encryption scopes available under the specified
174187
/// storage account.

src/Storage/Storage.Management.Sdk/Generated/IStorageAccountsOperations.cs

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -361,10 +361,20 @@ public partial interface IStorageAccountsOperations
361361
/// </exception>
362362
Task<AzureOperationResponse<ListServiceSasResponse>> ListServiceSASWithHttpMessagesAsync(string resourceGroupName, string accountName, ServiceSasParameters parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
363363
/// <summary>
364-
/// Failover request can be triggered for a storage account in case of
365-
/// availability issues. The failover occurs from the storage account's
366-
/// primary cluster to secondary cluster for RA-GRS accounts. The
367-
/// secondary cluster will become primary after failover.
364+
/// A failover request can be triggered for a storage account in the
365+
/// event a primary endpoint becomes unavailable for any reason. The
366+
/// failover occurs from the storage account's primary cluster to the
367+
/// secondary cluster for RA-GRS accounts. The secondary cluster will
368+
/// become primary after failover and the account is converted to LRS.
369+
/// In the case of a Planned Failover, the primary and secondary
370+
/// clusters are swapped after failover and the account remains
371+
/// geo-replicated. Failover should continue to be used in the event of
372+
/// availability issues as Planned failover is only available while the
373+
/// primary and secondary endpoints are available. The primary use case
374+
/// of a Planned Failover is disaster recovery testing drills. This
375+
/// type of failover is invoked by setting FailoverType parameter to
376+
/// 'Planned'. Learn more about the failover options here-
377+
/// https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance
368378
/// </summary>
369379
/// <param name='resourceGroupName'>
370380
/// The name of the resource group within the user's subscription. The
@@ -375,6 +385,10 @@ public partial interface IStorageAccountsOperations
375385
/// group. Storage account names must be between 3 and 24 characters in
376386
/// length and use numbers and lower-case letters only.
377387
/// </param>
388+
/// <param name='failoverType'>
389+
/// The parameter is set to 'Planned' to indicate whether a Planned
390+
/// failover is requested. Possible values include: 'Planned'
391+
/// </param>
378392
/// <param name='customHeaders'>
379393
/// The headers that will be added to request.
380394
/// </param>
@@ -387,7 +401,7 @@ public partial interface IStorageAccountsOperations
387401
/// <exception cref="Microsoft.Rest.ValidationException">
388402
/// Thrown when a required parameter is null
389403
/// </exception>
390-
Task<AzureOperationResponse> FailoverWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
404+
Task<AzureOperationResponse> FailoverWithHttpMessagesAsync(string resourceGroupName, string accountName, FailoverType? failoverType = default(FailoverType?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
391405
/// <summary>
392406
/// Live Migration of storage account to enable Hns
393407
/// </summary>
@@ -541,10 +555,20 @@ public partial interface IStorageAccountsOperations
541555
/// </exception>
542556
Task<AzureOperationResponse<StorageAccount>> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, StorageAccountCreateParameters parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
543557
/// <summary>
544-
/// Failover request can be triggered for a storage account in case of
545-
/// availability issues. The failover occurs from the storage account's
546-
/// primary cluster to secondary cluster for RA-GRS accounts. The
547-
/// secondary cluster will become primary after failover.
558+
/// A failover request can be triggered for a storage account in the
559+
/// event a primary endpoint becomes unavailable for any reason. The
560+
/// failover occurs from the storage account's primary cluster to the
561+
/// secondary cluster for RA-GRS accounts. The secondary cluster will
562+
/// become primary after failover and the account is converted to LRS.
563+
/// In the case of a Planned Failover, the primary and secondary
564+
/// clusters are swapped after failover and the account remains
565+
/// geo-replicated. Failover should continue to be used in the event of
566+
/// availability issues as Planned failover is only available while the
567+
/// primary and secondary endpoints are available. The primary use case
568+
/// of a Planned Failover is disaster recovery testing drills. This
569+
/// type of failover is invoked by setting FailoverType parameter to
570+
/// 'Planned'. Learn more about the failover options here-
571+
/// https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance
548572
/// </summary>
549573
/// <param name='resourceGroupName'>
550574
/// The name of the resource group within the user's subscription. The
@@ -555,6 +579,10 @@ public partial interface IStorageAccountsOperations
555579
/// group. Storage account names must be between 3 and 24 characters in
556580
/// length and use numbers and lower-case letters only.
557581
/// </param>
582+
/// <param name='failoverType'>
583+
/// The parameter is set to 'Planned' to indicate whether a Planned
584+
/// failover is requested. Possible values include: 'Planned'
585+
/// </param>
558586
/// <param name='customHeaders'>
559587
/// The headers that will be added to request.
560588
/// </param>
@@ -567,7 +595,7 @@ public partial interface IStorageAccountsOperations
567595
/// <exception cref="Microsoft.Rest.ValidationException">
568596
/// Thrown when a required parameter is null
569597
/// </exception>
570-
Task<AzureOperationResponse> BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
598+
Task<AzureOperationResponse> BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string accountName, FailoverType? failoverType = default(FailoverType?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
571599
/// <summary>
572600
/// Live Migration of storage account to enable Hns
573601
/// </summary>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// <auto-generated>
2+
// Copyright (c) Microsoft Corporation. All rights reserved.
3+
// Licensed under the MIT License. See License.txt in the project root for
4+
// license information.
5+
//
6+
// Code generated by Microsoft (R) AutoRest Code Generator.
7+
// Changes may cause incorrect behavior and will be lost if the code is
8+
// regenerated.
9+
// </auto-generated>
10+
11+
namespace Microsoft.Azure.Management.Storage.Models
12+
{
13+
using Newtonsoft.Json;
14+
using Newtonsoft.Json.Converters;
15+
using System.Runtime;
16+
using System.Runtime.Serialization;
17+
18+
/// <summary>
19+
/// Defines values for FailoverType.
20+
/// </summary>
21+
[JsonConverter(typeof(StringEnumConverter))]
22+
public enum FailoverType
23+
{
24+
[EnumMember(Value = "Planned")]
25+
Planned
26+
}
27+
internal static class FailoverTypeEnumExtension
28+
{
29+
internal static string ToSerializedValue(this FailoverType? value)
30+
{
31+
return value == null ? null : ((FailoverType)value).ToSerializedValue();
32+
}
33+
34+
internal static string ToSerializedValue(this FailoverType value)
35+
{
36+
switch( value )
37+
{
38+
case FailoverType.Planned:
39+
return "Planned";
40+
}
41+
return null;
42+
}
43+
44+
internal static FailoverType? ParseFailoverType(this string value)
45+
{
46+
switch( value )
47+
{
48+
case "Planned":
49+
return FailoverType.Planned;
50+
}
51+
return null;
52+
}
53+
}
54+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// <auto-generated>
2+
// Copyright (c) Microsoft Corporation. All rights reserved.
3+
// Licensed under the MIT License. See License.txt in the project root for
4+
// license information.
5+
//
6+
// Code generated by Microsoft (R) AutoRest Code Generator.
7+
// Changes may cause incorrect behavior and will be lost if the code is
8+
// regenerated.
9+
// </auto-generated>
10+
11+
namespace Microsoft.Azure.Management.Storage.Models
12+
{
13+
14+
/// <summary>
15+
/// Defines values for ListEncryptionScopesInclude.
16+
/// </summary>
17+
public static class ListEncryptionScopesInclude
18+
{
19+
public const string All = "All";
20+
public const string Enabled = "Enabled";
21+
public const string Disabled = "Disabled";
22+
}
23+
}

0 commit comments

Comments
 (0)