Skip to content

Commit 4310547

Browse files
Add cmdlet to update replication link type (#25502)
* add generated sdk * add a new cmdlet file for update link type * add new ps cmdlet for update link type and upgrade to new sdk version * update test case for new cmdlet * update session records for new cmdlet * update comments * add module file * modify module file * fill the synopsis * update the help file of set cmdlet
1 parent d6ed60f commit 4310547

24 files changed

+10239
-14426
lines changed

src/Sql/Sql.Management.Sdk/Generated/IReplicationLinksOperations.cs

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,42 @@ public partial interface IReplicationLinksOperations
7676
/// </exception>
7777
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<ReplicationLink>> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
7878

79+
/// <summary>
80+
/// Updates the replication link type.
81+
/// </summary>
82+
/// <remarks>
83+
/// Updates the replication link type.
84+
/// </remarks>
85+
/// <param name='resourceGroupName'>
86+
/// The name of the resource group that contains the resource. You can obtain
87+
/// this value from the Azure Resource Manager API or the portal.
88+
/// </param>
89+
/// <param name='serverName'>
90+
/// The name of the server.
91+
/// </param>
92+
/// <param name='databaseName'>
93+
/// The name of the database.
94+
/// </param>
95+
/// <param name='linkId'>
96+
///
97+
/// </param>
98+
/// <param name='parameters'>
99+
///
100+
/// </param>
101+
/// <param name='customHeaders'>
102+
/// The headers that will be added to request.
103+
/// </param>
104+
/// <param name='cancellationToken'>
105+
/// The cancellation token.
106+
/// </param>
107+
/// <exception cref="Microsoft.Rest.Azure.CloudException">
108+
/// Thrown when the operation returned an invalid status code
109+
/// </exception>
110+
/// <exception cref="Microsoft.Rest.SerializationException">
111+
/// Thrown when unable to deserialize the response
112+
/// </exception>
113+
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<ReplicationLink>> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, ReplicationLink parameters, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
114+
79115
/// <summary>
80116
/// Deletes the replication link.
81117
/// </summary>
@@ -106,6 +142,42 @@ public partial interface IReplicationLinksOperations
106142
/// </exception>
107143
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse> DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
108144

145+
/// <summary>
146+
/// Updates the replication link type.
147+
/// </summary>
148+
/// <remarks>
149+
/// Updates the replication link type.
150+
/// </remarks>
151+
/// <param name='resourceGroupName'>
152+
/// The name of the resource group that contains the resource. You can obtain
153+
/// this value from the Azure Resource Manager API or the portal.
154+
/// </param>
155+
/// <param name='serverName'>
156+
/// The name of the server.
157+
/// </param>
158+
/// <param name='databaseName'>
159+
/// The name of the database.
160+
/// </param>
161+
/// <param name='linkId'>
162+
///
163+
/// </param>
164+
/// <param name='parameters'>
165+
///
166+
/// </param>
167+
/// <param name='customHeaders'>
168+
/// The headers that will be added to request.
169+
/// </param>
170+
/// <param name='cancellationToken'>
171+
/// The cancellation token.
172+
/// </param>
173+
/// <exception cref="Microsoft.Rest.Azure.CloudException">
174+
/// Thrown when the operation returned an invalid status code
175+
/// </exception>
176+
/// <exception cref="Microsoft.Rest.SerializationException">
177+
/// Thrown when unable to deserialize the response
178+
/// </exception>
179+
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<ReplicationLink>> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, ReplicationLinkUpdate parameters, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
180+
109181
/// <summary>
110182
/// Fails over from the current primary server to this server.
111183
/// </summary>
@@ -201,6 +273,42 @@ public partial interface IReplicationLinksOperations
201273
/// </exception>
202274
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Rest.Azure.IPage<ReplicationLink>>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
203275

276+
/// <summary>
277+
/// Updates the replication link type.
278+
/// </summary>
279+
/// <remarks>
280+
/// Updates the replication link type.
281+
/// </remarks>
282+
/// <param name='resourceGroupName'>
283+
/// The name of the resource group that contains the resource. You can obtain
284+
/// this value from the Azure Resource Manager API or the portal.
285+
/// </param>
286+
/// <param name='serverName'>
287+
/// The name of the server.
288+
/// </param>
289+
/// <param name='databaseName'>
290+
/// The name of the database.
291+
/// </param>
292+
/// <param name='linkId'>
293+
///
294+
/// </param>
295+
/// <param name='parameters'>
296+
///
297+
/// </param>
298+
/// <param name='customHeaders'>
299+
/// The headers that will be added to request.
300+
/// </param>
301+
/// <param name='cancellationToken'>
302+
/// The cancellation token.
303+
/// </param>
304+
/// <exception cref="Microsoft.Rest.Azure.CloudException">
305+
/// Thrown when the operation returned an invalid status code
306+
/// </exception>
307+
/// <exception cref="Microsoft.Rest.SerializationException">
308+
/// Thrown when unable to deserialize the response
309+
/// </exception>
310+
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<ReplicationLink>> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, ReplicationLink parameters, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
311+
204312
/// <summary>
205313
/// Deletes the replication link.
206314
/// </summary>
@@ -231,6 +339,42 @@ public partial interface IReplicationLinksOperations
231339
/// </exception>
232340
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
233341

342+
/// <summary>
343+
/// Updates the replication link type.
344+
/// </summary>
345+
/// <remarks>
346+
/// Updates the replication link type.
347+
/// </remarks>
348+
/// <param name='resourceGroupName'>
349+
/// The name of the resource group that contains the resource. You can obtain
350+
/// this value from the Azure Resource Manager API or the portal.
351+
/// </param>
352+
/// <param name='serverName'>
353+
/// The name of the server.
354+
/// </param>
355+
/// <param name='databaseName'>
356+
/// The name of the database.
357+
/// </param>
358+
/// <param name='linkId'>
359+
///
360+
/// </param>
361+
/// <param name='parameters'>
362+
///
363+
/// </param>
364+
/// <param name='customHeaders'>
365+
/// The headers that will be added to request.
366+
/// </param>
367+
/// <param name='cancellationToken'>
368+
/// The cancellation token.
369+
/// </param>
370+
/// <exception cref="Microsoft.Rest.Azure.CloudException">
371+
/// Thrown when the operation returned an invalid status code
372+
/// </exception>
373+
/// <exception cref="Microsoft.Rest.SerializationException">
374+
/// Thrown when unable to deserialize the response
375+
/// </exception>
376+
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<ReplicationLink>> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, ReplicationLinkUpdate parameters, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
377+
234378
/// <summary>
235379
/// Fails over from the current primary server to this server.
236380
/// </summary>

src/Sql/Sql.Management.Sdk/Generated/Models/ReplicationLink.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ public ReplicationLink()
4343
/// <param name="partnerDatabase">Resource partner database.
4444
/// </param>
4545

46+
/// <param name="partnerDatabaseId">Resource partner database Id.
47+
/// </param>
48+
4649
/// <param name="partnerLocation">Resource partner location.
4750
/// </param>
4851

@@ -66,15 +69,16 @@ public ReplicationLink()
6669
/// <param name="isTerminationAllowed">Whether the user is currently allowed to terminate the link.
6770
/// </param>
6871

69-
/// <param name="linkType">Link type (GEO, NAMED, STANDBY).
72+
/// <param name="linkType">Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED.
7073
/// Possible values include: &#39;GEO&#39;, &#39;NAMED&#39;, &#39;STANDBY&#39;</param>
71-
public ReplicationLink(string id = default(string), string name = default(string), string type = default(string), string replicationState = default(string), string partnerServer = default(string), string partnerDatabase = default(string), string partnerLocation = default(string), ReplicationRole? role = default(ReplicationRole?), ReplicationRole? partnerRole = default(ReplicationRole?), string replicationMode = default(string), System.DateTime? startTime = default(System.DateTime?), int? percentComplete = default(int?), bool? isTerminationAllowed = default(bool?), string linkType = default(string))
74+
public ReplicationLink(string id = default(string), string name = default(string), string type = default(string), string replicationState = default(string), string partnerServer = default(string), string partnerDatabase = default(string), string partnerDatabaseId = default(string), string partnerLocation = default(string), ReplicationRole? role = default(ReplicationRole?), ReplicationRole? partnerRole = default(ReplicationRole?), string replicationMode = default(string), System.DateTime? startTime = default(System.DateTime?), int? percentComplete = default(int?), bool? isTerminationAllowed = default(bool?), string linkType = default(string))
7275

7376
: base(id, name, type)
7477
{
7578
this.ReplicationState = replicationState;
7679
this.PartnerServer = partnerServer;
7780
this.PartnerDatabase = partnerDatabase;
81+
this.PartnerDatabaseId = partnerDatabaseId;
7882
this.PartnerLocation = partnerLocation;
7983
this.Role = role;
8084
this.PartnerRole = partnerRole;
@@ -110,6 +114,12 @@ public ReplicationLink()
110114
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.partnerDatabase")]
111115
public string PartnerDatabase {get; private set; }
112116

117+
/// <summary>
118+
/// Gets resource partner database Id.
119+
/// </summary>
120+
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.partnerDatabaseId")]
121+
public string PartnerDatabaseId {get; private set; }
122+
113123
/// <summary>
114124
/// Gets resource partner location.
115125
/// </summary>
@@ -153,9 +163,10 @@ public ReplicationLink()
153163
public bool? IsTerminationAllowed {get; private set; }
154164

155165
/// <summary>
156-
/// Gets link type (GEO, NAMED, STANDBY). Possible values include: &#39;GEO&#39;, &#39;NAMED&#39;, &#39;STANDBY&#39;
166+
/// Gets or sets link type (GEO, NAMED, STANDBY). Update operation does not
167+
/// support NAMED. Possible values include: &#39;GEO&#39;, &#39;NAMED&#39;, &#39;STANDBY&#39;
157168
/// </summary>
158169
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.linkType")]
159-
public string LinkType {get; private set; }
170+
public string LinkType {get; set; }
160171
}
161172
}

