ZiWei Chen 2024-05-24 11:31:08 +08:00 коммит произвёл GitHub
Родитель f6e0038c15
Коммит 86c72ad0a7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
260 изменённых файлов: 4781 добавлений и 7104 удалений

Просмотреть файл

@ -18070,7 +18070,7 @@ packages:
dev: false
file:projects/arm-storagecache.tgz:
resolution: {integrity: sha512-UbC2fW2yNlSq5C56fbpimT3gOret2gaoPhAzPUXlcvKKXH/5OQ1LvoYcRXc3C7Kty+zOmUgtaG9Mxu3/QngX8A==, tarball: file:projects/arm-storagecache.tgz}
resolution: {integrity: sha512-9OpxPZSNt4bx1p/9E3qAEzdQ4CbIK40ZPLAHUinWXnikt+LuE1a9q18cpqo1rDkQp7nByAmcrtKRt44MeNUXaw==, tarball: file:projects/arm-storagecache.tgz}
name: '@rush-temp/arm-storagecache'
version: 0.0.0
dependencies:
@ -18086,6 +18086,7 @@ packages:
chai: 4.3.10
cross-env: 7.0.3
dotenv: 16.4.5
esm: 3.2.25
mkdirp: 3.0.1
mocha: 10.4.0
rimraf: 5.0.7

Просмотреть файл

@ -1,15 +1,52 @@
# Release History
## 8.0.0 (2024-05-13)
**Features**
## 7.1.0-beta.2 (Unreleased)
- Added operation group ImportJobs
- Added Interface AmlFilesystemRootSquashSettings
- Added Interface AscOperationErrorResponse
- Added Interface ErrorAdditionalInfo
- Added Interface ErrorDetail
- Added Interface ImportJob
- Added Interface ImportJobsCreateOrUpdateHeaders
- Added Interface ImportJobsCreateOrUpdateOptionalParams
- Added Interface ImportJobsDeleteHeaders
- Added Interface ImportJobsDeleteOptionalParams
- Added Interface ImportJobsGetOptionalParams
- Added Interface ImportJobsListByAmlFilesystemNextOptionalParams
- Added Interface ImportJobsListByAmlFilesystemOptionalParams
- Added Interface ImportJobsListResult
- Added Interface ImportJobsUpdateHeaders
- Added Interface ImportJobsUpdateOptionalParams
- Added Interface ImportJobUpdate
- Added Type Alias AmlFilesystemSquashMode
- Added Type Alias ConflictResolutionMode
- Added Type Alias ImportJobProvisioningStateType
- Added Type Alias ImportJobsCreateOrUpdateResponse
- Added Type Alias ImportJobsDeleteResponse
- Added Type Alias ImportJobsGetResponse
- Added Type Alias ImportJobsListByAmlFilesystemNextResponse
- Added Type Alias ImportJobsListByAmlFilesystemResponse
- Added Type Alias ImportJobsUpdateResponse
- Added Type Alias ImportStatusType
- Interface AmlFilesystem has a new optional parameter rootSquashSettings
- Interface AmlFilesystemHsmSettings has a new optional parameter importPrefixesInitial
- Interface AmlFilesystemUpdate has a new optional parameter rootSquashSettings
- Interface ErrorResponse has a new optional parameter error
- Added Enum KnownAmlFilesystemSquashMode
- Added Enum KnownConflictResolutionMode
- Added Enum KnownImportJobProvisioningStateType
- Added Enum KnownImportStatusType
### Features Added
### Breaking Changes
### Bugs Fixed
### Other Changes
**Breaking Changes**
- Interface ErrorResponse no longer has parameter code
- Interface ErrorResponse no longer has parameter message
- Type of parameter error of interface AscOperation is changed from ErrorResponse to AscOperationErrorResponse
## 7.1.0-beta.1 (2024-02-01)
**Features**
@ -213,4 +250,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka.
To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide).
To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart).

Просмотреть файл

@ -6,7 +6,7 @@ Azure Managed Lustre provides a fully managed Lustre® file system, integrated w
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storagecache/arm-storagecache) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-storagecache) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-storagecache?view=azure-node-preview) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-storagecache) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
## Getting started

Просмотреть файл

@ -1,8 +1,8 @@
{
"commit": "68030f1c17e0cd5912e1bda17a5f28473e84b5f9",
"commit": "fdc2e7b8efa15b521c7af6b041f226d5a090d5e1",
"readme": "specification/storagecache/resource-manager/readme.md",
"autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\storagecache\\resource-manager\\readme.md --use=@autorest/typescript@6.0.13 --generate-sample=true",
"autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\storagecache\\resource-manager\\readme.md --use=@autorest/typescript@6.0.21 --generate-sample=true",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.7.4",
"use": "@autorest/typescript@6.0.13"
"release_tool": "@azure-tools/js-sdk-release-tools@2.7.7",
"use": "@autorest/typescript@6.0.21"
}

Просмотреть файл

@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "js",
"TagPrefix": "js/storagecache/arm-storagecache",
"Tag": "js/storagecache/arm-storagecache_27037083e5"
"Tag": "js/storagecache/arm-storagecache_a43d5287d0"
}

Просмотреть файл

