Files
9af3cb23a2 [AutoPR @azure-arm-storagecache]-generated-from-SDK Generation - JS-6392800 (#38812)
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]>
2026-06-08 22:19:32 +08:00

25 lines
1.4 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 removes a Storage Target from a cache. This operation is allowed at any time, but if the cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the cache is healthy again. Note that if the cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted.
*
* @summary removes a Storage Target from a cache. This operation is allowed at any time, but if the cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the cache is healthy again. Note that if the cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted.
* x-ms-original-file: 2026-01-01/StorageTargets_Delete.json
*/
async function storageTargetsDelete(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new StorageCacheManagementClient(credential, subscriptionId);
await client.storageTargets.delete("scgroup", "sc1", "st1");
}
async function main(): Promise<void> {
await storageTargetsDelete();
}
main().catch(console.error);