-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SQL Virtual Network Rules and DNS Aliases (#244)
* Add Fluent support for SQL Virtual Network Rules * Add Fluent support for SQL server DNS aliases
- Loading branch information
Showing
30 changed files
with
5,718 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlServerDnsAlias.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for | ||
* license information. | ||
*/ | ||
package com.microsoft.azure.management.sql; | ||
|
||
import com.microsoft.azure.management.apigeneration.Beta; | ||
import com.microsoft.azure.management.apigeneration.Fluent; | ||
import com.microsoft.azure.management.apigeneration.Method; | ||
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasId; | ||
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName; | ||
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasResourceGroup; | ||
import com.microsoft.azure.management.resources.fluentcore.model.HasInner; | ||
import com.microsoft.azure.management.resources.fluentcore.model.Indexable; | ||
import com.microsoft.azure.management.resources.fluentcore.model.Refreshable; | ||
import com.microsoft.azure.management.sql.implementation.ServerDnsAliasInner; | ||
import rx.Completable; | ||
|
||
/** | ||
* An immutable client-side representation of an Azure SQL Server DNS alias. | ||
*/ | ||
@Fluent | ||
@Beta(Beta.SinceVersion.V1_8_0) | ||
public interface SqlServerDnsAlias | ||
extends | ||
HasId, | ||
HasInner<ServerDnsAliasInner>, | ||
HasName, | ||
HasResourceGroup, | ||
Indexable, | ||
Refreshable<SqlServerDnsAlias> { | ||
/** | ||
* @return name of the SQL Server to which this DNS alias belongs | ||
*/ | ||
String sqlServerName(); | ||
|
||
/** | ||
* @return the fully qualified DNS record for alias | ||
*/ | ||
String azureDnsRecord(); | ||
|
||
/** | ||
* @return the parent SQL server ID | ||
*/ | ||
String parentId(); | ||
|
||
/** | ||
* Deletes the DNS alias. | ||
*/ | ||
@Method | ||
void delete(); | ||
|
||
/** | ||
* Deletes the DNS alias asynchronously. | ||
* | ||
* @return a representation of the deferred computation of this call | ||
*/ | ||
@Method | ||
Completable deleteAsync(); | ||
|
||
} |
145 changes: 145 additions & 0 deletions
145
...gmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlServerDnsAliasOperations.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for | ||
* license information. | ||
*/ | ||
package com.microsoft.azure.management.sql; | ||
|
||
import com.microsoft.azure.management.apigeneration.Beta; | ||
import com.microsoft.azure.management.apigeneration.Fluent; | ||
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; | ||
import com.microsoft.azure.management.resources.fluentcore.model.Creatable; | ||
import rx.Completable; | ||
|
||
/** | ||
* A representation of the Azure SQL Server DNS alias operations. | ||
*/ | ||
@Fluent | ||
@Beta(Beta.SinceVersion.V1_8_0) | ||
public interface SqlServerDnsAliasOperations extends | ||
SupportsCreating<SqlServerDnsAliasOperations.DefinitionStages.WithSqlServer>, | ||
SqlChildrenOperations<SqlServerDnsAlias> { | ||
|
||
/** | ||
* Acquires server DNS alias from another server. | ||
* | ||
* @param resourceGroupName the name of the resource group that contains the resource | ||
* @param serverName the name of the server that the alias is pointing to | ||
* @param dnsAliasName the name of the Server DNS alias | ||
* @param sqlServerId the id of the other SQL server that the DNS alias was pointing to | ||
*/ | ||
void acquire(String resourceGroupName, String serverName, String dnsAliasName, String sqlServerId); | ||
|
||
/** | ||
* Acquires server DNS alias from another server asynchronously. | ||
* | ||
* @param resourceGroupName the name of the resource group that contains the resource | ||
* @param serverName the name of the server that the alias is pointing to | ||
* @param dnsAliasName the name of the Server DNS alias | ||
* @param sqlServerId the id of the other SQL server that the DNS alias was pointing to | ||
* @return a representation of the deferred computation of this call | ||
*/ | ||
Completable acquireAsync(String resourceGroupName, String serverName, String dnsAliasName, String sqlServerId); | ||
|
||
/** | ||
* Acquires server DNS alias from another server. | ||
* | ||
* @param dnsAliasName the name of the Server DNS alias | ||
* @param oldSqlServerId the id of the other SQL server that the DNS alias was pointing to | ||
* @param newSqlServerId the id of the server that the alias is pointing to | ||
*/ | ||
void acquire(String dnsAliasName, String oldSqlServerId, String newSqlServerId); | ||
|
||
/** | ||
* Acquires server DNS alias from another server asynchronously. | ||
* | ||
* @param dnsAliasName the name of the Server DNS alias | ||
* @param oldSqlServerId the id of the other SQL server that the DNS alias was pointing to | ||
* @param newSqlServerId the id of the server that the alias is pointing to | ||
* @return a representation of the deferred computation of this call | ||
*/ | ||
Completable acquireAsync(String dnsAliasName, String oldSqlServerId, String newSqlServerId); | ||
|
||
/** | ||
* Container interface for all the definitions that need to be implemented. | ||
*/ | ||
@Beta(Beta.SinceVersion.V1_8_0) | ||
interface SqlServerDnsAliasOperationsDefinition extends | ||
SqlServerDnsAliasOperations.DefinitionStages.WithSqlServer, | ||
SqlServerDnsAliasOperations.DefinitionStages.WithCreate { | ||
} | ||
|
||
/** | ||
* Grouping of all the SQL Server DNS alias definition stages. | ||
*/ | ||
@Beta(Beta.SinceVersion.V1_8_0) | ||
interface DefinitionStages { | ||
/** | ||
* The first stage of the SQL Server DNS alias definition. | ||
*/ | ||
@Beta(Beta.SinceVersion.V1_8_0) | ||
interface WithSqlServer { | ||
/** | ||
* Sets the parent SQL server name and resource group it belongs to. | ||
* | ||
* @param resourceGroupName the name of the resource group the parent SQL server | ||
* @param sqlServerName the parent SQL server name | ||
* @return The next stage of the definition. | ||
*/ | ||
SqlServerDnsAliasOperations.DefinitionStages.WithCreate withExistingSqlServer(String resourceGroupName, String sqlServerName); | ||
|
||
/** | ||
* Sets the parent SQL server for the new Server DNS alias. | ||
* | ||
* @param sqlServerId the parent SQL server ID | ||
* @return The next stage of the definition. | ||
*/ | ||
SqlServerDnsAliasOperations.DefinitionStages.WithCreate withExistingSqlServerId(String sqlServerId); | ||
|
||
/** | ||
* Sets the parent SQL server for the new Server DNS alias. | ||
* | ||
* @param sqlServer the parent SQL server | ||
* @return The next stage of the definition. | ||
*/ | ||
SqlServerDnsAliasOperations.DefinitionStages.WithCreate withExistingSqlServer(SqlServer sqlServer); | ||
} | ||
|
||
/** | ||
* The final stage of the SQL Server DNS alias definition. | ||
*/ | ||
interface WithCreate extends Creatable<SqlServerDnsAlias> { | ||
} | ||
} | ||
|
||
/** | ||
* Grouping of the Azure SQL Server DNS alias common actions. | ||
*/ | ||
@Beta(Beta.SinceVersion.V1_8_0) | ||
interface SqlServerDnsAliasActionsDefinition extends SqlChildrenActionsDefinition<SqlServerDnsAlias> { | ||
/** | ||
* Begins the definition of a new SQL ServerDNS alias to be added to this server. | ||
* | ||
* @param serverDnsAliasName the name of the new DNS alias to be created for the selected SQL server | ||
* @return the first stage of the new SQL Virtual Network Rule definition | ||
*/ | ||
SqlServerDnsAliasOperations.DefinitionStages.WithCreate define(String serverDnsAliasName); | ||
|
||
/** | ||
* Acquires server DNS alias from another server. | ||
* | ||
* @param dnsAliasName the name of the Server DNS alias | ||
* @param sqlServerId the id of the other SQL server that the DNS alias was pointing to | ||
*/ | ||
void acquire(String dnsAliasName, String sqlServerId); | ||
|
||
/** | ||
* Acquires server DNS alias from another server asynchronously. | ||
* | ||
* @param dnsAliasName the name of the Server DNS alias | ||
* @param sqlServerId the id of the other SQL server that the DNS alias was pointing to | ||
* @return a representation of the deferred computation of this call | ||
*/ | ||
Completable acquireAsync(String dnsAliasName, String sqlServerId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.