mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
Configurations: 'specification/storagecache/resource-manager/Microsoft.StorageCache/StorageCache/tspconfig.yaml', API Version: 2026-01-01, SDK Release Type: beta, and CommitSHA: '4270ac9d4ba3f3bb031b01f5773208d7d4827a9e' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6392800 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --------- Co-authored-by: Jiao Di (MSFT) <[email protected]>
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
import { StorageCacheManagementClient } from "@azure/arm-storagecache";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
|
|
/**
|
|
* This sample demonstrates how to create a priming job. This operation is only allowed when the cache is healthy.
|
|
*
|
|
* @summary create a priming job. This operation is only allowed when the cache is healthy.
|
|
* x-ms-original-file: 2026-01-01/StartPrimingJob.json
|
|
*/
|
|
async function startPrimingJob(): Promise<void> {
|
|
const credential = new DefaultAzureCredential();
|
|
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
|
const client = new StorageCacheManagementClient(credential, subscriptionId);
|
|
await client.caches.startPrimingJob("scgroup", "sc1", {
|
|
primingjob: {
|
|
primingJobName: "contosoJob",
|
|
primingManifestUrl:
|
|
"https://contosostorage.blob.core.windows.net/contosoblob/00000000_00000000000000000000000000000000.00000000000.FFFFFFFF.00000000?sp=r&st=2021-08-11T19:33:35Z&se=2021-08-12T03:33:35Z&spr=https&sv=2020-08-04&sr=b&sig=<secret-value-from-key>",
|
|
},
|
|
});
|
|
}
|
|
|
|
async function main(): Promise<void> {
|
|
await startPrimingJob();
|
|
}
|
|
|
|
main().catch(console.error);
|