Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
92ab945
Initial commit of client testing around Server crud, database crud, e…
nathannfan Oct 23, 2016
36f9879
Updated tests to match updated specs
nathannfan Oct 23, 2016
f4493b1
Update tests to reflect name changes in swagger spec
nathannfan Oct 26, 2016
a3484ca
Responded to comments, added GeoDR functionality
nathannfan Oct 28, 2016
63bd3db
Responded to comments, added GeoDR functionality
nathannfan Oct 28, 2016
136d7f1
Updated test records
nathannfan Nov 4, 2016
5a32898
Additional test and recording fixes
nathannfan Nov 4, 2016
ec0d325
Merge remote-tracking branch 'upstream/AutoRest' into AutoRest
nathannfan Feb 9, 2017
f2756be
Update TestFramework version, re-do Test Recordings
nathannfan Feb 10, 2017
656ec25
Responded to comments: updated comments, referenced constant classes …
nathannfan Feb 17, 2017
7c1c45e
Merge remote-tracking branch 'upstream/AutoRest' into AutoRest
nathannfan Feb 17, 2017
6645568
Re-generate code after Swagger examples update and fixes, re-do recor…
nathannfan Feb 22, 2017
f7de0fe
Merge remote-tracking branch 'upstream/AutoRest' into AutoRest
nathannfan Feb 22, 2017
2c6c703
Regen from Swagger. DB now has RestorePointInTime
jaredmoo Feb 23, 2017
9fc86c3
Added point in time restore test
jaredmoo Feb 23, 2017
1dfb310
Regen from swagger
jaredmoo Feb 23, 2017
9efd1e4
Added SampleName param to DB create max test case
jaredmoo Feb 23, 2017
323cf27
Added Copy and move db between pools scenarios
nathannfan Feb 24, 2017
dbcc7b7
Merge remote-tracking branch 'origin' into AutoRest
nathannfan Feb 24, 2017
627bdf2
Update client to remove unused parameters/definitions, add Operations…
nathannfan Feb 24, 2017
6d9709c
Add test case for removing database from elastic pool
nathannfan Feb 25, 2017
b67c487
Regen with doc updates
jaredmoo Feb 27, 2017
071fd65
Added test for list database filter
jaredmoo Feb 27, 2017
1b479a6
Update AutoRest to 1.0.0-Nightly20161212 and regen
jaredmoo Feb 28, 2017
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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,18 @@ internal ElasticPoolsOperations(SqlManagementClient client)
/// elastic pool.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the Resource Group to which the resource belongs.
/// 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>
/// <param name='serverName'>
/// The name of the Azure SQL Server
/// The name of the Azure SQL server.
/// </param>
/// <param name='elasticPoolName'>
/// The name of the Azure SQL Elastic Pool to be operated on (Updated or
/// created).
/// </param>
/// <param name='parameters'>
/// The required parameters for createing or updating an Elastic Pool.
/// The required parameters for creating or updating an Elastic Pool.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
Expand All @@ -79,17 +80,18 @@ internal ElasticPoolsOperations(SqlManagementClient client)
/// elastic pool.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the Resource Group to which the resource belongs.
/// 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>
/// <param name='serverName'>
/// The name of the Azure SQL Server
/// The name of the Azure SQL server.
/// </param>
/// <param name='elasticPoolName'>
/// The name of the Azure SQL Elastic Pool to be operated on (Updated or
/// created).
/// </param>
/// <param name='parameters'>
/// The required parameters for createing or updating an Elastic Pool.
/// The required parameters for creating or updating an Elastic Pool.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
Expand Down Expand Up @@ -303,24 +305,6 @@ internal ElasticPoolsOperations(SqlManagementClient client)
throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nathannfan did the swagger changed and is no longer returning 202?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swagger still documents 202, but no longer has a response body, which I believe is why this section is removed.

}
// Deserialize Response
if ((int)_statusCode == 202)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
_result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<ElasticPool>(_responseContent, this.Client.DeserializationSettings);
}
catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
Expand All @@ -332,10 +316,11 @@ internal ElasticPoolsOperations(SqlManagementClient client)
/// Deletes the Azure SQL elastic pool.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the Resource Group to which the resource belongs.
/// 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>
/// <param name='serverName'>
/// The name of the Azure SQL Server
/// The name of the Azure SQL server.
/// </param>
/// <param name='elasticPoolName'>
/// The name of the Azure SQL Elastic Pool to be deleted.
Expand Down Expand Up @@ -498,13 +483,14 @@ internal ElasticPoolsOperations(SqlManagementClient client)
}

