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

Added more apis in SQL SDK #1270

Merged
merged 1 commit into from
Nov 10, 2016
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 @@ -13,7 +13,7 @@
/**
* Defines values for DatabaseEditions.
*/
public class DatabaseEditions {
public final class DatabaseEditions {
/** Static value Web for DatabaseEditions. */
public static final DatabaseEditions WEB = new DatabaseEditions("Web");

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/**
* 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.Fluent;
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.Wrapper;
import com.microsoft.azure.management.sql.implementation.ElasticPoolActivityInner;
import org.joda.time.DateTime;


/**
* An immutable client-side representation of an Azure SQL ElasticPool's Activity.
*/
@Fluent
public interface ElasticPoolActivity extends
Wrapper<ElasticPoolActivityInner>,
HasResourceGroup,
HasName,
HasId {
/**
* @return the time the operation finished (ISO8601 format)
*/
DateTime endTime();

/**
* @return the error code if available
*/
int errorCode();

/**
* @return the error message if available
*/
String errorMessage();

/**
* @return the error severity if available
*/
int errorSeverity();

/**
* @return the operation name
*/
String operation();

/**
* @return the unique operation ID
*/
String operationId();

/**
* @return the percentage complete if available
*/
int percentComplete();

/**
* @return the requested max DTU per database if available
*/
int requestedDatabaseDtuMax();

/**
* @return the requested min DTU per database if available
*/
int requestedDatabaseDtuMin();

/**
* @return the requested DTU for the pool if available
*/
int requestedDtu();

/**
* @return the requested name for the Elastic Pool if available
*/
String requestedElasticPoolName();

/**
* @return the requested storage limit for the pool in GB if available
*/
long requestedStorageLimitInGB();

/**
* @return the name of the Elastic Pool
*/
String elasticPoolName();

/**
* @return the name of the Azure SQL Server the Elastic Pool is in
*/
String serverName();

/**
* @return the time the operation started (ISO8601 format)
*/
DateTime startTime();

/**
* @return the current state of the operation
*/
String state();
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/**
* 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.Fluent;
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.Wrapper;
import com.microsoft.azure.management.sql.implementation.ElasticPoolDatabaseActivityInner;
import org.joda.time.DateTime;


/**
* An immutable client-side representation of an Azure SQL ElasticPool's Database Activity.
*/
@Fluent
public interface ElasticPoolDatabaseActivity extends
Wrapper<ElasticPoolDatabaseActivityInner>,
HasResourceGroup,
HasName,
HasId {
/**
* @return the database name
*/
String databaseName();

/**
* @return the time the operation finished (ISO8601 format)
*/
DateTime endTime();

/**
* @return the error code if available
*/
int errorCode();

/**
* @return the error message if available
*/
String errorMessage();

/**
* @return the error severity if available
*/
int errorSeverity();

/**
* @return the operation name
*/
String operation();

/**
* @return the unique operation ID
*/
String operationId();

/**
* @return the percentage complete if available
*/
int percentComplete();

/**
* @return the name for the Elastic Pool the database is moving into if available
*/
String requestedElasticPoolName();

/**
* @return the name of the current Elastic Pool the database is in if available
*/
String currentElasticPoolName();

/**
* @return the name of the current service objective if available
*/
String currentServiceObjective();

/**
* @return the name of the requested service objective if available
*/
String requestedServiceObjective();

/**
* @return the name of the Azure SQL Server the Elastic Pool is in
*/
String serverName();

/**
* @return the time the operation started (ISO8601 format)
*/
DateTime startTime();

/**
* @return the current state of the operation
*/
String state();

}

Original file line number Diff line number Diff line change
@@ -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.
*/

package com.microsoft.azure.management.sql;

import com.microsoft.azure.PagedList;
import com.microsoft.azure.management.apigeneration.Fluent;
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.Refreshable;
import com.microsoft.azure.management.resources.fluentcore.model.Wrapper;
import com.microsoft.azure.management.sql.implementation.RecommendedElasticPoolInner;
import com.microsoft.azure.management.sql.implementation.RecommendedElasticPoolMetricInner;
import org.joda.time.DateTime;

import java.util.List;

/**
* An immutable client-side representation of an Azure SQL Recommended ElasticPool.
*/
@Fluent
public interface RecommendedElasticPool extends
Refreshable<RecommendedElasticPool>,
Wrapper<RecommendedElasticPoolInner>,
HasResourceGroup,
HasName,
HasId {

/**
* @return name of the SQL Server to which this database belongs
*/
String sqlServerName();

/**
* @return the edition of the Azure SQL Recommended Elastic Pool. The
* ElasticPoolEditions enumeration contains all the valid editions.
* Possible values include: 'Basic', 'Standard', 'Premium'.
*/
ElasticPoolEditions databaseEdition();

/**
* @return the DTU for the SQL Azure Recommended Elastic Pool.
*/
double dtu();

/**
* @return the minimum DTU for the database.
*/
double databaseDtuMin();

/**
* @return the maximum DTU for the database.
*/
double databaseDtuMax();

/**
* @return storage size in megabytes.
*/
double storageMB();

/**
* @return the observation period start (ISO8601 format).
*/
DateTime observationPeriodStart();

/**
* @return the observation period start (ISO8601 format).
*/
DateTime observationPeriodEnd();

/**
* @return maximum observed DTU.
*/
double maxObservedDtu();

/**
* @return maximum observed storage in megabytes.
*/
double maxObservedStorageMB();

/**
* @return the list of Azure SQL Databases in this pool. Expanded property.
*/
List<SqlDatabase> databases();

// TODO - ans - Will implement this once knowing what to do with expanded properties
/**
* @return the list of Azure SQL Databases housed in the server. Expanded property.
*/
List<RecommendedElasticPoolMetricInner> metrics();

/**
* Fetches list of databases by making call to Azure.
* @return list of the databases in recommended elastic pool
*/
PagedList<SqlDatabase> listDatabases();

/**
* Get a specific database in the recommended database.
*
* @param databaseName name of the database to be fetched
* @return information on the database recommended in recommended elastic pool
*/
SqlDatabase getDatabase(String databaseName);


/**
* Fetches list of metrics information by making call to Azure.
* @return list of the databases in recommended elastic pool
*/
PagedList<RecommendedElasticPoolMetric> listMetrics();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* 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.Fluent;
import com.microsoft.azure.management.resources.fluentcore.model.Wrapper;
import com.microsoft.azure.management.sql.implementation.RecommendedElasticPoolMetricInner;
import org.joda.time.DateTime;


/**
* An immutable client-side representation of an Azure SQL Replication link.
*/
@Fluent
public interface RecommendedElasticPoolMetric extends
Wrapper<RecommendedElasticPoolMetricInner> {
/**
* @return the time of metric (ISO8601 format).
*/
DateTime dateTimeProperty();

/**
* @return the DTUs (Database Transaction Units)
* See https://azure.microsoft.com/en-us/documentation/articles/sql-database-what-is-a-dtu/
*/
double dtu();

/**
* @return the size in gigabytes.
*/
double sizeGB();
}

Loading