Skip to main content

IContainerStorageService Interface

Interface to provide access to snapshots and policies to the Runtime layer. This should follow the Loader / Runtime layer compatibility rules.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/container-definitions/legacy.

For more information about our API support guarantees, see here.

Signature

export interface IContainerStorageService

Remarks

It contains a subset of APIs from IDocumentStorageService but allows the Runtime to not support layer compatibility with the Driver layer. Instead, it supports compatibility with the Loader layer which it already does. \

Properties

Property Alerts Modifiers Type Description
disposed Deprecated, Alpha optional, readonly boolean Whether or not the object has been disposed. If true, the object should be considered invalid, and its other state should be disregarded.
maximumCacheDurationMs Alpha optional, readonly IDocumentStorageServicePolicies["maximumCacheDurationMs"] See maximumCacheDurationMs
policies Deprecated, Alpha optional, readonly IDocumentStorageServicePolicies | undefined Policies implemented/instructed by driver.

Methods

Method Alerts Modifiers Return Type Description
createBlob(file) Alpha Promise<ICreateBlobResponse> Creates a blob out of the given buffer
dispose(error) Deprecated, Alpha optional void Dispose of the object and its resources.
downloadSummary(handle) Deprecated, Alpha Promise<ISummaryTree> Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the server has deleted it this call may result in a broken promise.
getSnapshot(snapshotFetchOptions) Alpha optional Promise<ISnapshot> Returns the snapshot which can contain other artifacts too like blob contents, ops etc. It is different from getSnapshotTree api in that, that API only returns the snapshot tree from the snapshot.
getSnapshotTree(version, scenarioName) Alpha Promise<ISnapshotTree | null> Returns the snapshot tree.
getVersions(versionId, count, scenarioName, fetchSource) Alpha Promise<IVersion[]> Retrieves all versions of the document starting at the specified versionId - or null if from the head
readBlob(id) Alpha Promise<ArrayBufferLike> Reads the object with the given ID, returns content in arrayBufferLike
uploadSummaryWithContext(summary, context) Alpha Promise<string> Uploads a summary tree to storage using the given context for reference of previous summary handle. The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are referencing from the previously acked summary. Returns the uploaded summary handle.

Property Details

disposed

Whether or not the object has been disposed. If true, the object should be considered invalid, and its other state should be disregarded.

This API is deprecated and will be removed in a future release.
  • This API is deprecated and will be removed in a future release. No replacement is planned as it is unused in the Runtime layer.
This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
readonly disposed?: boolean;

Type: boolean

maximumCacheDurationMs

See maximumCacheDurationMs

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
readonly maximumCacheDurationMs?: IDocumentStorageServicePolicies["maximumCacheDurationMs"];

Type: IDocumentStorageServicePolicies["maximumCacheDurationMs"]

policies

Policies implemented/instructed by driver.

This API is deprecated and will be removed in a future release.
  • This will be removed in a future release. The Runtime layer only needs maximumCacheDurationMs policy which is added as a separate property.
This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
readonly policies?: IDocumentStorageServicePolicies | undefined;

Type: IDocumentStorageServicePolicies | undefined

Method Details

createBlob

Creates a blob out of the given buffer

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;

Parameters

Parameter Type Description
file ArrayBufferLike

Returns

Return type: Promise<ICreateBlobResponse>

dispose

Dispose of the object and its resources.

This API is deprecated and will be removed in a future release.
  • This API is deprecated and will be removed in a future release. No replacement is planned as it is unused in the Runtime layer.
This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
dispose?(error?: Error): void;

Parameters

Parameter Modifiers Type Description
error optional Error Optional error indicating the reason for the disposal, if the object was disposed as the result of an error.

downloadSummary

Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the server has deleted it this call may result in a broken promise.

This API is deprecated and will be removed in a future release.
  • This API is deprecated and will be removed in a future release. No replacement is planned as it is unused in the Runtime and below layers.
This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;

Parameters

Parameter Type Description
handle ISummaryHandle

Returns

Return type: Promise<ISummaryTree>

getSnapshot

Returns the snapshot which can contain other artifacts too like blob contents, ops etc. It is different from getSnapshotTree api in that, that API only returns the snapshot tree from the snapshot.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
getSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;

Parameters

Parameter Modifiers Type Description
snapshotFetchOptions optional ISnapshotFetchOptions Options specified by the caller to specify and want certain behavior from the driver when fetching the snapshot.

Returns

Return type: Promise<ISnapshot>

getSnapshotTree

Returns the snapshot tree.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;

Parameters

Parameter Modifiers Type Description
version optional IVersion Version of the snapshot to be fetched.
scenarioName optional string scenario in which this api is called. This will be recorded by server and would help in debugging purposes to see why this call was made.

Returns

Return type: Promise<ISnapshotTree | null>

getVersions

Retrieves all versions of the document starting at the specified versionId - or null if from the head

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
getVersions(versionId: string | null, count: number, scenarioName?: string, fetchSource?: FetchSource): Promise<IVersion[]>;

Parameters

Parameter Modifiers Type Description
versionId string | null Version id of the requested version.
count number Number of the versions to be fetched.
scenarioName optional string scenario in which this api is called. This will be recorded by server and would help in debugging purposes to see why this call was made.
fetchSource optional FetchSource Callers can specify the source of the response. For ex. Driver may choose to cache requests and serve data from cache. That will result in stale info returned. Callers can disable this functionality by passing fetchSource = noCache and ensuring that driver will return latest information from storage.

Returns

Return type: Promise<IVersion[]>

readBlob

Reads the object with the given ID, returns content in arrayBufferLike

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
readBlob(id: string): Promise<ArrayBufferLike>;

Parameters

Parameter Type Description
id string

Returns

Return type: Promise<ArrayBufferLike>

uploadSummaryWithContext

Uploads a summary tree to storage using the given context for reference of previous summary handle. The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are referencing from the previously acked summary. Returns the uploaded summary handle.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;

Parameters

Parameter Type Description
summary ISummaryTree
context ISummaryContext

Returns

Return type: Promise<string>