/// <summary>
/// Returns information about an Azure SQL elastic pool.
/// Gets information about an Azure SQL elastic pool.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the Resource Group to which the resource belongs.
/// 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>
/// <param name='serverName'>
/// The name of the Azure SQL Server
/// The name of the Azure SQL server.
/// </param>
/// <param name='elasticPoolName'>
/// The name of the Azure SQL Elastic Pool to be retrieved.
Expand Down Expand Up @@ -699,10 +685,11 @@ internal ElasticPoolsOperations(SqlManagementClient client)
/// Returns information about Azure SQL elastic pools.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the Resource Group to which the resource belongs.
/// 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>
/// <param name='serverName'>
/// The name of the Azure SQL Server
/// The name of the Azure SQL server.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
Expand Down Expand Up @@ -888,10 +875,11 @@ internal ElasticPoolsOperations(SqlManagementClient client)
/// Returns information about Azure SQL elastic pool activities.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the Resource Group to which the resource belongs.
/// 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>
/// <param name='serverName'>
/// The name of the Azure SQL Server
/// The name of the Azure SQL server.
/// </param>
/// <param name='elasticPoolName'>
/// The name of the Azure SQL Elastic Pool for which to get the current
Expand Down Expand Up @@ -1087,14 +1075,15 @@ internal ElasticPoolsOperations(SqlManagementClient client)
/// Returns information about activity on Azure SQL databases inside of an
/// Azure SQL elastic pool.
/// </summary>
/// <param name='elasticPoolName'>
/// The name of the Azure SQL Elastic Pool.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the Resource Group to which the resource belongs.
/// 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>
/// <param name='serverName'>
/// The name of the Azure SQL Server
/// The name of the Azure SQL server.
/// </param>
/// <param name='elasticPoolName'>
/// The name of the Azure SQL Elastic Pool.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
Expand All @@ -1114,12 +1103,8 @@ internal ElasticPoolsOperations(SqlManagementClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<System.Collections.Generic.IEnumerable<ElasticPoolDatabaseActivity>>> ListDatabaseActivityWithHttpMessagesAsync(string elasticPoolName, string resourceGroupName, string serverName, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<System.Collections.Generic.IEnumerable<ElasticPoolDatabaseActivity>>> ListDatabaseActivityWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nathannfan was name simplification used when the code was generated via AutoRest?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shahabhijeet Not sure how that is specified. Is there documentation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Synced up with Cormac. This requires a later version of AutoRest.

{
if (elasticPoolName == null)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "elasticPoolName");
}
if (this.Client.SubscriptionId == null)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
Expand All @@ -1132,6 +1117,10 @@ internal ElasticPoolsOperations(SqlManagementClient client)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serverName");
}
if (elasticPoolName == null)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "elasticPoolName");
}
string apiVersion = "2014-04-01";
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
Expand All @@ -1140,20 +1129,20 @@ internal ElasticPoolsOperations(SqlManagementClient client)
{
_invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>();
tracingParameters.Add("elasticPoolName", elasticPoolName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("elasticPoolName", elasticPoolName);
tracingParameters.Add("cancellationToken", cancellationToken);
Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListDatabaseActivity", tracingParameters);
}
// Construct URL
var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity").ToString();
_url = _url.Replace("{elasticPoolName}", System.Uri.EscapeDataString(elasticPoolName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
_url = _url.Replace("{elasticPoolName}", System.Uri.EscapeDataString(elasticPoolName));
System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>();
if (apiVersion != null)
{
Expand Down Expand Up @@ -1283,20 +1272,21 @@ internal ElasticPoolsOperations(SqlManagementClient client)
}

/// <summary>
/// Returns information about an Azure SQL database inside of an Azure SQL
/// Gets information about an Azure SQL database inside of an Azure SQL
/// elastic pool.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the Resource Group to which the resource belongs.
/// 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>
/// <param name='serverName'>
/// The name of the Azure SQL Server
/// The name of the Azure SQL server.
/// </param>
/// <param name='elasticPoolName'>
/// The name of the Azure SQL Elastic Pool to be retrieved.
/// </param>
/// <param name='databaseName'>
/// The name of the Azure SQL Database to be retrieved.
/// The name of the Azure SQL database to be retrieved.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
Expand Down Expand Up @@ -1495,10 +1485,11 @@ internal ElasticPoolsOperations(SqlManagementClient client)
/// elastic pool.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the Resource Group to which the resource belongs.
/// 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>
/// <param name='serverName'>
/// The name of the Azure SQL Server
/// The name of the Azure SQL server.
/// </param>
/// <param name='elasticPoolName'>
/// The name of the Azure SQL Elastic Pool to be retrieved.
Expand Down
Loading