@ -3,7 +3,7 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for StorageCacheManagementClient.",
"version": "7.1.0-beta.2",
"version": "8.0.0",
"engines": {
"node": ">=18.0.0"
},
@ -12,8 +12,8 @@
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.7.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.12.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-rest-pipeline": "^1.14.0",
"tslib": "^2.2.0"
},
"keywords": [
@ -34,16 +34,17 @@
"uglify-js": "^3.4.9",
"rimraf": "^5.0.0",
"dotenv": "^16.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/identity": "^4.0.1",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^1.0.0",
"@azure-tools/test-credential": "^1.1.0",
"mocha": "^10.0.0",
"@types/mocha": "^10.0.0",
"esm": "^3.2.18",
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@types/node": "^18.0.0",
"@azure/dev-tool": "^1.0.0",
"ts-node": "^10.0.0"
},
"repository": {
@ -77,7 +78,6 @@
"pack": "npm pack 2>&1",
"extract-api": "dev-tool run extract-api",
"lint": "echo skipped",
"audit": "echo skipped",
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"build:node": "echo skipped",
"build:browser": "echo skipped",

Просмотреть файл

@ -93,6 +93,7 @@ export type AmlFilesystemHealthStateType = string;
export interface AmlFilesystemHsmSettings {
container: string;
importPrefix?: string;
importPrefixesInitial?: string[];
loggingContainer: string;
}
@ -301,7 +302,7 @@ export type ArchiveStatusType = string;
// @public
export interface AscOperation {
endTime?: string;
error?: ErrorResponse;
error?: AscOperationErrorResponse;
id?: string;
name?: string;
output?: {
@ -311,6 +312,12 @@ export interface AscOperation {
status?: string;
}
// @public
export interface AscOperationErrorResponse {
code?: string;
message?: string;
}
// @public
export interface AscOperations {
get(location: string, operationId: string, options?: AscOperationsGetOptionalParams): Promise<AscOperationsGetResponse>;
@ -764,16 +771,33 @@ export interface Condition {
readonly timestamp?: Date;
}
// @public
export type ConflictResolutionMode = string;
// @public
export type CreatedByType = string;
// @public
export type DomainJoinedType = string;
// @public
export interface ErrorAdditionalInfo {
readonly info?: Record<string, unknown>;
readonly type?: string;
}
// @public
export interface ErrorDetail {
readonly additionalInfo?: ErrorAdditionalInfo[];
readonly code?: string;
readonly details?: ErrorDetail[];
readonly message?: string;
readonly target?: string;
}
// @public
export interface ErrorResponse {
code?: string;
message?: string;
error?: ErrorDetail;
}
// @public
@ -796,6 +820,120 @@ export type GetRequiredAmlFSSubnetsSizeResponse = RequiredAmlFilesystemSubnetsSi
// @public
export type HealthStateType = string;
// @public
export interface ImportJob extends TrackedResource {
readonly blobsImportedPerSecond?: number;
readonly blobsWalkedPerSecond?: number;
conflictResolutionMode?: ConflictResolutionMode;
importPrefixes?: string[];
readonly lastCompletionTime?: Date;
readonly lastStartedTime?: Date;
maximumErrors?: number;
readonly provisioningState?: ImportJobProvisioningStateType;
readonly state?: ImportStatusType;
readonly statusMessage?: string;
readonly totalBlobsImported?: number;
readonly totalBlobsWalked?: number;
readonly totalConflicts?: number;
readonly totalErrors?: number;
}
// @public
export type ImportJobProvisioningStateType = string;
// @public
export interface ImportJobs {
beginCreateOrUpdate(resourceGroupName: string, amlFilesystemName: string, importJobName: string, importJob: ImportJob, options?: ImportJobsCreateOrUpdateOptionalParams): Promise<SimplePollerLike<OperationState<ImportJobsCreateOrUpdateResponse>, ImportJobsCreateOrUpdateResponse>>;
beginCreateOrUpdateAndWait(resourceGroupName: string, amlFilesystemName: string, importJobName: string, importJob: ImportJob, options?: ImportJobsCreateOrUpdateOptionalParams): Promise<ImportJobsCreateOrUpdateResponse>;
beginDelete(resourceGroupName: string, amlFilesystemName: string, importJobName: string, options?: ImportJobsDeleteOptionalParams): Promise<SimplePollerLike<OperationState<ImportJobsDeleteResponse>, ImportJobsDeleteResponse>>;
beginDeleteAndWait(resourceGroupName: string, amlFilesystemName: string, importJobName: string, options?: ImportJobsDeleteOptionalParams): Promise<ImportJobsDeleteResponse>;
beginUpdate(resourceGroupName: string, amlFilesystemName: string, importJobName: string, importJob: ImportJobUpdate, options?: ImportJobsUpdateOptionalParams): Promise<SimplePollerLike<OperationState<ImportJobsUpdateResponse>, ImportJobsUpdateResponse>>;
beginUpdateAndWait(resourceGroupName: string, amlFilesystemName: string, importJobName: string, importJob: ImportJobUpdate, options?: ImportJobsUpdateOptionalParams): Promise<ImportJobsUpdateResponse>;
get(resourceGroupName: string, amlFilesystemName: string, importJobName: string, options?: ImportJobsGetOptionalParams): Promise<ImportJobsGetResponse>;
listByAmlFilesystem(resourceGroupName: string, amlFilesystemName: string, options?: ImportJobsListByAmlFilesystemOptionalParams): PagedAsyncIterableIterator<ImportJob>;
}
// @public
export interface ImportJobsCreateOrUpdateHeaders {
azureAsyncOperation?: string;
}
// @public
export interface ImportJobsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
updateIntervalInMs?: number;
}
// @public
export type ImportJobsCreateOrUpdateResponse = ImportJob;
// @public
export interface ImportJobsDeleteHeaders {
azureAsyncOperation?: string;
location?: string;
}
// @public
export interface ImportJobsDeleteOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
updateIntervalInMs?: number;
}
// @public
export type ImportJobsDeleteResponse = ImportJobsDeleteHeaders;
// @public
export interface ImportJobsGetOptionalParams extends coreClient.OperationOptions {
}
// @public
export type ImportJobsGetResponse = ImportJob;
// @public
export interface ImportJobsListByAmlFilesystemNextOptionalParams extends coreClient.OperationOptions {
}
// @public
export type ImportJobsListByAmlFilesystemNextResponse = ImportJobsListResult;
// @public
export interface ImportJobsListByAmlFilesystemOptionalParams extends coreClient.OperationOptions {
}
// @public
export type ImportJobsListByAmlFilesystemResponse = ImportJobsListResult;
// @public
export interface ImportJobsListResult {
nextLink?: string;
value?: ImportJob[];
}
// @public
export interface ImportJobsUpdateHeaders {
azureAsyncOperation?: string;
location?: string;
}
// @public
export interface ImportJobsUpdateOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
updateIntervalInMs?: number;
}
// @public
export type ImportJobsUpdateResponse = ImportJob;
// @public
export interface ImportJobUpdate {
tags?: {
[propertyName: string]: string;
};
}
// @public
export type ImportStatusType = string;
// @public
export interface KeyVaultKeyReference {
keyUrl: string;
@ -845,6 +983,14 @@ export enum KnownArchiveStatusType {
NotConfigured = "NotConfigured"
}
// @public
export enum KnownConflictResolutionMode {
Fail = "Fail",
OverwriteAlways = "OverwriteAlways",
OverwriteIfDirty = "OverwriteIfDirty",
Skip = "Skip"
}
// @public
export enum KnownCreatedByType {
Application = "Application",
@ -888,6 +1034,26 @@ export enum KnownHealthStateType {
WaitingForKey = "WaitingForKey"
}
// @public
export enum KnownImportJobProvisioningStateType {
Canceled = "Canceled",
Creating = "Creating",
Deleting = "Deleting",
Failed = "Failed",
Succeeded = "Succeeded",
Updating = "Updating"
}
// @public
export enum KnownImportStatusType {
Canceled = "Canceled",
Cancelling = "Cancelling",
Completed = "Completed",
CompletedPartial = "CompletedPartial",
Failed = "Failed",
InProgress = "InProgress"
}
// @public
export enum KnownMetricAggregationType {
Average = "Average",
@ -1203,6 +1369,8 @@ export class StorageCacheManagementClient extends coreClient.ServiceClient {
checkAmlFSSubnets(options?: CheckAmlFSSubnetsOptionalParams): Promise<void>;
getRequiredAmlFSSubnetsSize(options?: GetRequiredAmlFSSubnetsSizeOptionalParams): Promise<GetRequiredAmlFSSubnetsSizeResponse>;
// (undocumented)
importJobs: ImportJobs;
// (undocumented)
operations: Operations;
// (undocumented)
skus: Skus;

Просмотреть файл

@ -11,7 +11,7 @@
import {
AmlFilesystemArchiveInfo,
AmlFilesystemsArchiveOptionalParams,
StorageCacheManagementClient
StorageCacheManagementClient,
} from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
@ -22,7 +22,7 @@ dotenv.config();
* This sample demonstrates how to Archive data from the AML file system.
*
* @summary Archive data from the AML file system.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_Archive.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_Archive.json
*/
async function amlFilesystemsArchive() {
const subscriptionId =
@ -38,7 +38,7 @@ async function amlFilesystemsArchive() {
const result = await client.amlFilesystems.archive(
resourceGroupName,
amlFilesystemName,
options
options,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Cancel archiving data from the AML file system.
*
* @summary Cancel archiving data from the AML file system.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_CancelArchive.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_CancelArchive.json
*/
async function amlFilesystemsCancelArchive() {
const subscriptionId =
@ -31,7 +31,7 @@ async function amlFilesystemsCancelArchive() {
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.amlFilesystems.cancelArchive(
resourceGroupName,
amlFilesystemName
amlFilesystemName,
);
console.log(result);
}

Просмотреть файл

@ -10,7 +10,7 @@
// Licensed under the MIT License.
import {
AmlFilesystem,
StorageCacheManagementClient
StorageCacheManagementClient,
} from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
@ -21,7 +21,7 @@ dotenv.config();
* This sample demonstrates how to Create or update an AML file system.
*
* @summary Create or update an AML file system.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_CreateOrUpdate.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_CreateOrUpdate.json
*/
async function amlFilesystemsCreateOrUpdate() {
const subscriptionId =
@ -36,10 +36,9 @@ async function amlFilesystemsCreateOrUpdate() {
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"
}
}
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",
@ -47,16 +46,17 @@ async function amlFilesystemsCreateOrUpdate() {
settings: {
container:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/containername",
importPrefix: "/",
importPrefixesInitial: ["/"],
loggingContainer:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/loggingcontainername"
}
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/loggingcontainername",
},
},
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/00000000000000000000000000000000/resourceGroups/scgroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {}
}
"/subscriptions/00000000000000000000000000000000/resourceGroups/scgroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1":
{},
},
},
location: "eastus",
maintenanceWindow: { dayOfWeek: "Friday", timeOfDayUTC: "22:00" },
@ -64,19 +64,19 @@ async function amlFilesystemsCreateOrUpdate() {
mode: "All",
noSquashNidLists: "10.0.0.[5-6]@tcp;10.0.1.2@tcp",
squashGID: 99,
squashUID: 99
squashUID: 99,
},
sku: { name: "AMLFS-Durable-Premium-250" },
storageCapacityTiB: 16,
tags: { dept: "ContosoAds" },
zones: ["1"]
zones: ["1"],
};
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.amlFilesystems.beginCreateOrUpdateAndWait(
resourceGroupName,
amlFilesystemName,
amlFilesystem
amlFilesystem,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Schedules an AML file system for deletion.
*
* @summary Schedules an AML file system for deletion.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_Delete.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_Delete.json
*/
async function amlFilesystemsDelete() {
const subscriptionId =
@ -31,7 +31,7 @@ async function amlFilesystemsDelete() {
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.amlFilesystems.beginDeleteAndWait(
resourceGroupName,
amlFilesystemName
amlFilesystemName,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Returns an AML file system.
*
* @summary Returns an AML file system.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_Get.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_Get.json
*/
async function amlFilesystemsGet() {
const subscriptionId =
@ -31,7 +31,7 @@ async function amlFilesystemsGet() {
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.amlFilesystems.get(
resourceGroupName,
amlFilesystemName
amlFilesystemName,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Returns all AML file systems the user has access to under a resource group.
*
* @summary Returns all AML file systems the user has access to under a resource group.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_ListByResourceGroup.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_ListByResourceGroup.json
*/
async function amlFilesystemsListByResourceGroup() {
const subscriptionId =
@ -30,7 +30,7 @@ async function amlFilesystemsListByResourceGroup() {
const client = new StorageCacheManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.amlFilesystems.listByResourceGroup(
resourceGroupName
resourceGroupName,
)) {
resArray.push(item);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Returns all AML file systems the user has access to under a subscription.
*
* @summary Returns all AML file systems the user has access to under a subscription.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_List.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_List.json
*/
async function amlFilesystemsList() {
const subscriptionId =

Просмотреть файл

@ -10,7 +10,7 @@
// Licensed under the MIT License.
import {
AmlFilesystemUpdate,
StorageCacheManagementClient
StorageCacheManagementClient,
} from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
@ -21,7 +21,7 @@ dotenv.config();
* This sample demonstrates how to Update an AML file system instance.
*
* @summary Update an AML file system instance.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_Update.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_Update.json
*/
async function amlFilesystemsUpdate() {
const subscriptionId =
@ -36,26 +36,25 @@ async function amlFilesystemsUpdate() {
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"
}
}
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk",
},
},
},
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
squashUID: 99,
},
tags: { dept: "ContosoAds" }
tags: { dept: "ContosoAds" },
};
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.amlFilesystems.beginUpdateAndWait(
resourceGroupName,
amlFilesystemName,
amlFilesystem
amlFilesystem,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Gets the status of an asynchronous operation for the Azure HPC Cache
*
* @summary Gets the status of an asynchronous operation for the Azure HPC Cache
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/AscOperations_Get.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/AscOperations_Get.json
*/
async function ascOperationsGet() {
const subscriptionId =

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Gets the quantity used and quota limit for resources
*
* @summary Gets the quantity used and quota limit for resources
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/AscResourceUsages_Get.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/AscResourceUsages_Get.json
*/
async function ascUsagesList() {
const subscriptionId =

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Create or update a cache.
*
* @summary Create or update a cache.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_CreateOrUpdate.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_CreateOrUpdate.json
*/
async function cachesCreateOrUpdate() {
const subscriptionId =
@ -36,33 +36,33 @@ async function cachesCreateOrUpdate() {
domainName: "contosoAd.contoso.local",
domainNetBiosName: "contosoAd",
primaryDnsIpAddress: "192.0.2.10",
secondaryDnsIpAddress: "192.0.2.11"
secondaryDnsIpAddress: "192.0.2.11",
},
usernameDownload: {
credentials: {
bindDn: "cn=ldapadmin,dc=contosoad,dc=contoso,dc=local",
bindPassword: "<bindPassword>"
bindPassword: "<bindPassword>",
},
extendedGroups: true,
ldapBaseDN: "dc=contosoad,dc=contoso,dc=local",
ldapServer: "192.0.2.12",
usernameSource: "LDAP"
}
usernameSource: "LDAP",
},
},
encryptionSettings: {
keyEncryptionKey: {
keyUrl: "https://keyvault-cmk.vault.azure.net/keys/key2047/test",
sourceVault: {
id:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"
}
}
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk",
},
},
},
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/00000000000000000000000000000000/resourceGroups/scgroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {}
}
"/subscriptions/00000000000000000000000000000000/resourceGroups/scgroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1":
{},
},
},
location: "westus",
securitySettings: {
@ -75,11 +75,11 @@ async function cachesCreateOrUpdate() {
rootSquash: false,
scope: "default",
submountAccess: true,
suid: false
}
]
}
]
suid: false,
},
],
},
],
},
sku: { name: "Standard_2G" },
subnet:
@ -87,15 +87,15 @@ async function cachesCreateOrUpdate() {
tags: { dept: "Contoso" },
upgradeSettings: {
scheduledTime: new Date("2022-04-26T18:25:43.511Z"),
upgradeScheduleEnabled: true
}
upgradeScheduleEnabled: true,
},
};
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginCreateOrUpdateAndWait(
resourceGroupName,
cacheName,
cache
cache,
);
console.log(result);
}
@ -104,7 +104,7 @@ async function cachesCreateOrUpdate() {
* This sample demonstrates how to Create or update a cache.
*
* @summary Create or update a cache.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_CreateOrUpdate_ldap_only.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_CreateOrUpdate_ldap_only.json
*/
async function cachesCreateOrUpdateLdapOnly() {
const subscriptionId =
@ -119,22 +119,21 @@ async function cachesCreateOrUpdateLdapOnly() {
usernameDownload: {
credentials: {
bindDn: "cn=ldapadmin,dc=contosoad,dc=contoso,dc=local",
bindPassword: "<bindPassword>"
bindPassword: "<bindPassword>",
},
extendedGroups: true,
ldapBaseDN: "dc=contosoad,dc=contoso,dc=local",
ldapServer: "192.0.2.12",
usernameSource: "LDAP"
}
usernameSource: "LDAP",
},
},
encryptionSettings: {
keyEncryptionKey: {
keyUrl: "https://keyvault-cmk.vault.azure.net/keys/key2048/test",
sourceVault: {
id:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"
}
}
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk",
},
},
},
location: "westus",
securitySettings: {
@ -147,11 +146,11 @@ async function cachesCreateOrUpdateLdapOnly() {
rootSquash: false,
scope: "default",
submountAccess: true,
suid: false
}
]
}
]
suid: false,
},
],
},
],
},
sku: { name: "Standard_2G" },
subnet:
@ -159,15 +158,15 @@ async function cachesCreateOrUpdateLdapOnly() {
tags: { dept: "Contoso" },
upgradeSettings: {
scheduledTime: new Date("2022-04-26T18:25:43.511Z"),
upgradeScheduleEnabled: true
}
upgradeScheduleEnabled: true,
},
};
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginCreateOrUpdateAndWait(
resourceGroupName,
cacheName,
cache
cache,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Tells a cache to write generate debug info for support to process.
*
* @summary Tells a cache to write generate debug info for support to process.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_DebugInfo.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_DebugInfo.json
*/
async function cachesDebugInfo() {
const subscriptionId =
@ -31,7 +31,7 @@ async function cachesDebugInfo() {
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginDebugInfoAndWait(
resourceGroupName,
cacheName
cacheName,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Schedules a cache for deletion.
*
* @summary Schedules a cache for deletion.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Delete.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Delete.json
*/
async function cachesDelete() {
const subscriptionId =
@ -31,7 +31,7 @@ async function cachesDelete() {
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginDeleteAndWait(
resourceGroupName,
cacheName
cacheName,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Tells a cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete.
*
* @summary Tells a cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Flush.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Flush.json
*/
async function cachesFlush() {
const subscriptionId =
@ -31,7 +31,7 @@ async function cachesFlush() {
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginFlushAndWait(
resourceGroupName,
cacheName
cacheName,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Returns a cache.
*
* @summary Returns a cache.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Get.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Get.json
*/
async function cachesGet() {
const subscriptionId =

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Returns all caches the user has access to under a resource group.
*
* @summary Returns all caches the user has access to under a resource group.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_ListByResourceGroup.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_ListByResourceGroup.json
*/
async function cachesListByResourceGroup() {
const subscriptionId =

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Returns all caches the user has access to under a subscription.
*
* @summary Returns all caches the user has access to under a subscription.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_List.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_List.json
*/
async function cachesList() {
const subscriptionId =

Просмотреть файл

@ -11,7 +11,7 @@
import {
PrimingJobIdParameter,
CachesPausePrimingJobOptionalParams,
StorageCacheManagementClient
StorageCacheManagementClient,
} from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
@ -22,7 +22,7 @@ dotenv.config();
* This sample demonstrates how to Schedule a priming job to be paused.
*
* @summary Schedule a priming job to be paused.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/PausePrimingJob.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/PausePrimingJob.json
*/
async function pausePrimingJob() {
const subscriptionId =
@ -32,7 +32,7 @@ async function pausePrimingJob() {
process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const primingJobId: PrimingJobIdParameter = {
primingJobId: "00000000000_0000000000"
primingJobId: "00000000000_0000000000",
};
const options: CachesPausePrimingJobOptionalParams = { primingJobId };
const credential = new DefaultAzureCredential();
@ -40,7 +40,7 @@ async function pausePrimingJob() {
const result = await client.caches.beginPausePrimingJobAndWait(
resourceGroupName,
cacheName,
options
options,
);
console.log(result);
}

Просмотреть файл

@ -11,7 +11,7 @@
import {
PrimingJobIdParameter,
CachesResumePrimingJobOptionalParams,
StorageCacheManagementClient
StorageCacheManagementClient,
} from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
@ -22,7 +22,7 @@ dotenv.config();
* This sample demonstrates how to Resumes a paused priming job.
*
* @summary Resumes a paused priming job.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/ResumePrimingJob.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/ResumePrimingJob.json
*/
async function resumePrimingJob() {
const subscriptionId =
@ -32,7 +32,7 @@ async function resumePrimingJob() {
process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const primingJobId: PrimingJobIdParameter = {
primingJobId: "00000000000_0000000000"
primingJobId: "00000000000_0000000000",
};
const options: CachesResumePrimingJobOptionalParams = { primingJobId };
const credential = new DefaultAzureCredential();
@ -40,7 +40,7 @@ async function resumePrimingJob() {
const result = await client.caches.beginResumePrimingJobAndWait(
resourceGroupName,
cacheName,
options
options,
);
console.log(result);
}

Просмотреть файл

@ -11,7 +11,7 @@
import {
StorageTargetSpaceAllocation,
CachesSpaceAllocationOptionalParams,
StorageCacheManagementClient
StorageCacheManagementClient,
} from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
@ -22,7 +22,7 @@ dotenv.config();
* This sample demonstrates how to Update cache space allocation.
*
* @summary Update cache space allocation.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/SpaceAllocation_Post.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/SpaceAllocation_Post.json
*/
async function spaceAllocationPost() {
const subscriptionId =
@ -34,7 +34,7 @@ async function spaceAllocationPost() {
const spaceAllocation: StorageTargetSpaceAllocation[] = [
{ name: "st1", allocationPercentage: 25 },
{ name: "st2", allocationPercentage: 50 },
{ name: "st3", allocationPercentage: 25 }
{ name: "st3", allocationPercentage: 25 },
];
const options: CachesSpaceAllocationOptionalParams = { spaceAllocation };
const credential = new DefaultAzureCredential();
@ -42,7 +42,7 @@ async function spaceAllocationPost() {
const result = await client.caches.beginSpaceAllocationAndWait(
resourceGroupName,
cacheName,
options
options,
);
console.log(result);
}

Просмотреть файл

@ -11,7 +11,7 @@
import {
PrimingJob,
CachesStartPrimingJobOptionalParams,
StorageCacheManagementClient
StorageCacheManagementClient,
} from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
@ -22,7 +22,7 @@ dotenv.config();
* 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: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StartPrimingJob.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StartPrimingJob.json
*/
async function startPrimingJob() {
const subscriptionId =
@ -34,7 +34,7 @@ async function startPrimingJob() {
const primingjob: 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>"
"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>",
};
const options: CachesStartPrimingJobOptionalParams = { primingjob };
const credential = new DefaultAzureCredential();
@ -42,7 +42,7 @@ async function startPrimingJob() {
const result = await client.caches.beginStartPrimingJobAndWait(
resourceGroupName,
cacheName,
options
options,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Tells a Stopped state cache to transition to Active state.
*
* @summary Tells a Stopped state cache to transition to Active state.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Start.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Start.json
*/
async function cachesStart() {
const subscriptionId =
@ -31,7 +31,7 @@ async function cachesStart() {
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginStartAndWait(
resourceGroupName,
cacheName
cacheName,
);
console.log(result);
}

Просмотреть файл

@ -11,7 +11,7 @@
import {
PrimingJobIdParameter,
CachesStopPrimingJobOptionalParams,
StorageCacheManagementClient
StorageCacheManagementClient,
} from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
@ -22,7 +22,7 @@ dotenv.config();
* This sample demonstrates how to Schedule a priming job for deletion.
*
* @summary Schedule a priming job for deletion.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StopPrimingJob.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StopPrimingJob.json
*/
async function stopPrimingJob() {
const subscriptionId =
@ -32,7 +32,7 @@ async function stopPrimingJob() {
process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const primingJobId: PrimingJobIdParameter = {
primingJobId: "00000000000_0000000000"
primingJobId: "00000000000_0000000000",
};
const options: CachesStopPrimingJobOptionalParams = { primingJobId };
const credential = new DefaultAzureCredential();
@ -40,7 +40,7 @@ async function stopPrimingJob() {
const result = await client.caches.beginStopPrimingJobAndWait(
resourceGroupName,
cacheName,
options
options,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Tells an Active cache to transition to Stopped state.
*
* @summary Tells an Active cache to transition to Stopped state.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Stop.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Stop.json
*/
async function cachesStop() {
const subscriptionId =
@ -31,7 +31,7 @@ async function cachesStop() {
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginStopAndWait(
resourceGroupName,
cacheName
cacheName,
);
console.log(result);
}

Просмотреть файл

@ -11,7 +11,7 @@
import {
Cache,
CachesUpdateOptionalParams,
StorageCacheManagementClient
StorageCacheManagementClient,
} from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
@ -22,7 +22,7 @@ dotenv.config();
* This sample demonstrates how to Update a cache instance.
*
* @summary Update a cache instance.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Update.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Update.json
*/
async function cachesUpdate() {
const subscriptionId =
@ -39,16 +39,16 @@ async function cachesUpdate() {
domainName: "contosoAd.contoso.local",
domainNetBiosName: "contosoAd",
primaryDnsIpAddress: "192.0.2.10",
secondaryDnsIpAddress: "192.0.2.11"
secondaryDnsIpAddress: "192.0.2.11",
},
usernameDownload: { extendedGroups: true, usernameSource: "AD" }
usernameDownload: { extendedGroups: true, usernameSource: "AD" },
},
location: "westus",
networkSettings: {
dnsSearchDomain: "contoso.com",
dnsServers: ["10.1.22.33", "10.1.12.33"],
mtu: 1500,
ntpServer: "time.contoso.com"
ntpServer: "time.contoso.com",
},
securitySettings: {
accessPolicies: [
@ -60,9 +60,9 @@ async function cachesUpdate() {
rootSquash: false,
scope: "default",
submountAccess: true,
suid: false
}
]
suid: false,
},
],
},
{
name: "restrictive",
@ -73,7 +73,7 @@ async function cachesUpdate() {
rootSquash: false,
scope: "host",
submountAccess: true,
suid: true
suid: true,
},
{
access: "rw",
@ -81,7 +81,7 @@ async function cachesUpdate() {
rootSquash: false,
scope: "network",
submountAccess: true,
suid: true
suid: true,
},
{
access: "no",
@ -90,11 +90,11 @@ async function cachesUpdate() {
rootSquash: true,
scope: "default",
submountAccess: true,
suid: false
}
]
}
]
suid: false,
},
],
},
],
},
sku: { name: "Standard_2G" },
subnet:
@ -102,8 +102,8 @@ async function cachesUpdate() {
tags: { dept: "Contoso" },
upgradeSettings: {
scheduledTime: new Date("2022-04-26T18:25:43.511Z"),
upgradeScheduleEnabled: true
}
upgradeScheduleEnabled: true,
},
};
const options: CachesUpdateOptionalParams = { cache };
const credential = new DefaultAzureCredential();
@ -111,7 +111,7 @@ async function cachesUpdate() {
const result = await client.caches.beginUpdateAndWait(
resourceGroupName,
cacheName,
options
options,
);
console.log(result);
}
@ -120,7 +120,7 @@ async function cachesUpdate() {
* This sample demonstrates how to Update a cache instance.
*
* @summary Update a cache instance.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Update_ldap_only.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Update_ldap_only.json
*/
async function cachesUpdateLdapOnly() {
const subscriptionId =
@ -135,20 +135,20 @@ async function cachesUpdateLdapOnly() {
usernameDownload: {
credentials: {
bindDn: "cn=ldapadmin,dc=contosoad,dc=contoso,dc=local",
bindPassword: "<bindPassword>"
bindPassword: "<bindPassword>",
},
extendedGroups: true,
ldapBaseDN: "dc=contosoad,dc=contoso,dc=local",
ldapServer: "192.0.2.12",
usernameSource: "LDAP"
}
usernameSource: "LDAP",
},
},
location: "westus",
networkSettings: {
dnsSearchDomain: "contoso.com",
dnsServers: ["10.1.22.33", "10.1.12.33"],
mtu: 1500,
ntpServer: "time.contoso.com"
ntpServer: "time.contoso.com",
},
securitySettings: {
accessPolicies: [
@ -160,9 +160,9 @@ async function cachesUpdateLdapOnly() {
rootSquash: false,
scope: "default",
submountAccess: true,
suid: false
}
]
suid: false,
},
],
},
{
name: "restrictive",
@ -173,7 +173,7 @@ async function cachesUpdateLdapOnly() {
rootSquash: false,
scope: "host",
submountAccess: true,
suid: true
suid: true,
},
{
access: "rw",
@ -181,7 +181,7 @@ async function cachesUpdateLdapOnly() {
rootSquash: false,
scope: "network",
submountAccess: true,
suid: true
suid: true,
},
{
access: "no",
@ -190,11 +190,11 @@ async function cachesUpdateLdapOnly() {
rootSquash: true,
scope: "default",
submountAccess: true,
suid: false
}
]
}
]
suid: false,
},
],
},
],
},
sku: { name: "Standard_2G" },
subnet:
@ -202,8 +202,8 @@ async function cachesUpdateLdapOnly() {
tags: { dept: "Contoso" },
upgradeSettings: {
scheduledTime: new Date("2022-04-26T18:25:43.511Z"),
upgradeScheduleEnabled: true
}
upgradeScheduleEnabled: true,
},
};
const options: CachesUpdateOptionalParams = { cache };
const credential = new DefaultAzureCredential();
@ -211,7 +211,7 @@ async function cachesUpdateLdapOnly() {
const result = await client.caches.beginUpdateAndWait(
resourceGroupName,
cacheName,
options
options,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Upgrade a cache's firmware if a new version is available. Otherwise, this operation has no effect.
*
* @summary Upgrade a cache's firmware if a new version is available. Otherwise, this operation has no effect.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_UpgradeFirmware.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_UpgradeFirmware.json
*/
async function cachesUpgradeFirmware() {
const subscriptionId =
@ -31,7 +31,7 @@ async function cachesUpgradeFirmware() {
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginUpgradeFirmwareAndWait(
resourceGroupName,
cacheName
cacheName,
);
console.log(result);
}

Просмотреть файл

@ -11,7 +11,7 @@
import {
AmlFilesystemSubnetInfo,
CheckAmlFSSubnetsOptionalParams,
StorageCacheManagementClient
StorageCacheManagementClient,
} from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
@ -22,7 +22,7 @@ dotenv.config();
* This sample demonstrates how to Check that subnets will be valid for AML file system create calls.
*
* @summary Check that subnets will be valid for AML file system create calls.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/checkAmlFSSubnets.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/checkAmlFSSubnets.json
*/
async function checkAmlFsSubnets() {
const subscriptionId =
@ -32,7 +32,7 @@ async function checkAmlFsSubnets() {
filesystemSubnet:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/fsSub",
sku: { name: "AMLFS-Durable-Premium-125" },
storageCapacityTiB: 16
storageCapacityTiB: 16,
};
const options: CheckAmlFSSubnetsOptionalParams = { amlFilesystemSubnetInfo };
const credential = new DefaultAzureCredential();

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Get the number of available IP addresses needed for the AML file system information provided.
*
* @summary Get the number of available IP addresses needed for the AML file system information provided.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/getRequiredAmlFSSubnetsSize.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/getRequiredAmlFSSubnetsSize.json
*/
async function getRequiredAmlFilesystemSubnetsSize() {
const subscriptionId =

Просмотреть файл

@ -9,9 +9,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
AmlFilesystemArchiveInfo,
AmlFilesystemsArchiveOptionalParams,
StorageCacheManagementClient
ImportJob,
StorageCacheManagementClient,
} from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
@ -19,32 +18,39 @@ import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Archive data from the AML file system.
* This sample demonstrates how to Create or update an import job. Import jobs are automatically deleted 72 hours after completion.
*
* @summary Archive data from the AML file system.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_Archive.json
* @summary Create or update an import job. Import jobs are automatically deleted 72 hours after completion.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/importJobs_CreateOrUpdate.json
*/
async function amlFilesystemsArchive() {
async function importJobsCreateOrUpdate() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const amlFilesystemName = "sc";
const archiveInfo: AmlFilesystemArchiveInfo = { filesystemPath: "/" };
const options: AmlFilesystemsArchiveOptionalParams = { archiveInfo };
const amlFilesystemName = "fs1";
const importJobName = "job1";
const importJob: ImportJob = {
conflictResolutionMode: "OverwriteAlways",
importPrefixes: ["/"],
location: "eastus",
maximumErrors: 0,
tags: { dept: "ContosoAds" },
};
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.amlFilesystems.archive(
const result = await client.importJobs.beginCreateOrUpdateAndWait(
resourceGroupName,
amlFilesystemName,
options
importJobName,
importJob,
);
console.log(result);
}
async function main() {
amlFilesystemsArchive();
importJobsCreateOrUpdate();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,45 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { StorageCacheManagementClient } from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Schedules an import job for deletion.
*
* @summary Schedules an import job for deletion.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/importJobs_Delete.json
*/
async function importJobsDelete() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const amlFilesystemName = "fs1";
const importJobName = "job1";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.importJobs.beginDeleteAndWait(
resourceGroupName,
amlFilesystemName,
importJobName,
);
console.log(result);
}
async function main() {
importJobsDelete();
}
main().catch(console.error);

Просмотреть файл

@ -15,29 +15,31 @@ import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Returns an AML file system.
* This sample demonstrates how to Returns an import job.
*
* @summary Returns an AML file system.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_Get.json
* @summary Returns an import job.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/importJobs_Get.json
*/
async function amlFilesystemsGet() {
async function importJobsGet() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const amlFilesystemName = "fs1";
const importJobName = "job1";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.amlFilesystems.get(
const result = await client.importJobs.get(
resourceGroupName,
amlFilesystemName
amlFilesystemName,
importJobName,
);
console.log(result);
}
async function main() {
amlFilesystemsGet();
importJobsGet();
}
main().catch(console.error);

Просмотреть файл

@ -15,24 +15,24 @@ import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Returns a list of Storage Targets for the specified cache.
* This sample demonstrates how to Returns all import jobs the user has access to under an AML File System.
*
* @summary Returns a list of Storage Targets for the specified cache.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_ListByCache.json
* @summary Returns all import jobs the user has access to under an AML File System.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/importJobs_ListByAmlFilesystem.json
*/
async function storageTargetsList() {
async function importJobsListByAmlFilesystem() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const amlFilesystemName = "fs1";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.storageTargets.listByCache(
for await (let item of client.importJobs.listByAmlFilesystem(
resourceGroupName,
cacheName
amlFilesystemName,
)) {
resArray.push(item);
}
@ -40,7 +40,7 @@ async function storageTargetsList() {
}
async function main() {
storageTargetsList();
importJobsListByAmlFilesystem();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,50 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
ImportJobUpdate,
StorageCacheManagementClient,
} from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Update an import job instance.
*
* @summary Update an import job instance.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/importJob_Update.json
*/
async function importJobsUpdate() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const amlFilesystemName = "fs1";
const importJobName = "job1";
const importJob: ImportJobUpdate = { tags: { dept: "ContosoAds" } };
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.importJobs.beginUpdateAndWait(
resourceGroupName,
amlFilesystemName,
importJobName,
importJob,
);
console.log(result);
}
async function main() {
importJobsUpdate();
}
main().catch(console.error);

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Lists all of the available Resource Provider operations.
*
* @summary Lists all of the available Resource Provider operations.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Operations_List.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Operations_List.json
*/
async function operationsList() {
const subscriptionId =

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Get the list of StorageCache.Cache SKUs available to this subscription.
*
* @summary Get the list of StorageCache.Cache SKUs available to this subscription.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Skus_List.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Skus_List.json
*/
async function skusList() {
const subscriptionId =

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage target's namespace will return errors until the flush operation completes.
*
* @summary Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage target's namespace will return errors until the flush operation completes.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Flush.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Flush.json
*/
async function storageTargetsFlush() {
const subscriptionId =
@ -33,7 +33,7 @@ async function storageTargetsFlush() {
const result = await client.storageTargetOperations.beginFlushAndWait(
resourceGroupName,
cacheName,
storageTargetName
storageTargetName,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the next request.
*
* @summary Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the next request.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Invalidate.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Invalidate.json
*/
async function storageTargetsInvalidate() {
const subscriptionId =
@ -33,7 +33,7 @@ async function storageTargetsInvalidate() {
const result = await client.storageTargetOperations.beginInvalidateAndWait(
resourceGroupName,
cacheName,
storageTargetName
storageTargetName,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Resumes client access to a previously suspended storage target.
*
* @summary Resumes client access to a previously suspended storage target.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Resume.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Resume.json
*/
async function storageTargetsResume() {
const subscriptionId =
@ -33,7 +33,7 @@ async function storageTargetsResume() {
const result = await client.storageTargetOperations.beginResumeAndWait(
resourceGroupName,
cacheName,
storageTargetName
storageTargetName,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Suspends client access to a storage target.
*
* @summary Suspends client access to a storage target.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Suspend.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Suspend.json
*/
async function storageTargetsSuspend() {
const subscriptionId =
@ -33,7 +33,7 @@ async function storageTargetsSuspend() {
const result = await client.storageTargetOperations.beginSuspendAndWait(
resourceGroupName,
cacheName,
storageTargetName
storageTargetName,
);
console.log(result);
}

Просмотреть файл

@ -10,7 +10,7 @@
// Licensed under the MIT License.
import {
StorageTarget,
StorageCacheManagementClient
StorageCacheManagementClient,
} from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
@ -21,7 +21,7 @@ dotenv.config();
* This sample demonstrates how to Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again.
*
* @summary Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_CreateOrUpdate.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_CreateOrUpdate.json
*/
async function storageTargetsCreateOrUpdate() {
const subscriptionId =
@ -37,21 +37,21 @@ async function storageTargetsCreateOrUpdate() {
namespacePath: "/path/on/cache",
nfsAccessPolicy: "default",
nfsExport: "exp1",
targetPath: "/path/on/exp1"
targetPath: "/path/on/exp1",
},
{
namespacePath: "/path2/on/cache",
nfsAccessPolicy: "rootSquash",
nfsExport: "exp2",
targetPath: "/path2/on/exp2"
}
targetPath: "/path2/on/exp2",
},
],
nfs3: {
target: "10.0.44.44",
usageModel: "READ_ONLY",
verificationTimer: 30
verificationTimer: 30,
},
targetType: "nfs3"
targetType: "nfs3",
};
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
@ -59,7 +59,7 @@ async function storageTargetsCreateOrUpdate() {
resourceGroupName,
cacheName,
storageTargetName,
storagetarget
storagetarget,
);
console.log(result);
}
@ -68,7 +68,7 @@ async function storageTargetsCreateOrUpdate() {
* This sample demonstrates how to Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again.
*
* @summary Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_CreateOrUpdate_BlobNfs.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_CreateOrUpdate_BlobNfs.json
*/
async function storageTargetsCreateOrUpdateBlobNfs() {
const subscriptionId =
@ -84,10 +84,10 @@ async function storageTargetsCreateOrUpdateBlobNfs() {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/blofnfs/blobServices/default/containers/blobnfs",
usageModel: "READ_WRITE",
verificationTimer: 28800,
writeBackTimer: 3600
writeBackTimer: 3600,
},
junctions: [{ namespacePath: "/blobnfs" }],
targetType: "blobNfs"
targetType: "blobNfs",
};
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
@ -95,7 +95,7 @@ async function storageTargetsCreateOrUpdateBlobNfs() {
resourceGroupName,
cacheName,
storageTargetName,
storagetarget
storagetarget,
);
console.log(result);
}
@ -104,7 +104,7 @@ async function storageTargetsCreateOrUpdateBlobNfs() {
* This sample demonstrates how to Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again.
*
* @summary Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_CreateOrUpdate_NoJunctions.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_CreateOrUpdate_NoJunctions.json
*/
async function storageTargetsCreateOrUpdateNoJunctions() {
const subscriptionId =
@ -118,9 +118,9 @@ async function storageTargetsCreateOrUpdateNoJunctions() {
nfs3: {
target: "10.0.44.44",
usageModel: "READ_ONLY",
verificationTimer: 30
verificationTimer: 30,
},
targetType: "nfs3"
targetType: "nfs3",
};
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
@ -128,7 +128,7 @@ async function storageTargetsCreateOrUpdateNoJunctions() {
resourceGroupName,
cacheName,
storageTargetName,
storagetarget
storagetarget,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* 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: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Delete.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Delete.json
*/
async function storageTargetsDelete() {
const subscriptionId =
@ -33,7 +33,7 @@ async function storageTargetsDelete() {
const result = await client.storageTargets.beginDeleteAndWait(
resourceGroupName,
cacheName,
storageTargetName
storageTargetName,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Tells a storage target to refresh its DNS information.
*
* @summary Tells a storage target to refresh its DNS information.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_DnsRefresh.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_DnsRefresh.json
*/
async function cachesDnsRefresh() {
const subscriptionId =
@ -33,7 +33,7 @@ async function cachesDnsRefresh() {
const result = await client.storageTargets.beginDnsRefreshAndWait(
resourceGroupName,
cacheName,
storageTargetName
storageTargetName,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Returns a Storage Target from a cache.
*
* @summary Returns a Storage Target from a cache.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Get.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Get.json
*/
async function storageTargetsGet() {
const subscriptionId =
@ -33,7 +33,7 @@ async function storageTargetsGet() {
const result = await client.storageTargets.get(
resourceGroupName,
cacheName,
storageTargetName
storageTargetName,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Returns a list of Storage Targets for the specified cache.
*
* @summary Returns a list of Storage Targets for the specified cache.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_ListByCache.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_ListByCache.json
*/
async function storageTargetsList() {
const subscriptionId =
@ -32,7 +32,7 @@ async function storageTargetsList() {
const resArray = new Array();
for await (let item of client.storageTargets.listByCache(
resourceGroupName,
cacheName
cacheName,
)) {
resArray.push(item);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Tells a storage target to restore its settings to their default values.
*
* @summary Tells a storage target to restore its settings to their default values.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_RestoreDefaults.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_RestoreDefaults.json
*/
async function storageTargetsRestoreDefaults() {
const subscriptionId =
@ -33,7 +33,7 @@ async function storageTargetsRestoreDefaults() {
const result = await client.storageTargets.beginRestoreDefaultsAndWait(
resourceGroupName,
cacheName,
storageTargetName
storageTargetName,
);
console.log(result);
}

Просмотреть файл

@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Get the list of cache usage models available to this subscription.
*
* @summary Get the list of cache usage models available to this subscription.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/UsageModels_List.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/UsageModels_List.json
*/
async function usageModelsList() {
const subscriptionId =

Просмотреть файл

@ -1,130 +0,0 @@
# client library samples for JavaScript (Beta)
These sample programs show how to use the JavaScript client libraries for in some common scenarios.
| **File Name** | **Description** |
| ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [amlFilesystemsArchiveSample.js][amlfilesystemsarchivesample] | Archive data from the AML file system. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_Archive.json |
| [amlFilesystemsCancelArchiveSample.js][amlfilesystemscancelarchivesample] | Cancel archiving data from the AML file system. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_CancelArchive.json |
| [amlFilesystemsCreateOrUpdateSample.js][amlfilesystemscreateorupdatesample] | Create or update an AML file system. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_CreateOrUpdate.json |
| [amlFilesystemsDeleteSample.js][amlfilesystemsdeletesample] | Schedules an AML file system for deletion. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_Delete.json |
| [amlFilesystemsGetSample.js][amlfilesystemsgetsample] | Returns an AML file system. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_Get.json |
| [amlFilesystemsListByResourceGroupSample.js][amlfilesystemslistbyresourcegroupsample] | Returns all AML file systems the user has access to under a resource group. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_ListByResourceGroup.json |
| [amlFilesystemsListSample.js][amlfilesystemslistsample] | Returns all AML file systems the user has access to under a subscription. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_List.json |
| [amlFilesystemsUpdateSample.js][amlfilesystemsupdatesample] | Update an AML file system instance. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_Update.json |
| [ascOperationsGetSample.js][ascoperationsgetsample] | Gets the status of an asynchronous operation for the Azure HPC Cache x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/AscOperations_Get.json |
| [ascUsagesListSample.js][ascusageslistsample] | Gets the quantity used and quota limit for resources x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/AscResourceUsages_Get.json |
| [cachesCreateOrUpdateSample.js][cachescreateorupdatesample] | Create or update a cache. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_CreateOrUpdate.json |
| [cachesDebugInfoSample.js][cachesdebuginfosample] | Tells a cache to write generate debug info for support to process. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_DebugInfo.json |
| [cachesDeleteSample.js][cachesdeletesample] | Schedules a cache for deletion. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Delete.json |
| [cachesFlushSample.js][cachesflushsample] | Tells a cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Flush.json |
| [cachesGetSample.js][cachesgetsample] | Returns a cache. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Get.json |
| [cachesListByResourceGroupSample.js][cacheslistbyresourcegroupsample] | Returns all caches the user has access to under a resource group. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_ListByResourceGroup.json |
| [cachesListSample.js][cacheslistsample] | Returns all caches the user has access to under a subscription. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_List.json |
| [cachesPausePrimingJobSample.js][cachespauseprimingjobsample] | Schedule a priming job to be paused. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/PausePrimingJob.json |
| [cachesResumePrimingJobSample.js][cachesresumeprimingjobsample] | Resumes a paused priming job. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/ResumePrimingJob.json |
| [cachesSpaceAllocationSample.js][cachesspaceallocationsample] | Update cache space allocation. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/SpaceAllocation_Post.json |
| [cachesStartPrimingJobSample.js][cachesstartprimingjobsample] | Create a priming job. This operation is only allowed when the cache is healthy. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StartPrimingJob.json |
| [cachesStartSample.js][cachesstartsample] | Tells a Stopped state cache to transition to Active state. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Start.json |
| [cachesStopPrimingJobSample.js][cachesstopprimingjobsample] | Schedule a priming job for deletion. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StopPrimingJob.json |
| [cachesStopSample.js][cachesstopsample] | Tells an Active cache to transition to Stopped state. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Stop.json |
| [cachesUpdateSample.js][cachesupdatesample] | Update a cache instance. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Update.json |
| [cachesUpgradeFirmwareSample.js][cachesupgradefirmwaresample] | Upgrade a cache's firmware if a new version is available. Otherwise, this operation has no effect. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_UpgradeFirmware.json |
| [checkAmlFsSubnetsSample.js][checkamlfssubnetssample] | Check that subnets will be valid for AML file system create calls. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/checkAmlFSSubnets.json |
| [getRequiredAmlFsSubnetsSizeSample.js][getrequiredamlfssubnetssizesample] | Get the number of available IP addresses needed for the AML file system information provided. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/getRequiredAmlFSSubnetsSize.json |
| [operationsListSample.js][operationslistsample] | Lists all of the available Resource Provider operations. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Operations_List.json |
| [skusListSample.js][skuslistsample] | Get the list of StorageCache.Cache SKUs available to this subscription. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Skus_List.json |
| [storageTargetFlushSample.js][storagetargetflushsample] | Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage target's namespace will return errors until the flush operation completes. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Flush.json |
| [storageTargetInvalidateSample.js][storagetargetinvalidatesample] | Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the next request. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Invalidate.json |
| [storageTargetResumeSample.js][storagetargetresumesample] | Resumes client access to a previously suspended storage target. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Resume.json |
| [storageTargetSuspendSample.js][storagetargetsuspendsample] | Suspends client access to a storage target. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Suspend.json |
| [storageTargetsCreateOrUpdateSample.js][storagetargetscreateorupdatesample] | Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_CreateOrUpdate.json |
| [storageTargetsDeleteSample.js][storagetargetsdeletesample] | 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: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Delete.json |
| [storageTargetsDnsRefreshSample.js][storagetargetsdnsrefreshsample] | Tells a storage target to refresh its DNS information. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_DnsRefresh.json |
| [storageTargetsGetSample.js][storagetargetsgetsample] | Returns a Storage Target from a cache. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Get.json |
| [storageTargetsListByCacheSample.js][storagetargetslistbycachesample] | Returns a list of Storage Targets for the specified cache. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_ListByCache.json |
| [storageTargetsRestoreDefaultsSample.js][storagetargetsrestoredefaultssample] | Tells a storage target to restore its settings to their default values. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_RestoreDefaults.json |
| [usageModelsListSample.js][usagemodelslistsample] | Get the list of cache usage models available to this subscription. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/UsageModels_List.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
You need [an Azure subscription][freesub] to run these sample programs.
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node amlFilesystemsArchiveSample.js
```
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
```bash
npx cross-env STORAGECACHE_SUBSCRIPTION_ID="<storagecache subscription id>" STORAGECACHE_RESOURCE_GROUP="<storagecache resource group>" node amlFilesystemsArchiveSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[amlfilesystemsarchivesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/amlFilesystemsArchiveSample.js
[amlfilesystemscancelarchivesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/amlFilesystemsCancelArchiveSample.js
[amlfilesystemscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/amlFilesystemsCreateOrUpdateSample.js
[amlfilesystemsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/amlFilesystemsDeleteSample.js
[amlfilesystemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/amlFilesystemsGetSample.js
[amlfilesystemslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/amlFilesystemsListByResourceGroupSample.js
[amlfilesystemslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/amlFilesystemsListSample.js
[amlfilesystemsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/amlFilesystemsUpdateSample.js
[ascoperationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/ascOperationsGetSample.js
[ascusageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/ascUsagesListSample.js
[cachescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesCreateOrUpdateSample.js
[cachesdebuginfosample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesDebugInfoSample.js
[cachesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesDeleteSample.js
[cachesflushsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesFlushSample.js
[cachesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesGetSample.js
[cacheslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesListByResourceGroupSample.js
[cacheslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesListSample.js
[cachespauseprimingjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesPausePrimingJobSample.js
[cachesresumeprimingjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesResumePrimingJobSample.js
[cachesspaceallocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesSpaceAllocationSample.js
[cachesstartprimingjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesStartPrimingJobSample.js
[cachesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesStartSample.js
[cachesstopprimingjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesStopPrimingJobSample.js
[cachesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesStopSample.js
[cachesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesUpdateSample.js
[cachesupgradefirmwaresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/cachesUpgradeFirmwareSample.js
[checkamlfssubnetssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/checkAmlFsSubnetsSample.js
[getrequiredamlfssubnetssizesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/getRequiredAmlFsSubnetsSizeSample.js
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/operationsListSample.js
[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/skusListSample.js
[storagetargetflushsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/storageTargetFlushSample.js
[storagetargetinvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/storageTargetInvalidateSample.js
[storagetargetresumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/storageTargetResumeSample.js
[storagetargetsuspendsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/storageTargetSuspendSample.js
[storagetargetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/storageTargetsCreateOrUpdateSample.js
[storagetargetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/storageTargetsDeleteSample.js
[storagetargetsdnsrefreshsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/storageTargetsDnsRefreshSample.js
[storagetargetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/storageTargetsGetSample.js
[storagetargetslistbycachesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/storageTargetsListByCacheSample.js
[storagetargetsrestoredefaultssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/storageTargetsRestoreDefaultsSample.js
[usagemodelslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/javascript/usageModelsListSample.js
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-storagecache?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storagecache/arm-storagecache/README.md

Просмотреть файл

@ -1,38 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Archive data from the AML file system.
*
* @summary Archive data from the AML file system.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_Archive.json
*/
async function amlFilesystemsArchive() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const amlFilesystemName = "sc";
const archiveInfo = { filesystemPath: "/" };
const options = { archiveInfo };
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.amlFilesystems.archive(resourceGroupName, amlFilesystemName, options);
console.log(result);
}
async function main() {
amlFilesystemsArchive();
}
main().catch(console.error);

Просмотреть файл

@ -1,36 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Cancel archiving data from the AML file system.
*
* @summary Cancel archiving data from the AML file system.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_CancelArchive.json
*/
async function amlFilesystemsCancelArchive() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const amlFilesystemName = "sc";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.amlFilesystems.cancelArchive(resourceGroupName, amlFilesystemName);
console.log(result);
}
async function main() {
amlFilesystemsCancelArchive();
}
main().catch(console.error);

Просмотреть файл

@ -1,37 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Returns all AML file systems the user has access to under a subscription.
*
* @summary Returns all AML file systems the user has access to under a subscription.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_List.json
*/
async function amlFilesystemsList() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.amlFilesystems.list()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
amlFilesystemsList();
}
main().catch(console.error);

Просмотреть файл

@ -1,36 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Gets the status of an asynchronous operation for the Azure HPC Cache
*
* @summary Gets the status of an asynchronous operation for the Azure HPC Cache
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/AscOperations_Get.json
*/
async function ascOperationsGet() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const location = "westus";
const operationId = "testoperationid";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.ascOperations.get(location, operationId);
console.log(result);
}
async function main() {
ascOperationsGet();
}
main().catch(console.error);

Просмотреть файл

@ -1,38 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Gets the quantity used and quota limit for resources
*
* @summary Gets the quantity used and quota limit for resources
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/AscResourceUsages_Get.json
*/
async function ascUsagesList() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const location = "eastus";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.ascUsages.list(location)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
ascUsagesList();
}
main().catch(console.error);

Просмотреть файл

@ -1,36 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Tells a cache to write generate debug info for support to process.
*
* @summary Tells a cache to write generate debug info for support to process.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_DebugInfo.json
*/
async function cachesDebugInfo() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginDebugInfoAndWait(resourceGroupName, cacheName);
console.log(result);
}
async function main() {
cachesDebugInfo();
}
main().catch(console.error);

Просмотреть файл

@ -1,36 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Schedules a cache for deletion.
*
* @summary Schedules a cache for deletion.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Delete.json
*/
async function cachesDelete() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginDeleteAndWait(resourceGroupName, cacheName);
console.log(result);
}
async function main() {
cachesDelete();
}
main().catch(console.error);

Просмотреть файл

@ -1,36 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Tells a cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete.
*
* @summary Tells a cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Flush.json
*/
async function cachesFlush() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginFlushAndWait(resourceGroupName, cacheName);
console.log(result);
}
async function main() {
cachesFlush();
}
main().catch(console.error);

Просмотреть файл

@ -1,36 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Returns a cache.
*
* @summary Returns a cache.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Get.json
*/
async function cachesGet() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.get(resourceGroupName, cacheName);
console.log(result);
}
async function main() {
cachesGet();
}
main().catch(console.error);

Просмотреть файл

@ -1,38 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Returns all caches the user has access to under a resource group.
*
* @summary Returns all caches the user has access to under a resource group.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_ListByResourceGroup.json
*/
async function cachesListByResourceGroup() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.caches.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
cachesListByResourceGroup();
}
main().catch(console.error);

Просмотреть файл

@ -1,37 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Returns all caches the user has access to under a subscription.
*
* @summary Returns all caches the user has access to under a subscription.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_List.json
*/
async function cachesList() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.caches.list()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
cachesList();
}
main().catch(console.error);

Просмотреть файл

@ -1,44 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Schedule a priming job to be paused.
*
* @summary Schedule a priming job to be paused.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/PausePrimingJob.json
*/
async function pausePrimingJob() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const primingJobId = {
primingJobId: "00000000000_0000000000",
};
const options = { primingJobId };
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginPausePrimingJobAndWait(
resourceGroupName,
cacheName,
options,
);
console.log(result);
}
async function main() {
pausePrimingJob();
}
main().catch(console.error);

Просмотреть файл

@ -1,44 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Resumes a paused priming job.
*
* @summary Resumes a paused priming job.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/ResumePrimingJob.json
*/
async function resumePrimingJob() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const primingJobId = {
primingJobId: "00000000000_0000000000",
};
const options = { primingJobId };
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginResumePrimingJobAndWait(
resourceGroupName,
cacheName,
options,
);
console.log(result);
}
async function main() {
resumePrimingJob();
}
main().catch(console.error);

Просмотреть файл

@ -1,46 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Update cache space allocation.
*
* @summary Update cache space allocation.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/SpaceAllocation_Post.json
*/
async function spaceAllocationPost() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const spaceAllocation = [
{ name: "st1", allocationPercentage: 25 },
{ name: "st2", allocationPercentage: 50 },
{ name: "st3", allocationPercentage: 25 },
];
const options = { spaceAllocation };
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginSpaceAllocationAndWait(
resourceGroupName,
cacheName,
options,
);
console.log(result);
}
async function main() {
spaceAllocationPost();
}
main().catch(console.error);

Просмотреть файл

@ -1,46 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* 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: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StartPrimingJob.json
*/
async function startPrimingJob() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const 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>",
};
const options = { primingjob };
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginStartPrimingJobAndWait(
resourceGroupName,
cacheName,
options,
);
console.log(result);
}
async function main() {
startPrimingJob();
}
main().catch(console.error);

Просмотреть файл

@ -1,36 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Tells a Stopped state cache to transition to Active state.
*
* @summary Tells a Stopped state cache to transition to Active state.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Start.json
*/
async function cachesStart() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginStartAndWait(resourceGroupName, cacheName);
console.log(result);
}
async function main() {
cachesStart();
}
main().catch(console.error);

Просмотреть файл

@ -1,44 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Schedule a priming job for deletion.
*
* @summary Schedule a priming job for deletion.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StopPrimingJob.json
*/
async function stopPrimingJob() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const primingJobId = {
primingJobId: "00000000000_0000000000",
};
const options = { primingJobId };
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginStopPrimingJobAndWait(
resourceGroupName,
cacheName,
options,
);
console.log(result);
}
async function main() {
stopPrimingJob();
}
main().catch(console.error);

Просмотреть файл

@ -1,36 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Tells an Active cache to transition to Stopped state.
*
* @summary Tells an Active cache to transition to Stopped state.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Stop.json
*/
async function cachesStop() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginStopAndWait(resourceGroupName, cacheName);
console.log(result);
}
async function main() {
cachesStop();
}
main().catch(console.error);

Просмотреть файл

@ -1,206 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Update a cache instance.
*
* @summary Update a cache instance.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Update.json
*/
async function cachesUpdate() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const cache = {
cacheSizeGB: 3072,
directoryServicesSettings: {
activeDirectory: {
cacheNetBiosName: "contosoSmb",
domainName: "contosoAd.contoso.local",
domainNetBiosName: "contosoAd",
primaryDnsIpAddress: "192.0.2.10",
secondaryDnsIpAddress: "192.0.2.11",
},
usernameDownload: { extendedGroups: true, usernameSource: "AD" },
},
location: "westus",
networkSettings: {
dnsSearchDomain: "contoso.com",
dnsServers: ["10.1.22.33", "10.1.12.33"],
mtu: 1500,
ntpServer: "time.contoso.com",
},
securitySettings: {
accessPolicies: [
{
name: "default",
accessRules: [
{
access: "rw",
rootSquash: false,
scope: "default",
submountAccess: true,
suid: false,
},
],
},
{
name: "restrictive",
accessRules: [
{
access: "rw",
filter: "10.99.3.145",
rootSquash: false,
scope: "host",
submountAccess: true,
suid: true,
},
{
access: "rw",
filter: "10.99.1.0/24",
rootSquash: false,
scope: "network",
submountAccess: true,
suid: true,
},
{
access: "no",
anonymousGID: "65534",
anonymousUID: "65534",
rootSquash: true,
scope: "default",
submountAccess: true,
suid: false,
},
],
},
],
},
sku: { name: "Standard_2G" },
subnet:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1",
tags: { dept: "Contoso" },
upgradeSettings: {
scheduledTime: new Date("2022-04-26T18:25:43.511Z"),
upgradeScheduleEnabled: true,
},
};
const options = { cache };
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginUpdateAndWait(resourceGroupName, cacheName, options);
console.log(result);
}
/**
* This sample demonstrates how to Update a cache instance.
*
* @summary Update a cache instance.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Update_ldap_only.json
*/
async function cachesUpdateLdapOnly() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const cache = {
cacheSizeGB: 3072,
directoryServicesSettings: {
usernameDownload: {
credentials: {
bindDn: "cn=ldapadmin,dc=contosoad,dc=contoso,dc=local",
bindPassword: "<bindPassword>",
},
extendedGroups: true,
ldapBaseDN: "dc=contosoad,dc=contoso,dc=local",
ldapServer: "192.0.2.12",
usernameSource: "LDAP",
},
},
location: "westus",
networkSettings: {
dnsSearchDomain: "contoso.com",
dnsServers: ["10.1.22.33", "10.1.12.33"],
mtu: 1500,
ntpServer: "time.contoso.com",
},
securitySettings: {
accessPolicies: [
{
name: "default",
accessRules: [
{
access: "rw",
rootSquash: false,
scope: "default",
submountAccess: true,
suid: false,
},
],
},
{
name: "restrictive",
accessRules: [
{
access: "rw",
filter: "10.99.3.145",
rootSquash: false,
scope: "host",
submountAccess: true,
suid: true,
},
{
access: "rw",
filter: "10.99.1.0/24",
rootSquash: false,
scope: "network",
submountAccess: true,
suid: true,
},
{
access: "no",
anonymousGID: "65534",
anonymousUID: "65534",
rootSquash: true,
scope: "default",
submountAccess: true,
suid: false,
},
],
},
],
},
sku: { name: "Standard_2G" },
subnet:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1",
tags: { dept: "Contoso" },
upgradeSettings: {
scheduledTime: new Date("2022-04-26T18:25:43.511Z"),
upgradeScheduleEnabled: true,
},
};
const options = { cache };
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginUpdateAndWait(resourceGroupName, cacheName, options);
console.log(result);
}
async function main() {
cachesUpdate();
cachesUpdateLdapOnly();
}
main().catch(console.error);

Просмотреть файл

@ -1,36 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Upgrade a cache's firmware if a new version is available. Otherwise, this operation has no effect.
*
* @summary Upgrade a cache's firmware if a new version is available. Otherwise, this operation has no effect.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_UpgradeFirmware.json
*/
async function cachesUpgradeFirmware() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginUpgradeFirmwareAndWait(resourceGroupName, cacheName);
console.log(result);
}
async function main() {
cachesUpgradeFirmware();
}
main().catch(console.error);

Просмотреть файл

@ -1,41 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Check that subnets will be valid for AML file system create calls.
*
* @summary Check that subnets will be valid for AML file system create calls.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/checkAmlFSSubnets.json
*/
async function checkAmlFsSubnets() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const amlFilesystemSubnetInfo = {
filesystemSubnet:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/fsSub",
sku: { name: "AMLFS-Durable-Premium-125" },
storageCapacityTiB: 16,
};
const options = { amlFilesystemSubnetInfo };
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.checkAmlFSSubnets(options);
console.log(result);
}
async function main() {
checkAmlFsSubnets();
}
main().catch(console.error);

Просмотреть файл

@ -1,34 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Get the number of available IP addresses needed for the AML file system information provided.
*
* @summary Get the number of available IP addresses needed for the AML file system information provided.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/getRequiredAmlFSSubnetsSize.json
*/
async function getRequiredAmlFilesystemSubnetsSize() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.getRequiredAmlFSSubnetsSize();
console.log(result);
}
async function main() {
getRequiredAmlFilesystemSubnetsSize();
}
main().catch(console.error);

Просмотреть файл

@ -1,37 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Lists all of the available Resource Provider operations.
*
* @summary Lists all of the available Resource Provider operations.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Operations_List.json
*/
async function operationsList() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.operations.list()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
operationsList();
}
main().catch(console.error);

Просмотреть файл

@ -1,32 +0,0 @@
{
"name": "@azure-samples/arm-storagecache-js-beta",
"private": true,
"version": "1.0.0",
"description": " client library samples for JavaScript (Beta)",
"engines": {
"node": ">=18.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/storagecache/arm-storagecache"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storagecache/arm-storagecache",
"dependencies": {
"@azure/arm-storagecache": "next",
"dotenv": "latest",
"@azure/identity": "^4.0.1"
}
}

Просмотреть файл

@ -1,37 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Get the list of StorageCache.Cache SKUs available to this subscription.
*
* @summary Get the list of StorageCache.Cache SKUs available to this subscription.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Skus_List.json
*/
async function skusList() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.skus.list()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
skusList();
}
main().catch(console.error);

Просмотреть файл

@ -1,41 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage target's namespace will return errors until the flush operation completes.
*
* @summary Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage target's namespace will return errors until the flush operation completes.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Flush.json
*/
async function storageTargetsFlush() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc";
const storageTargetName = "st1";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.storageTargetOperations.beginFlushAndWait(
resourceGroupName,
cacheName,
storageTargetName,
);
console.log(result);
}
async function main() {
storageTargetsFlush();
}
main().catch(console.error);

Просмотреть файл

@ -1,41 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the next request.
*
* @summary Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the next request.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Invalidate.json
*/
async function storageTargetsInvalidate() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc";
const storageTargetName = "st1";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.storageTargetOperations.beginInvalidateAndWait(
resourceGroupName,
cacheName,
storageTargetName,
);
console.log(result);
}
async function main() {
storageTargetsInvalidate();
}
main().catch(console.error);

Просмотреть файл

@ -1,41 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Resumes client access to a previously suspended storage target.
*
* @summary Resumes client access to a previously suspended storage target.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Resume.json
*/
async function storageTargetsResume() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc";
const storageTargetName = "st1";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.storageTargetOperations.beginResumeAndWait(
resourceGroupName,
cacheName,
storageTargetName,
);
console.log(result);
}
async function main() {
storageTargetsResume();
}
main().catch(console.error);

Просмотреть файл

@ -1,41 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Suspends client access to a storage target.
*
* @summary Suspends client access to a storage target.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Suspend.json
*/
async function storageTargetsSuspend() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc";
const storageTargetName = "st1";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.storageTargetOperations.beginSuspendAndWait(
resourceGroupName,
cacheName,
storageTargetName,
);
console.log(result);
}
async function main() {
storageTargetsSuspend();
}
main().catch(console.error);

Просмотреть файл

@ -1,131 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again.
*
* @summary Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_CreateOrUpdate.json
*/
async function storageTargetsCreateOrUpdate() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const storageTargetName = "st1";
const storagetarget = {
junctions: [
{
namespacePath: "/path/on/cache",
nfsAccessPolicy: "default",
nfsExport: "exp1",
targetPath: "/path/on/exp1",
},
{
namespacePath: "/path2/on/cache",
nfsAccessPolicy: "rootSquash",
nfsExport: "exp2",
targetPath: "/path2/on/exp2",
},
],
nfs3: {
target: "10.0.44.44",
usageModel: "READ_ONLY",
verificationTimer: 30,
},
targetType: "nfs3",
};
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.storageTargets.beginCreateOrUpdateAndWait(
resourceGroupName,
cacheName,
storageTargetName,
storagetarget,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again.
*
* @summary Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_CreateOrUpdate_BlobNfs.json
*/
async function storageTargetsCreateOrUpdateBlobNfs() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const storageTargetName = "st1";
const storagetarget = {
blobNfs: {
target:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/blofnfs/blobServices/default/containers/blobnfs",
usageModel: "READ_WRITE",
verificationTimer: 28800,
writeBackTimer: 3600,
},
junctions: [{ namespacePath: "/blobnfs" }],
targetType: "blobNfs",
};
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.storageTargets.beginCreateOrUpdateAndWait(
resourceGroupName,
cacheName,
storageTargetName,
storagetarget,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again.
*
* @summary Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_CreateOrUpdate_NoJunctions.json
*/
async function storageTargetsCreateOrUpdateNoJunctions() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const storageTargetName = "st1";
const storagetarget = {
nfs3: {
target: "10.0.44.44",
usageModel: "READ_ONLY",
verificationTimer: 30,
},
targetType: "nfs3",
};
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.storageTargets.beginCreateOrUpdateAndWait(
resourceGroupName,
cacheName,
storageTargetName,
storagetarget,
);
console.log(result);
}
async function main() {
storageTargetsCreateOrUpdate();
storageTargetsCreateOrUpdateBlobNfs();
storageTargetsCreateOrUpdateNoJunctions();
}
main().catch(console.error);

Просмотреть файл

@ -1,41 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* 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: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Delete.json
*/
async function storageTargetsDelete() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const storageTargetName = "st1";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.storageTargets.beginDeleteAndWait(
resourceGroupName,
cacheName,
storageTargetName,
);
console.log(result);
}
async function main() {
storageTargetsDelete();
}
main().catch(console.error);

Просмотреть файл

@ -1,41 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Tells a storage target to refresh its DNS information.
*
* @summary Tells a storage target to refresh its DNS information.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_DnsRefresh.json
*/
async function cachesDnsRefresh() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc";
const storageTargetName = "st1";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.storageTargets.beginDnsRefreshAndWait(
resourceGroupName,
cacheName,
storageTargetName,
);
console.log(result);
}
async function main() {
cachesDnsRefresh();
}
main().catch(console.error);

Просмотреть файл

@ -1,37 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Returns a Storage Target from a cache.
*
* @summary Returns a Storage Target from a cache.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Get.json
*/
async function storageTargetsGet() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const storageTargetName = "st1";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.storageTargets.get(resourceGroupName, cacheName, storageTargetName);
console.log(result);
}
async function main() {
storageTargetsGet();
}
main().catch(console.error);

Просмотреть файл

@ -1,39 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Returns a list of Storage Targets for the specified cache.
*
* @summary Returns a list of Storage Targets for the specified cache.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_ListByCache.json
*/
async function storageTargetsList() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.storageTargets.listByCache(resourceGroupName, cacheName)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
storageTargetsList();
}
main().catch(console.error);

Просмотреть файл

@ -1,41 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Tells a storage target to restore its settings to their default values.
*
* @summary Tells a storage target to restore its settings to their default values.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_RestoreDefaults.json
*/
async function storageTargetsRestoreDefaults() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc";
const storageTargetName = "st1";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.storageTargets.beginRestoreDefaultsAndWait(
resourceGroupName,
cacheName,
storageTargetName,
);
console.log(result);
}
async function main() {
storageTargetsRestoreDefaults();
}
main().catch(console.error);

Просмотреть файл

@ -1,37 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { StorageCacheManagementClient } = require("@azure/arm-storagecache");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Get the list of cache usage models available to this subscription.
*
* @summary Get the list of cache usage models available to this subscription.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/UsageModels_List.json
*/
async function usageModelsList() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.usageModels.list()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
usageModelsList();
}
main().catch(console.error);

Просмотреть файл

@ -1,143 +0,0 @@
# client library samples for TypeScript (Beta)
These sample programs show how to use the TypeScript client libraries for in some common scenarios.
| **File Name** | **Description** |
| ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [amlFilesystemsArchiveSample.ts][amlfilesystemsarchivesample] | Archive data from the AML file system. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_Archive.json |
| [amlFilesystemsCancelArchiveSample.ts][amlfilesystemscancelarchivesample] | Cancel archiving data from the AML file system. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_CancelArchive.json |
| [amlFilesystemsCreateOrUpdateSample.ts][amlfilesystemscreateorupdatesample] | Create or update an AML file system. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_CreateOrUpdate.json |
| [amlFilesystemsDeleteSample.ts][amlfilesystemsdeletesample] | Schedules an AML file system for deletion. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_Delete.json |
| [amlFilesystemsGetSample.ts][amlfilesystemsgetsample] | Returns an AML file system. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_Get.json |
| [amlFilesystemsListByResourceGroupSample.ts][amlfilesystemslistbyresourcegroupsample] | Returns all AML file systems the user has access to under a resource group. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_ListByResourceGroup.json |
| [amlFilesystemsListSample.ts][amlfilesystemslistsample] | Returns all AML file systems the user has access to under a subscription. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_List.json |
| [amlFilesystemsUpdateSample.ts][amlfilesystemsupdatesample] | Update an AML file system instance. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_Update.json |
| [ascOperationsGetSample.ts][ascoperationsgetsample] | Gets the status of an asynchronous operation for the Azure HPC Cache x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/AscOperations_Get.json |
| [ascUsagesListSample.ts][ascusageslistsample] | Gets the quantity used and quota limit for resources x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/AscResourceUsages_Get.json |
| [cachesCreateOrUpdateSample.ts][cachescreateorupdatesample] | Create or update a cache. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_CreateOrUpdate.json |
| [cachesDebugInfoSample.ts][cachesdebuginfosample] | Tells a cache to write generate debug info for support to process. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_DebugInfo.json |
| [cachesDeleteSample.ts][cachesdeletesample] | Schedules a cache for deletion. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Delete.json |
| [cachesFlushSample.ts][cachesflushsample] | Tells a cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Flush.json |
| [cachesGetSample.ts][cachesgetsample] | Returns a cache. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Get.json |
| [cachesListByResourceGroupSample.ts][cacheslistbyresourcegroupsample] | Returns all caches the user has access to under a resource group. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_ListByResourceGroup.json |
| [cachesListSample.ts][cacheslistsample] | Returns all caches the user has access to under a subscription. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_List.json |
| [cachesPausePrimingJobSample.ts][cachespauseprimingjobsample] | Schedule a priming job to be paused. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/PausePrimingJob.json |
| [cachesResumePrimingJobSample.ts][cachesresumeprimingjobsample] | Resumes a paused priming job. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/ResumePrimingJob.json |
| [cachesSpaceAllocationSample.ts][cachesspaceallocationsample] | Update cache space allocation. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/SpaceAllocation_Post.json |
| [cachesStartPrimingJobSample.ts][cachesstartprimingjobsample] | Create a priming job. This operation is only allowed when the cache is healthy. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StartPrimingJob.json |
| [cachesStartSample.ts][cachesstartsample] | Tells a Stopped state cache to transition to Active state. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Start.json |
| [cachesStopPrimingJobSample.ts][cachesstopprimingjobsample] | Schedule a priming job for deletion. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StopPrimingJob.json |
| [cachesStopSample.ts][cachesstopsample] | Tells an Active cache to transition to Stopped state. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Stop.json |
| [cachesUpdateSample.ts][cachesupdatesample] | Update a cache instance. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Update.json |
| [cachesUpgradeFirmwareSample.ts][cachesupgradefirmwaresample] | Upgrade a cache's firmware if a new version is available. Otherwise, this operation has no effect. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_UpgradeFirmware.json |
| [checkAmlFsSubnetsSample.ts][checkamlfssubnetssample] | Check that subnets will be valid for AML file system create calls. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/checkAmlFSSubnets.json |
| [getRequiredAmlFsSubnetsSizeSample.ts][getrequiredamlfssubnetssizesample] | Get the number of available IP addresses needed for the AML file system information provided. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/getRequiredAmlFSSubnetsSize.json |
| [operationsListSample.ts][operationslistsample] | Lists all of the available Resource Provider operations. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Operations_List.json |
| [skusListSample.ts][skuslistsample] | Get the list of StorageCache.Cache SKUs available to this subscription. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Skus_List.json |
| [storageTargetFlushSample.ts][storagetargetflushsample] | Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage target's namespace will return errors until the flush operation completes. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Flush.json |
| [storageTargetInvalidateSample.ts][storagetargetinvalidatesample] | Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the next request. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Invalidate.json |
| [storageTargetResumeSample.ts][storagetargetresumesample] | Resumes client access to a previously suspended storage target. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Resume.json |
| [storageTargetSuspendSample.ts][storagetargetsuspendsample] | Suspends client access to a storage target. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Suspend.json |
| [storageTargetsCreateOrUpdateSample.ts][storagetargetscreateorupdatesample] | Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_CreateOrUpdate.json |
| [storageTargetsDeleteSample.ts][storagetargetsdeletesample] | 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: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Delete.json |
| [storageTargetsDnsRefreshSample.ts][storagetargetsdnsrefreshsample] | Tells a storage target to refresh its DNS information. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_DnsRefresh.json |
| [storageTargetsGetSample.ts][storagetargetsgetsample] | Returns a Storage Target from a cache. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_Get.json |
| [storageTargetsListByCacheSample.ts][storagetargetslistbycachesample] | Returns a list of Storage Targets for the specified cache. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_ListByCache.json |
| [storageTargetsRestoreDefaultsSample.ts][storagetargetsrestoredefaultssample] | Tells a storage target to restore its settings to their default values. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/StorageTargets_RestoreDefaults.json |
| [usageModelsListSample.ts][usagemodelslistsample] | Get the list of cache usage models available to this subscription. x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/UsageModels_List.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using:
```bash
npm install -g typescript
```
You need [an Azure subscription][freesub] to run these sample programs.
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Compile the samples:
```bash
npm run build
```
3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
4. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node dist/amlFilesystemsArchiveSample.js
```
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
```bash
npx cross-env STORAGECACHE_SUBSCRIPTION_ID="<storagecache subscription id>" STORAGECACHE_RESOURCE_GROUP="<storagecache resource group>" node dist/amlFilesystemsArchiveSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[amlfilesystemsarchivesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/amlFilesystemsArchiveSample.ts
[amlfilesystemscancelarchivesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/amlFilesystemsCancelArchiveSample.ts
[amlfilesystemscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/amlFilesystemsCreateOrUpdateSample.ts
[amlfilesystemsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/amlFilesystemsDeleteSample.ts
[amlfilesystemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/amlFilesystemsGetSample.ts
[amlfilesystemslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/amlFilesystemsListByResourceGroupSample.ts
[amlfilesystemslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/amlFilesystemsListSample.ts
[amlfilesystemsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/amlFilesystemsUpdateSample.ts
[ascoperationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/ascOperationsGetSample.ts
[ascusageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/ascUsagesListSample.ts
[cachescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesCreateOrUpdateSample.ts
[cachesdebuginfosample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesDebugInfoSample.ts
[cachesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesDeleteSample.ts
[cachesflushsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesFlushSample.ts
[cachesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesGetSample.ts
[cacheslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesListByResourceGroupSample.ts
[cacheslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesListSample.ts
[cachespauseprimingjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesPausePrimingJobSample.ts
[cachesresumeprimingjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesResumePrimingJobSample.ts
[cachesspaceallocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesSpaceAllocationSample.ts
[cachesstartprimingjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesStartPrimingJobSample.ts
[cachesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesStartSample.ts
[cachesstopprimingjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesStopPrimingJobSample.ts
[cachesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesStopSample.ts
[cachesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesUpdateSample.ts
[cachesupgradefirmwaresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/cachesUpgradeFirmwareSample.ts
[checkamlfssubnetssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/checkAmlFsSubnetsSample.ts
[getrequiredamlfssubnetssizesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/getRequiredAmlFsSubnetsSizeSample.ts
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/operationsListSample.ts
[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/skusListSample.ts
[storagetargetflushsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/storageTargetFlushSample.ts
[storagetargetinvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/storageTargetInvalidateSample.ts
[storagetargetresumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/storageTargetResumeSample.ts
[storagetargetsuspendsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/storageTargetSuspendSample.ts
[storagetargetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/storageTargetsCreateOrUpdateSample.ts
[storagetargetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/storageTargetsDeleteSample.ts
[storagetargetsdnsrefreshsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/storageTargetsDnsRefreshSample.ts
[storagetargetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/storageTargetsGetSample.ts
[storagetargetslistbycachesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/storageTargetsListByCacheSample.ts
[storagetargetsrestoredefaultssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/storageTargetsRestoreDefaultsSample.ts
[usagemodelslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagecache/arm-storagecache/samples/v7-beta/typescript/src/usageModelsListSample.ts
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-storagecache?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storagecache/arm-storagecache/README.md
[typescript]: https://www.typescriptlang.org/docs/home.html

Просмотреть файл

@ -1,41 +0,0 @@
{
"name": "@azure-samples/arm-storagecache-ts-beta",
"private": true,
"version": "1.0.0",
"description": " client library samples for TypeScript (Beta)",
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"build": "tsc",
"prebuild": "rimraf dist/"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/storagecache/arm-storagecache"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storagecache/arm-storagecache",
"dependencies": {
"@azure/arm-storagecache": "next",
"dotenv": "latest",
"@azure/identity": "^4.0.1"
},
"devDependencies": {
"@types/node": "^18.0.0",
"typescript": "~5.4.5",
"rimraf": "latest"
}
}

Просмотреть файл

@ -1,43 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { StorageCacheManagementClient } from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Cancel archiving data from the AML file system.
*
* @summary Cancel archiving data from the AML file system.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_CancelArchive.json
*/
async function amlFilesystemsCancelArchive() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const amlFilesystemName = "sc";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.amlFilesystems.cancelArchive(
resourceGroupName,
amlFilesystemName
);
console.log(result);
}
async function main() {
amlFilesystemsCancelArchive();
}
main().catch(console.error);

Просмотреть файл

@ -1,40 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { StorageCacheManagementClient } from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Returns all AML file systems the user has access to under a subscription.
*
* @summary Returns all AML file systems the user has access to under a subscription.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/amlFilesystems_List.json
*/
async function amlFilesystemsList() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.amlFilesystems.list()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
amlFilesystemsList();
}
main().catch(console.error);

Просмотреть файл

@ -1,39 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { StorageCacheManagementClient } from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets the status of an asynchronous operation for the Azure HPC Cache
*
* @summary Gets the status of an asynchronous operation for the Azure HPC Cache
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/AscOperations_Get.json
*/
async function ascOperationsGet() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "westus";
const operationId = "testoperationid";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.ascOperations.get(location, operationId);
console.log(result);
}
async function main() {
ascOperationsGet();
}
main().catch(console.error);

Просмотреть файл

@ -1,41 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { StorageCacheManagementClient } from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets the quantity used and quota limit for resources
*
* @summary Gets the quantity used and quota limit for resources
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/AscResourceUsages_Get.json
*/
async function ascUsagesList() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.ascUsages.list(location)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
ascUsagesList();
}
main().catch(console.error);

Просмотреть файл

@ -1,180 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { Cache, StorageCacheManagementClient } from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Create or update a cache.
*
* @summary Create or update a cache.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_CreateOrUpdate.json
*/
async function cachesCreateOrUpdate() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const cache: Cache = {
cacheSizeGB: 3072,
directoryServicesSettings: {
activeDirectory: {
cacheNetBiosName: "contosoSmb",
credentials: { password: "<password>", username: "consotoAdmin" },
domainName: "contosoAd.contoso.local",
domainNetBiosName: "contosoAd",
primaryDnsIpAddress: "192.0.2.10",
secondaryDnsIpAddress: "192.0.2.11"
},
usernameDownload: {
credentials: {
bindDn: "cn=ldapadmin,dc=contosoad,dc=contoso,dc=local",
bindPassword: "<bindPassword>"
},
extendedGroups: true,
ldapBaseDN: "dc=contosoad,dc=contoso,dc=local",
ldapServer: "192.0.2.12",
usernameSource: "LDAP"
}
},
encryptionSettings: {
keyEncryptionKey: {
keyUrl: "https://keyvault-cmk.vault.azure.net/keys/key2047/test",
sourceVault: {
id:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"
}
}
},
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/00000000000000000000000000000000/resourceGroups/scgroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {}
}
},
location: "westus",
securitySettings: {
accessPolicies: [
{
name: "default",
accessRules: [
{
access: "rw",
rootSquash: false,
scope: "default",
submountAccess: true,
suid: false
}
]
}
]
},
sku: { name: "Standard_2G" },
subnet:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1",
tags: { dept: "Contoso" },
upgradeSettings: {
scheduledTime: new Date("2022-04-26T18:25:43.511Z"),
upgradeScheduleEnabled: true
}
};
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginCreateOrUpdateAndWait(
resourceGroupName,
cacheName,
cache
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a cache.
*
* @summary Create or update a cache.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_CreateOrUpdate_ldap_only.json
*/
async function cachesCreateOrUpdateLdapOnly() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc1";
const cache: Cache = {
cacheSizeGB: 3072,
directoryServicesSettings: {
usernameDownload: {
credentials: {
bindDn: "cn=ldapadmin,dc=contosoad,dc=contoso,dc=local",
bindPassword: "<bindPassword>"
},
extendedGroups: true,
ldapBaseDN: "dc=contosoad,dc=contoso,dc=local",
ldapServer: "192.0.2.12",
usernameSource: "LDAP"
}
},
encryptionSettings: {
keyEncryptionKey: {
keyUrl: "https://keyvault-cmk.vault.azure.net/keys/key2048/test",
sourceVault: {
id:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"
}
}
},
location: "westus",
securitySettings: {
accessPolicies: [
{
name: "default",
accessRules: [
{
access: "rw",
rootSquash: false,
scope: "default",
submountAccess: true,
suid: false
}
]
}
]
},
sku: { name: "Standard_2G" },
subnet:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1",
tags: { dept: "Contoso" },
upgradeSettings: {
scheduledTime: new Date("2022-04-26T18:25:43.511Z"),
upgradeScheduleEnabled: true
}
};
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginCreateOrUpdateAndWait(
resourceGroupName,
cacheName,
cache
);
console.log(result);
}
async function main() {
cachesCreateOrUpdate();
cachesCreateOrUpdateLdapOnly();
}
main().catch(console.error);

Просмотреть файл

@ -1,43 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { StorageCacheManagementClient } from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Tells a cache to write generate debug info for support to process.
*
* @summary Tells a cache to write generate debug info for support to process.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_DebugInfo.json
*/
async function cachesDebugInfo() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginDebugInfoAndWait(
resourceGroupName,
cacheName
);
console.log(result);
}
async function main() {
cachesDebugInfo();
}
main().catch(console.error);

Просмотреть файл

@ -1,43 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { StorageCacheManagementClient } from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Schedules a cache for deletion.
*
* @summary Schedules a cache for deletion.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Delete.json
*/
async function cachesDelete() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginDeleteAndWait(
resourceGroupName,
cacheName
);
console.log(result);
}
async function main() {
cachesDelete();
}
main().catch(console.error);

Просмотреть файл

@ -1,43 +0,0 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { StorageCacheManagementClient } from "@azure/arm-storagecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Tells a cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete.
*
* @summary Tells a cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete.
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/preview/2023-11-01-preview/examples/Caches_Flush.json
*/
async function cachesFlush() {
const subscriptionId =
process.env["STORAGECACHE_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["STORAGECACHE_RESOURCE_GROUP"] || "scgroup";
const cacheName = "sc";
const credential = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(credential, subscriptionId);
const result = await client.caches.beginFlushAndWait(
resourceGroupName,
cacheName
);
console.log(result);
}
async function main() {
cachesFlush();
}
main().catch(console.error);

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше