1+ // ----------------------------------------------------------------------------------
2+ //
3+ // Copyright Microsoft Corporation
4+ // Licensed under the Apache License, Version 2.0 (the "License");
5+ // you may not use this file except in compliance with the License.
6+ // You may obtain a copy of the License at
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ // Unless required by applicable law or agreed to in writing, software
9+ // distributed under the License is distributed on an "AS IS" BASIS,
10+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+ // See the License for the specific language governing permissions and
12+ // limitations under the License.
13+ // ----------------------------------------------------------------------------------
14+
15+ using System ;
16+ using Microsoft . WindowsAzure ;
17+ using Microsoft . WindowsAzure . Management . SiteRecovery ;
18+ using Microsoft . WindowsAzure . Management . SiteRecovery . Models ;
19+
20+ namespace Microsoft . Azure . Commands . RecoveryServices
21+ {
22+ /// <summary>
23+ /// Recovery services convenience client.
24+ /// </summary>
25+ public partial class PSRecoveryServicesClient
26+ {
27+ /// <summary>
28+ /// Gets Azure Site Recovery Storage pool mappings.
29+ /// </summary>
30+ /// <param name="primaryServerId">Primary server ID</param>
31+ /// <param name="recoveryServerId">Recovery server ID</param>
32+ /// <returns>Storage pool mapping list response</returns>
33+ public StoragePoolMappingListResponse GetAzureSiteRecoveryStoragePoolMappings (
34+ string primaryServerId ,
35+ string recoveryServerId )
36+ {
37+ return this . GetSiteRecoveryClient ( )
38+ . StoragePoolMappings
39+ . List ( primaryServerId , recoveryServerId , this . GetRequestHeaders ( ) ) ;
40+ }
41+
42+ /// <summary>
43+ /// Create Azure Site Recovery Storage pool mapping.
44+ /// </summary>
45+ /// <param name="primaryServerId">Primary server Id</param>
46+ /// <param name="primaryArrayId">Primary array Id</param>
47+ /// <param name="primaryStoragePoolId">Primary storage pool Id</param>
48+ /// <param name="recoveryServerId">Recovery server Id</param>
49+ /// <param name="recoveryArrayId">Recovery array Id</param>
50+ /// <param name="recoveryStoragePoolId">Recovery storage pool Id</param>
51+ /// <returns>Job response</returns>
52+ public JobResponse NewAzureSiteRecoveryStoragePoolMapping (
53+ string primaryServerId ,
54+ string primaryArrayId ,
55+ string primaryStoragePoolId ,
56+ string recoveryServerId ,
57+ string recoveryArrayId ,
58+ string recoveryStoragePoolId )
59+ {
60+ StoragePoolMappingInput parameters = new StoragePoolMappingInput ( ) ;
61+ parameters . PrimaryServerId = primaryServerId ;
62+ parameters . PrimaryArrayId = primaryArrayId ;
63+ parameters . PrimaryStoragePoolId = primaryStoragePoolId ;
64+ parameters . RecoveryServerId = recoveryServerId ;
65+ parameters . RecoveryArrayId = recoveryArrayId ;
66+ parameters . RecoveryStoragePoolId = recoveryStoragePoolId ;
67+
68+ return this . GetSiteRecoveryClient ( )
69+ . StoragePoolMappings
70+ . Create ( parameters , this . GetRequestHeaders ( ) ) ;
71+ }
72+
73+ /// <summary>
74+ /// Delete Azure Site Recovery Storage pool mapping.
75+ /// </summary>
76+ /// <param name="primaryServerId">Primary server Id</param>
77+ /// <param name="primaryArrayId">Primary array Id</param>
78+ /// <param name="primaryStoragePoolId">Primary storage pool Id</param>
79+ /// <param name="recoveryServerId">Recovery server Id</param>
80+ /// <param name="recoveryArrayId">Recovery array Id</param>
81+ /// <param name="recoveryStoragePoolId">Recovery storage pool Id</param>
82+ /// <returns>Job response</returns>
83+ public JobResponse RemoveAzureSiteRecoveryStoragePoolMapping (
84+ string primaryServerId ,
85+ string primaryArrayId ,
86+ string primaryStoragePoolId ,
87+ string recoveryServerId ,
88+ string recoveryArrayId ,
89+ string recoveryStoragePoolId )
90+ {
91+ StoragePoolMappingInput parameters = new StoragePoolMappingInput ( ) ;
92+ parameters . PrimaryServerId = primaryServerId ;
93+ parameters . PrimaryArrayId = primaryArrayId ;
94+ parameters . PrimaryStoragePoolId = primaryStoragePoolId ;
95+ parameters . RecoveryServerId = recoveryServerId ;
96+ parameters . RecoveryArrayId = recoveryArrayId ;
97+ parameters . RecoveryStoragePoolId = recoveryStoragePoolId ;
98+
99+ return this . GetSiteRecoveryClient ( )
100+ . StoragePoolMappings
101+ . Delete ( parameters , this . GetRequestHeaders ( ) ) ;
102+ }
103+ }
104+ }
0 commit comments