IContainerStorageService Interface
Interface to provide access to snapshots and policies to the Runtime layer. This should follow the Loader / Runtime layer compatibility rules.
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 |
|---|---|---|---|---|
| maximumCacheDurationMs | Beta |
optional, readonly |
IDocumentStorageServicePolicies["maximumCacheDurationMs"] | See maximumCacheDurationMs |
| policies | Deprecated, Beta |
optional, readonly |
IDocumentStorageServicePolicies | undefined | Policies implemented/instructed by driver. |
Methods
| Method | Alerts | Modifiers | Return Type | Description |
|---|---|---|---|---|
| createBlob(file) | Beta |
Promise<ICreateBlobResponse> | Creates a blob out of the given buffer | |
| getSnapshot(snapshotFetchOptions) | Beta |
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) | Beta |
Promise<ISnapshotTree | null> | Returns the snapshot tree. | |
| getVersions(versionId, count, scenarioName, fetchSource) | Beta |
Promise<IVersion[]> | Retrieves all versions of the document starting at the specified versionId - or null if from the head | |
| readBlob(id) | Beta |
Promise<ArrayBufferLike> | Reads the object with the given ID, returns content in arrayBufferLike | |
| uploadSummaryWithContext(summary, context) | Beta |
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
maximumCacheDurationMs
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 will be removed in a future release. The Runtime layer only needs maximumCacheDurationMs policy which is added as a separate property.
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
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>
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.
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.
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
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
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.
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>