src/Sql/Sql.Management.Sdk/Generated/Models/ReplicationLinkProperties.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public ReplicationLinkProperties()
3030
/// <param name="partnerDatabase">Resource partner database.
3131
/// </param>
3232

33+
/// <param name="partnerDatabaseId">Resource partner database Id.
34+
/// </param>
35+
3336
/// <param name="partnerLocation">Resource partner location.
3437
/// </param>
3538

@@ -56,13 +59,14 @@ public ReplicationLinkProperties()
5659
/// <param name="isTerminationAllowed">Whether the user is currently allowed to terminate the link.
5760
/// </param>
5861

59-
/// <param name="linkType">Link type (GEO, NAMED, STANDBY).
62+
/// <param name="linkType">Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED.
6063
/// Possible values include: &#39;GEO&#39;, &#39;NAMED&#39;, &#39;STANDBY&#39;</param>
61-
public ReplicationLinkProperties(string partnerServer = default(string), string partnerDatabase = default(string), string partnerLocation = default(string), ReplicationRole? role = default(ReplicationRole?), ReplicationRole? partnerRole = default(ReplicationRole?), string replicationMode = default(string), System.DateTime? startTime = default(System.DateTime?), int? percentComplete = default(int?), string replicationState = default(string), bool? isTerminationAllowed = default(bool?), string linkType = default(string))
64+
public ReplicationLinkProperties(string partnerServer = default(string), string partnerDatabase = default(string), string partnerDatabaseId = default(string), string partnerLocation = default(string), ReplicationRole? role = default(ReplicationRole?), ReplicationRole? partnerRole = default(ReplicationRole?), string replicationMode = default(string), System.DateTime? startTime = default(System.DateTime?), int? percentComplete = default(int?), string replicationState = default(string), bool? isTerminationAllowed = default(bool?), string linkType = default(string))
6265

