/// <summary>
 /// Returns information about a certain Service Objective on a given Id.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IServiceObjectiveOperations.
 /// </param>
 /// <param name='serverName'>
 /// The name of the SQL Server to be queried.
 /// </param>
 /// <param name='serviceObjectiveId'>
 /// The Id of the Service Objective to be obtained.
 /// </param>
 /// <returns>
 /// Response containing the service objective for a given server and
 /// service objective Id.
 /// </returns>
 public static ServiceObjectiveGetResponse Get(this IServiceObjectiveOperations operations, string serverName, string serviceObjectiveId)
 {
     try
     {
         return(operations.GetAsync(serverName, serviceObjectiveId).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Example #2
0
 /// <summary>
 /// Returns information about an Azure SQL Database Server Service
 /// Objectives.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.LegacySdk.IServiceObjectiveOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the Resource Group to which the server
 /// belongs.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Server.
 /// </param>
 /// <param name='serviceObjectiveName'>
 /// Required. The name of the service objective to retrieve.
 /// </param>
 /// <returns>
 /// Represents the response to a Get Azure Sql Database Service
 /// Objective request.
 /// </returns>
 public static Task <ServiceObjectiveGetResponse> GetAsync(this IServiceObjectiveOperations operations, string resourceGroupName, string serverName, string serviceObjectiveName)
 {
     return(operations.GetAsync(resourceGroupName, serverName, serviceObjectiveName, CancellationToken.None));
 }
Example #3
0
 /// <summary>
 /// Returns information about a certain Service Objective on a given Id.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IServiceObjectiveOperations.
 /// </param>
 /// <param name='serverName'>
 /// The name of the SQL Server to be queried.
 /// </param>
 /// <param name='serviceObjectiveId'>
 /// The Id of the Service Objective to be obtained.
 /// </param>
 /// <returns>
 /// Response containing the service objective for a given server and
 /// service objective Id.
 /// </returns>
 public static Task<ServiceObjectiveGetResponse> GetAsync(this IServiceObjectiveOperations operations, string serverName, string serviceObjectiveId)
 {
     return operations.GetAsync(serverName, serviceObjectiveId, CancellationToken.None);
 }