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

PropertyAlertsModifiersTypeDescription
maximumCacheDurationMsBetaoptional, readonlyIDocumentStorageServicePolicies["maximumCacheDurationMs"]See maximumCacheDurationMs
policiesDeprecated, Betaoptional, readonlyIDocumentStorageServicePolicies | undefinedPolicies implemented/instructed by driver.

Methods

MethodAlertsModifiersReturn TypeDescription
createBlob(file)BetaPromise<ICreateBlobResponse>Creates a blob out of the given buffer
getSnapshot(snapshotFetchOptions)BetaoptionalPromise<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)BetaPromise<ISnapshotTree | null>Returns the snapshot tree.
getVersions(versionId, count, scenarioName, fetchSource)BetaPromise<IVersion[]>Retrieves all versions of the document starting at the specified versionId - or null if from the head
readBlob(id)BetaPromise<ArrayBufferLike>Reads the object with the given ID, returns content in arrayBufferLike
uploadSummaryWithContext(summary, context)BetaPromise<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

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

ParameterTypeDescription
fileArrayBufferLike

Returns

Return type: Promise<ICreateBlobResponse>

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

ParameterModifiersTypeDescription
snapshotFetchOptionsoptionalISnapshotFetchOptionsOptions 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

ParameterModifiersTypeDescription
versionoptionalIVersionVersion of the snapshot to be fetched.
scenarioNameoptionalstringscenario 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

ParameterModifiersTypeDescription
versionIdstring | nullVersion id of the requested version.
countnumberNumber of the versions to be fetched.
scenarioNameoptionalstringscenario 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.
fetchSourceoptionalFetchSourceCallers 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

ParameterTypeDescription
idstring

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

ParameterTypeDescription
summaryISummaryTree
contextISummaryContext

Returns

Return type: Promise<string>