Skip to content

Commit

Permalink
BREAKING CHANGE: Adl object refactor (#3512)
Browse files Browse the repository at this point in the history
* Code gen for ADLA

* This change is mapped to this PR:
Azure/azure-rest-api-specs#1429

* This commit is for ADLA

* Code gen for ADLS

* This change is mapped to this PR:
Azure/azure-rest-api-specs#1429

* This commit for ADLS

* Code gen for ADLS (part 2)

* I missed this file!

* Code gen for ADL (part 3)

* Updating to the correct commit number:
Azure/azure-rest-api-specs#1452

* Update Azure Batch to 5.1.0 (#3513)

* Fixing publishing of symbols. Fixing issue# 3518 (#3519)

* Fix Batch changelog references (#3517)

* Do hydra to swagger specs migration for azure-sdk-for-net (#3482)

* Do hydra to swagger specs migration for azure-sdk-for-net

* Fix build failed problem

* update the assemblyinfo file with the updated version 2.6.0

* Revert "update the assemblyinfo file with the updated version 2.6.0"

This reverts commit a33beb0.

* Updata the AssemblyFileVersion to 2.6.0.0

* revert package version

* Make project files concise.

* Add Provider test case

* update the pr with new tests with session records

* remove extra code

* Fixing changelog.md

* Fixing up changelog.md
  • Loading branch information
ro-joowan authored and shahabhijeet committed Aug 4, 2017
1 parent 11e6593 commit 638fb1a
Show file tree
Hide file tree
Showing 228 changed files with 9,858 additions and 7,588 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ public void SubmitGetListCancelTest()
var pipelineName = TestUtilities.GenerateName("jobPipeline");
var pipelineUri = string.Format("https://{0}.contoso.com/myJob", TestUtilities.GenerateName("pipelineuri"));
// Submit a job to the account
var jobToSubmit = new JobInformation
var jobToSubmit = new CreateJobParameters
{
Name = "azure sdk data lake analytics job",
DegreeOfParallelism = 2,
Type = JobType.USql,
Properties = new USqlJobProperties
Properties = new CreateUSqlJobProperties
{
Script = "DROP DATABASE IF EXISTS testdb; CREATE DATABASE testdb;"
},
Expand Down Expand Up @@ -146,13 +146,24 @@ public void SubmitGetListCancelTest()
Assert.Equal(1, listRecurrence.Count());
Assert.True(listRecurrence.Any(recurrence => recurrence.RecurrenceId == recurrenceId));

// Build a job to the account
var jobToBuild = new BuildJobParameters
{
Name = "azure sdk data lake analytics job",
Type = JobType.USql,
Properties = new CreateUSqlJobProperties
{
Script = "DROP DATABASE IF EXISTS testdb; CREATE DATABASE testdb;"
}
};

// Just compile the job, which requires a jobId in the job object
var compileResponse = clientToUse.Job.Build(commonData.SecondDataLakeAnalyticsAccountName, jobToSubmit);
var compileResponse = clientToUse.Job.Build(commonData.SecondDataLakeAnalyticsAccountName, jobToBuild);
Assert.NotNull(compileResponse);

// now compile a broken job and verify diagnostics report an error
jobToSubmit.Properties.Script = "DROP DATABASE IF EXIST FOO; CREATE DATABASE FOO;";
compileResponse = clientToUse.Job.Build(commonData.SecondDataLakeAnalyticsAccountName, jobToSubmit);
compileResponse = clientToUse.Job.Build(commonData.SecondDataLakeAnalyticsAccountName, jobToBuild);
Assert.NotNull(compileResponse);

Assert.Equal(1, ((USqlJobProperties)compileResponse.Properties).Diagnostics.Count);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,12 @@ CREATE VIEW {0}.dbo.{3}

internal Guid RunJobToCompletion(DataLakeAnalyticsJobManagementClient jobClient, string dataLakeAnalyticsAccountName, Guid jobIdToUse, string scriptToRun)
{
var createOrBuildParams = new JobInformation
var createOrBuildParams = new CreateJobParameters
{
Name = TestUtilities.GenerateName("testjob1"),
Type = JobType.USql,
DegreeOfParallelism = 2,
Properties = new USqlJobProperties
Properties = new CreateUSqlJobProperties
{
// Type = JobType.USql,
Script = scriptToRun
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal static class DataLakeAnalyticsCustomizationHelper
/// This constant is used as the default package version to place in the user agent.
/// It should mirror the package version in the project.json file.
/// </summary>
internal const string PackageVersion = "3.0.1";
internal const string PackageVersion = "3.1.0-preview";

internal const string DefaultAdlaDnsSuffix = "azuredatalakeanalytics.net";

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

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 @@ -2,7 +2,7 @@
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
// Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
// Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
// Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
// Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
// Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

Expand Down Expand Up @@ -213,6 +213,8 @@ private void Initialize()
};
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<JobProperties>("type"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<JobProperties>("type"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<CreateJobProperties>("type"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<CreateJobProperties>("type"));
CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
// Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

Expand Down Expand Up @@ -53,19 +53,22 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien
public DataLakeAnalyticsAccountManagementClient Client { get; private set; }

/// <summary>
/// Gets the specified Data Lake Store account details in the specified Data
/// Lake Analytics account.
/// Updates the specified Data Lake Analytics account to include the additional
/// Data Lake Store account.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the Azure resource group that contains the Data Lake Analytics
/// account.
/// </param>
/// <param name='accountName'>
/// The name of the Data Lake Analytics account from which to retrieve the Data
/// Lake Store account details.
/// The name of the Data Lake Analytics account to which to add the Data Lake
/// Store account.
/// </param>
/// <param name='dataLakeStoreAccountName'>
/// The name of the Data Lake Store account to retrieve
/// The name of the Data Lake Store account to add.
/// </param>
/// <param name='parameters'>
/// The details of the Data Lake Store account.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
Expand All @@ -76,9 +79,6 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien
/// <exception cref="CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Expand All @@ -88,7 +88,7 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<DataLakeStoreAccountInfo>> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string dataLakeStoreAccountName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse> AddWithHttpMessagesAsync(string resourceGroupName, string accountName, string dataLakeStoreAccountName, AddDataLakeStoreParameters parameters = default(AddDataLakeStoreParameters), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
Expand Down Expand Up @@ -120,8 +120,9 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("accountName", accountName);
tracingParameters.Add("dataLakeStoreAccountName", dataLakeStoreAccountName);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
ServiceClientTracing.Enter(_invocationId, this, "Add", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
Expand All @@ -142,7 +143,7 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
_httpRequest.Method = new HttpMethod("GET");
_httpRequest.Method = new HttpMethod("PUT");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
Expand Down Expand Up @@ -173,6 +174,12 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien

// Serialize Request
string _requestContent = null;
if(parameters != null)
{
_requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
_httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
}
// Set Credentials
if (Client.Credentials != null)
{
Expand Down Expand Up @@ -228,31 +235,13 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien
throw ex;
}
// Create Result
var _result = new AzureOperationResponse<DataLakeStoreAccountInfo>();
var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
// Deserialize Response
if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
_result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<DataLakeStoreAccountInfo>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
Expand Down Expand Up @@ -448,22 +437,19 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien
}

/// <summary>
/// Updates the specified Data Lake Analytics account to include the additional
/// Data Lake Store account.
/// Gets the specified Data Lake Store account details in the specified Data
/// Lake Analytics account.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the Azure resource group that contains the Data Lake Analytics
/// account.
/// </param>
/// <param name='accountName'>
/// The name of the Data Lake Analytics account to which to add the Data Lake
/// Store account.
/// The name of the Data Lake Analytics account from which to retrieve the Data
/// Lake Store account details.
/// </param>
/// <param name='dataLakeStoreAccountName'>
/// The name of the Data Lake Store account to add.
/// </param>
/// <param name='parameters'>
/// The details of the Data Lake Store account.
/// The name of the Data Lake Store account to retrieve
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
Expand All @@ -474,6 +460,9 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien
/// <exception cref="CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Expand All @@ -483,7 +472,7 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse> AddWithHttpMessagesAsync(string resourceGroupName, string accountName, string dataLakeStoreAccountName, AddDataLakeStoreParameters parameters = default(AddDataLakeStoreParameters), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse<DataLakeStoreAccountInfo>> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string dataLakeStoreAccountName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
Expand Down Expand Up @@ -515,9 +504,8 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("accountName", accountName);
tracingParameters.Add("dataLakeStoreAccountName", dataLakeStoreAccountName);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Add", tracingParameters);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
Expand All @@ -538,7 +526,7 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
_httpRequest.Method = new HttpMethod("PUT");
_httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
Expand Down Expand Up @@ -569,12 +557,6 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien

// Serialize Request
string _requestContent = null;
if(parameters != null)
{
_requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
_httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
}
// Set Credentials
if (Client.Credentials != null)
{
Expand Down Expand Up @@ -630,13 +612,31 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien
throw ex;
}
// Create Result
var _result = new AzureOperationResponse();
var _result = new AzureOperationResponse<DataLakeStoreAccountInfo>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
// Deserialize Response
if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
_result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<DataLakeStoreAccountInfo>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
Expand Down
Loading

0 comments on commit 638fb1a

Please sign in to comment.