Skip to content

Commit 11bdb8c

Browse files
[SQL] Add cmdlet to refresh external governance status. (#21220)
* irrelevant changes after updating the readme * updates for api getter * changes for external governance api * add tests * make auditing build * Revert "irrelevant changes after updating the readme" This reverts commit 4da1243. * potentially relavant generated files * Revert "make auditing build" This reverts commit 070cadc. * add help file * address code review comments * rename cmdlet * update PS cmdlet name * update help * update example * Update ChangeLog.md --------- Co-authored-by: Yabo Hu <[email protected]>
1 parent f1b0634 commit 11bdb8c

22 files changed

+1541
-342
lines changed

src/Sql/Sql.Sdk/Generated/IServersOperations.cs

Lines changed: 85 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,51 @@ namespace Microsoft.Azure.Management.Sql
2323
/// </summary>
2424
public partial interface IServersOperations
2525
{
26+
/// <summary>
27+
/// Determines whether a resource can be created with the specified
28+
/// name.
29+
/// </summary>
30+
/// <param name='parameters'>
31+
/// The name availability request parameters.
32+
/// </param>
33+
/// <param name='customHeaders'>
34+
/// The headers that will be added to request.
35+
/// </param>
36+
/// <param name='cancellationToken'>
37+
/// The cancellation token.
38+
/// </param>
39+
/// <exception cref="Microsoft.Rest.Azure.CloudException">
40+
/// Thrown when the operation returned an invalid status code
41+
/// </exception>
42+
/// <exception cref="Microsoft.Rest.SerializationException">
43+
/// Thrown when unable to deserialize the response
44+
/// </exception>
45+
/// <exception cref="Microsoft.Rest.ValidationException">
46+
/// Thrown when a required parameter is null
47+
/// </exception>
48+
Task<AzureOperationResponse<CheckNameAvailabilityResponse>> CheckNameAvailabilityWithHttpMessagesAsync(CheckNameAvailabilityRequest parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
49+
/// <summary>
50+
/// Gets a list of all servers in the subscription.
51+
/// </summary>
52+
/// <param name='expand'>
53+
/// The child resources to include in the response.
54+
/// </param>
55+
/// <param name='customHeaders'>
56+
/// The headers that will be added to request.
57+
/// </param>
58+
/// <param name='cancellationToken'>
59+
/// The cancellation token.
60+
/// </param>
61+
/// <exception cref="Microsoft.Rest.Azure.CloudException">
62+
/// Thrown when the operation returned an invalid status code
63+
/// </exception>
64+
/// <exception cref="Microsoft.Rest.SerializationException">
65+
/// Thrown when unable to deserialize the response
66+
/// </exception>
67+
/// <exception cref="Microsoft.Rest.ValidationException">
68+
/// Thrown when a required parameter is null
69+
/// </exception>
70+
Task<AzureOperationResponse<IPage<Server>>> ListWithHttpMessagesAsync(string expand = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
2671
/// <summary>
2772
/// Gets a list of servers in a resource groups.
2873
/// </summary>
@@ -165,28 +210,6 @@ public partial interface IServersOperations
165210
/// </exception>
166211
Task<AzureOperationResponse<Server>> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerUpdate parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
167212
/// <summary>
168-
/// Gets a list of all servers in the subscription.
169-
/// </summary>
170-
/// <param name='expand'>
171-
/// The child resources to include in the response.
172-
/// </param>
173-
/// <param name='customHeaders'>
174-
/// The headers that will be added to request.
175-
/// </param>
176-
/// <param name='cancellationToken'>
177-
/// The cancellation token.
178-
/// </param>
179-
/// <exception cref="Microsoft.Rest.Azure.CloudException">
180-
/// Thrown when the operation returned an invalid status code
181-
/// </exception>
182-
/// <exception cref="Microsoft.Rest.SerializationException">
183-
/// Thrown when unable to deserialize the response
184-
/// </exception>
185-
/// <exception cref="Microsoft.Rest.ValidationException">
186-
/// Thrown when a required parameter is null
187-
/// </exception>
188-
Task<AzureOperationResponse<IPage<Server>>> ListWithHttpMessagesAsync(string expand = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
189-
/// <summary>
190213
/// Imports a bacpac into a new database.
191214
/// </summary>
192215
/// <param name='resourceGroupName'>
@@ -217,11 +240,15 @@ public partial interface IServersOperations
217240
/// </exception>
218241
Task<AzureOperationResponse<ImportExportOperationResult>> ImportDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, ImportNewDatabaseDefinition parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
219242
/// <summary>
220-
/// Determines whether a resource can be created with the specified
221-
/// name.
243+
/// Refresh external governance enablement status.
222244
/// </summary>
223-
/// <param name='parameters'>
224-
/// The name availability request parameters.
245+
/// <param name='resourceGroupName'>
246+
/// The name of the resource group that contains the resource. You can
247+
/// obtain this value from the Azure Resource Manager API or the
248+
/// portal.
249+
/// </param>
250+
/// <param name='serverName'>
251+
/// The name of the server.
225252
/// </param>
226253
/// <param name='customHeaders'>
227254
/// The headers that will be added to request.
@@ -238,7 +265,7 @@ public partial interface IServersOperations
238265
/// <exception cref="Microsoft.Rest.ValidationException">
239266
/// Thrown when a required parameter is null
240267
/// </exception>
241-
Task<AzureOperationResponse<CheckNameAvailabilityResponse>> CheckNameAvailabilityWithHttpMessagesAsync(CheckNameAvailabilityRequest parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
268+
Task<AzureOperationResponse<RefreshExternalGovernanceStatusOperationResult>> RefreshStatusWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
242269
/// <summary>
243270
/// Creates or updates a server.
244271
/// </summary>
@@ -354,10 +381,15 @@ public partial interface IServersOperations
354381
/// </exception>
355382
Task<AzureOperationResponse<ImportExportOperationResult>> BeginImportDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, ImportNewDatabaseDefinition parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
356383
/// <summary>
357-
/// Gets a list of servers in a resource groups.
384+
/// Refresh external governance enablement status.
358385
/// </summary>
359-
/// <param name='nextPageLink'>
360-
/// The NextLink from the previous successful call to List operation.
386+
/// <param name='resourceGroupName'>
387+
/// The name of the resource group that contains the resource. You can
388+
/// obtain this value from the Azure Resource Manager API or the
389+
/// portal.
390+
/// </param>
391+
/// <param name='serverName'>
392+
/// The name of the server.
361393
/// </param>
362394
/// <param name='customHeaders'>
363395
/// The headers that will be added to request.
@@ -374,7 +406,7 @@ public partial interface IServersOperations
374406
/// <exception cref="Microsoft.Rest.ValidationException">
375407
/// Thrown when a required parameter is null
376408
/// </exception>
377-
Task<AzureOperationResponse<IPage<Server>>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
409+
Task<AzureOperationResponse<RefreshExternalGovernanceStatusOperationResult>> BeginRefreshStatusWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
378410
/// <summary>
379411
/// Gets a list of all servers in the subscription.
380412
/// </summary>
@@ -397,5 +429,27 @@ public partial interface IServersOperations
397429
/// Thrown when a required parameter is null
398430
/// </exception>
399431
Task<AzureOperationResponse<IPage<Server>>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
432+
/// <summary>
433+
/// Gets a list of servers in a resource groups.
434+
/// </summary>
435+
/// <param name='nextPageLink'>
436+
/// The NextLink from the previous successful call to List operation.
437+
/// </param>
438+
/// <param name='customHeaders'>
439+
/// The headers that will be added to request.
440+
/// </param>
441+
/// <param name='cancellationToken'>
442+
/// The cancellation token.
443+
/// </param>
444+
/// <exception cref="Microsoft.Rest.Azure.CloudException">
445+
/// Thrown when the operation returned an invalid status code
446+
/// </exception>
447+
/// <exception cref="Microsoft.Rest.SerializationException">
448+
/// Thrown when unable to deserialize the response
449+
/// </exception>
450+
/// <exception cref="Microsoft.Rest.ValidationException">
451+
/// Thrown when a required parameter is null
452+
/// </exception>
453+
Task<AzureOperationResponse<IPage<Server>>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
400454
}
401455
}

src/Sql/Sql.Sdk/Generated/ISqlManagementClient.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ public partial interface ISqlManagementClient : System.IDisposable
8383
/// </summary>
8484
IElasticPoolDatabaseActivitiesOperations ElasticPoolDatabaseActivities { get; }
8585

86-
/// <summary>
87-
/// Gets the IServersOperations.
88-
/// </summary>
89-
IServersOperations Servers { get; }
90-
9186
/// <summary>
9287
/// Gets the IServerDevOpsAuditSettingsOperations.
9388
/// </summary>
@@ -503,5 +498,10 @@ public partial interface ISqlManagementClient : System.IDisposable
503498
/// </summary>
504499
IInstanceFailoverGroupsOperations InstanceFailoverGroups { get; }
505500

501+
/// <summary>
502+
/// Gets the IServersOperations.
503+
/// </summary>
504+
IServersOperations Servers { get; }
505+
506506
}
507507
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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.Sql.Models
12+
{
13+
14+
/// <summary>
15+
/// Defines values for ExternalGovernanceStatus.
16+
/// </summary>
17+
public static class ExternalGovernanceStatus
18+
{
19+
public const string Enabled = "Enabled";
20+
public const string Disabled = "Disabled";
21+
}
22+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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.Sql.Models
12+
{
13+
using Microsoft.Rest;
14+
using Microsoft.Rest.Serialization;
15+
using Newtonsoft.Json;
16+
using System.Linq;
17+
18+
/// <summary>
19+
/// An RefreshExternalGovernanceStatus operation result resource.
20+
/// </summary>
21+
[Rest.Serialization.JsonTransformation]
22+
public partial class RefreshExternalGovernanceStatusOperationResult : ProxyResource
23+
{
24+
/// <summary>
25+
/// Initializes a new instance of the
26+
/// RefreshExternalGovernanceStatusOperationResult class.
27+
/// </summary>
28+
public RefreshExternalGovernanceStatusOperationResult()
29+
{
30+
CustomInit();
31+
}
32+
33+
/// <summary>
34+
/// Initializes a new instance of the
35+
/// RefreshExternalGovernanceStatusOperationResult class.
36+
/// </summary>
37+
/// <param name="id">Resource ID.</param>
38+
/// <param name="name">Resource name.</param>
39+
/// <param name="type">Resource type.</param>
40+
/// <param name="requestId">Request Id.</param>
41+
/// <param name="requestType">Request type.</param>
42+
/// <param name="queuedTime">Queued time.</param>
43+
/// <param name="serverName">Server name.</param>
44+
/// <param name="status">Operation status.</param>
45+
/// <param name="errorMessage">Error message.</param>
46+
public RefreshExternalGovernanceStatusOperationResult(string id = default(string), string name = default(string), string type = default(string), System.Guid? requestId = default(System.Guid?), string requestType = default(string), string queuedTime = default(string), string serverName = default(string), string status = default(string), string errorMessage = default(string))
47+
: base(id, name, type)
48+
{
49+
RequestId = requestId;
50+
RequestType = requestType;
51+
QueuedTime = queuedTime;
52+
ServerName = serverName;
53+
Status = status;
54+
ErrorMessage = errorMessage;
55+
CustomInit();
56+
}
57+
58+
/// <summary>
59+
/// An initialization method that performs custom operations like setting defaults
60+
/// </summary>
61+
partial void CustomInit();
62+
63+
/// <summary>
64+
/// Gets request Id.
65+
/// </summary>
66+
[JsonProperty(PropertyName = "properties.requestId")]
67+
public System.Guid? RequestId { get; private set; }
68+
69+
/// <summary>
70+
/// Gets request type.
71+
/// </summary>
72+
[JsonProperty(PropertyName = "properties.requestType")]
73+
public string RequestType { get; private set; }
74+
75+
/// <summary>
76+
/// Gets queued time.
77+
/// </summary>
78+
[JsonProperty(PropertyName = "properties.queuedTime")]
79+
public string QueuedTime { get; private set; }
80+
81+
/// <summary>
82+
/// Gets server name.
83+
/// </summary>
84+
[JsonProperty(PropertyName = "properties.serverName")]
85+
public string ServerName { get; private set; }
86+
87+
/// <summary>
88+
/// Gets operation status.
89+
/// </summary>
90+
[JsonProperty(PropertyName = "properties.status")]
91+
public string Status { get; private set; }
92+
93+
/// <summary>
94+
/// Gets error message.
95+
/// </summary>
96+
[JsonProperty(PropertyName = "properties.errorMessage")]
97+
public string ErrorMessage { get; private set; }
98+
99+
}
100+
}

0 commit comments

Comments
 (0)