Cold Storage Manager (.NET)

The Cold Storage Manager service exposes endpoints for programmatically managing workspaces in Relativity cold storage. It includes the following features:

  • Moving workspaces in or out of cold storage
  • Deleting workspaces in cold storage
  • Provides helper endpoints that help to determine:
    • if a given workspace is in cold storage
    • if users have permission to manage cold storage workspaces

As a sample use case, you might use the Cold Storage Manager service to automatically move workspaces in and out of cold storage, or keep track of the workspaces in cold storage in a Relativity application developed for your organization.

You can also access the Cold Storage Manager service through REST. For more information, see Cold Storage Manager (REST).

Fundamentals for the Cold Storage Manager API

The Cold Storage Manager API contains the following methods and classes.

Methods

The Cold Storage Manager API includes the following methods available on the IColdStorageManager interface in the Relativity.ColdStorage.<VersionNumber>namespace:

  • MoveWorkspaceIntoColdStorageAsync - move a workspace into cold storage
  • StartMoveWorkspaceOutOfColdStorageAsync - start the process of moving a workspace out of cold storage
  • GetWorkspaceColdStorageStatusAsync - get the cold storage status for a workspace
  • DeleteWorkspaceFromColdStorageAsync - delete workspace in cold storage. Workspace must be in cold storage for at least 30 days, otherwise an error is thrown.
  • CanManageColdStorageAsync - get a value indicating whether your can manage cold storage.

Classes and enumerations

The Cold Storage Manager API uses the following classes and enumerations:

  • MoveWorkspaceResponse - represents information about a workspace migration to cold storage state, includes workspace id and status. The StartMoveWorkspaceOutOfColdStorageAsync() and MoveWorkspaceIntoColdStorageAsync() methods return an object of this type.
  • WorkspaceColdStorageStatus enumeration - identifies whether a workspace is in cold storage, or not.
  • WorkspaceColdStorageStatusResponse - indicates the results of a request that attempts to get the cold storage status for a workspace. The GetWorkspaceColdStorageStatusAsync() method returns an object of this type.

Guidelines for the Cold Storage Manager API

You can access the Cold Storage Manager service by creating a client proxy, and then instantiating a ColdStorageManager object.

Copy
Uri keplerEndPoint = new Uri("http://localhost/relativity.rest/api");
Services.ServiceProxy.ServiceFactory serviceFactory = new Services.ServiceProxy.ServiceFactory(new Services.ServiceProxy.ServiceFactorySettings(keplerEndpoint,
  new Services.ServiceProxy.UsernamePasswordCredentials("username", "password")));
Relativity.ColdStorage. < VersionNumber > .IColdStorageManager proxy = serviceFactory.CreateProxy < Relativity.ColdStorage. < VersionNumber > .IColdStorageManager > ();

Move Workspace Into Cold Storage

To move a workspace to cold storage, call the MoveWorkspaceIntoColdStorageAsync() method by passing the Artifact ID of the workspace.

Copy
public bool Create(IHelper helper) {
  bool success = false;
  using(IColdStorageManager proxy = helper.GetServicesManager().CreateProxy < Relativity.ColdStorage. < VersionNumber > .IColdStorageManager > (ExecutionIdentity.System)) {
    try {
      MoveWorkspaceResponse response = proxy.MoveWorkspaceIntoColdStorageAsync(SampleWorkspace_ID).GetAwaiter().GetResult();
      _logger.LogDebug("{WorkspaceID} - {Status}", response.WorkspaceID, response.Status);
    } catch (Exception ex) {
      _logger.LogError("Action failed - {message}", ex.Message);
      throw;
    }
  }
  return success;
}

Move Workspace Out Of Cold Storage

To move a workspace out of cold storage, call the StartMoveWorkspaceOutOfColdStorageAsync() method by passing the Artifact ID of the workspace.

Copy
public bool Create(IHelper helper) {
  bool success = false;
  using(IColdStorageManager proxy = helper.GetServicesManager().CreateProxy < Relativity.ColdStorage. < VersionNumber > .IColdStorageManager > (ExecutionIdentity.System)) {
    try {
      MoveWorkspaceResponse response = proxy.StartMoveWorkspaceOutOfColdStorageAsync(SampleWorkspace_ID).GetAwaiter().GetResult();
      _logger.LogDebug("{WorkspaceID} - {Status}", response.WorkspaceID, response.Status);
    } catch (Exception ex) {
      _logger.LogError("Action failed - {message}", ex.Message);
      throw;
    }
  }
  return success;
}

Get Workspace Cold Storage Status

To get workspace cold storage status, call the GetWorkspaceColdStorageStatusAsync()  method by passing the Artifact ID of the workspace.

Copy
public bool Create(IHelper helper) {
  bool success = false;
  using(IColdStorageManager proxy = helper.GetServicesManager().CreateProxy < Relativity.ColdStorage. < VersionNumber > .IColdStorageManager > (ExecutionIdentity.System)) {
    try {
      WorkspaceColdStorageStatusResponse response = proxy.GetWorkspaceColdStorageStatusAsync(SampleWorkspace_ID).GetAwaiter().GetResult();
      _logger.LogDebug("{WorkspaceID} - {Status}", response.WorkspaceID, response.Status);
    } catch (Exception ex) {
      _logger.LogError("Action failed - {message}", ex.Message);
      throw;
    }
  }
  return success;
}

Delete Workspace From Cold Storage

To delete a workspace in cold storage, call the DeleteWorkspaceFromColdStorageAsync()  method by passing the Artifact ID of the workspace.

To use this endpoint, you must have the following:

  • View and delete permissions for the workspace set at the workspace level. See Workspace security on the Documentation site.

Workspaces must be in cold storage for at least 30 days, otherwise an error is thrown.

Copy
public bool Create(IHelper helper) {
  bool success = false;
  using(IColdStorageManager proxy = helper.GetServicesManager().CreateProxy < Relativity.ColdStorage. < VersionNumber > .IColdStorageManager > (ExecutionIdentity.System)) {
    try {
      proxy.DeleteWorkspaceFromColdStorageAsync(SampleWorkspace_ID).GetAwaiter().GetResult();
    } catch (Exception ex) {
      _logger.LogError("Action failed - {message}", ex.Message);
      throw;
    }
  }
  return success;
}

Manage Cold Storage

If you have permission to manage a workspace, call the CanManageColdStorageAsync()  method by passing the Artifact ID of the workspace.

Copy
public bool Create(IHelper helper) {
  bool success = false;
  using(IColdStorageManager proxy = helper.GetServicesManager().CreateProxy < Relativity.ColdStorage. < VersionNumber > .IColdStorageManager > (ExecutionIdentity.System)) {
    try {
      bool response = proxy.CanManageColdStorageAsync(SampleWorkspace_ID).GetAwaiter().GetResult();
      _logger.LogDebug("The user can manage cold storage workspace - {canManage}", response);
    } catch (Exception ex) {
      _logger.LogError("Action failed - {message}", ex.Message);
      throw;
    }
  }
  return success;
}