File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed
src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Models Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -73,10 +73,10 @@ public class AzureRmRecoveryServicesContainerBase : AzureRmRecoveryServicesConta
73
73
public string Name { get ; set ; }
74
74
75
75
public AzureRmRecoveryServicesContainerBase ( ProtectionContainerResource protectionContainer )
76
- : base ( ConversionUtils . GetPsContainerType ( ( ( ProtectionContainer ) protectionContainer . Properties ) . ContainerType ) ,
76
+ : base ( ConversionUtils . GetPsContainerType ( ( ( ProtectionContainer ) protectionContainer . Properties ) . ContainerType ) ,
77
77
( ( ProtectionContainer ) protectionContainer . Properties ) . BackupManagementType )
78
78
{
79
- Name = protectionContainer . Name ;
79
+ Name = IdUtils . GetNameFromUri ( protectionContainer . Name ) ;
80
80
}
81
81
}
82
82
@@ -166,7 +166,7 @@ public class AzureRmRecoveryServicesItemExtendedInfoBase : AzureRmRecoveryServic
166
166
public class AzureRmRecoveryServicesRecoveryPointBase : AzureRmRecoveryServicesItemContext
167
167
{
168
168
private global ::Microsoft . Azure . Management . RecoveryServices . Backup . Models . RecoveryPointResource rp ;
169
-
169
+
170
170
/// <summary>
171
171
///
172
172
/// </summary>
@@ -212,12 +212,12 @@ public override void Validate()
212
212
{
213
213
base . Validate ( ) ;
214
214
215
- if ( string . IsNullOrEmpty ( Name ) )
215
+ if ( string . IsNullOrEmpty ( Name ) )
216
216
{
217
217
throw new ArgumentException ( Resources . PolicyNameIsEmptyOrNull ) ;
218
218
}
219
219
220
- if ( string . IsNullOrEmpty ( Id ) )
220
+ if ( string . IsNullOrEmpty ( Id ) )
221
221
{
222
222
throw new ArgumentException ( Resources . PolicyIdIsEmptyOrNull ) ;
223
223
}
Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ public class TraceUtils
44
44
{
45
45
public static string GetString < T > ( IEnumerable < T > objList )
46
46
{
47
- return ( objList == null ) ? "null" : "{" + string . Join ( ", " , objList . Select ( e => e . ToString ( ) ) ) + "}" ;
48
- }
47
+ return ( objList == null ) ? "null" : "{" + string . Join ( ", " , objList . Select ( e => e . ToString ( ) ) ) + "}" ;
48
+ }
49
49
}
50
50
51
51
public class IdUtils
@@ -104,6 +104,16 @@ public static string GetValueByName(string id, string idName)
104
104
105
105
return dict [ idName ] ;
106
106
}
107
+
108
+ /// <summary>
109
+ /// URI format: Type;Name
110
+ /// </summary>
111
+ /// <param name="uri"></param>
112
+ /// <returns></returns>
113
+ public static string GetNameFromUri ( string uri )
114
+ {
115
+ return uri . Substring ( uri . IndexOf ( NameDelimiter ) + 1 ) ;
116
+ }
107
117
}
108
118
109
119
public class EnumUtils
You can’t perform that action at this time.
0 commit comments