diff --git a/src/ResourceManagement/AzureBackup/AzureBackup.sln b/src/ResourceManagement/AzureBackup/AzureBackup.sln
index ee7520ab97fa..d18505134f47 100644
--- a/src/ResourceManagement/AzureBackup/AzureBackup.sln
+++ b/src/ResourceManagement/AzureBackup/AzureBackup.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
-VisualStudioVersion = 12.0.21005.1
+VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackupServicesManagment", "BackupServicesManagment\BackupServicesManagment.csproj", "{38A6741C-77A3-42A8-A846-83373BE57C7F}"
EndProject
@@ -9,6 +9,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestDependencies", "..\..\T
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackupServices.Tests", "BackupServices.Tests\BackupServices.Tests.csproj", "{472DDC1D-318A-477C-949B-10811FDA6730}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{2C5BD9EC-5B75-46B0-B84E-29A1F1F9909D}"
+ ProjectSection(SolutionItems) = preProject
+ .nuget\NuGet.Config = .nuget\NuGet.Config
+ .nuget\NuGet.exe = .nuget\NuGet.exe
+ .nuget\NuGet.targets = .nuget\NuGet.targets
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Net40-Debug|Any CPU = Net40-Debug|Any CPU
diff --git a/src/ResourceManagement/AzureBackup/BackupServicesManagment/BackupServicesManagment.csproj b/src/ResourceManagement/AzureBackup/BackupServicesManagment/BackupServicesManagment.csproj
index 0bf19f749296..96f968612784 100644
--- a/src/ResourceManagement/AzureBackup/BackupServicesManagment/BackupServicesManagment.csproj
+++ b/src/ResourceManagement/AzureBackup/BackupServicesManagment/BackupServicesManagment.csproj
@@ -16,7 +16,49 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/BackupServicesManagementClient.cs b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/BackupServicesManagementClient.cs
index 543eda11deea..de3be4ba5eb9 100644
--- a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/BackupServicesManagementClient.cs
+++ b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/BackupServicesManagementClient.cs
@@ -100,6 +100,16 @@ public string ResourceName
set { this._resourceName = value; }
}
+ private IBackUpOperations _backUp;
+
+ ///
+ /// Definition of BackUp operations for the Azure Backup extension.
+ ///
+ public virtual IBackUpOperations BackUp
+ {
+ get { return this._backUp; }
+ }
+
private IJobOperations _job;
///
@@ -122,6 +132,28 @@ public virtual IProtectionPolicyOperations ProtectionPolicy
get { return this._protectionPolicy; }
}
+ private IRecoveryPointOperations _recoveryPoint;
+
+ ///
+ /// Definition of Recovery Point operations for the Azure Backup
+ /// extension.
+ ///
+ public virtual IRecoveryPointOperations RecoveryPoint
+ {
+ get { return this._recoveryPoint; }
+ }
+
+ private IVaultCredentialOperations _vaultCredentials;
+
+ ///
+ /// Definition of Vault credential-related operations for the Azure
+ /// Backup extension.
+ ///
+ public virtual IVaultCredentialOperations VaultCredentials
+ {
+ get { return this._vaultCredentials; }
+ }
+
///
/// Initializes a new instance of the BackupServicesManagementClient
/// class.
@@ -129,8 +161,11 @@ public virtual IProtectionPolicyOperations ProtectionPolicy
public BackupServicesManagementClient()
: base()
{
+ this._backUp = new BackUpOperations(this);
this._job = new JobOperations(this);
this._protectionPolicy = new ProtectionPolicyOperations(this);
+ this._recoveryPoint = new RecoveryPointOperations(this);
+ this._vaultCredentials = new VaultCredentialOperations(this);
this._apiVersion = "2013-03-01";
this._longRunningOperationInitialTimeout = -1;
this._longRunningOperationRetryTimeout = -1;
@@ -231,8 +266,11 @@ public BackupServicesManagementClient(string resourceName, string resourceGroupN
public BackupServicesManagementClient(HttpClient httpClient)
: base(httpClient)
{
+ this._backUp = new BackUpOperations(this);
this._job = new JobOperations(this);
this._protectionPolicy = new ProtectionPolicyOperations(this);
+ this._recoveryPoint = new RecoveryPointOperations(this);
+ this._vaultCredentials = new VaultCredentialOperations(this);
this._apiVersion = "2013-03-01";
this._longRunningOperationInitialTimeout = -1;
this._longRunningOperationRetryTimeout = -1;
diff --git a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/IBackupServicesManagementClient.cs b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/IBackupServicesManagementClient.cs
index f16cad2f4fa9..d0da5012c656 100644
--- a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/IBackupServicesManagementClient.cs
+++ b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/IBackupServicesManagementClient.cs
@@ -80,6 +80,14 @@ string ResourceName
get; set;
}
+ ///
+ /// Definition of BackUp operations for the Azure Backup extension.
+ ///
+ IBackUpOperations BackUp
+ {
+ get;
+ }
+
///
/// Definition of Protection Policy operations for the Azure Backup
/// extension.
@@ -97,5 +105,23 @@ IProtectionPolicyOperations ProtectionPolicy
{
get;
}
+
+ ///
+ /// Definition of Recovery Point operations for the Azure Backup
+ /// extension.
+ ///
+ IRecoveryPointOperations RecoveryPoint
+ {
+ get;
+ }
+
+ ///
+ /// Definition of Vault credential-related operations for the Azure
+ /// Backup extension.
+ ///
+ IVaultCredentialOperations VaultCredentials
+ {
+ get;
+ }
}
}
diff --git a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/IVaultCredentialOperations.cs b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/IVaultCredentialOperations.cs
new file mode 100644
index 000000000000..d4176c626ba9
--- /dev/null
+++ b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/IVaultCredentialOperations.cs
@@ -0,0 +1,56 @@
+//
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// Warning: This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if the
+// code is regenerated.
+
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.Azure.Management.BackupServices.Models;
+
+namespace Microsoft.Azure.Management.BackupServices
+{
+ ///
+ /// Definition of Vault credential-related operations for the Azure Backup
+ /// extension.
+ ///
+ public partial interface IVaultCredentialOperations
+ {
+ ///
+ /// Uploads vault credential certificate.
+ ///
+ ///
+ /// Name of the certificate.
+ ///
+ ///
+ /// Certificate parameters.
+ ///
+ ///
+ /// Request header parameters.
+ ///
+ ///
+ /// Cancellation token.
+ ///
+ ///
+ /// The definition of a certificate response.
+ ///
+ Task UploadCertificateAsync(string certificateName, VaultCredUploadCertRequest vaultCredUploadCertRequest, CustomRequestHeaders customRequestHeaders, CancellationToken cancellationToken);
+ }
+}
diff --git a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/JobOperations.cs b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/JobOperations.cs
index 2bfcce94357f..e1d2abc91282 100644
--- a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/JobOperations.cs
+++ b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/JobOperations.cs
@@ -98,7 +98,7 @@ public async Task ListAsync(JobQueryParameter parameters, Custo
url = url + "/Subscriptions/";
if (this.Client.Credentials.SubscriptionId != null)
{
- url = url + Uri.EscapeDataString(this.Client.Credentials.SubscriptionId.ToString());
+ url = url + Uri.EscapeDataString(this.Client.Credentials.SubscriptionId);
}
url = url + "/resourceGroups/";
url = url + Uri.EscapeDataString(this.Client.ResourceGroupName);
@@ -162,7 +162,6 @@ public async Task ListAsync(JobQueryParameter parameters, Custo
// Set Headers
httpRequest.Headers.Add("Accept-Language", "en-us");
- httpRequest.Headers.Add("x-ms-client-request-id", customRequestHeaders.ClientRequestId);
// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
@@ -319,6 +318,10 @@ public async Task ListAsync(JobQueryParameter parameters, Custo
}
result.StatusCode = statusCode;
+ if (httpResponse.Headers.Contains("x-ms-client-request-id"))
+ {
+ customRequestHeaders.ClientRequestId = httpResponse.Headers.GetValues("x-ms-client-request-id").FirstOrDefault();
+ }
if (shouldTrace)
{
diff --git a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/RawCertificateData.cs b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/RawCertificateData.cs
new file mode 100644
index 000000000000..d0e694a4cba0
--- /dev/null
+++ b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/RawCertificateData.cs
@@ -0,0 +1,51 @@
+//
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// Warning: This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if the
+// code is regenerated.
+
+using System;
+using System.Linq;
+
+namespace Microsoft.Azure.Management.BackupServices.Models
+{
+ ///
+ /// Model for raw certificate data.
+ ///
+ public partial class RawCertificateData
+ {
+ private string _certificate;
+
+ ///
+ /// Optional. Gets or sets the base64 encoded certificate raw data
+ /// string.
+ ///
+ public string Certificate
+ {
+ get { return this._certificate; }
+ set { this._certificate = value; }
+ }
+
+ ///
+ /// Initializes a new instance of the RawCertificateData class.
+ ///
+ public RawCertificateData()
+ {
+ }
+ }
+}
diff --git a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/RecoveryPointInfo.cs b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/RecoveryPointInfo.cs
new file mode 100644
index 000000000000..090b2b9e3c62
--- /dev/null
+++ b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/RecoveryPointInfo.cs
@@ -0,0 +1,73 @@
+//
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// Warning: This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if the
+// code is regenerated.
+
+using System;
+using System.Linq;
+using Microsoft.Azure.Management.BackupServices.Models;
+
+namespace Microsoft.Azure.Management.BackupServices.Models
+{
+ ///
+ /// The definition of a RecoveryPoint Info object.
+ ///
+ public partial class RecoveryPointInfo : ManagementResponseObject
+ {
+ private string _recoveryPointAdditionalInfo;
+
+ ///
+ /// Optional. RecoveryPointAdditionalInfo of RecoveryPointInfo.
+ ///
+ public string RecoveryPointAdditionalInfo
+ {
+ get { return this._recoveryPointAdditionalInfo; }
+ set { this._recoveryPointAdditionalInfo = value; }
+ }
+
+ private DateTime _recoveryPointTime;
+
+ ///
+ /// Optional. RecoveryPointTime of RecoveryPointInfo.
+ ///
+ public DateTime RecoveryPointTime
+ {
+ get { return this._recoveryPointTime; }
+ set { this._recoveryPointTime = value; }
+ }
+
+ private string _recoveryPointType;
+
+ ///
+ /// Optional. RecoveryPointType of RecoveryPointInfo.
+ ///
+ public string RecoveryPointType
+ {
+ get { return this._recoveryPointType; }
+ set { this._recoveryPointType = value; }
+ }
+
+ ///
+ /// Initializes a new instance of the RecoveryPointInfo class.
+ ///
+ public RecoveryPointInfo()
+ {
+ }
+ }
+}
diff --git a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/RecoveryPointListResponse.cs b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/RecoveryPointListResponse.cs
new file mode 100644
index 000000000000..6a98291c8e79
--- /dev/null
+++ b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/RecoveryPointListResponse.cs
@@ -0,0 +1,52 @@
+//
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// Warning: This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if the
+// code is regenerated.
+
+using System;
+using System.Linq;
+using Microsoft.Azure;
+using Microsoft.Azure.Management.BackupServices.Models;
+
+namespace Microsoft.Azure.Management.BackupServices.Models
+{
+ ///
+ /// The response model for the list RecoveryPoints operation.
+ ///
+ public partial class RecoveryPointListResponse : AzureOperationResponse
+ {
+ private RecoveryPointInfoResponse _recoveryPoints;
+
+ ///
+ /// Optional. The list of RecoveryPoints for the resource id.
+ ///
+ public RecoveryPointInfoResponse RecoveryPoints
+ {
+ get { return this._recoveryPoints; }
+ set { this._recoveryPoints = value; }
+ }
+
+ ///
+ /// Initializes a new instance of the RecoveryPointListResponse class.
+ ///
+ public RecoveryPointListResponse()
+ {
+ }
+ }
+}
diff --git a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/ResourceCertificateAndACSDetails.cs b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/ResourceCertificateAndACSDetails.cs
new file mode 100644
index 000000000000..4134ade24cad
--- /dev/null
+++ b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/ResourceCertificateAndACSDetails.cs
@@ -0,0 +1,162 @@
+//
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// Warning: This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if the
+// code is regenerated.
+
+using System;
+using System.Linq;
+
+namespace Microsoft.Azure.Management.BackupServices.Models
+{
+ ///
+ /// The resource certificate and ACS details.
+ ///
+ public partial class ResourceCertificateAndACSDetails
+ {
+ private string _certificate;
+
+ ///
+ /// Optional. Gets or sets the base64 encoded certificate raw data
+ /// string.
+ ///
+ public string Certificate
+ {
+ get { return this._certificate; }
+ set { this._certificate = value; }
+ }
+
+ private string _friendlyName;
+
+ ///
+ /// Optional. Certificate friendlyname.
+ ///
+ public string FriendlyName
+ {
+ get { return this._friendlyName; }
+ set { this._friendlyName = value; }
+ }
+
+ private string _globalAcsHostName;
+
+ ///
+ /// Optional. Acs mgmt host name to connect to.
+ ///
+ public string GlobalAcsHostName
+ {
+ get { return this._globalAcsHostName; }
+ set { this._globalAcsHostName = value; }
+ }
+
+ private string _globalAcsNamespace;
+
+ ///
+ /// Optional. ACS namespace name - tenant for our service.
+ ///
+ public string GlobalAcsNamespace
+ {
+ get { return this._globalAcsNamespace; }
+ set { this._globalAcsNamespace = value; }
+ }
+
+ private string _globalAcsRPRealm;
+
+ ///
+ /// Optional. Global ACS namespace RP realm.
+ ///
+ public string GlobalAcsRPRealm
+ {
+ get { return this._globalAcsRPRealm; }
+ set { this._globalAcsRPRealm = value; }
+ }
+
+ private string _issuer;
+
+ ///
+ /// Optional. Certificate issuer.
+ ///
+ public string Issuer
+ {
+ get { return this._issuer; }
+ set { this._issuer = value; }
+ }
+
+ private long _resourceId;
+
+ ///
+ /// Optional. Resource ID.
+ ///
+ public long ResourceId
+ {
+ get { return this._resourceId; }
+ set { this._resourceId = value; }
+ }
+
+ private string _subject;
+
+ ///
+ /// Optional. Certificate Subject Name.
+ ///
+ public string Subject
+ {
+ get { return this._subject; }
+ set { this._subject = value; }
+ }
+
+ private string _thumbprint;
+
+ ///
+ /// Optional. Certificate thumbrprint.
+ ///
+ public string Thumbprint
+ {
+ get { return this._thumbprint; }
+ set { this._thumbprint = value; }
+ }
+
+ private DateTime _validFrom;
+
+ ///
+ /// Optional. Certificate Validity start Date time.
+ ///
+ public DateTime ValidFrom
+ {
+ get { return this._validFrom; }
+ set { this._validFrom = value; }
+ }
+
+ private DateTime _validTo;
+
+ ///
+ /// Optional. Certificate Validity End Date time.
+ ///
+ public DateTime ValidTo
+ {
+ get { return this._validTo; }
+ set { this._validTo = value; }
+ }
+
+ ///
+ /// Initializes a new instance of the ResourceCertificateAndACSDetails
+ /// class.
+ ///
+ public ResourceCertificateAndACSDetails()
+ {
+ }
+ }
+}
diff --git a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/VaultCredUploadCertRequest.cs b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/VaultCredUploadCertRequest.cs
new file mode 100644
index 000000000000..e1da431c7d74
--- /dev/null
+++ b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/VaultCredUploadCertRequest.cs
@@ -0,0 +1,51 @@
+//
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// Warning: This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if the
+// code is regenerated.
+
+using System;
+using System.Linq;
+using Microsoft.Azure.Management.BackupServices.Models;
+
+namespace Microsoft.Azure.Management.BackupServices.Models
+{
+ ///
+ /// The request model for the upload vault credential certificate operation.
+ ///
+ public partial class VaultCredUploadCertRequest
+ {
+ private RawCertificateData _rawCertificateData;
+
+ ///
+ /// Optional. Certificate properties.
+ ///
+ public RawCertificateData RawCertificateData
+ {
+ get { return this._rawCertificateData; }
+ set { this._rawCertificateData = value; }
+ }
+
+ ///
+ /// Initializes a new instance of the VaultCredUploadCertRequest class.
+ ///
+ public VaultCredUploadCertRequest()
+ {
+ }
+ }
+}
diff --git a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/VaultCredUploadCertResponse.cs b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/VaultCredUploadCertResponse.cs
new file mode 100644
index 000000000000..33adc469d92a
--- /dev/null
+++ b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/Models/VaultCredUploadCertResponse.cs
@@ -0,0 +1,52 @@
+//
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// Warning: This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if the
+// code is regenerated.
+
+using System;
+using System.Linq;
+using Microsoft.Azure;
+using Microsoft.Azure.Management.BackupServices.Models;
+
+namespace Microsoft.Azure.Management.BackupServices.Models
+{
+ ///
+ /// The definition of a certificate response.
+ ///
+ public partial class VaultCredUploadCertResponse : AzureOperationResponse
+ {
+ private ResourceCertificateAndACSDetails _resourceCertificateAndACSDetails;
+
+ ///
+ /// Optional. The resource certificate and ACS details.
+ ///
+ public ResourceCertificateAndACSDetails ResourceCertificateAndACSDetails
+ {
+ get { return this._resourceCertificateAndACSDetails; }
+ set { this._resourceCertificateAndACSDetails = value; }
+ }
+
+ ///
+ /// Initializes a new instance of the VaultCredUploadCertResponse class.
+ ///
+ public VaultCredUploadCertResponse()
+ {
+ }
+ }
+}
diff --git a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/ProtectionPolicyOperations.cs b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/ProtectionPolicyOperations.cs
index 1a4a03ac890e..4681d3e7ccf0 100644
--- a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/ProtectionPolicyOperations.cs
+++ b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/ProtectionPolicyOperations.cs
@@ -98,7 +98,7 @@ public async Task GetAsync(string jobId, CustomRequestHeaders c
url = url + "/Subscriptions/";
if (this.Client.Credentials.SubscriptionId != null)
{
- url = url + Uri.EscapeDataString(this.Client.Credentials.SubscriptionId.ToString());
+ url = url + Uri.EscapeDataString(this.Client.Credentials.SubscriptionId);
}
url = url + "/resourceGroups/";
url = url + Uri.EscapeDataString(this.Client.ResourceGroupName);
@@ -142,7 +142,6 @@ public async Task GetAsync(string jobId, CustomRequestHeaders c
// Set Headers
httpRequest.Headers.Add("Accept-Language", "en-us");
- httpRequest.Headers.Add("x-ms-client-request-id", customRequestHeaders.ClientRequestId);
// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
@@ -352,6 +351,10 @@ public async Task GetAsync(string jobId, CustomRequestHeaders c
}
result.StatusCode = statusCode;
+ if (httpResponse.Headers.Contains("x-ms-client-request-id"))
+ {
+ customRequestHeaders.ClientRequestId = httpResponse.Headers.GetValues("x-ms-client-request-id").FirstOrDefault();
+ }
if (shouldTrace)
{
@@ -408,7 +411,7 @@ public async Task ListAsync(CustomRequestHeaders c
url = url + "/Subscriptions/";
if (this.Client.Credentials.SubscriptionId != null)
{
- url = url + Uri.EscapeDataString(this.Client.Credentials.SubscriptionId.ToString());
+ url = url + Uri.EscapeDataString(this.Client.Credentials.SubscriptionId);
}
url = url + "/resourceGroups/";
url = url + Uri.EscapeDataString(this.Client.ResourceGroupName);
@@ -448,7 +451,6 @@ public async Task ListAsync(CustomRequestHeaders c
// Set Headers
httpRequest.Headers.Add("Accept-Language", "en-us");
- httpRequest.Headers.Add("x-ms-client-request-id", customRequestHeaders.ClientRequestId);
// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
@@ -494,18 +496,18 @@ public async Task ListAsync(CustomRequestHeaders c
responseDoc = JToken.Parse(responseContent);
}
- JToken protectionPolicyInfoResponseValue = responseDoc["ProtectionPolicyInfoResponse"];
- if (protectionPolicyInfoResponseValue != null && protectionPolicyInfoResponseValue.Type != JTokenType.Null)
+ if (responseDoc != null && responseDoc.Type != JTokenType.Null)
{
- ProtectionPolicyInfoResponse protectionPolicyInfoResponseInstance = new ProtectionPolicyInfoResponse();
+ ProtectionPolicyInfoResponse protectionPoliciesInstance = new ProtectionPolicyInfoResponse();
+ result.ProtectionPolicies = protectionPoliciesInstance;
- JToken objectsArray = protectionPolicyInfoResponseValue["Objects"];
+ JToken objectsArray = responseDoc["Objects"];
if (objectsArray != null && objectsArray.Type != JTokenType.Null)
{
foreach (JToken objectsValue in ((JArray)objectsArray))
{
ProtectionPolicyInfo protectionPolicyInfoInstance = new ProtectionPolicyInfo();
- protectionPolicyInfoResponseInstance.Objects.Add(protectionPolicyInfoInstance);
+ protectionPoliciesInstance.Objects.Add(protectionPolicyInfoInstance);
JToken workloadTypeValue = objectsValue["WorkloadType"];
if (workloadTypeValue != null && workloadTypeValue.Type != JTokenType.Null)
@@ -604,23 +606,27 @@ public async Task ListAsync(CustomRequestHeaders c
}
}
- JToken resultCountValue = protectionPolicyInfoResponseValue["ResultCount"];
+ JToken resultCountValue = responseDoc["ResultCount"];
if (resultCountValue != null && resultCountValue.Type != JTokenType.Null)
{
int resultCountInstance = ((int)resultCountValue);
- protectionPolicyInfoResponseInstance.ResultCount = resultCountInstance;
+ protectionPoliciesInstance.ResultCount = resultCountInstance;
}
- JToken skiptokenValue = protectionPolicyInfoResponseValue["Skiptoken"];
+ JToken skiptokenValue = responseDoc["Skiptoken"];
if (skiptokenValue != null && skiptokenValue.Type != JTokenType.Null)
{
string skiptokenInstance = ((string)skiptokenValue);
- protectionPolicyInfoResponseInstance.Skiptoken = skiptokenInstance;
+ protectionPoliciesInstance.Skiptoken = skiptokenInstance;
}
}
}
result.StatusCode = statusCode;
+ if (httpResponse.Headers.Contains("x-ms-client-request-id"))
+ {
+ customRequestHeaders.ClientRequestId = httpResponse.Headers.GetValues("x-ms-client-request-id").FirstOrDefault();
+ }
if (shouldTrace)
{
diff --git a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/VaultCredentialOperations.cs b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/VaultCredentialOperations.cs
new file mode 100644
index 000000000000..69a0e2300453
--- /dev/null
+++ b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/VaultCredentialOperations.cs
@@ -0,0 +1,211 @@
+//
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// Warning: This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if the
+// code is regenerated.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+using Hyak.Common;
+using Microsoft.Azure.Management.BackupServices;
+using Microsoft.Azure.Management.BackupServices.Models;
+
+namespace Microsoft.Azure.Management.BackupServices
+{
+ ///
+ /// Definition of Vault credential-related operations for the Azure Backup
+ /// extension.
+ ///
+ internal partial class VaultCredentialOperations : IServiceOperations, IVaultCredentialOperations
+ {
+ ///
+ /// Initializes a new instance of the VaultCredentialOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ internal VaultCredentialOperations(BackupServicesManagementClient client)
+ {
+ this._client = client;
+ }
+
+ private BackupServicesManagementClient _client;
+
+ ///
+ /// Gets a reference to the
+ /// Microsoft.Azure.Management.BackupServices.BackupServicesManagementClient.
+ ///
+ public BackupServicesManagementClient Client
+ {
+ get { return this._client; }
+ }
+
+ ///
+ /// Uploads vault credential certificate.
+ ///
+ ///
+ /// Optional. Name of the certificate.
+ ///
+ ///
+ /// Optional. Certificate parameters.
+ ///
+ ///
+ /// Optional. Request header parameters.
+ ///
+ ///
+ /// Cancellation token.
+ ///
+ ///
+ /// The definition of a certificate response.
+ ///
+ public async Task UploadCertificateAsync(string certificateName, VaultCredUploadCertRequest vaultCredUploadCertRequest, CustomRequestHeaders customRequestHeaders, CancellationToken cancellationToken)
+ {
+ // Validate
+
+ // Tracing
+ bool shouldTrace = TracingAdapter.IsEnabled;
+ string invocationId = null;
+ if (shouldTrace)
+ {
+ invocationId = TracingAdapter.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("certificateName", certificateName);
+ tracingParameters.Add("vaultCredUploadCertRequest", vaultCredUploadCertRequest);
+ tracingParameters.Add("customRequestHeaders", customRequestHeaders);
+ TracingAdapter.Enter(invocationId, this, "UploadCertificateAsync", tracingParameters);
+ }
+
+ // Construct URL
+ string url = "";
+ url = url + "/Subscriptions/";
+ if (this.Client.Credentials.SubscriptionId != null)
+ {
+ url = url + Uri.EscapeDataString(this.Client.Credentials.SubscriptionId);
+ }
+ url = url + "/resourceGroups/";
+ url = url + Uri.EscapeDataString(this.Client.ResourceGroupName);
+ url = url + "/providers/";
+ url = url + "Microsoft.Backupseadev01";
+ url = url + "/";
+ url = url + "BackupVault";
+ url = url + "/";
+ url = url + Uri.EscapeDataString(this.Client.ResourceName);
+ url = url + "/certificates/";
+ if (certificateName != null)
+ {
+ url = url + Uri.EscapeDataString(certificateName);
+ }
+ List queryParameters = new List();
+ queryParameters.Add("api-version=2014-09-01.1.0");
+ if (queryParameters.Count > 0)
+ {
+ url = url + "?" + string.Join("&", queryParameters);
+ }
+ string baseUrl = this.Client.BaseUri.AbsoluteUri;
+ // Trim '/' character from the end of baseUrl and beginning of url.
+ if (baseUrl[baseUrl.Length - 1] == '/')
+ {
+ baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
+ }
+ if (url[0] == '/')
+ {
+ url = url.Substring(1);
+ }
+ url = baseUrl + "/" + url;
+ url = url.Replace(" ", "%20");
+
+ // Create HTTP transport objects
+ HttpRequestMessage httpRequest = null;
+ try
+ {
+ httpRequest = new HttpRequestMessage();
+ httpRequest.Method = HttpMethod.Put;
+ httpRequest.RequestUri = new Uri(url);
+
+ // Set Headers
+ httpRequest.Headers.Add("Accept-Language", "en-us");
+
+ // Set Credentials
+ cancellationToken.ThrowIfCancellationRequested();
+ await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);
+
+ // Send Request
+ HttpResponseMessage httpResponse = null;
+ try
+ {
+ if (shouldTrace)
+ {
+ TracingAdapter.SendRequest(invocationId, httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
+ if (shouldTrace)
+ {
+ TracingAdapter.ReceiveResponse(invocationId, httpResponse);
+ }
+ HttpStatusCode statusCode = httpResponse.StatusCode;
+ if (statusCode != HttpStatusCode.OK)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ CloudException ex = CloudException.Create(httpRequest, null, httpResponse, await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
+ if (shouldTrace)
+ {
+ TracingAdapter.Error(invocationId, ex);
+ }
+ throw ex;
+ }
+
+ // Create Result
+ VaultCredUploadCertResponse result = null;
+ // Deserialize Response
+ result = new VaultCredUploadCertResponse();
+ result.StatusCode = statusCode;
+ if (httpResponse.Headers.Contains("x-ms-client-request-id"))
+ {
+ customRequestHeaders.ClientRequestId = httpResponse.Headers.GetValues("x-ms-client-request-id").FirstOrDefault();
+ }
+
+ if (shouldTrace)
+ {
+ TracingAdapter.Exit(invocationId, result);
+ }
+ return result;
+ }
+ finally
+ {
+ if (httpResponse != null)
+ {
+ httpResponse.Dispose();
+ }
+ }
+ }
+ finally
+ {
+ if (httpRequest != null)
+ {
+ httpRequest.Dispose();
+ }
+ }
+ }
+ }
+}
diff --git a/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/VaultCredentialOperationsExtensions.cs b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/VaultCredentialOperationsExtensions.cs
new file mode 100644
index 000000000000..7f2f1fa69db6
--- /dev/null
+++ b/src/ResourceManagement/AzureBackup/BackupServicesManagment/Generated/VaultCredentialOperationsExtensions.cs
@@ -0,0 +1,85 @@
+//
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// Warning: This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if the
+// code is regenerated.
+
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.Azure.Management.BackupServices;
+using Microsoft.Azure.Management.BackupServices.Models;
+
+namespace Microsoft.Azure.Management.BackupServices
+{
+ public static partial class VaultCredentialOperationsExtensions
+ {
+ ///
+ /// Uploads vault credential certificate.
+ ///
+ ///
+ /// Reference to the
+ /// Microsoft.Azure.Management.BackupServices.IVaultCredentialOperations.
+ ///
+ ///
+ /// Optional. Name of the certificate.
+ ///
+ ///
+ /// Optional. Certificate parameters.
+ ///
+ ///
+ /// Optional. Request header parameters.
+ ///
+ ///
+ /// The definition of a certificate response.
+ ///
+ public static VaultCredUploadCertResponse UploadCertificate(this IVaultCredentialOperations operations, string certificateName, VaultCredUploadCertRequest vaultCredUploadCertRequest, CustomRequestHeaders customRequestHeaders)
+ {
+ return Task.Factory.StartNew((object s) =>
+ {
+ return ((IVaultCredentialOperations)s).UploadCertificateAsync(certificateName, vaultCredUploadCertRequest, customRequestHeaders);
+ }
+ , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Uploads vault credential certificate.
+ ///
+ ///
+ /// Reference to the
+ /// Microsoft.Azure.Management.BackupServices.IVaultCredentialOperations.
+ ///
+ ///
+ /// Optional. Name of the certificate.
+ ///
+ ///
+ /// Optional. Certificate parameters.
+ ///
+ ///
+ /// Optional. Request header parameters.
+ ///
+ ///
+ /// The definition of a certificate response.
+ ///
+ public static Task UploadCertificateAsync(this IVaultCredentialOperations operations, string certificateName, VaultCredUploadCertRequest vaultCredUploadCertRequest, CustomRequestHeaders customRequestHeaders)
+ {
+ return operations.UploadCertificateAsync(certificateName, vaultCredUploadCertRequest, customRequestHeaders, CancellationToken.None);
+ }
+ }
+}