Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.ServiceClientAdapterNS.ServiceClientAdapter.CreateOrUpdateProtectedItem C# (CSharp) Method

CreateOrUpdateProtectedItem() public method

Creates a new protected item or updates an already existing protected item
public CreateOrUpdateProtectedItem ( string containerName, string protectedItemName, Microsoft.Azure.Management.RecoveryServices.Backup.Models.ProtectedItemCreateOrUpdateRequest request ) : Microsoft.Azure.Management.RecoveryServices.Backup.Models.BaseRecoveryServicesJobResponse
containerName string Name of the container which this item belongs to
protectedItemName string Name of the item
request Microsoft.Azure.Management.RecoveryServices.Backup.Models.ProtectedItemCreateOrUpdateRequest Protected item create or update request
return Microsoft.Azure.Management.RecoveryServices.Backup.Models.BaseRecoveryServicesJobResponse
        public BaseRecoveryServicesJobResponse CreateOrUpdateProtectedItem(
                string containerName,
                string protectedItemName,
                ProtectedItemCreateOrUpdateRequest request)
        {
            string resourceName = BmsAdapter.GetResourceName();
            string resourceGroupName = BmsAdapter.GetResourceGroupName();

            return BmsAdapter.Client.ProtectedItems.CreateOrUpdateProtectedItemAsync(
                                     resourceGroupName,
                                     resourceName,
                                     AzureFabricName,
                                     containerName,
                                     protectedItemName,
                                     request,
                                     BmsAdapter.GetCustomRequestHeaders(),
                                     BmsAdapter.CmdletCancellationToken).Result;
        }