* redisenterprise-track2-release

* update
This commit is contained in:
colawwj 2022-04-19 15:16:15 +08:00 коммит произвёл GitHub
Родитель 9e7f225c9c
Коммит 7997f0194f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
89 изменённых файлов: 3431 добавлений и 131 удалений

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

@ -12624,27 +12624,28 @@ packages:
dev: false
file:projects/arm-redisenterprisecache.tgz:
resolution: {integrity: sha512-NpcR7oPMzt7couLICc2xUop/hvfUsTfeUpLtSzboJYs6M8qxwvETQ+thlXH6PJstF3iwWyw38SPpQCmYbVhPAA==, tarball: file:projects/arm-redisenterprisecache.tgz}
resolution: {integrity: sha512-0JE50xwsp2jnnm8q5H+R/nXedOrfxuA+7ND4iU5ohCHNmcgpGSlsxDw/zBlh7u6/yslSP8p2KVg1iGOZ1vYJuA==, tarball: file:projects/arm-redisenterprisecache.tgz}
name: '@rush-temp/arm-redisenterprisecache'
version: 0.0.0
dependencies:
'@azure-tools/test-recorder': 1.0.2
'@azure/identity': 2.0.4
'@microsoft/api-extractor': 7.22.1
'@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1
'@rollup/plugin-json': 4.1.0_rollup@1.32.1
'@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1
'@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1
'@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1
'@rollup/plugin-json': 4.1.0_rollup@2.70.1
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1
'@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1
cross-env: 7.0.3
mkdirp: 1.0.4
mocha: 7.2.0
rimraf: 3.0.2
rollup: 1.32.1
rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1
rollup: 2.70.1
rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1
tslib: 2.3.1
typescript: 4.2.4
uglify-js: 3.15.4
transitivePeerDependencies:
- '@types/node'
- debug
- encoding
- supports-color

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

@ -1,5 +1,21 @@
# Release History
## 2.1.0 (2022-04-11)
**Features**
- Added operation Databases.beginForceUnlink
- Added operation Databases.beginForceUnlinkAndWait
- Added Interface DatabasePropertiesGeoReplication
- Added Interface DatabasesForceUnlinkOptionalParams
- Added Interface ForceUnlinkParameters
- Added Interface LinkedDatabase
- Added Type Alias LinkState
- Interface DatabaseUpdate has a new optional parameter geoReplication
- Type Alias Database has a new parameter geoReplication
- Added Enum KnownLinkState
## 2.0.0 (2022-01-20)
The package of @azure/arm-redisenterprisecache is using our next generation design principles since version 2.0.0, which contains breaking changes.

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

@ -16,6 +16,8 @@ REST API for managing Redis Enterprise resources in Azure.
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
- Latest versions of Safari, Chrome, Edge and Firefox.
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
### Prerequisites
- An [Azure subscription][azure_sub].
@ -49,8 +51,17 @@ For more information about how to create an Azure AD Application check out [this
```javascript
const { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new RedisEnterpriseManagementClient(new DefaultAzureCredential(), subscriptionId);
// For client-side applications running in the browser, use this code instead:
// const credential = new InteractiveBrowserCredential({
// tenantId: "<YOUR_TENANT_ID>",
// clientId: "<YOUR_CLIENT_ID>"
// });
// const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
```

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

@ -1,7 +1,8 @@
{
"commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb",
"commit": "468e23d2ac1bd3f3956924eadc2cc881a2b37e73",
"readme": "specification/redisenterprise/resource-manager/readme.md",
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/redisenterprise/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1 --generate-sample=true",
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\redisenterprise\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.18.20220329.1 --generate-sample=true",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"use": "@autorest/typescript@6.0.0-alpha.16.20220114.1"
"release_tool": "@azure-tools/js-sdk-release-tools@2.2.1",
"use": "@autorest/typescript@6.0.0-alpha.18.20220329.1"
}

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

@ -1,18 +1,31 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./dist-esm/src/index.d.ts",
"docModel": { "enabled": true },
"apiReport": { "enabled": true, "reportFolder": "./review" },
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/arm-redisenterprisecache.d.ts"
},
"messages": {
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": { "logLevel": "none" },
"ae-unresolved-link": { "logLevel": "none" }
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}
}

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

@ -3,8 +3,10 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for RedisEnterpriseManagementClient.",
"version": "2.0.0",
"engines": { "node": ">=12.0.0" },
"version": "2.1.0",
"engines": {
"node": ">=12.0.0"
},
"dependencies": {
"@azure/core-lro": "^2.2.0",
"@azure/abort-controller": "^1.0.0",
@ -14,20 +16,26 @@
"@azure/core-rest-pipeline": "^1.1.0",
"tslib": "^2.2.0"
},
"keywords": ["node", "azure", "typescript", "browser", "isomorphic"],
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
"types": "./types/arm-redisenterprisecache.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "^7.18.11",
"@rollup/plugin-commonjs": "11.0.2",
"@rollup/plugin-json": "^4.0.0",
"@rollup/plugin-multi-entry": "^3.0.0",
"@rollup/plugin-node-resolve": "^8.0.0",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-multi-entry": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"mkdirp": "^1.0.4",
"rollup": "^1.16.3",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup": "^2.66.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"typescript": "~4.2.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
@ -41,7 +49,9 @@
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
},
"bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" },
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
@ -91,7 +101,7 @@
"//metadata": {
"constantPaths": [
{
"path": "src/RedisEnterpriseManagementClient.ts",
"path": "src/redisEnterpriseManagementClient.ts",
"prefix": "packageDetails"
}
]
@ -99,8 +109,10 @@
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": ["azure"],
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-redisenterprisecache?view=azure-node-preview"
}
}
}

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

