Skip to content

Commit 81fb8f7

Browse files
authored
[Storage] Optimize appendBlock's example. (#7520)
1 parent 85a55ab commit 81fb8f7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

sdk/storage/storage-blob/src/Clients.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,6 +2420,13 @@ export class AppendBlobClient extends BlobClient {
24202420
* @param {AppendBlobCreateOptions} [options] Options to the Append Block Create operation.
24212421
* @returns {Promise<AppendBlobCreateResponse>}
24222422
* @memberof AppendBlobClient
2423+
*
2424+
* Example usage:
2425+
*
2426+
* ```js
2427+
* const appendBlobClient = containerClient.getAppendBlobClient("<blob name>");
2428+
* await appendBlobClient.create();
2429+
* ```
24232430
*/
24242431
public async create(options: AppendBlobCreateOptions = {}): Promise<AppendBlobCreateResponse> {
24252432
const { span, spanOptions } = createSpan("AppendBlobClient-create", options.tracingOptions);
@@ -2457,6 +2464,21 @@ export class AppendBlobClient extends BlobClient {
24572464
* @param {AppendBlobAppendBlockOptions} [options] Options to the Append Block operation.
24582465
* @returns {Promise<AppendBlobAppendBlockResponse>}
24592466
* @memberof AppendBlobClient
2467+
*
2468+
* Example usage:
2469+
*
2470+
* ```js
2471+
* const content = "Hello World!";
2472+
*
2473+
* // Create a new append blob and append data to the blob.
2474+
* const newAppendBlobClient = containerClient.getAppendBlobClient("<blob name>");
2475+
* await newAppendBlobClient.create();
2476+
* await newAppendBlobClient.appendBlock(content, content.length);
2477+
*
2478+
* // Append data to an existing append blob.
2479+
* const existingAppendBlobClient = containerClient.getAppendBlobClient("<blob name>");
2480+
* await existingAppendBlobClient.appendBlock(content, content.length);
2481+
* ```
24602482
*/
24612483
public async appendBlock(
24622484
body: HttpRequestBody,

0 commit comments

Comments
 (0)