private void ValidateAzureVMContainerType(CmdletModel.ContainerType type) { if (type != CmdletModel.ContainerType.AzureVM) { throw new ArgumentException(string.Format(Resources.UnExpectedContainerTypeException, CmdletModel.ContainerType.AzureVM.ToString(), type.ToString())); } }
/// <summary> /// Gets the provider type with which the service client calls are to made to contact the backend service. /// This can be determined by the container type in case of certain containers such as those of the type AzureVM. /// </summary> /// <param name="containerType">Type of the container</param> /// <returns></returns> public static string GetServiceClientProviderType(CmdletModel.ContainerType containerType) { string providerType = string.Empty; switch (containerType) { case CmdletModel.ContainerType.AzureVM: providerType = ServiceClientModel.BackupManagementType.AzureIaasVM.ToString(); break; default: break; } return(providerType); }
/// <summary> /// Gets the service client specific container type given the PS container type /// </summary> /// <param name="containerType">PS container type</param> /// <returns></returns> public static string GetServiceClientContainerType(CmdletModel.ContainerType containerType) { string serviceClientContainerType = string.Empty; switch (containerType) { case CmdletModel.ContainerType.AzureVM: serviceClientContainerType = ServiceClientModel.MabServerType.IaasVMContainer.ToString(); break; default: break; } return(serviceClientContainerType); }