Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR postgresql/resource-manager] add missed parameters in Postgres Update Server API to stop replication #3264

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ interface WithCreate extends Creatable<Server>, Resource.DefinitionWithTags<With
/**
* The template for a Server update operation, containing all the settings that can be modified.
*/
interface Update extends Appliable<Server>, Resource.UpdateWithTags<Update>, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithSku, UpdateStages.WithSslEnforcement, UpdateStages.WithStorageProfile, UpdateStages.WithVersion {
interface Update extends Appliable<Server>, Resource.UpdateWithTags<Update>, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithReplicationRole, UpdateStages.WithSku, UpdateStages.WithSslEnforcement, UpdateStages.WithStorageProfile, UpdateStages.WithVersion {
}

/**
Expand All @@ -156,6 +156,18 @@ interface WithAdministratorLoginPassword {
Update withAdministratorLoginPassword(String administratorLoginPassword);
}

/**
* The stage of the server update allowing to specify ReplicationRole.
*/
interface WithReplicationRole {
/**
* Specifies replicationRole.
* @param replicationRole The replication role of the server
* @return the next update stage
*/
Update withReplicationRole(String replicationRole);
}

/**
* The stage of the server update allowing to specify Sku.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ public class ServerUpdateParameters {
@JsonProperty(value = "properties.sslEnforcement")
private SslEnforcementEnum sslEnforcement;

/**
* The replication role of the server.
*/
@JsonProperty(value = "properties.replicationRole")
private String replicationRole;

/**
* Application-specific metadata in the form of key-value pairs.
*/
Expand Down Expand Up @@ -155,6 +161,26 @@ public ServerUpdateParameters withSslEnforcement(SslEnforcementEnum sslEnforceme
return this;
}

/**
* Get the replication role of the server.
*
* @return the replicationRole value
*/
public String replicationRole() {
return this.replicationRole;
}

/**
* Set the replication role of the server.
*
* @param replicationRole the replicationRole value to set
* @return the ServerUpdateParameters object itself.
*/
public ServerUpdateParameters withReplicationRole(String replicationRole) {
this.replicationRole = replicationRole;
return this;
}

/**
* Get application-specific metadata in the form of key-value pairs.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ public ServerImpl withAdministratorLoginPassword(String administratorLoginPasswo
return this;
}

@Override
public ServerImpl withReplicationRole(String replicationRole) {
this.updateParameter.withReplicationRole(replicationRole);
return this;
}

@Override
public ServerImpl withSslEnforcement(SslEnforcementEnum sslEnforcement) {
this.updateParameter.withSslEnforcement(sslEnforcement);
Expand Down