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]>
65 lines
2.5 KiB
TypeScript
65 lines
2.5 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 or update an AML file system.
|
|
*
|
|
* @summary create or update an AML file system.
|
|
* x-ms-original-file: 2026-01-01/amlFilesystems_CreateOrUpdate.json
|
|
*/
|
|
async function amlFilesystemsCreateOrUpdate(): Promise<void> {
|
|
const credential = new DefaultAzureCredential();
|
|
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
|
const client = new StorageCacheManagementClient(credential, subscriptionId);
|
|
const result = await client.amlFilesystems.createOrUpdate("scgroup", "fs1", {
|
|
identity: {
|
|
type: "UserAssigned",
|
|
userAssignedIdentities: {
|
|
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1":
|
|
{},
|
|
},
|
|
},
|
|
location: "eastus",
|
|
encryptionSettings: {
|
|
keyEncryptionKey: {
|
|
keyUrl: "https://examplekv.vault.azure.net/keys/kvk/3540a47df75541378d3518c6a4bdf5af",
|
|
sourceVault: {
|
|
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk",
|
|
},
|
|
},
|
|
},
|
|
filesystemSubnet:
|
|
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/fsSub",
|
|
hsm: {
|
|
settings: {
|
|
container:
|
|
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/containername",
|
|
importPrefixesInitial: ["/"],
|
|
loggingContainer:
|
|
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/loggingcontainername",
|
|
},
|
|
},
|
|
maintenanceWindow: { dayOfWeek: "Friday", timeOfDayUTC: "22:00" },
|
|
rootSquashSettings: {
|
|
mode: "All",
|
|
noSquashNidLists: "10.0.0.[5-6]@tcp;10.0.1.2@tcp",
|
|
squashGID: 99,
|
|
squashUID: 99,
|
|
},
|
|
storageCapacityTiB: 16,
|
|
sku: { name: "AMLFS-Durable-Premium-250" },
|
|
tags: { Dept: "ContosoAds" },
|
|
zones: ["1"],
|
|
});
|
|
console.log(result);
|
|
}
|
|
|
|
async function main(): Promise<void> {
|
|
await amlFilesystemsCreateOrUpdate();
|
|
}
|
|
|
|
main().catch(console.error);
|