@ -70,6 +70,7 @@ export type Database = ProxyResource & {
evictionPolicy?: EvictionPolicy;
persistence?: Persistence;
modules?: Module[];
geoReplication?: DatabasePropertiesGeoReplication;
};
// @public
@ -78,6 +79,12 @@ export interface DatabaseList {
value?: Database[];
}
// @public
export interface DatabasePropertiesGeoReplication {
groupNickname?: string;
linkedDatabases?: LinkedDatabase[];
}
// @public
export interface Databases {
beginCreate(resourceGroupName: string, clusterName: string, databaseName: string, parameters: Database, options?: DatabasesCreateOptionalParams): Promise<PollerLike<PollOperationState<DatabasesCreateResponse>, DatabasesCreateResponse>>;
@ -86,6 +93,8 @@ export interface Databases {
beginDeleteAndWait(resourceGroupName: string, clusterName: string, databaseName: string, options?: DatabasesDeleteOptionalParams): Promise<void>;
beginExport(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ExportClusterParameters, options?: DatabasesExportOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
beginExportAndWait(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ExportClusterParameters, options?: DatabasesExportOptionalParams): Promise<void>;
beginForceUnlink(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ForceUnlinkParameters, options?: DatabasesForceUnlinkOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
beginForceUnlinkAndWait(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ForceUnlinkParameters, options?: DatabasesForceUnlinkOptionalParams): Promise<void>;
beginImport(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ImportClusterParameters, options?: DatabasesImportOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
beginImportAndWait(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ImportClusterParameters, options?: DatabasesImportOptionalParams): Promise<void>;
beginRegenerateKey(resourceGroupName: string, clusterName: string, databaseName: string, parameters: RegenerateKeyParameters, options?: DatabasesRegenerateKeyOptionalParams): Promise<PollerLike<PollOperationState<DatabasesRegenerateKeyResponse>, DatabasesRegenerateKeyResponse>>;
@ -118,6 +127,12 @@ export interface DatabasesExportOptionalParams extends coreClient.OperationOptio
updateIntervalInMs?: number;
}
// @public
export interface DatabasesForceUnlinkOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
updateIntervalInMs?: number;
}
// @public
export interface DatabasesGetOptionalParams extends coreClient.OperationOptions {
}
@ -175,6 +190,7 @@ export interface DatabaseUpdate {
clientProtocol?: Protocol;
clusteringPolicy?: ClusteringPolicy;
evictionPolicy?: EvictionPolicy;
geoReplication?: DatabasePropertiesGeoReplication;
modules?: Module[];
persistence?: Persistence;
port?: number;
@ -210,6 +226,11 @@ export interface ExportClusterParameters {
sasUri: string;
}
// @public
export interface ForceUnlinkParameters {
ids: string[];
}
// @public
export interface ImportClusterParameters {
sasUris: string[];
@ -257,6 +278,20 @@ export enum KnownEvictionPolicy {
VolatileTTL = "VolatileTTL"
}
// @public
export enum KnownLinkState {
// (undocumented)
Linked = "Linked",
// (undocumented)
LinkFailed = "LinkFailed",
// (undocumented)
Linking = "Linking",
// (undocumented)
UnlinkFailed = "UnlinkFailed",
// (undocumented)
Unlinking = "Unlinking"
}
// @public
export enum KnownOrigin {
// (undocumented)
@ -379,6 +414,15 @@ export enum KnownTlsVersion {
One2 = "1.2"
}
// @public
export interface LinkedDatabase {
id?: string;
readonly state?: LinkState;
}
// @public
export type LinkState = string;
// @public
export interface Module {
args?: string;

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

@ -14,62 +14,14 @@ import json from "@rollup/plugin-json";
import nodeBuiltins from "builtin-modules";
/**
* Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api.
*
* NOTE: this manual configuration is only needed because OpenTelemetry uses an
* __exportStar downleveled helper function to declare its exports which confuses
* rollup's automatic discovery mechanism.
*
* @returns an object reference that can be `...`'d into your cjs() configuration.
*/
export function openTelemetryCommonJs() {
const namedExports = {};
for (const key of [
"@opentelemetry/api",
"@azure/core-tracing/node_modules/@opentelemetry/api"
]) {
namedExports[key] = [
"SpanKind",
"TraceFlags",
"getSpan",
"setSpan",
"SpanStatusCode",
"getSpanContext",
"setSpanContext"
];
}
const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"];
for (const version of releasedOpenTelemetryVersions) {
namedExports[
// working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path.
`../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js`
] = [
"SpanKind",
"TraceFlags",
"getSpan",
"setSpan",
"StatusCode",
"CanonicalCode",
"getSpanContext",
"setSpanContext"
];
}
return namedExports;
}
// #region Warning Handler
/**
* A function that can determine whether a rollupwarning should be ignored. If
* A function that can determine whether a rollup warning should be ignored. If
* the function returns `true`, then the warning will not be displayed.
*/
function ignoreNiseSinonEvalWarnings(warning) {
function ignoreNiseSinonEval(warning) {
return (
warning.code === "EVAL" &&
warning.id &&
@ -78,17 +30,14 @@ function ignoreNiseSinonEvalWarnings(warning) {
);
}
function ignoreChaiCircularDependencyWarnings(warning) {
function ignoreChaiCircularDependency(warning) {
return (
warning.code === "CIRCULAR_DEPENDENCY" &&
warning.importer && warning.importer.includes("node_modules/chai") === true
);
}
const warningInhibitors = [
ignoreChaiCircularDependencyWarnings,
ignoreNiseSinonEvalWarnings
];
const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
/**
* Construct a warning handler for the shared rollup configuration
@ -122,22 +71,7 @@ function makeBrowserTestConfig() {
nodeResolve({
mainFields: ["module", "browser"]
}),
cjs({
namedExports: {
// Chai's strange internal architecture makes it impossible to statically
// analyze its exports.
chai: [
"version",
"use",
"util",
"config",
"expect",
"should",
"assert"
],
...openTelemetryCommonJs()
}
}),
cjs(),
json(),
sourcemaps()
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
@ -173,7 +107,7 @@ export function makeConfig(pkg, options) {
],
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
preserveSymlinks: false,
plugins: [sourcemaps(), nodeResolve(), cjs()]
plugins: [sourcemaps(), nodeResolve()]
};
const config = [baseConfig];

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

@ -0,0 +1,100 @@
/*
* 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 {
Database,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Creates a database
*
* @summary Creates a database
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesCreate.json
*/
async function redisEnterpriseDatabasesCreate() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters: Database = {
clientProtocol: "Encrypted",
clusteringPolicy: "EnterpriseCluster",
evictionPolicy: "AllKeysLRU",
modules: [
{ name: "RedisBloom", args: "ERROR_RATE 0.00 INITIAL_SIZE 400" },
{ name: "RedisTimeSeries", args: "RETENTION_POLICY 20" },
{ name: "RediSearch" }
],
persistence: { aofEnabled: true, aofFrequency: "1s" },
port: 10000
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginCreateAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesCreate().catch(console.error);
/**
* This sample demonstrates how to Creates a database
*
* @summary Creates a database
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesCreateWithGeoReplication.json
*/
async function redisEnterpriseDatabasesCreateWithActiveGeoReplication() {
const subscriptionId = "subid1";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters: Database = {
clientProtocol: "Encrypted",
clusteringPolicy: "EnterpriseCluster",
evictionPolicy: "NoEviction",
geoReplication: {
groupNickname: "groupName",
linkedDatabases: [
{
id:
"/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"
},
{
id:
"/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"
}
]
},
port: 10000
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginCreateAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesCreateWithActiveGeoReplication().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Deletes a single database
*
* @summary Deletes a single database
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesDelete.json
*/
async function redisEnterpriseDatabasesDelete() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "db1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginDeleteAndWait(
resourceGroupName,
clusterName,
databaseName
);
console.log(result);
}
redisEnterpriseDatabasesDelete().catch(console.error);

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

@ -0,0 +1,46 @@
/*
* 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 {
ExportClusterParameters,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Exports a database file from target database.
*
* @summary Exports a database file from target database.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesExport.json
*/
async function redisEnterpriseDatabasesExport() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters: ExportClusterParameters = {
sasUri:
"https://contosostorage.blob.core.window.net/urlToBlobContainer?sasKeyParameters"
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginExportAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesExport().catch(console.error);

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

@ -0,0 +1,47 @@
/*
* 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 {
ForceUnlinkParameters,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Forcibly removes the link to the specified database resource.
*
* @summary Forcibly removes the link to the specified database resource.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesForceUnlink.json
*/
async function howToUnlinkADatabaseDuringARegionalOutage() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters: ForceUnlinkParameters = {
ids: [
"/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"
]
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginForceUnlinkAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
howToUnlinkADatabaseDuringARegionalOutage().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets information about a database in a RedisEnterprise cluster.
*
* @summary Gets information about a database in a RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesGet.json
*/
async function redisEnterpriseDatabasesGet() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.get(
resourceGroupName,
clusterName,
databaseName
);
console.log(result);
}
redisEnterpriseDatabasesGet().catch(console.error);

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

@ -0,0 +1,48 @@
/*
* 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 {
ImportClusterParameters,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Imports database files to target database.
*
* @summary Imports database files to target database.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesImport.json
*/
async function redisEnterpriseDatabasesImport() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters: ImportClusterParameters = {
sasUris: [
"https://contosostorage.blob.core.window.net/urltoBlobFile1?sasKeyParameters",
"https://contosostorage.blob.core.window.net/urltoBlobFile2?sasKeyParameters"
]
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginImportAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesImport().catch(console.error);

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

@ -0,0 +1,39 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets all databases in the specified RedisEnterprise cluster.
*
* @summary Gets all databases in the specified RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesListByCluster.json
*/
async function redisEnterpriseDatabasesListByCluster() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.databases.listByCluster(
resourceGroupName,
clusterName
)) {
resArray.push(item);
}
console.log(resArray);
}
redisEnterpriseDatabasesListByCluster().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Retrieves the access keys for the RedisEnterprise database.
*
* @summary Retrieves the access keys for the RedisEnterprise database.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesListKeys.json
*/
async function redisEnterpriseDatabasesListKeys() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.listKeys(
resourceGroupName,
clusterName,
databaseName
);
console.log(result);
}
redisEnterpriseDatabasesListKeys().catch(console.error);

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

@ -0,0 +1,43 @@
/*
* 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 {
RegenerateKeyParameters,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Regenerates the RedisEnterprise database's access keys.
*
* @summary Regenerates the RedisEnterprise database's access keys.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesRegenerateKey.json
*/
async function redisEnterpriseDatabasesRegenerateKey() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters: RegenerateKeyParameters = { keyType: "Primary" };
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginRegenerateKeyAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesRegenerateKey().catch(console.error);

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

@ -0,0 +1,47 @@
/*
* 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 {
DatabaseUpdate,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Updates a database
*
* @summary Updates a database
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesUpdate.json
*/
async function redisEnterpriseDatabasesUpdate() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters: DatabaseUpdate = {
clientProtocol: "Encrypted",
evictionPolicy: "AllKeysLRU",
persistence: { rdbEnabled: true, rdbFrequency: "12h" }
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginUpdateAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesUpdate().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.Cache provider.
*
* @summary Lists all of the available REST API operations of the Microsoft.Cache provider.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/OperationsList.json
*/
async function operationsList() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.operations.list()) {
resArray.push(item);
}
console.log(resArray);
}
operationsList().catch(console.error);

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

@ -0,0 +1,33 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets the status of operation.
*
* @summary Gets the status of operation.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/OperationsStatusGet.json
*/
async function operationsStatusGet() {
const subscriptionId = "subid";
const location = "West US";
const operationId = "testoperationid";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.operationsStatus.get(location, operationId);
console.log(result);
}
operationsStatusGet().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Deletes the specified private endpoint connection associated with the RedisEnterprise cluster.
*
* @summary Deletes the specified private endpoint connection associated with the RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDeletePrivateEndpointConnection.json
*/
async function redisEnterpriseDeletePrivateEndpointConnection() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const privateEndpointConnectionName = "pectest01";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.privateEndpointConnections.delete(
resourceGroupName,
clusterName,
privateEndpointConnectionName
);
console.log(result);
}
redisEnterpriseDeletePrivateEndpointConnection().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets the specified private endpoint connection associated with the RedisEnterprise cluster.
*
* @summary Gets the specified private endpoint connection associated with the RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseGetPrivateEndpointConnection.json
*/
async function redisEnterpriseGetPrivateEndpointConnection() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const privateEndpointConnectionName = "pectest01";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.privateEndpointConnections.get(
resourceGroupName,
clusterName,
privateEndpointConnectionName
);
console.log(result);
}
redisEnterpriseGetPrivateEndpointConnection().catch(console.error);

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

@ -0,0 +1,39 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Lists all the private endpoint connections associated with the RedisEnterprise cluster.
*
* @summary Lists all the private endpoint connections associated with the RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListPrivateEndpointConnections.json
*/
async function redisEnterpriseListPrivateEndpointConnections() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.privateEndpointConnections.list(
resourceGroupName,
clusterName
)) {
resArray.push(item);
}
console.log(resArray);
}
redisEnterpriseListPrivateEndpointConnections().catch(console.error);

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

@ -0,0 +1,48 @@
/*
* 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 {
PrivateEndpointConnection,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster.
*
* @summary Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterprisePutPrivateEndpointConnection.json
*/
async function redisEnterprisePutPrivateEndpointConnection() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const privateEndpointConnectionName = "pectest01";
const properties: PrivateEndpointConnection = {
privateLinkServiceConnectionState: {
description: "Auto-Approved",
status: "Approved"
}
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.privateEndpointConnections.beginPutAndWait(
resourceGroupName,
clusterName,
privateEndpointConnectionName,
properties
);
console.log(result);
}
redisEnterprisePutPrivateEndpointConnection().catch(console.error);

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

@ -0,0 +1,39 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets the private link resources that need to be created for a RedisEnterprise cluster.
*
* @summary Gets the private link resources that need to be created for a RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListPrivateLinkResources.json
*/
async function redisEnterpriseListPrivateLinkResources() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.privateLinkResources.listByCluster(
resourceGroupName,
clusterName
)) {
resArray.push(item);
}
console.log(resArray);
}
redisEnterpriseListPrivateLinkResources().catch(console.error);

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

@ -0,0 +1,47 @@
/*
* 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 {
Cluster,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster
*
* @summary Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseCreate.json
*/
async function redisEnterpriseCreate() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const parameters: Cluster = {
location: "West US",
minimumTlsVersion: "1.2",
sku: { name: "EnterpriseFlash_F300", capacity: 3 },
tags: { tag1: "value1" },
zones: ["1", "2", "3"]
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.redisEnterprise.beginCreateAndWait(
resourceGroupName,
clusterName,
parameters
);
console.log(result);
}
redisEnterpriseCreate().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Deletes a RedisEnterprise cache cluster.
*
* @summary Deletes a RedisEnterprise cache cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDelete.json
*/
async function redisEnterpriseDelete() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.redisEnterprise.beginDeleteAndWait(
resourceGroupName,
clusterName
);
console.log(result);
}
redisEnterpriseDelete().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets information about a RedisEnterprise cluster
*
* @summary Gets information about a RedisEnterprise cluster
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseGet.json
*/
async function redisEnterpriseGet() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.redisEnterprise.get(
resourceGroupName,
clusterName
);
console.log(result);
}
redisEnterpriseGet().catch(console.error);

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

@ -0,0 +1,37 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Lists all RedisEnterprise clusters in a resource group.
*
* @summary Lists all RedisEnterprise clusters in a resource group.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListByResourceGroup.json
*/
async function redisEnterpriseListByResourceGroup() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.redisEnterprise.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
redisEnterpriseListByResourceGroup().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets all RedisEnterprise clusters in the specified subscription.
*
* @summary Gets all RedisEnterprise clusters in the specified subscription.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseList.json
*/
async function redisEnterpriseList() {
const subscriptionId = "subid";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.redisEnterprise.list()) {
resArray.push(item);
}
console.log(resArray);
}
redisEnterpriseList().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 {
ClusterUpdate,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Updates an existing RedisEnterprise cluster
*
* @summary Updates an existing RedisEnterprise cluster
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseUpdate.json
*/
async function redisEnterpriseUpdate() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const parameters: ClusterUpdate = {
minimumTlsVersion: "1.2",
sku: { name: "EnterpriseFlash_F300", capacity: 9 },
tags: { tag1: "value1" }
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.redisEnterprise.beginUpdateAndWait(
resourceGroupName,
clusterName,
parameters
);
console.log(result);
}
redisEnterpriseUpdate().catch(console.error);

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

@ -4,8 +4,26 @@ These sample programs show how to use the JavaScript client libraries for in som
| **File Name** | **Description** |
| --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [databasesCreateSample.js][databasescreatesample] | Creates a database x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesCreate.json |
| [databasesDeleteSample.js][databasesdeletesample] | Deletes a single database x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesDelete.json |
| [databasesExportSample.js][databasesexportsample] | Exports a database file from target database. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesExport.json |
| [databasesForceUnlinkSample.js][databasesforceunlinksample] | Forcibly removes the link to the specified database resource. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesForceUnlink.json |
| [databasesGetSample.js][databasesgetsample] | Gets information about a database in a RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesGet.json |
| [databasesImportSample.js][databasesimportsample] | Imports database files to target database. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesImport.json |
| [databasesListByClusterSample.js][databaseslistbyclustersample] | Gets all databases in the specified RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesListByCluster.json |
| [databasesListKeysSample.js][databaseslistkeyssample] | Retrieves the access keys for the RedisEnterprise database. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesListKeys.json |
| [databasesRegenerateKeySample.js][databasesregeneratekeysample] | Regenerates the RedisEnterprise database's access keys. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesRegenerateKey.json |
| [databasesUpdateSample.js][databasesupdatesample] | Updates a database x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesUpdate.json |
| [operationsListSample.js][operationslistsample] | Lists all of the available REST API operations of the Microsoft.Cache provider. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/OperationsList.json |
| [operationsStatusGet.js][operationsstatusget] | Gets the status of operation. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/OperationsStatusGet.json |
| [operationsStatusGetSample.js][operationsstatusgetsample] | Gets the status of operation. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/OperationsStatusGet.json |
| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDeletePrivateEndpointConnection.json |
| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Gets the specified private endpoint connection associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseGetPrivateEndpointConnection.json |
| [privateEndpointConnectionsListSample.js][privateendpointconnectionslistsample] | Lists all the private endpoint connections associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListPrivateEndpointConnections.json |
| [privateEndpointConnectionsPutSample.js][privateendpointconnectionsputsample] | Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterprisePutPrivateEndpointConnection.json |
| [privateLinkResourcesListByClusterSample.js][privatelinkresourceslistbyclustersample] | Gets the private link resources that need to be created for a RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListPrivateLinkResources.json |
| [redisEnterpriseCreate.js][redisenterprisecreate] | Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseCreate.json |
| [redisEnterpriseCreateSample.js][redisenterprisecreatesample] | Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseCreate.json |
| [redisEnterpriseDatabasesCreate.js][redisenterprisedatabasescreate] | Creates a database x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseDatabasesCreate.json |
| [redisEnterpriseDatabasesDelete.js][redisenterprisedatabasesdelete] | Deletes a single database x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseDatabasesDelete.json |
| [redisEnterpriseDatabasesExport.js][redisenterprisedatabasesexport] | Exports a database file from target database. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseDatabasesExport.json |
@ -17,14 +35,19 @@ These sample programs show how to use the JavaScript client libraries for in som
| [redisEnterpriseDatabasesUpdate.js][redisenterprisedatabasesupdate] | Updates a database x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseDatabasesUpdate.json |
| [redisEnterpriseDelete.js][redisenterprisedelete] | Deletes a RedisEnterprise cache cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseDelete.json |
| [redisEnterpriseDeletePrivateEndpointConnection.js][redisenterprisedeleteprivateendpointconnection] | Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseDeletePrivateEndpointConnection.json |
| [redisEnterpriseDeleteSample.js][redisenterprisedeletesample] | Deletes a RedisEnterprise cache cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDelete.json |
| [redisEnterpriseGet.js][redisenterpriseget] | Gets information about a RedisEnterprise cluster x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseGet.json |
| [redisEnterpriseGetPrivateEndpointConnection.js][redisenterprisegetprivateendpointconnection] | Gets the specified private endpoint connection associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseGetPrivateEndpointConnection.json |
| [redisEnterpriseGetSample.js][redisenterprisegetsample] | Gets information about a RedisEnterprise cluster x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseGet.json |
| [redisEnterpriseList.js][redisenterpriselist] | Gets all RedisEnterprise clusters in the specified subscription. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseList.json |
| [redisEnterpriseListByResourceGroup.js][redisenterpriselistbyresourcegroup] | Lists all RedisEnterprise clusters in a resource group. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseListByResourceGroup.json |
| [redisEnterpriseListByResourceGroupSample.js][redisenterpriselistbyresourcegroupsample] | Lists all RedisEnterprise clusters in a resource group. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListByResourceGroup.json |
| [redisEnterpriseListPrivateEndpointConnections.js][redisenterpriselistprivateendpointconnections] | Lists all the private endpoint connections associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseListPrivateEndpointConnections.json |
| [redisEnterpriseListPrivateLinkResources.js][redisenterpriselistprivatelinkresources] | Gets the private link resources that need to be created for a RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseListPrivateLinkResources.json |
| [redisEnterpriseListSample.js][redisenterpriselistsample] | Gets all RedisEnterprise clusters in the specified subscription. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseList.json |
| [redisEnterprisePutPrivateEndpointConnection.js][redisenterpriseputprivateendpointconnection] | Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterprisePutPrivateEndpointConnection.json |
| [redisEnterpriseUpdate.js][redisenterpriseupdate] | Updates an existing RedisEnterprise cluster x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseUpdate.json |
| [redisEnterpriseUpdateSample.js][redisenterpriseupdatesample] | Updates an existing RedisEnterprise cluster x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseUpdate.json |
## Prerequisites
@ -51,21 +74,39 @@ npm install
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node operationsStatusGet.js
node databasesCreateSample.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 node operationsStatusGet.js
npx cross-env node databasesCreateSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[databasescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/databasesCreateSample.js
[databasesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/databasesDeleteSample.js
[databasesexportsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/databasesExportSample.js
[databasesforceunlinksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/databasesForceUnlinkSample.js
[databasesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/databasesGetSample.js
[databasesimportsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/databasesImportSample.js
[databaseslistbyclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/databasesListByClusterSample.js
[databaseslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/databasesListKeysSample.js
[databasesregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/databasesRegenerateKeySample.js
[databasesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/databasesUpdateSample.js
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/operationsListSample.js
[operationsstatusget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/operationsStatusGet.js
[operationsstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/operationsStatusGetSample.js
[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/privateEndpointConnectionsDeleteSample.js
[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/privateEndpointConnectionsGetSample.js
[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/privateEndpointConnectionsListSample.js
[privateendpointconnectionsputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/privateEndpointConnectionsPutSample.js
[privatelinkresourceslistbyclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/privateLinkResourcesListByClusterSample.js
[redisenterprisecreate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseCreate.js
[redisenterprisecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseCreateSample.js
[redisenterprisedatabasescreate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseDatabasesCreate.js
[redisenterprisedatabasesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseDatabasesDelete.js
[redisenterprisedatabasesexport]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseDatabasesExport.js
@ -77,14 +118,19 @@ Take a look at our [API Documentation][apiref] for more information about the AP
[redisenterprisedatabasesupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseDatabasesUpdate.js
[redisenterprisedelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseDelete.js
[redisenterprisedeleteprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseDeletePrivateEndpointConnection.js
[redisenterprisedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseDeleteSample.js
[redisenterpriseget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseGet.js
[redisenterprisegetprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseGetPrivateEndpointConnection.js
[redisenterprisegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseGetSample.js
[redisenterpriselist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseList.js
[redisenterpriselistbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseListByResourceGroup.js
[redisenterpriselistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseListByResourceGroupSample.js
[redisenterpriselistprivateendpointconnections]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseListPrivateEndpointConnections.js
[redisenterpriselistprivatelinkresources]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseListPrivateLinkResources.js
[redisenterpriselistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseListSample.js
[redisenterpriseputprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterprisePutPrivateEndpointConnection.js
[redisenterpriseupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseUpdate.js
[redisenterpriseupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/javascript/redisEnterpriseUpdateSample.js
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-redisenterprisecache?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redisenterprise/arm-redisenterprisecache/README.md

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

@ -0,0 +1,89 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates a database
*
* @summary Creates a database
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesCreate.json
*/
async function redisEnterpriseDatabasesCreate() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters = {
clientProtocol: "Encrypted",
clusteringPolicy: "EnterpriseCluster",
evictionPolicy: "AllKeysLRU",
modules: [
{ name: "RedisBloom", args: "ERROR_RATE 0.00 INITIAL_SIZE 400" },
{ name: "RedisTimeSeries", args: "RETENTION_POLICY 20" },
{ name: "RediSearch" },
],
persistence: { aofEnabled: true, aofFrequency: "1s" },
port: 10000,
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.databases.beginCreateAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesCreate().catch(console.error);
/**
* This sample demonstrates how to Creates a database
*
* @summary Creates a database
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesCreateWithGeoReplication.json
*/
async function redisEnterpriseDatabasesCreateWithActiveGeoReplication() {
const subscriptionId = "subid1";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters = {
clientProtocol: "Encrypted",
clusteringPolicy: "EnterpriseCluster",
evictionPolicy: "NoEviction",
geoReplication: {
groupNickname: "groupName",
linkedDatabases: [
{
id: "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default",
},
{
id: "/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default",
},
],
},
port: 10000,
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.databases.beginCreateAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesCreateWithActiveGeoReplication().catch(console.error);

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

@ -0,0 +1,35 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Deletes a single database
*
* @summary Deletes a single database
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesDelete.json
*/
async function redisEnterpriseDatabasesDelete() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "db1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.databases.beginDeleteAndWait(
resourceGroupName,
clusterName,
databaseName
);
console.log(result);
}
redisEnterpriseDatabasesDelete().catch(console.error);

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

@ -0,0 +1,39 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Exports a database file from target database.
*
* @summary Exports a database file from target database.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesExport.json
*/
async function redisEnterpriseDatabasesExport() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters = {
sasUri: "https://contosostorage.blob.core.window.net/urlToBlobContainer?sasKeyParameters",
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.databases.beginExportAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesExport().catch(console.error);

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

@ -0,0 +1,41 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Forcibly removes the link to the specified database resource.
*
* @summary Forcibly removes the link to the specified database resource.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesForceUnlink.json
*/
async function howToUnlinkADatabaseDuringARegionalOutage() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters = {
ids: [
"/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default",
],
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.databases.beginForceUnlinkAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
howToUnlinkADatabaseDuringARegionalOutage().catch(console.error);

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

@ -0,0 +1,31 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets information about a database in a RedisEnterprise cluster.
*
* @summary Gets information about a database in a RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesGet.json
*/
async function redisEnterpriseDatabasesGet() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.databases.get(resourceGroupName, clusterName, databaseName);
console.log(result);
}
redisEnterpriseDatabasesGet().catch(console.error);

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

@ -0,0 +1,42 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Imports database files to target database.
*
* @summary Imports database files to target database.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesImport.json
*/
async function redisEnterpriseDatabasesImport() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters = {
sasUris: [
"https://contosostorage.blob.core.window.net/urltoBlobFile1?sasKeyParameters",
"https://contosostorage.blob.core.window.net/urltoBlobFile2?sasKeyParameters",
],
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.databases.beginImportAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesImport().catch(console.error);

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

@ -0,0 +1,33 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets all databases in the specified RedisEnterprise cluster.
*
* @summary Gets all databases in the specified RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesListByCluster.json
*/
async function redisEnterpriseDatabasesListByCluster() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.databases.listByCluster(resourceGroupName, clusterName)) {
resArray.push(item);
}
console.log(resArray);
}
redisEnterpriseDatabasesListByCluster().catch(console.error);

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

@ -0,0 +1,31 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Retrieves the access keys for the RedisEnterprise database.
*
* @summary Retrieves the access keys for the RedisEnterprise database.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesListKeys.json
*/
async function redisEnterpriseDatabasesListKeys() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.databases.listKeys(resourceGroupName, clusterName, databaseName);
console.log(result);
}
redisEnterpriseDatabasesListKeys().catch(console.error);

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

@ -0,0 +1,37 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Regenerates the RedisEnterprise database's access keys.
*
* @summary Regenerates the RedisEnterprise database's access keys.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesRegenerateKey.json
*/
async function redisEnterpriseDatabasesRegenerateKey() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters = { keyType: "Primary" };
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.databases.beginRegenerateKeyAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesRegenerateKey().catch(console.error);

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

@ -0,0 +1,41 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates a database
*
* @summary Updates a database
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesUpdate.json
*/
async function redisEnterpriseDatabasesUpdate() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters = {
clientProtocol: "Encrypted",
evictionPolicy: "AllKeysLRU",
persistence: { rdbEnabled: true, rdbFrequency: "12h" },
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.databases.beginUpdateAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesUpdate().catch(console.error);

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

@ -0,0 +1,31 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.Cache provider.
*
* @summary Lists all of the available REST API operations of the Microsoft.Cache provider.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/OperationsList.json
*/
async function operationsList() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.operations.list()) {
resArray.push(item);
}
console.log(resArray);
}
operationsList().catch(console.error);

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

@ -0,0 +1,30 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets the status of operation.
*
* @summary Gets the status of operation.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/OperationsStatusGet.json
*/
async function operationsStatusGet() {
const subscriptionId = "subid";
const location = "West US";
const operationId = "testoperationid";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.operationsStatus.get(location, operationId);
console.log(result);
}
operationsStatusGet().catch(console.error);

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

@ -0,0 +1,35 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Deletes the specified private endpoint connection associated with the RedisEnterprise cluster.
*
* @summary Deletes the specified private endpoint connection associated with the RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDeletePrivateEndpointConnection.json
*/
async function redisEnterpriseDeletePrivateEndpointConnection() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const privateEndpointConnectionName = "pectest01";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.privateEndpointConnections.delete(
resourceGroupName,
clusterName,
privateEndpointConnectionName
);
console.log(result);
}
redisEnterpriseDeletePrivateEndpointConnection().catch(console.error);

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

@ -0,0 +1,35 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets the specified private endpoint connection associated with the RedisEnterprise cluster.
*
* @summary Gets the specified private endpoint connection associated with the RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseGetPrivateEndpointConnection.json
*/
async function redisEnterpriseGetPrivateEndpointConnection() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const privateEndpointConnectionName = "pectest01";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.privateEndpointConnections.get(
resourceGroupName,
clusterName,
privateEndpointConnectionName
);
console.log(result);
}
redisEnterpriseGetPrivateEndpointConnection().catch(console.error);

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

@ -0,0 +1,33 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists all the private endpoint connections associated with the RedisEnterprise cluster.
*
* @summary Lists all the private endpoint connections associated with the RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListPrivateEndpointConnections.json
*/
async function redisEnterpriseListPrivateEndpointConnections() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.privateEndpointConnections.list(resourceGroupName, clusterName)) {
resArray.push(item);
}
console.log(resArray);
}
redisEnterpriseListPrivateEndpointConnections().catch(console.error);

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

@ -0,0 +1,42 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster.
*
* @summary Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterprisePutPrivateEndpointConnection.json
*/
async function redisEnterprisePutPrivateEndpointConnection() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const privateEndpointConnectionName = "pectest01";
const properties = {
privateLinkServiceConnectionState: {
description: "Auto-Approved",
status: "Approved",
},
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.privateEndpointConnections.beginPutAndWait(
resourceGroupName,
clusterName,
privateEndpointConnectionName,
properties
);
console.log(result);
}
redisEnterprisePutPrivateEndpointConnection().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets the private link resources that need to be created for a RedisEnterprise cluster.
*
* @summary Gets the private link resources that need to be created for a RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListPrivateLinkResources.json
*/
async function redisEnterpriseListPrivateLinkResources() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.privateLinkResources.listByCluster(
resourceGroupName,
clusterName
)) {
resArray.push(item);
}
console.log(resArray);
}
redisEnterpriseListPrivateLinkResources().catch(console.error);

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

@ -0,0 +1,41 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster
*
* @summary Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseCreate.json
*/
async function redisEnterpriseCreate() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const parameters = {
location: "West US",
minimumTlsVersion: "1.2",
sku: { name: "EnterpriseFlash_F300", capacity: 3 },
tags: { tag1: "value1" },
zones: ["1", "2", "3"],
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.redisEnterprise.beginCreateAndWait(
resourceGroupName,
clusterName,
parameters
);
console.log(result);
}
redisEnterpriseCreate().catch(console.error);

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

@ -0,0 +1,30 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Deletes a RedisEnterprise cache cluster.
*
* @summary Deletes a RedisEnterprise cache cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDelete.json
*/
async function redisEnterpriseDelete() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.redisEnterprise.beginDeleteAndWait(resourceGroupName, clusterName);
console.log(result);
}
redisEnterpriseDelete().catch(console.error);

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

@ -0,0 +1,30 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets information about a RedisEnterprise cluster
*
* @summary Gets information about a RedisEnterprise cluster
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseGet.json
*/
async function redisEnterpriseGet() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.redisEnterprise.get(resourceGroupName, clusterName);
console.log(result);
}
redisEnterpriseGet().catch(console.error);

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

@ -0,0 +1,32 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists all RedisEnterprise clusters in a resource group.
*
* @summary Lists all RedisEnterprise clusters in a resource group.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListByResourceGroup.json
*/
async function redisEnterpriseListByResourceGroup() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.redisEnterprise.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
}
console.log(resArray);
}
redisEnterpriseListByResourceGroup().catch(console.error);

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

@ -0,0 +1,31 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets all RedisEnterprise clusters in the specified subscription.
*
* @summary Gets all RedisEnterprise clusters in the specified subscription.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseList.json
*/
async function redisEnterpriseList() {
const subscriptionId = "subid";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.redisEnterprise.list()) {
resArray.push(item);
}
console.log(resArray);
}
redisEnterpriseList().catch(console.error);

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

@ -0,0 +1,39 @@
/*
* 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 { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates an existing RedisEnterprise cluster
*
* @summary Updates an existing RedisEnterprise cluster
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseUpdate.json
*/
async function redisEnterpriseUpdate() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const parameters = {
minimumTlsVersion: "1.2",
sku: { name: "EnterpriseFlash_F300", capacity: 9 },
tags: { tag1: "value1" },
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(credential, subscriptionId);
const result = await client.redisEnterprise.beginUpdateAndWait(
resourceGroupName,
clusterName,
parameters
);
console.log(result);
}
redisEnterpriseUpdate().catch(console.error);

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

@ -4,8 +4,26 @@ These sample programs show how to use the TypeScript client libraries for in som
| **File Name** | **Description** |
| --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [databasesCreateSample.ts][databasescreatesample] | Creates a database x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesCreate.json |
| [databasesDeleteSample.ts][databasesdeletesample] | Deletes a single database x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesDelete.json |
| [databasesExportSample.ts][databasesexportsample] | Exports a database file from target database. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesExport.json |
| [databasesForceUnlinkSample.ts][databasesforceunlinksample] | Forcibly removes the link to the specified database resource. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesForceUnlink.json |
| [databasesGetSample.ts][databasesgetsample] | Gets information about a database in a RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesGet.json |
| [databasesImportSample.ts][databasesimportsample] | Imports database files to target database. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesImport.json |
| [databasesListByClusterSample.ts][databaseslistbyclustersample] | Gets all databases in the specified RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesListByCluster.json |
| [databasesListKeysSample.ts][databaseslistkeyssample] | Retrieves the access keys for the RedisEnterprise database. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesListKeys.json |
| [databasesRegenerateKeySample.ts][databasesregeneratekeysample] | Regenerates the RedisEnterprise database's access keys. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesRegenerateKey.json |
| [databasesUpdateSample.ts][databasesupdatesample] | Updates a database x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesUpdate.json |
| [operationsListSample.ts][operationslistsample] | Lists all of the available REST API operations of the Microsoft.Cache provider. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/OperationsList.json |
| [operationsStatusGet.ts][operationsstatusget] | Gets the status of operation. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/OperationsStatusGet.json |
| [operationsStatusGetSample.ts][operationsstatusgetsample] | Gets the status of operation. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/OperationsStatusGet.json |
| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDeletePrivateEndpointConnection.json |
| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Gets the specified private endpoint connection associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseGetPrivateEndpointConnection.json |
| [privateEndpointConnectionsListSample.ts][privateendpointconnectionslistsample] | Lists all the private endpoint connections associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListPrivateEndpointConnections.json |
| [privateEndpointConnectionsPutSample.ts][privateendpointconnectionsputsample] | Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterprisePutPrivateEndpointConnection.json |
| [privateLinkResourcesListByClusterSample.ts][privatelinkresourceslistbyclustersample] | Gets the private link resources that need to be created for a RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListPrivateLinkResources.json |
| [redisEnterpriseCreate.ts][redisenterprisecreate] | Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseCreate.json |
| [redisEnterpriseCreateSample.ts][redisenterprisecreatesample] | Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseCreate.json |
| [redisEnterpriseDatabasesCreate.ts][redisenterprisedatabasescreate] | Creates a database x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseDatabasesCreate.json |
| [redisEnterpriseDatabasesDelete.ts][redisenterprisedatabasesdelete] | Deletes a single database x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseDatabasesDelete.json |
| [redisEnterpriseDatabasesExport.ts][redisenterprisedatabasesexport] | Exports a database file from target database. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseDatabasesExport.json |
@ -17,14 +35,19 @@ These sample programs show how to use the TypeScript client libraries for in som
| [redisEnterpriseDatabasesUpdate.ts][redisenterprisedatabasesupdate] | Updates a database x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseDatabasesUpdate.json |
| [redisEnterpriseDelete.ts][redisenterprisedelete] | Deletes a RedisEnterprise cache cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseDelete.json |
| [redisEnterpriseDeletePrivateEndpointConnection.ts][redisenterprisedeleteprivateendpointconnection] | Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseDeletePrivateEndpointConnection.json |
| [redisEnterpriseDeleteSample.ts][redisenterprisedeletesample] | Deletes a RedisEnterprise cache cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDelete.json |
| [redisEnterpriseGet.ts][redisenterpriseget] | Gets information about a RedisEnterprise cluster x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseGet.json |
| [redisEnterpriseGetPrivateEndpointConnection.ts][redisenterprisegetprivateendpointconnection] | Gets the specified private endpoint connection associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseGetPrivateEndpointConnection.json |
| [redisEnterpriseGetSample.ts][redisenterprisegetsample] | Gets information about a RedisEnterprise cluster x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseGet.json |
| [redisEnterpriseList.ts][redisenterpriselist] | Gets all RedisEnterprise clusters in the specified subscription. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseList.json |
| [redisEnterpriseListByResourceGroup.ts][redisenterpriselistbyresourcegroup] | Lists all RedisEnterprise clusters in a resource group. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseListByResourceGroup.json |
| [redisEnterpriseListByResourceGroupSample.ts][redisenterpriselistbyresourcegroupsample] | Lists all RedisEnterprise clusters in a resource group. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListByResourceGroup.json |
| [redisEnterpriseListPrivateEndpointConnections.ts][redisenterpriselistprivateendpointconnections] | Lists all the private endpoint connections associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseListPrivateEndpointConnections.json |
| [redisEnterpriseListPrivateLinkResources.ts][redisenterpriselistprivatelinkresources] | Gets the private link resources that need to be created for a RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseListPrivateLinkResources.json |
| [redisEnterpriseListSample.ts][redisenterpriselistsample] | Gets all RedisEnterprise clusters in the specified subscription. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseList.json |
| [redisEnterprisePutPrivateEndpointConnection.ts][redisenterpriseputprivateendpointconnection] | Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster. x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterprisePutPrivateEndpointConnection.json |
| [redisEnterpriseUpdate.ts][redisenterpriseupdate] | Updates an existing RedisEnterprise cluster x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseUpdate.json |
| [redisEnterpriseUpdateSample.ts][redisenterpriseupdatesample] | Updates an existing RedisEnterprise cluster x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseUpdate.json |
## Prerequisites
@ -63,21 +86,39 @@ npm run build
4. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node dist/operationsStatusGet.js
node dist/databasesCreateSample.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 node dist/operationsStatusGet.js
npx cross-env node dist/databasesCreateSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[databasescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/databasesCreateSample.ts
[databasesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/databasesDeleteSample.ts
[databasesexportsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/databasesExportSample.ts
[databasesforceunlinksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/databasesForceUnlinkSample.ts
[databasesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/databasesGetSample.ts
[databasesimportsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/databasesImportSample.ts
[databaseslistbyclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/databasesListByClusterSample.ts
[databaseslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/databasesListKeysSample.ts
[databasesregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/databasesRegenerateKeySample.ts
[databasesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/databasesUpdateSample.ts
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/operationsListSample.ts
[operationsstatusget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/operationsStatusGet.ts
[operationsstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/operationsStatusGetSample.ts
[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/privateEndpointConnectionsDeleteSample.ts
[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/privateEndpointConnectionsGetSample.ts
[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/privateEndpointConnectionsListSample.ts
[privateendpointconnectionsputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/privateEndpointConnectionsPutSample.ts
[privatelinkresourceslistbyclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/privateLinkResourcesListByClusterSample.ts
[redisenterprisecreate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseCreate.ts
[redisenterprisecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseCreateSample.ts
[redisenterprisedatabasescreate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseDatabasesCreate.ts
[redisenterprisedatabasesdelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseDatabasesDelete.ts
[redisenterprisedatabasesexport]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseDatabasesExport.ts
@ -89,14 +130,19 @@ Take a look at our [API Documentation][apiref] for more information about the AP
[redisenterprisedatabasesupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseDatabasesUpdate.ts
[redisenterprisedelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseDelete.ts
[redisenterprisedeleteprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseDeletePrivateEndpointConnection.ts
[redisenterprisedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseDeleteSample.ts
[redisenterpriseget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseGet.ts
[redisenterprisegetprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseGetPrivateEndpointConnection.ts
[redisenterprisegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseGetSample.ts
[redisenterpriselist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseList.ts
[redisenterpriselistbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseListByResourceGroup.ts
[redisenterpriselistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseListByResourceGroupSample.ts
[redisenterpriselistprivateendpointconnections]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseListPrivateEndpointConnections.ts
[redisenterpriselistprivatelinkresources]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseListPrivateLinkResources.ts
[redisenterpriselistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseListSample.ts
[redisenterpriseputprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterprisePutPrivateEndpointConnection.ts
[redisenterpriseupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseUpdate.ts
[redisenterpriseupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redisenterprise/arm-redisenterprisecache/samples/v2/typescript/src/redisEnterpriseUpdateSample.ts
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-redisenterprisecache?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redisenterprise/arm-redisenterprisecache/README.md

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

@ -0,0 +1,100 @@
/*
* 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 {
Database,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Creates a database
*
* @summary Creates a database
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesCreate.json
*/
async function redisEnterpriseDatabasesCreate() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters: Database = {
clientProtocol: "Encrypted",
clusteringPolicy: "EnterpriseCluster",
evictionPolicy: "AllKeysLRU",
modules: [
{ name: "RedisBloom", args: "ERROR_RATE 0.00 INITIAL_SIZE 400" },
{ name: "RedisTimeSeries", args: "RETENTION_POLICY 20" },
{ name: "RediSearch" }
],
persistence: { aofEnabled: true, aofFrequency: "1s" },
port: 10000
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginCreateAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesCreate().catch(console.error);
/**
* This sample demonstrates how to Creates a database
*
* @summary Creates a database
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesCreateWithGeoReplication.json
*/
async function redisEnterpriseDatabasesCreateWithActiveGeoReplication() {
const subscriptionId = "subid1";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters: Database = {
clientProtocol: "Encrypted",
clusteringPolicy: "EnterpriseCluster",
evictionPolicy: "NoEviction",
geoReplication: {
groupNickname: "groupName",
linkedDatabases: [
{
id:
"/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"
},
{
id:
"/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"
}
]
},
port: 10000
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginCreateAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesCreateWithActiveGeoReplication().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Deletes a single database
*
* @summary Deletes a single database
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesDelete.json
*/
async function redisEnterpriseDatabasesDelete() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "db1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginDeleteAndWait(
resourceGroupName,
clusterName,
databaseName
);
console.log(result);
}
redisEnterpriseDatabasesDelete().catch(console.error);

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

@ -0,0 +1,46 @@
/*
* 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 {
ExportClusterParameters,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Exports a database file from target database.
*
* @summary Exports a database file from target database.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesExport.json
*/
async function redisEnterpriseDatabasesExport() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters: ExportClusterParameters = {
sasUri:
"https://contosostorage.blob.core.window.net/urlToBlobContainer?sasKeyParameters"
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginExportAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesExport().catch(console.error);

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

@ -0,0 +1,47 @@
/*
* 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 {
ForceUnlinkParameters,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Forcibly removes the link to the specified database resource.
*
* @summary Forcibly removes the link to the specified database resource.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesForceUnlink.json
*/
async function howToUnlinkADatabaseDuringARegionalOutage() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters: ForceUnlinkParameters = {
ids: [
"/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"
]
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginForceUnlinkAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
howToUnlinkADatabaseDuringARegionalOutage().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets information about a database in a RedisEnterprise cluster.
*
* @summary Gets information about a database in a RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesGet.json
*/
async function redisEnterpriseDatabasesGet() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.get(
resourceGroupName,
clusterName,
databaseName
);
console.log(result);
}
redisEnterpriseDatabasesGet().catch(console.error);

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

@ -0,0 +1,48 @@
/*
* 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 {
ImportClusterParameters,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Imports database files to target database.
*
* @summary Imports database files to target database.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesImport.json
*/
async function redisEnterpriseDatabasesImport() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters: ImportClusterParameters = {
sasUris: [
"https://contosostorage.blob.core.window.net/urltoBlobFile1?sasKeyParameters",
"https://contosostorage.blob.core.window.net/urltoBlobFile2?sasKeyParameters"
]
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginImportAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesImport().catch(console.error);

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

@ -0,0 +1,39 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets all databases in the specified RedisEnterprise cluster.
*
* @summary Gets all databases in the specified RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesListByCluster.json
*/
async function redisEnterpriseDatabasesListByCluster() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.databases.listByCluster(
resourceGroupName,
clusterName
)) {
resArray.push(item);
}
console.log(resArray);
}
redisEnterpriseDatabasesListByCluster().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Retrieves the access keys for the RedisEnterprise database.
*
* @summary Retrieves the access keys for the RedisEnterprise database.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesListKeys.json
*/
async function redisEnterpriseDatabasesListKeys() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.listKeys(
resourceGroupName,
clusterName,
databaseName
);
console.log(result);
}
redisEnterpriseDatabasesListKeys().catch(console.error);

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

@ -0,0 +1,43 @@
/*
* 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 {
RegenerateKeyParameters,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Regenerates the RedisEnterprise database's access keys.
*
* @summary Regenerates the RedisEnterprise database's access keys.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesRegenerateKey.json
*/
async function redisEnterpriseDatabasesRegenerateKey() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters: RegenerateKeyParameters = { keyType: "Primary" };
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginRegenerateKeyAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesRegenerateKey().catch(console.error);

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

@ -0,0 +1,47 @@
/*
* 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 {
DatabaseUpdate,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Updates a database
*
* @summary Updates a database
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesUpdate.json
*/
async function redisEnterpriseDatabasesUpdate() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const databaseName = "default";
const parameters: DatabaseUpdate = {
clientProtocol: "Encrypted",
evictionPolicy: "AllKeysLRU",
persistence: { rdbEnabled: true, rdbFrequency: "12h" }
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.databases.beginUpdateAndWait(
resourceGroupName,
clusterName,
databaseName,
parameters
);
console.log(result);
}
redisEnterpriseDatabasesUpdate().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.Cache provider.
*
* @summary Lists all of the available REST API operations of the Microsoft.Cache provider.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/OperationsList.json
*/
async function operationsList() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.operations.list()) {
resArray.push(item);
}
console.log(resArray);
}
operationsList().catch(console.error);

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

@ -0,0 +1,33 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets the status of operation.
*
* @summary Gets the status of operation.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/OperationsStatusGet.json
*/
async function operationsStatusGet() {
const subscriptionId = "subid";
const location = "West US";
const operationId = "testoperationid";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.operationsStatus.get(location, operationId);
console.log(result);
}
operationsStatusGet().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Deletes the specified private endpoint connection associated with the RedisEnterprise cluster.
*
* @summary Deletes the specified private endpoint connection associated with the RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDeletePrivateEndpointConnection.json
*/
async function redisEnterpriseDeletePrivateEndpointConnection() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const privateEndpointConnectionName = "pectest01";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.privateEndpointConnections.delete(
resourceGroupName,
clusterName,
privateEndpointConnectionName
);
console.log(result);
}
redisEnterpriseDeletePrivateEndpointConnection().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets the specified private endpoint connection associated with the RedisEnterprise cluster.
*
* @summary Gets the specified private endpoint connection associated with the RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseGetPrivateEndpointConnection.json
*/
async function redisEnterpriseGetPrivateEndpointConnection() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const privateEndpointConnectionName = "pectest01";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.privateEndpointConnections.get(
resourceGroupName,
clusterName,
privateEndpointConnectionName
);
console.log(result);
}
redisEnterpriseGetPrivateEndpointConnection().catch(console.error);

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

@ -0,0 +1,39 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Lists all the private endpoint connections associated with the RedisEnterprise cluster.
*
* @summary Lists all the private endpoint connections associated with the RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListPrivateEndpointConnections.json
*/
async function redisEnterpriseListPrivateEndpointConnections() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.privateEndpointConnections.list(
resourceGroupName,
clusterName
)) {
resArray.push(item);
}
console.log(resArray);
}
redisEnterpriseListPrivateEndpointConnections().catch(console.error);

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

@ -0,0 +1,48 @@
/*
* 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 {
PrivateEndpointConnection,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster.
*
* @summary Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterprisePutPrivateEndpointConnection.json
*/
async function redisEnterprisePutPrivateEndpointConnection() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const privateEndpointConnectionName = "pectest01";
const properties: PrivateEndpointConnection = {
privateLinkServiceConnectionState: {
description: "Auto-Approved",
status: "Approved"
}
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.privateEndpointConnections.beginPutAndWait(
resourceGroupName,
clusterName,
privateEndpointConnectionName,
properties
);
console.log(result);
}
redisEnterprisePutPrivateEndpointConnection().catch(console.error);

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

@ -0,0 +1,39 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets the private link resources that need to be created for a RedisEnterprise cluster.
*
* @summary Gets the private link resources that need to be created for a RedisEnterprise cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListPrivateLinkResources.json
*/
async function redisEnterpriseListPrivateLinkResources() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.privateLinkResources.listByCluster(
resourceGroupName,
clusterName
)) {
resArray.push(item);
}
console.log(resArray);
}
redisEnterpriseListPrivateLinkResources().catch(console.error);

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

@ -0,0 +1,47 @@
/*
* 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 {
Cluster,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster
*
* @summary Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseCreate.json
*/
async function redisEnterpriseCreate() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const parameters: Cluster = {
location: "West US",
minimumTlsVersion: "1.2",
sku: { name: "EnterpriseFlash_F300", capacity: 3 },
tags: { tag1: "value1" },
zones: ["1", "2", "3"]
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.redisEnterprise.beginCreateAndWait(
resourceGroupName,
clusterName,
parameters
);
console.log(result);
}
redisEnterpriseCreate().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Deletes a RedisEnterprise cache cluster.
*
* @summary Deletes a RedisEnterprise cache cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDelete.json
*/
async function redisEnterpriseDelete() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.redisEnterprise.beginDeleteAndWait(
resourceGroupName,
clusterName
);
console.log(result);
}
redisEnterpriseDelete().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets information about a RedisEnterprise cluster
*
* @summary Gets information about a RedisEnterprise cluster
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseGet.json
*/
async function redisEnterpriseGet() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.redisEnterprise.get(
resourceGroupName,
clusterName
);
console.log(result);
}
redisEnterpriseGet().catch(console.error);

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

@ -0,0 +1,37 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Lists all RedisEnterprise clusters in a resource group.
*
* @summary Lists all RedisEnterprise clusters in a resource group.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListByResourceGroup.json
*/
async function redisEnterpriseListByResourceGroup() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.redisEnterprise.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
redisEnterpriseListByResourceGroup().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* 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 { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets all RedisEnterprise clusters in the specified subscription.
*
* @summary Gets all RedisEnterprise clusters in the specified subscription.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseList.json
*/
async function redisEnterpriseList() {
const subscriptionId = "subid";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.redisEnterprise.list()) {
resArray.push(item);
}
console.log(resArray);
}
redisEnterpriseList().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 {
ClusterUpdate,
RedisEnterpriseManagementClient
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Updates an existing RedisEnterprise cluster
*
* @summary Updates an existing RedisEnterprise cluster
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseUpdate.json
*/
async function redisEnterpriseUpdate() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const clusterName = "cache1";
const parameters: ClusterUpdate = {
minimumTlsVersion: "1.2",
sku: { name: "EnterpriseFlash_F300", capacity: 9 },
tags: { tag1: "value1" }
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId
);
const result = await client.redisEnterprise.beginUpdateAndWait(
resourceGroupName,
clusterName,
parameters
);
console.log(result);
}
redisEnterpriseUpdate().catch(console.error);

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

@ -256,7 +256,7 @@ export interface Persistence {
export interface Module {
/** The name of the module, e.g. 'RedisBloom', 'RediSearch', 'RedisTimeSeries' */
name: string;
/** Configuration options for the module, e.g. 'ERROR_RATE 0.00 INITIAL_SIZE 400'. */
/** Configuration options for the module, e.g. 'ERROR_RATE 0.01 INITIAL_SIZE 400'. */
args?: string;
/**
* The version of the module, e.g. '1.0'.
@ -265,6 +265,25 @@ export interface Module {
readonly version?: string;
}
/** Optional set of properties to configure geo replication for this database. */
export interface DatabasePropertiesGeoReplication {
/** Name for the group of linked database resources */
groupNickname?: string;
/** List of database resources to link with this database */
linkedDatabases?: LinkedDatabase[];
}
/** Specifies details of a linked database resource. */
export interface LinkedDatabase {
/** Resource ID of a database resource to link with this database. */
id?: string;
/**
* State of the link between the database resources.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly state?: LinkState;
}
/** A partial update to the RedisEnterprise database */
export interface DatabaseUpdate {
/** Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted. */
@ -289,6 +308,8 @@ export interface DatabaseUpdate {
persistence?: Persistence;
/** Optional set of redis modules to enable in this database - modules can only be added at creation time. */
modules?: Module[];
/** Optional set of properties to configure geo replication for this database. */
geoReplication?: DatabasePropertiesGeoReplication;
}
/** The secret access keys used for authenticating connections to redis */
@ -335,6 +356,12 @@ export interface PrivateLinkResourceListResult {
value?: PrivateLinkResource[];
}
/** Parameters for a Redis Enterprise Active Geo Replication Force Unlink operation. */
export interface ForceUnlinkParameters {
/** The resource IDs of the database resources to be unlinked. */
ids: string[];
}
/** The Private Endpoint Connection resource. */
export type PrivateEndpointConnection = Resource & {
/** The resource of private end point. */
@ -434,6 +461,8 @@ export type Database = ProxyResource & {
persistence?: Persistence;
/** Optional set of redis modules to enable in this database - modules can only be added at creation time. */
modules?: Module[];
/** Optional set of properties to configure geo replication for this database. */
geoReplication?: DatabasePropertiesGeoReplication;
};
/** Known values of {@link Origin} that the service accepts. */
@ -703,6 +732,28 @@ export enum KnownRdbFrequency {
* **12h**
*/
export type RdbFrequency = string;
/** Known values of {@link LinkState} that the service accepts. */
export enum KnownLinkState {
Linked = "Linked",
Linking = "Linking",
Unlinking = "Unlinking",
LinkFailed = "LinkFailed",
UnlinkFailed = "UnlinkFailed"
}
/**
* Defines values for LinkState. \
* {@link KnownLinkState} can be used interchangeably with LinkState,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Linked** \
* **Linking** \
* **Unlinking** \
* **LinkFailed** \
* **UnlinkFailed**
*/
export type LinkState = string;
/** Defines values for AccessKeyType. */
export type AccessKeyType = "Primary" | "Secondary";
@ -879,6 +930,15 @@ export interface DatabasesExportOptionalParams
resumeFrom?: string;
}
/** Optional parameters. */
export interface DatabasesForceUnlinkOptionalParams
extends coreClient.OperationOptions {
/** Delay to wait until next poll, in milliseconds. */
updateIntervalInMs?: number;
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
resumeFrom?: string;
}
/** Optional parameters. */
export interface DatabasesListByClusterNextOptionalParams
extends coreClient.OperationOptions {}

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

@ -543,6 +543,55 @@ export const Module: coreClient.CompositeMapper = {
}
};
export const DatabasePropertiesGeoReplication: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DatabasePropertiesGeoReplication",
modelProperties: {
groupNickname: {
serializedName: "groupNickname",
type: {
name: "String"
}
},
linkedDatabases: {
serializedName: "linkedDatabases",
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "LinkedDatabase"
}
}
}
}
}
}
};
export const LinkedDatabase: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "LinkedDatabase",
modelProperties: {
id: {
serializedName: "id",
type: {
name: "String"
}
},
state: {
serializedName: "state",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const DatabaseUpdate: coreClient.CompositeMapper = {
type: {
name: "Composite",
@ -604,6 +653,13 @@ export const DatabaseUpdate: coreClient.CompositeMapper = {
}
}
}
},
geoReplication: {
serializedName: "properties.geoReplication",
type: {
name: "Composite",
className: "DatabasePropertiesGeoReplication"
}
}
}
}
@ -728,6 +784,27 @@ export const PrivateLinkResourceListResult: coreClient.CompositeMapper = {
}
};
export const ForceUnlinkParameters: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ForceUnlinkParameters",
modelProperties: {
ids: {
serializedName: "ids",
required: true,
type: {
name: "Sequence",
element: {
type: {
name: "String"
}
}
}
}
}
}
};
export const PrivateEndpointConnection: coreClient.CompositeMapper = {
type: {
name: "Composite",
@ -970,6 +1047,13 @@ export const Database: coreClient.CompositeMapper = {
}
}
}
},
geoReplication: {
serializedName: "properties.geoReplication",
type: {
name: "Composite",
className: "DatabasePropertiesGeoReplication"
}
}
}
}

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

@ -19,6 +19,7 @@ import {
RegenerateKeyParameters as RegenerateKeyParametersMapper,
ImportClusterParameters as ImportClusterParametersMapper,
ExportClusterParameters as ExportClusterParametersMapper,
ForceUnlinkParameters as ForceUnlinkParametersMapper,
PrivateEndpointConnection as PrivateEndpointConnectionMapper
} from "../models/mappers";
@ -49,7 +50,7 @@ export const $host: OperationURLParameter = {
export const apiVersion: OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
defaultValue: "2021-08-01",
defaultValue: "2022-01-01",
isConstant: true,
serializedName: "api-version",
type: {
@ -190,6 +191,11 @@ export const parameters6: OperationParameter = {
mapper: ExportClusterParametersMapper
};
export const parameters7: OperationParameter = {
parameterPath: "parameters",
mapper: ForceUnlinkParametersMapper
};
export const privateEndpointConnectionName: OperationURLParameter = {
parameterPath: "privateEndpointConnectionName",
mapper: {

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

@ -36,6 +36,8 @@ import {
DatabasesImportOptionalParams,
ExportClusterParameters,
DatabasesExportOptionalParams,
ForceUnlinkParameters,
DatabasesForceUnlinkOptionalParams,
DatabasesListByClusterNextResponse
} from "../models";
@ -204,11 +206,13 @@ export class DatabasesImpl implements Databases {
{ resourceGroupName, clusterName, databaseName, parameters, options },
createOperationSpec
);
return new LroEngine(lro, {
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "original-uri"
});
await poller.poll();
return poller;
}
/**
@ -300,11 +304,13 @@ export class DatabasesImpl implements Databases {
{ resourceGroupName, clusterName, databaseName, parameters, options },
updateOperationSpec
);
return new LroEngine(lro, {
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "azure-async-operation"
});
await poller.poll();
return poller;
}
/**
@ -408,11 +414,13 @@ export class DatabasesImpl implements Databases {
{ resourceGroupName, clusterName, databaseName, options },
deleteOperationSpec
);
return new LroEngine(lro, {
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "azure-async-operation"
});
await poller.poll();
return poller;
}
/**
@ -520,11 +528,13 @@ export class DatabasesImpl implements Databases {
{ resourceGroupName, clusterName, databaseName, parameters, options },
regenerateKeyOperationSpec
);
return new LroEngine(lro, {
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "azure-async-operation"
});
await poller.poll();
return poller;
}
/**
@ -611,11 +621,13 @@ export class DatabasesImpl implements Databases {
{ resourceGroupName, clusterName, databaseName, parameters, options },
importOperationSpec
);
return new LroEngine(lro, {
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "azure-async-operation"
});
await poller.poll();
return poller;
}
/**
@ -702,11 +714,13 @@ export class DatabasesImpl implements Databases {
{ resourceGroupName, clusterName, databaseName, parameters, options },
exportOperationSpec
);
return new LroEngine(lro, {
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "azure-async-operation"
});
await poller.poll();
return poller;
}
/**
@ -734,6 +748,99 @@ export class DatabasesImpl implements Databases {
return poller.pollUntilDone();
}
/**
* Forcibly removes the link to the specified database resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the RedisEnterprise cluster.
* @param databaseName The name of the database.
* @param parameters Information identifying the database to be unlinked.
* @param options The options parameters.
*/
async beginForceUnlink(
resourceGroupName: string,
clusterName: string,
databaseName: string,
parameters: ForceUnlinkParameters,
options?: DatabasesForceUnlinkOptionalParams
): Promise<PollerLike<PollOperationState<void>, void>> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
): Promise<void> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
) => {
let currentRawResponse:
| coreClient.FullOperationResponse
| undefined = undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback
}
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON()
}
};
};
const lro = new LroImpl(
sendOperation,
{ resourceGroupName, clusterName, databaseName, parameters, options },
forceUnlinkOperationSpec
);
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "azure-async-operation"
});
await poller.poll();
return poller;
}
/**
* Forcibly removes the link to the specified database resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the RedisEnterprise cluster.
* @param databaseName The name of the database.
* @param parameters Information identifying the database to be unlinked.
* @param options The options parameters.
*/
async beginForceUnlinkAndWait(
resourceGroupName: string,
clusterName: string,
databaseName: string,
parameters: ForceUnlinkParameters,
options?: DatabasesForceUnlinkOptionalParams
): Promise<void> {
const poller = await this.beginForceUnlink(
resourceGroupName,
clusterName,
databaseName,
parameters,
options
);
return poller.pollUntilDone();
}
/**
* ListByClusterNext
* @param resourceGroupName The name of the resource group. The name is case insensitive.
@ -1002,6 +1109,32 @@ const exportOperationSpec: coreClient.OperationSpec = {
mediaType: "json",
serializer
};
const forceUnlinkOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/forceUnlink",
httpMethod: "POST",
responses: {
200: {},
201: {},
202: {},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.parameters7,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.clusterName,
Parameters.databaseName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const listByClusterNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",

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

@ -201,10 +201,12 @@ export class PrivateEndpointConnectionsImpl
},
putOperationSpec
);
return new LroEngine(lro, {
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs
});
await poller.poll();
return poller;
}
/**

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

@ -204,11 +204,13 @@ export class RedisEnterpriseImpl implements RedisEnterprise {
{ resourceGroupName, clusterName, parameters, options },
createOperationSpec
);
return new LroEngine(lro, {
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "original-uri"
});
await poller.poll();
return poller;
}
/**
@ -295,11 +297,13 @@ export class RedisEnterpriseImpl implements RedisEnterprise {
{ resourceGroupName, clusterName, parameters, options },
updateOperationSpec
);
return new LroEngine(lro, {
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "azure-async-operation"
});
await poller.poll();
return poller;
}
/**
@ -379,11 +383,13 @@ export class RedisEnterpriseImpl implements RedisEnterprise {
{ resourceGroupName, clusterName, options },
deleteOperationSpec
);
return new LroEngine(lro, {
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "azure-async-operation"
});
await poller.poll();
return poller;
}
/**

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

@ -27,7 +27,9 @@ import {
ImportClusterParameters,
DatabasesImportOptionalParams,
ExportClusterParameters,
DatabasesExportOptionalParams
DatabasesExportOptionalParams,
ForceUnlinkParameters,
DatabasesForceUnlinkOptionalParams
} from "../models";
/// <reference lib="esnext.asynciterable" />
@ -261,4 +263,34 @@ export interface Databases {
parameters: ExportClusterParameters,
options?: DatabasesExportOptionalParams
): Promise<void>;
/**
* Forcibly removes the link to the specified database resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the RedisEnterprise cluster.
* @param databaseName The name of the database.
* @param parameters Information identifying the database to be unlinked.
* @param options The options parameters.
*/
beginForceUnlink(
resourceGroupName: string,
clusterName: string,
databaseName: string,
parameters: ForceUnlinkParameters,
options?: DatabasesForceUnlinkOptionalParams
): Promise<PollerLike<PollOperationState<void>, void>>;
/**
* Forcibly removes the link to the specified database resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the RedisEnterprise cluster.
* @param databaseName The name of the database.
* @param parameters Information identifying the database to be unlinked.
* @param options The options parameters.
*/
beginForceUnlinkAndWait(
resourceGroupName: string,
clusterName: string,
databaseName: string,
parameters: ForceUnlinkParameters,
options?: DatabasesForceUnlinkOptionalParams
): Promise<void>;
}

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

@ -58,7 +58,7 @@ export class RedisEnterpriseManagementClient extends coreClient.ServiceClient {
credential: credentials
};
const packageDetails = `azsdk-js-arm-redisenterprisecache/2.0.0`;
const packageDetails = `azsdk-js-arm-redisenterprisecache/2.1.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
@ -73,7 +73,8 @@ export class RedisEnterpriseManagementClient extends coreClient.ServiceClient {
userAgentOptions: {
userAgentPrefix
},
baseUri: options.endpoint || "https://management.azure.com"
baseUri:
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
};
super(optionsWithDefaults);
// Parameter assignments
@ -81,7 +82,7 @@ export class RedisEnterpriseManagementClient extends coreClient.ServiceClient {
// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2021-08-01";
this.apiVersion = options.apiVersion || "2022-01-01";
this.operations = new OperationsImpl(this);
this.operationsStatus = new OperationsStatusImpl(this);
this.redisEnterprise = new RedisEnterpriseImpl(this);

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

@ -9,12 +9,25 @@
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"lib": ["es6", "dom"],
"lib": [
"es6",
"dom"
],
"declaration": true,
"outDir": "./dist-esm",
"importHelpers": true,
"paths": { "@azure/arm-redisenterprisecache": ["./src/index"] }
"paths": {
"@azure/arm-redisenterprisecache": [
"./src/index"
]
}
},
"include": ["./src/**/*.ts", "./test/**/*.ts", "samples-dev/**/*.ts"],
"exclude": ["node_modules"]
}
"include": [
"./src/**/*.ts",
"./test/**/*.ts",
"samples-dev/**/*.ts"
],
"exclude": [
"node_modules"
]
}

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

@ -1,5 +1,5 @@
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
trigger:
branches:
include:
@ -9,7 +9,7 @@ trigger:
paths:
include:
- sdk/redisenterprise/ci.mgmt.yml
- sdk/redisenterprise/arm-redisenterprise/
- sdk/redisenterprise/arm-redisenterprisecache
pr:
branches:
include:
@ -22,12 +22,11 @@ pr:
paths:
include:
- sdk/redisenterprise/ci.mgmt.yml
- sdk/redisenterprise/arm-redisenterprise/
- sdk/redisenterprise/arm-redisenterprisecache
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: redisenterprise
Artifacts:
- name: azure-arm-redisenterprisecache
safeName: azurearmredisenterprisecache
safeName: azurearmredisenterprisecache