diff --git a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/Replicas.java b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/Replicas.java new file mode 100644 index 0000000000000..93dac700ea3ce --- /dev/null +++ b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/Replicas.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mysql.v2017_12_01; + +import rx.Observable; +import com.microsoft.azure.management.mysql.v2017_12_01.implementation.ReplicasInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Replicas. + */ +public interface Replicas extends HasInner { + /** + * List all the replicas for a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(String resourceGroupName, String serverName); + +} diff --git a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/Server.java b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/Server.java index a3eae254544bb..361259fc4d946 100644 --- a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/Server.java +++ b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/Server.java @@ -40,6 +40,21 @@ public interface Server extends HasInner, Resource, GroupableResour */ String fullyQualifiedDomainName(); + /** + * @return the masterServerId value. + */ + String masterServerId(); + + /** + * @return the replicaCapacity value. + */ + Integer replicaCapacity(); + + /** + * @return the replicationRole value. + */ + String replicationRole(); + /** * @return the sku value. */ @@ -118,7 +133,7 @@ interface WithCreate extends Creatable, Resource.DefinitionWithTags, Resource.UpdateWithTags, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithSku, UpdateStages.WithSslEnforcement, UpdateStages.WithStorageProfile, UpdateStages.WithVersion { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithReplicationRole, UpdateStages.WithSku, UpdateStages.WithSslEnforcement, UpdateStages.WithStorageProfile, UpdateStages.WithVersion { } /** @@ -135,6 +150,16 @@ interface WithAdministratorLoginPassword { Update withAdministratorLoginPassword(String administratorLoginPassword); } + /** + * The stage of the server {0} allowing to specify ReplicationRole. + */ + interface WithReplicationRole { + /** + * Specifies replicationRole. + */ + Update withReplicationRole(String replicationRole); + } + /** * The stage of the server {0} allowing to specify Sku. */ diff --git a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/ServerPropertiesForCreate.java b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/ServerPropertiesForCreate.java index 1e38852db96f5..79295faadaf3b 100644 --- a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/ServerPropertiesForCreate.java +++ b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/ServerPropertiesForCreate.java @@ -21,7 +21,8 @@ @JsonSubTypes({ @JsonSubTypes.Type(name = "Default", value = ServerPropertiesForDefaultCreate.class), @JsonSubTypes.Type(name = "PointInTimeRestore", value = ServerPropertiesForRestore.class), - @JsonSubTypes.Type(name = "GeoRestore", value = ServerPropertiesForGeoRestore.class) + @JsonSubTypes.Type(name = "GeoRestore", value = ServerPropertiesForGeoRestore.class), + @JsonSubTypes.Type(name = "Replica", value = ServerPropertiesForReplica.class) }) public class ServerPropertiesForCreate { /** diff --git a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/ServerPropertiesForReplica.java b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/ServerPropertiesForReplica.java new file mode 100644 index 0000000000000..a2c26825a8ee6 --- /dev/null +++ b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/ServerPropertiesForReplica.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mysql.v2017_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties to create a new replica. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode") +@JsonTypeName("Replica") +public class ServerPropertiesForReplica extends ServerPropertiesForCreate { + /** + * The master server id to create replica from. + */ + @JsonProperty(value = "sourceServerId", required = true) + private String sourceServerId; + + /** + * Get the master server id to create replica from. + * + * @return the sourceServerId value + */ + public String sourceServerId() { + return this.sourceServerId; + } + + /** + * Set the master server id to create replica from. + * + * @param sourceServerId the sourceServerId value to set + * @return the ServerPropertiesForReplica object itself. + */ + public ServerPropertiesForReplica withSourceServerId(String sourceServerId) { + this.sourceServerId = sourceServerId; + return this; + } + +} diff --git a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/ServerServer.java b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/ServerServer.java new file mode 100644 index 0000000000000..cffd4100b34a4 --- /dev/null +++ b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/ServerServer.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mysql.v2017_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mysql.v2017_12_01.implementation.ServerInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mysql.v2017_12_01.implementation.DBforMySQLManager; +import org.joda.time.DateTime; +import java.util.Map; + +/** + * Type representing ServerServer. + */ +public interface ServerServer extends HasInner, HasManager { + /** + * @return the administratorLogin value. + */ + String administratorLogin(); + + /** + * @return the earliestRestoreDate value. + */ + DateTime earliestRestoreDate(); + + /** + * @return the fullyQualifiedDomainName value. + */ + String fullyQualifiedDomainName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the masterServerId value. + */ + String masterServerId(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the replicaCapacity value. + */ + Integer replicaCapacity(); + + /** + * @return the replicationRole value. + */ + String replicationRole(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the sslEnforcement value. + */ + SslEnforcementEnum sslEnforcement(); + + /** + * @return the storageProfile value. + */ + StorageProfile storageProfile(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the userVisibleState value. + */ + ServerState userVisibleState(); + + /** + * @return the version value. + */ + ServerVersion version(); + +} diff --git a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/ServerUpdateParameters.java b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/ServerUpdateParameters.java index 351e3725fd0c1..cd6117b39c3ae 100644 --- a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/ServerUpdateParameters.java +++ b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/ServerUpdateParameters.java @@ -13,7 +13,7 @@ import com.microsoft.rest.serializer.JsonFlatten; /** - * Parameters allowd to update for a server. + * Parameters allowed to update for a server. */ @JsonFlatten public class ServerUpdateParameters { @@ -48,6 +48,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. */ @@ -154,6 +160,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. * diff --git a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/DBforMySQLManager.java b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/DBforMySQLManager.java index 6509cffd2091b..ce36c57cb5068 100644 --- a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/DBforMySQLManager.java +++ b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/DBforMySQLManager.java @@ -17,6 +17,7 @@ import com.microsoft.azure.serializer.AzureJacksonAdapter; import com.microsoft.rest.RestClient; import com.microsoft.azure.management.mysql.v2017_12_01.Servers; +import com.microsoft.azure.management.mysql.v2017_12_01.Replicas; import com.microsoft.azure.management.mysql.v2017_12_01.FirewallRules; import com.microsoft.azure.management.mysql.v2017_12_01.VirtualNetworkRules; import com.microsoft.azure.management.mysql.v2017_12_01.Databases; @@ -34,6 +35,7 @@ */ public final class DBforMySQLManager extends ManagerCore { private Servers servers; + private Replicas replicas; private FirewallRules firewallRules; private VirtualNetworkRules virtualNetworkRules; private Databases databases; @@ -100,6 +102,16 @@ public Servers servers() { return this.servers; } + /** + * @return Entry point to manage Replicas. + */ + public Replicas replicas() { + if (this.replicas == null) { + this.replicas = new ReplicasImpl(this); + } + return this.replicas; + } + /** * @return Entry point to manage FirewallRules. */ diff --git a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/MySQLManagementClientImpl.java b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/MySQLManagementClientImpl.java index ab3b4ed49ab0f..f0f55c976639b 100644 --- a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/MySQLManagementClientImpl.java +++ b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/MySQLManagementClientImpl.java @@ -145,6 +145,19 @@ public ServersInner servers() { return this.servers; } + /** + * The ReplicasInner object to access its operations. + */ + private ReplicasInner replicas; + + /** + * Gets the ReplicasInner object to access its operations. + * @return the ReplicasInner object. + */ + public ReplicasInner replicas() { + return this.replicas; + } + /** * The FirewallRulesInner object to access its operations. */ @@ -298,6 +311,7 @@ protected void initialize() { this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; this.servers = new ServersInner(restClient().retrofit(), this); + this.replicas = new ReplicasInner(restClient().retrofit(), this); this.firewallRules = new FirewallRulesInner(restClient().retrofit(), this); this.virtualNetworkRules = new VirtualNetworkRulesInner(restClient().retrofit(), this); this.databases = new DatabasesInner(restClient().retrofit(), this); diff --git a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ReplicasImpl.java b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ReplicasImpl.java new file mode 100644 index 0000000000000..c412a171dc090 --- /dev/null +++ b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ReplicasImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mysql.v2017_12_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mysql.v2017_12_01.Replicas; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.mysql.v2017_12_01.ServerServer; + +class ReplicasImpl extends WrapperImpl implements Replicas { + private final DBforMySQLManager manager; + + ReplicasImpl(DBforMySQLManager manager) { + super(manager.inner().replicas()); + this.manager = manager; + } + + public DBforMySQLManager manager() { + return this.manager; + } + + private ServerServerImpl wrapModel(ServerInner inner) { + return new ServerServerImpl(inner, manager()); + } + + @Override + public Observable listByServerAsync(String resourceGroupName, String serverName) { + ReplicasInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ServerServer call(ServerInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ReplicasInner.java b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ReplicasInner.java new file mode 100644 index 0000000000000..7002c5b0a0e04 --- /dev/null +++ b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ReplicasInner.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mysql.v2017_12_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Replicas. + */ +public class ReplicasInner { + /** The Retrofit service to perform REST calls. */ + private ReplicasService service; + /** The service client containing this operation class. */ + private MySQLManagementClientImpl client; + + /** + * Initializes an instance of ReplicasInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ReplicasInner(Retrofit retrofit, MySQLManagementClientImpl client) { + this.service = retrofit.create(ReplicasService.class); + this.client = client; + } + + /** + * The interface defining all the services for Replicas to be + * used by Retrofit to perform actually REST calls. + */ + interface ReplicasService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mysql.v2017_12_01.Replicas listByServer" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/replicas") + Observable> listByServer(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all the replicas for a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ServerInner> object if successful. + */ + public List listByServer(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * List all the replicas for a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerAsync(String resourceGroupName, String serverName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByServerWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * List all the replicas for a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServerInner> object + */ + public Observable> listByServerAsync(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the replicas for a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServerInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ServerImpl.java b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ServerImpl.java index 8ddacd31fed40..0f95fe4429135 100644 --- a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ServerImpl.java +++ b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ServerImpl.java @@ -92,6 +92,21 @@ public String fullyQualifiedDomainName() { return this.inner().fullyQualifiedDomainName(); } + @Override + public String masterServerId() { + return this.inner().masterServerId(); + } + + @Override + public Integer replicaCapacity() { + return this.inner().replicaCapacity(); + } + + @Override + public String replicationRole() { + return this.inner().replicationRole(); + } + @Override public Sku sku() { return this.inner().sku(); @@ -129,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); diff --git a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ServerInner.java b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ServerInner.java index a73e7b72e4d36..b205bd622d97b 100644 --- a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ServerInner.java +++ b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ServerInner.java @@ -74,6 +74,24 @@ public class ServerInner extends Resource { @JsonProperty(value = "properties.storageProfile") private StorageProfile storageProfile; + /** + * The replication role of the server. + */ + @JsonProperty(value = "properties.replicationRole") + private String replicationRole; + + /** + * The master server id of a replica server. + */ + @JsonProperty(value = "properties.masterServerId") + private String masterServerId; + + /** + * The maximum number of replicas that a master server can have. + */ + @JsonProperty(value = "properties.replicaCapacity") + private Integer replicaCapacity; + /** * Get the SKU (pricing tier) of the server. * @@ -234,4 +252,64 @@ public ServerInner withStorageProfile(StorageProfile storageProfile) { 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 ServerInner object itself. + */ + public ServerInner withReplicationRole(String replicationRole) { + this.replicationRole = replicationRole; + return this; + } + + /** + * Get the master server id of a replica server. + * + * @return the masterServerId value + */ + public String masterServerId() { + return this.masterServerId; + } + + /** + * Set the master server id of a replica server. + * + * @param masterServerId the masterServerId value to set + * @return the ServerInner object itself. + */ + public ServerInner withMasterServerId(String masterServerId) { + this.masterServerId = masterServerId; + return this; + } + + /** + * Get the maximum number of replicas that a master server can have. + * + * @return the replicaCapacity value + */ + public Integer replicaCapacity() { + return this.replicaCapacity; + } + + /** + * Set the maximum number of replicas that a master server can have. + * + * @param replicaCapacity the replicaCapacity value to set + * @return the ServerInner object itself. + */ + public ServerInner withReplicaCapacity(Integer replicaCapacity) { + this.replicaCapacity = replicaCapacity; + return this; + } + } diff --git a/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ServerServerImpl.java b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ServerServerImpl.java new file mode 100644 index 0000000000000..4b55f578d750c --- /dev/null +++ b/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ServerServerImpl.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mysql.v2017_12_01.implementation; + +import com.microsoft.azure.management.mysql.v2017_12_01.ServerServer; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mysql.v2017_12_01.Sku; +import com.microsoft.azure.management.mysql.v2017_12_01.SslEnforcementEnum; +import com.microsoft.azure.management.mysql.v2017_12_01.StorageProfile; +import java.util.Map; +import com.microsoft.azure.management.mysql.v2017_12_01.ServerState; +import com.microsoft.azure.management.mysql.v2017_12_01.ServerVersion; + +class ServerServerImpl extends WrapperImpl implements ServerServer { + private final DBforMySQLManager manager; + + ServerServerImpl(ServerInner inner, DBforMySQLManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DBforMySQLManager manager() { + return this.manager; + } + + + + @Override + public String administratorLogin() { + return this.inner().administratorLogin(); + } + + @Override + public DateTime earliestRestoreDate() { + return this.inner().earliestRestoreDate(); + } + + @Override + public String fullyQualifiedDomainName() { + return this.inner().fullyQualifiedDomainName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String masterServerId() { + return this.inner().masterServerId(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer replicaCapacity() { + return this.inner().replicaCapacity(); + } + + @Override + public String replicationRole() { + return this.inner().replicationRole(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public SslEnforcementEnum sslEnforcement() { + return this.inner().sslEnforcement(); + } + + @Override + public StorageProfile storageProfile() { + return this.inner().storageProfile(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ServerState userVisibleState() { + return this.inner().userVisibleState(); + } + + @Override + public ServerVersion version() { + return this.inner().version(); + } + +}