6366
{
6467
this.PartnerServer = partnerServer;
6568
this.PartnerDatabase = partnerDatabase;
69+
this.PartnerDatabaseId = partnerDatabaseId;
6670
this.PartnerLocation = partnerLocation;
6771
this.Role = role;
6872
this.PartnerRole = partnerRole;
@@ -93,6 +97,12 @@ public ReplicationLinkProperties()
9397
[Newtonsoft.Json.JsonProperty(PropertyName = "partnerDatabase")]
9498
public string PartnerDatabase {get; private set; }
9599

100+
/// <summary>
101+
/// Gets resource partner database Id.
102+
/// </summary>
103+
[Newtonsoft.Json.JsonProperty(PropertyName = "partnerDatabaseId")]
104+
public string PartnerDatabaseId {get; private set; }
105+
96106
/// <summary>
97107
/// Gets resource partner location.
98108
/// </summary>
@@ -142,9 +152,10 @@ public ReplicationLinkProperties()
142152
public bool? IsTerminationAllowed {get; private set; }
143153

144154
/// <summary>
145-
/// Gets link type (GEO, NAMED, STANDBY). Possible values include: &#39;GEO&#39;, &#39;NAMED&#39;, &#39;STANDBY&#39;
155+
/// Gets or sets link type (GEO, NAMED, STANDBY). Update operation does not
156+
/// support NAMED. Possible values include: &#39;GEO&#39;, &#39;NAMED&#39;, &#39;STANDBY&#39;
146157
/// </summary>
147158
[Newtonsoft.Json.JsonProperty(PropertyName = "linkType")]
148-
public string LinkType {get; private set; }
159+
public string LinkType {get; set; }
149160
}
150161
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
5+
6+
namespace Microsoft.Azure.Management.Sql.Models
7+
{
8+
using System.Linq;
9+
10+
/// <summary>
11+
/// A replication link update request.
12+
/// </summary>
13+
[Microsoft.Rest.Serialization.JsonTransformation]
14+
public partial class ReplicationLinkUpdate : ProxyResource
15+
{
16+
/// <summary>
17+
/// Initializes a new instance of the ReplicationLinkUpdate class.
18+
/// </summary>
19+
public ReplicationLinkUpdate()
20+
{
21+
CustomInit();
22+
}
23+
24+
/// <summary>
25+
/// Initializes a new instance of the ReplicationLinkUpdate class.
26+
/// </summary>
27+
28+
/// <param name="id">Resource ID.
29+
/// </param>
30+
31+
/// <param name="name">Resource name.
32+
/// </param>
33+
34+
/// <param name="type">Resource type.
35+
/// </param>
36+
37+
/// <param name="linkType">Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED.
38+
/// Possible values include: &#39;GEO&#39;, &#39;NAMED&#39;, &#39;STANDBY&#39;</param>
39+
public ReplicationLinkUpdate(string id = default(string), string name = default(string), string type = default(string), string linkType = default(string))
40+
41+
: base(id, name, type)
42+
{
43+
this.LinkType = linkType;
44+
CustomInit();
45+
}
46+
47+
/// <summary>
48+
/// An initialization method that performs custom operations like setting defaults
49+
/// </summary>
50+
partial void CustomInit();
51+
52+
53+
/// <summary>
54+
/// Gets or sets link type (GEO, NAMED, STANDBY). Update operation does not
55+
/// support NAMED. Possible values include: &#39;GEO&#39;, &#39;NAMED&#39;, &#39;STANDBY&#39;
56+
/// </summary>
57+
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.linkType")]
58+
public string LinkType {get; set; }
59+
}
60+
}

0 commit comments

Comments
 (0)