[mgmt] servicefabricmanagedclusters release (#30537)

https://github.com/Azure/sdk-release-request/issues/5375
This commit is contained in:
ZiWei Chen 2024-07-26 16:43:20 +08:00 коммит произвёл GitHub
Родитель 730ac9f9e1
Коммит c3ae1398ff
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
212 изменённых файлов: 27121 добавлений и 2 удалений

3
.github/CODEOWNERS поставляемый
Просмотреть файл

@ -827,6 +827,9 @@ sdk/ai/ai-inference-rest @glharper @dargilco
# PRLabel: %Mgmt
/sdk/servicefabric/arm-servicefabric/ @qiaozha @MaryGao
# PRLabel: %Mgmt
/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/ @qiaozha @MaryGao
# PRLabel: %Mgmt
/sdk/servicefabric/arm-servicefabric-rest/ @qiaozha @MaryGao

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

@ -668,6 +668,9 @@ dependencies:
'@rush-temp/arm-servicefabric-1':
specifier: file:./projects/arm-servicefabric-1.tgz
version: file:projects/arm-servicefabric-1.tgz
'@rush-temp/arm-servicefabricmanagedclusters':
specifier: file:./projects/arm-servicefabricmanagedclusters.tgz
version: file:projects/arm-servicefabricmanagedclusters.tgz
'@rush-temp/arm-servicefabricmesh':
specifier: file:./projects/arm-servicefabricmesh.tgz
version: file:projects/arm-servicefabricmesh.tgz
@ -18206,6 +18209,37 @@ packages:
- utf-8-validate
dev: false
file:projects/arm-servicefabricmanagedclusters.tgz:
resolution: {integrity: sha512-aXLhNHWEstwVsLKpmTC2k/xVystn9qlcSGaDg+o6B5saAiAICgXAynb+8X4YUUkH/N7xVIGwB06GhYPhmkDwMw==, tarball: file:projects/arm-servicefabricmanagedclusters.tgz}
name: '@rush-temp/arm-servicefabricmanagedclusters'
version: 0.0.0
dependencies:
'@azure-tools/test-credential': 1.2.0
'@azure-tools/test-recorder': 3.5.2
'@azure/abort-controller': 1.1.0
'@azure/core-lro': 2.7.2
'@azure/identity': 4.4.0
'@microsoft/api-extractor': 7.47.1(@types/node@18.19.40)
'@types/chai': 4.3.16
'@types/mocha': 10.0.7
'@types/node': 18.19.40
chai: 4.3.10
cross-env: 7.0.3
dotenv: 16.4.5
mkdirp: 3.0.1
mocha: 10.6.0
rimraf: 5.0.9
ts-node: 10.9.2(@types/node@18.19.40)(typescript@5.4.5)
tslib: 2.6.3
tsx: 4.16.2
typescript: 5.4.5
uglify-js: 3.18.0
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
- supports-color
dev: false
file:projects/arm-servicefabricmesh.tgz:
resolution: {integrity: sha512-DAoHYCxEbPvnDOv46/WhvUT+yt66a6vKoaGJpQvqDpKmmpToXECdoprk6D4y0TvRfA1qRjpF8VoNFHjtgOUynA==, tarball: file:projects/arm-servicefabricmesh.tgz}
name: '@rush-temp/arm-servicefabricmesh'

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

@ -25,6 +25,7 @@ https://docs.microsoft.com/javascript/api/@azure/arm-deviceregistry?view=azure-n
https://docs.microsoft.com/javascript/api/@azure/arm-standbypool?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-devopsinfrastructure?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-informaticadatamanagement?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-servicefabricmanagedclusters?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-oracledatabase?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-mongocluster?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-edgezones?view=azure-node-preview

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

@ -1,7 +1,7 @@
/**
* This is the main configuration file for Rush.
* For full documentation, please see https://rushjs.io
*/{
*/ {
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json",
/**
* (Required) This specifies the version of the Rush engine to be used in this repo.
@ -2237,10 +2237,15 @@
"projectFolder": "sdk/edgezones/arm-edgezones",
"versionPolicyName": "management"
},
{
"packageName": "@azure/arm-servicefabricmanagedclusters",
"projectFolder": "sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters",
"versionPolicyName": "management"
},
{
"packageName": "@azure/arm-redhatopenshift",
"projectFolder": "sdk/redhatopenshift/arm-redhatopenshift",
"versionPolicyName": "management"
}
]
}
}

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

@ -0,0 +1,7 @@
# Release History
## 1.0.0-beta.1 (2024-07-26)
### Features Added
The package of @azure/arm-servicefabricmanagedclusters is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart).

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

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2024 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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

@ -0,0 +1,109 @@
# Azure ServiceFabricManagedClustersManagement client library for JavaScript
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ServiceFabricManagedClustersManagement client.
Service Fabric Managed Clusters Management Client
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-servicefabricmanagedclusters) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-servicefabricmanagedclusters?view=azure-node-preview) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
## Getting started
### Currently supported environments
- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
- 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].
### Install the `@azure/arm-servicefabricmanagedclusters` package
Install the Azure ServiceFabricManagedClustersManagement client library for JavaScript with `npm`:
```bash
npm install @azure/arm-servicefabricmanagedclusters
```
### Create and authenticate a `ServiceFabricManagedClustersManagementClient`
To create a client object to access the Azure ServiceFabricManagedClustersManagement API, you will need the `endpoint` of your Azure ServiceFabricManagedClustersManagement resource and a `credential`. The Azure ServiceFabricManagedClustersManagement client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your Azure ServiceFabricManagedClustersManagement resource in the [Azure Portal][azure_portal].
You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).
To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:
```bash
npm install @azure/identity
```
You will also need to **register a new AAD application and grant access to Azure ServiceFabricManagedClustersManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
```javascript
const { ServiceFabricManagedClustersManagementClient } = require("@azure/arm-servicefabricmanagedclusters");
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 ServiceFabricManagedClustersManagementClient(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 ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
```
### JavaScript Bundle
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
## Key concepts
### ServiceFabricManagedClustersManagementClient
`ServiceFabricManagedClustersManagementClient` is the primary interface for developers using the Azure ServiceFabricManagedClustersManagement client library. Explore the methods on this client object to understand the different features of the Azure ServiceFabricManagedClustersManagement service that you can access.
## Troubleshooting
### Logging
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
```javascript
const { setLogLevel } = require("@azure/logger");
setLogLevel("info");
```
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
## Next steps
Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library.
## Contributing
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
## Related projects
- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fservicefabricmanagedclusters%2Farm-servicefabricmanagedclusters%2FREADME.png)
[azure_cli]: https://docs.microsoft.com/cli/azure
[azure_sub]: https://azure.microsoft.com/free/
[azure_sub]: https://azure.microsoft.com/free/
[azure_portal]: https://portal.azure.com
[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential

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

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

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

@ -0,0 +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"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/arm-servicefabricmanagedclusters.d.ts"
},
"messages": {
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}

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

@ -0,0 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "js",
"TagPrefix": "js/servicefabricmanagedclusters/arm-servicefabricmanagedclusters",
"Tag": "js/servicefabricmanagedclusters/arm-servicefabricmanagedclusters_12492568b6"
}

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

@ -0,0 +1,118 @@
{
"name": "@azure/arm-servicefabricmanagedclusters",
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for ServiceFabricManagedClustersManagementClient.",
"version": "1.0.0-beta.1",
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"@azure/core-lro": "^2.5.4",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.7.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-rest-pipeline": "^1.14.0",
"tslib": "^2.2.0"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
"types": "./types/arm-servicefabricmanagedclusters.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "^7.31.1",
"mkdirp": "^3.0.1",
"typescript": "~5.4.5",
"uglify-js": "^3.4.9",
"rimraf": "^5.0.0",
"dotenv": "^16.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/identity": "^4.0.1",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^1.1.0",
"mocha": "^10.0.0",
"@types/mocha": "^10.0.0",
"tsx": "^4.7.1",
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@types/node": "^18.0.0",
"ts-node": "^10.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
},
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
"dist/**/*.d.ts",
"dist/**/*.d.ts.map",
"dist-esm/**/*.js",
"dist-esm/**/*.js.map",
"dist-esm/**/*.d.ts",
"dist-esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"tsconfig.json",
"review/*",
"CHANGELOG.md",
"types/*"
],
"scripts": {
"build": "npm run clean && tsc && dev-tool run bundle && npm run minify && mkdirp ./review && npm run extract-api",
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
"prepack": "npm run build",
"pack": "npm pack 2>&1",
"extract-api": "dev-tool run extract-api",
"lint": "echo skipped",
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"build:node": "echo skipped",
"build:browser": "echo skipped",
"build:test": "echo skipped",
"build:samples": "echo skipped.",
"check-format": "echo skipped",
"execute:samples": "echo skipped",
"format": "echo skipped",
"test": "npm run integration-test",
"test:node": "echo skipped",
"test:browser": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
"unit-test:browser": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"integration-test:browser": "echo skipped"
},
"sideEffects": false,
"//metadata": {
"constantPaths": [
{
"path": "src/serviceFabricManagedClustersManagementClient.ts",
"prefix": "packageDetails"
}
]
},
"autoPublish": true,
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters",
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-servicefabricmanagedclusters?view=azure-node-preview"
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

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

@ -0,0 +1,59 @@
/*
* 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 {
ApplicationTypeVersionResource,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Create or update a Service Fabric managed application type version resource with the specified name.
*
* @summary Create or update a Service Fabric managed application type version resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeVersionPutOperation_example.json
*/
async function putAnApplicationTypeVersion() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const version = "1.0";
const parameters: ApplicationTypeVersionResource = {
appPackageUrl: "http://fakelink.test.com/MyAppType",
location: "eastus",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result =
await client.applicationTypeVersions.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
applicationTypeName,
version,
parameters,
);
console.log(result);
}
async function main() {
putAnApplicationTypeVersion();
}
main().catch(console.error);

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

@ -0,0 +1,50 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Delete a Service Fabric managed application type version resource with the specified name.
*
* @summary Delete a Service Fabric managed application type version resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeVersionDeleteOperation_example.json
*/
async function deleteAnApplicationTypeVersion() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const version = "1.0";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.applicationTypeVersions.beginDeleteAndWait(
resourceGroupName,
clusterName,
applicationTypeName,
version,
);
console.log(result);
}
async function main() {
deleteAnApplicationTypeVersion();
}
main().catch(console.error);

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

@ -0,0 +1,50 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get a Service Fabric managed application type version resource created or in the process of being created in the Service Fabric managed application type name resource.
*
* @summary Get a Service Fabric managed application type version resource created or in the process of being created in the Service Fabric managed application type name resource.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeVersionGetOperation_example.json
*/
async function getAnApplicationTypeVersion() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const version = "1.0";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.applicationTypeVersions.get(
resourceGroupName,
clusterName,
applicationTypeName,
version,
);
console.log(result);
}
async function main() {
getAnApplicationTypeVersion();
}
main().catch(console.error);

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

@ -0,0 +1,51 @@
/*
* 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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets all application type version resources created or in the process of being created in the Service Fabric managed application type name resource.
*
* @summary Gets all application type version resources created or in the process of being created in the Service Fabric managed application type name resource.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeVersionListOperation_example.json
*/
async function getAListOfApplicationTypeVersionResources() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const resArray = new Array();
for await (let item of client.applicationTypeVersions.listByApplicationTypes(
resourceGroupName,
clusterName,
applicationTypeName,
)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
getAListOfApplicationTypeVersionResources();
}
main().catch(console.error);

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

@ -0,0 +1,57 @@
/*
* 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 {
ApplicationTypeVersionUpdateParameters,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Updates the tags of an application type version resource of a given managed cluster.
*
* @summary Updates the tags of an application type version resource of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeVersionPatchOperation_example.json
*/
async function patchAnApplicationTypeVersion() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const version = "1.0";
const parameters: ApplicationTypeVersionUpdateParameters = {
tags: { a: "b" },
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.applicationTypeVersions.update(
resourceGroupName,
clusterName,
applicationTypeName,
version,
parameters,
);
console.log(result);
}
async function main() {
patchAnApplicationTypeVersion();
}
main().catch(console.error);

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

@ -0,0 +1,53 @@
/*
* 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 {
ApplicationTypeResource,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Create or update a Service Fabric managed application type name resource with the specified name.
*
* @summary Create or update a Service Fabric managed application type name resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeNamePutOperation_example.json
*/
async function putAnApplicationType() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const parameters: ApplicationTypeResource = { location: "eastus" };
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.applicationTypes.createOrUpdate(
resourceGroupName,
clusterName,
applicationTypeName,
parameters,
);
console.log(result);
}
async function main() {
putAnApplicationType();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Delete a Service Fabric managed application type name resource with the specified name.
*
* @summary Delete a Service Fabric managed application type name resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeNameDeleteOperation_example.json
*/
async function deleteAnApplicationType() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.applicationTypes.beginDeleteAndWait(
resourceGroupName,
clusterName,
applicationTypeName,
);
console.log(result);
}
async function main() {
deleteAnApplicationType();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric managed cluster resource.
*
* @summary Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric managed cluster resource.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeNameGetOperation_example.json
*/
async function getAnApplicationType() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.applicationTypes.get(
resourceGroupName,
clusterName,
applicationTypeName,
);
console.log(result);
}
async function main() {
getAnApplicationType();
}
main().catch(console.error);

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

@ -0,0 +1,49 @@
/*
* 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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets all application type name resources created or in the process of being created in the Service Fabric managed cluster resource.
*
* @summary Gets all application type name resources created or in the process of being created in the Service Fabric managed cluster resource.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeNameListOperation_example.json
*/
async function getAListOfApplicationTypeNameResources() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const resArray = new Array();
for await (let item of client.applicationTypes.list(
resourceGroupName,
clusterName,
)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
getAListOfApplicationTypeNameResources();
}
main().catch(console.error);

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

@ -0,0 +1,53 @@
/*
* 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 {
ApplicationTypeUpdateParameters,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Updates the tags of an application type resource of a given managed cluster.
*
* @summary Updates the tags of an application type resource of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeNamePatchOperation_example.json
*/
async function patchAnApplicationType() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const parameters: ApplicationTypeUpdateParameters = { tags: { a: "b" } };
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.applicationTypes.update(
resourceGroupName,
clusterName,
applicationTypeName,
parameters,
);
console.log(result);
}
async function main() {
patchAnApplicationType();
}
main().catch(console.error);

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

@ -0,0 +1,124 @@
/*
* 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 {
ApplicationResource,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Create or update a Service Fabric managed application resource with the specified name.
*
* @summary Create or update a Service Fabric managed application resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationPutOperation_example_max.json
*/
async function putAnApplicationWithMaximumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const parameters: ApplicationResource = {
location: "eastus",
parameters: { param1: "value1" },
tags: { a: "b" },
upgradePolicy: {
applicationHealthPolicy: {
considerWarningAsError: true,
defaultServiceTypeHealthPolicy: {
maxPercentUnhealthyPartitionsPerService: 0,
maxPercentUnhealthyReplicasPerPartition: 0,
maxPercentUnhealthyServices: 0,
},
maxPercentUnhealthyDeployedApplications: 0,
serviceTypeHealthPolicyMap: {
service1: {
maxPercentUnhealthyPartitionsPerService: 30,
maxPercentUnhealthyReplicasPerPartition: 30,
maxPercentUnhealthyServices: 30,
},
},
},
forceRestart: false,
instanceCloseDelayDuration: 600,
recreateApplication: false,
rollingUpgradeMonitoringPolicy: {
failureAction: "Rollback",
healthCheckRetryTimeout: "00:10:00",
healthCheckStableDuration: "00:05:00",
healthCheckWaitDuration: "00:02:00",
upgradeDomainTimeout: "00:15:00",
upgradeTimeout: "01:00:00",
},
upgradeMode: "UnmonitoredAuto",
upgradeReplicaSetCheckTimeout: 3600,
},
version:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.applications.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
applicationName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric managed application resource with the specified name.
*
* @summary Create or update a Service Fabric managed application resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationPutOperation_example_min.json
*/
async function putAnApplicationWithMinimumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const parameters: ApplicationResource = {
location: "eastus",
version:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.applications.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
applicationName,
parameters,
);
console.log(result);
}
async function main() {
putAnApplicationWithMaximumParameters();
putAnApplicationWithMinimumParameters();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Delete a Service Fabric managed application resource with the specified name.
*
* @summary Delete a Service Fabric managed application resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationDeleteOperation_example.json
*/
async function deleteAnApplication() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.applications.beginDeleteAndWait(
resourceGroupName,
clusterName,
applicationName,
);
console.log(result);
}
async function main() {
deleteAnApplication();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get a Service Fabric managed application resource created or in the process of being created in the Service Fabric cluster resource.
*
* @summary Get a Service Fabric managed application resource created or in the process of being created in the Service Fabric cluster resource.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationGetOperation_example.json
*/
async function getAnApplication() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.applications.get(
resourceGroupName,
clusterName,
applicationName,
);
console.log(result);
}
async function main() {
getAnApplication();
}
main().catch(console.error);

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

@ -0,0 +1,49 @@
/*
* 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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets all managed application resources created or in the process of being created in the Service Fabric cluster resource.
*
* @summary Gets all managed application resources created or in the process of being created in the Service Fabric cluster resource.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationListOperation_example.json
*/
async function getAListOfApplicationResources() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const resArray = new Array();
for await (let item of client.applications.list(
resourceGroupName,
clusterName,
)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
getAListOfApplicationResources();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get the status of the latest application upgrade. It will query the cluster to find the status of the latest application upgrade.
*
* @summary Get the status of the latest application upgrade. It will query the cluster to find the status of the latest application upgrade.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationActionGetUpgrade_example.json
*/
async function getAnApplicationUpgrade() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.applications.beginReadUpgradeAndWait(
resourceGroupName,
clusterName,
applicationName,
);
console.log(result);
}
async function main() {
getAnApplicationUpgrade();
}
main().catch(console.error);

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

@ -0,0 +1,55 @@
/*
* 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 {
RuntimeResumeApplicationUpgradeParameters,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Send a request to resume the current application upgrade. This will resume the application upgrade from where it was paused.
*
* @summary Send a request to resume the current application upgrade. This will resume the application upgrade from where it was paused.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationActionResumeUpgrade_example.json
*/
async function resumeUpgrade() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const parameters: RuntimeResumeApplicationUpgradeParameters = {
upgradeDomainName: "UD1",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.applications.beginResumeUpgradeAndWait(
resourceGroupName,
clusterName,
applicationName,
parameters,
);
console.log(result);
}
async function main() {
resumeUpgrade();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Send a request to start a rollback of the current application upgrade. This will start rolling back the application to the previous version.
*
* @summary Send a request to start a rollback of the current application upgrade. This will start rolling back the application to the previous version.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationActionStartRollback_example.json
*/
async function startAnApplicationUpgradeRollback() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.applications.beginStartRollbackAndWait(
resourceGroupName,
clusterName,
applicationName,
);
console.log(result);
}
async function main() {
startAnApplicationUpgradeRollback();
}
main().catch(console.error);

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

@ -0,0 +1,53 @@
/*
* 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 {
ApplicationUpdateParameters,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Updates the tags of an application resource of a given managed cluster.
*
* @summary Updates the tags of an application resource of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationPatchOperation_example.json
*/
async function patchAnApplication() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const parameters: ApplicationUpdateParameters = { tags: { a: "b" } };
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.applications.update(
resourceGroupName,
clusterName,
applicationName,
parameters,
);
console.log(result);
}
async function main() {
patchAnApplication();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Action to Apply Maintenance window on the Service Fabric Managed Clusters, right now. Any pending update will be applied.
*
* @summary Action to Apply Maintenance window on the Service Fabric Managed Clusters, right now. Any pending update will be applied.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedApplyMaintenanceWindowPost_example.json
*/
async function maintenanceWindowStatus() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] ||
"resourceGroup1";
const clusterName = "mycluster1";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.managedApplyMaintenanceWindow.post(
resourceGroupName,
clusterName,
);
console.log(result);
}
async function main() {
maintenanceWindowStatus();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Action to get Az Resiliency Status of all the Base resources constituting Service Fabric Managed Clusters.
*
* @summary Action to get Az Resiliency Status of all the Base resources constituting Service Fabric Managed Clusters.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/managedAzResiliencyStatusGet_example.json
*/
async function azResiliencyStatusOfBaseResources() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] ||
"resourceGroup1";
const clusterName = "mycluster1";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.managedAzResiliencyStatusOperations.get(
resourceGroupName,
clusterName,
);
console.log(result);
}
async function main() {
azResiliencyStatusOfBaseResources();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets information about an available Service Fabric cluster code version by environment.
*
* @summary Gets information about an available Service Fabric cluster code version by environment.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterVersionGetByEnvironment_example.json
*/
async function getClusterVersionByEnvironment() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const environment = "Windows";
const clusterVersion = "7.2.477.9590";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.managedClusterVersion.getByEnvironment(
location,
environment,
clusterVersion,
);
console.log(result);
}
async function main() {
getClusterVersionByEnvironment();
}
main().catch(console.error);

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

@ -0,0 +1,45 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets information about an available Service Fabric managed cluster code version.
*
* @summary Gets information about an available Service Fabric managed cluster code version.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterVersionGet_example.json
*/
async function getClusterVersion() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const clusterVersion = "7.2.477.9590";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.managedClusterVersion.get(
location,
clusterVersion,
);
console.log(result);
}
async function main() {
getClusterVersion();
}
main().catch(console.error);

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

@ -0,0 +1,45 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets all available code versions for Service Fabric cluster resources by environment.
*
* @summary Gets all available code versions for Service Fabric cluster resources by environment.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterVersionListByEnvironment.json
*/
async function listClusterVersionsByEnvironment() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const environment = "Windows";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.managedClusterVersion.listByEnvironment(
location,
environment,
);
console.log(result);
}
async function main() {
listClusterVersionsByEnvironment();
}
main().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.
import { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets all available code versions for Service Fabric cluster resources by location.
*
* @summary Gets all available code versions for Service Fabric cluster resources by location.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterVersionList_example.json
*/
async function listClusterVersions() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.managedClusterVersion.list(location);
console.log(result);
}
async function main() {
listClusterVersions();
}
main().catch(console.error);

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

@ -0,0 +1,212 @@
/*
* 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 {
ManagedCluster,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Create or update a Service Fabric managed cluster resource with the specified name.
*
* @summary Create or update a Service Fabric managed cluster resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterPutOperation_example_max.json
*/
async function putAClusterWithMaximumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const parameters: ManagedCluster = {
addonFeatures: [
"DnsService",
"BackupRestoreService",
"ResourceMonitorService",
],
adminPassword: "{vm-password}",
adminUserName: "vmadmin",
allowRdpAccess: true,
applicationTypeVersionsCleanupPolicy: { maxUnusedVersionsToKeep: 3 },
auxiliarySubnets: [
{
name: "testSubnet1",
enableIpv6: true,
networkSecurityGroupId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/networkSecurityGroups/sn1",
privateEndpointNetworkPolicies: "enabled",
privateLinkServiceNetworkPolicies: "enabled",
},
],
clientConnectionPort: 19000,
clusterCodeVersion: "7.1.168.9494",
clusterUpgradeMode: "Manual",
ddosProtectionPlanId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/ddosProtectionPlans/myDDoSProtectionPlan",
dnsName: "myCluster",
enableAutoOSUpgrade: true,
enableHttpGatewayExclusiveAuthMode: true,
enableIpv6: true,
fabricSettings: [
{
name: "ManagedIdentityTokenService",
parameters: [{ name: "IsEnabled", value: "true" }],
},
],
httpGatewayConnectionPort: 19080,
httpGatewayTokenAuthConnectionPort: 19081,
ipTags: [{ ipTagType: "FirstPartyUsage", tag: "SQL" }],
loadBalancingRules: [
{
backendPort: 80,
frontendPort: 80,
probePort: 80,
probeProtocol: "http",
protocol: "http",
},
{
backendPort: 443,
frontendPort: 443,
probePort: 443,
probeProtocol: "http",
protocol: "http",
},
{
backendPort: 10000,
frontendPort: 10000,
loadDistribution: "Default",
probePort: 10000,
probeProtocol: "http",
protocol: "tcp",
},
],
location: "eastus",
networkSecurityRules: [
{
name: "TestName",
description: "Test description",
access: "allow",
destinationAddressPrefixes: ["*"],
destinationPortRanges: ["*"],
direction: "inbound",
priority: 1010,
sourceAddressPrefixes: ["*"],
sourcePortRanges: ["*"],
protocol: "tcp",
},
{
name: "AllowARM",
access: "allow",
destinationAddressPrefix: "*",
destinationPortRange: "33500-33699",
direction: "inbound",
priority: 2002,
sourceAddressPrefix: "AzureResourceManager",
sourcePortRange: "*",
protocol: "*",
},
],
publicIPPrefixId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.Network/publicIPPrefixes/myPublicIPPrefix",
publicIPv6PrefixId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.Network/publicIPPrefixes/myPublicIPv6Prefix",
serviceEndpoints: [
{ locations: ["eastus2", "usnorth"], service: "Microsoft.Storage" },
],
sku: { name: "Basic" },
tags: {},
upgradeDescription: {
deltaHealthPolicy: {
maxPercentDeltaUnhealthyApplications: 40,
maxPercentDeltaUnhealthyNodes: 20,
maxPercentUpgradeDomainDeltaUnhealthyNodes: 40,
},
forceRestart: false,
healthPolicy: {
maxPercentUnhealthyApplications: 30,
maxPercentUnhealthyNodes: 10,
},
monitoringPolicy: {
healthCheckRetryTimeout: "00:55:00",
healthCheckStableDuration: "00:45:00",
healthCheckWaitDuration: "00:05:00",
upgradeDomainTimeout: "03:00:00",
upgradeTimeout: "12:00:00",
},
},
useCustomVnet: true,
zonalResiliency: true,
zonalUpdateMode: "Fast",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.managedClusters.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric managed cluster resource with the specified name.
*
* @summary Create or update a Service Fabric managed cluster resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterPutOperation_example_min.json
*/
async function putAClusterWithMinimumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const parameters: ManagedCluster = {
adminPassword: "{vm-password}",
adminUserName: "vmadmin",
clusterUpgradeCadence: "Wave1",
clusterUpgradeMode: "Automatic",
dnsName: "myCluster",
fabricSettings: [
{
name: "ManagedIdentityTokenService",
parameters: [{ name: "IsEnabled", value: "true" }],
},
],
location: "eastus",
sku: { name: "Basic" },
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.managedClusters.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
parameters,
);
console.log(result);
}
async function main() {
putAClusterWithMaximumParameters();
putAClusterWithMinimumParameters();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Delete a Service Fabric managed cluster resource with the specified name.
*
* @summary Delete a Service Fabric managed cluster resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterDeleteOperation_example.json
*/
async function deleteACluster() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.managedClusters.beginDeleteAndWait(
resourceGroupName,
clusterName,
);
console.log(result);
}
async function main() {
deleteACluster();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get a Service Fabric managed cluster resource created or in the process of being created in the specified resource group.
*
* @summary Get a Service Fabric managed cluster resource created or in the process of being created in the specified resource group.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterGetOperation_example.json
*/
async function getACluster() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.managedClusters.get(
resourceGroupName,
clusterName,
);
console.log(result);
}
async function main() {
getACluster();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets all Service Fabric cluster resources created or in the process of being created in the resource group.
*
* @summary Gets all Service Fabric cluster resources created or in the process of being created in the resource group.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterListByResourceGroupOperation_example.json
*/
async function listClusterByResourceGroup() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const resArray = new Array();
for await (let item of client.managedClusters.listByResourceGroup(
resourceGroupName,
)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
listClusterByResourceGroup();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets all Service Fabric cluster resources created or in the process of being created in the subscription.
*
* @summary Gets all Service Fabric cluster resources created or in the process of being created in the subscription.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterListBySubscriptionOperation_example.json
*/
async function listManagedClusters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const resArray = new Array();
for await (let item of client.managedClusters.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
listManagedClusters();
}
main().catch(console.error);

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

@ -0,0 +1,51 @@
/*
* 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 {
ManagedClusterUpdateParameters,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Update the tags of of a Service Fabric managed cluster resource with the specified name.
*
* @summary Update the tags of of a Service Fabric managed cluster resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterPatchOperation_example.json
*/
async function patchAManagedCluster() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const parameters: ManagedClusterUpdateParameters = { tags: { a: "b" } };
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.managedClusters.update(
resourceGroupName,
clusterName,
parameters,
);
console.log(result);
}
async function main() {
patchAManagedCluster();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Action to get Maintenance Window Status of the Service Fabric Managed Clusters.
*
* @summary Action to get Maintenance Window Status of the Service Fabric Managed Clusters.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedMaintenanceWindowStatusGet_example.json
*/
async function maintenanceWindowStatus() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] ||
"resourceGroup1";
const clusterName = "mycluster1";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.managedMaintenanceWindowStatusOperations.get(
resourceGroupName,
clusterName,
);
console.log(result);
}
async function main() {
maintenanceWindowStatus();
}
main().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.
import { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get unsupported vm size for Service Fabric Managed Clusters.
*
* @summary Get unsupported vm size for Service Fabric Managed Clusters.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/managedUnsupportedVMSizesGet_example.json
*/
async function getUnsupportedVMSizes() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const vmSize = "Standard_B1ls1";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.managedUnsupportedVMSizes.get(location, vmSize);
console.log(result);
}
async function main() {
getUnsupportedVMSizes();
}
main().catch(console.error);

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

@ -0,0 +1,44 @@
/*
* 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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get the lists of unsupported vm sizes for Service Fabric Managed Clusters.
*
* @summary Get the lists of unsupported vm sizes for Service Fabric Managed Clusters.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/managedUnsupportedVMSizesList_example.json
*/
async function listUnsupportedVMSizes() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const resArray = new Array();
for await (let item of client.managedUnsupportedVMSizes.list(location)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
listUnsupportedVMSizes();
}
main().catch(console.error);

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

@ -0,0 +1,51 @@
/*
* 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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get a Service Fabric node type supported SKUs.
*
* @summary Get a Service Fabric node type supported SKUs.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypeSkusListOperation_example.json
*/
async function listANodeTypeSkUs() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const resArray = new Array();
for await (let item of client.nodeTypeSkus.list(
resourceGroupName,
clusterName,
nodeTypeName,
)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
listANodeTypeSkUs();
}
main().catch(console.error);

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

@ -0,0 +1,511 @@
/*
* 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 {
NodeType,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperationAutoScale_example.json
*/
async function putANodeTypeWithAutoScaleParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters: NodeType = {
capacities: { clientConnections: "65536" },
dataDiskSizeGB: 200,
dataDiskType: "Premium_LRS",
isPrimary: false,
isStateless: true,
multiplePlacementGroups: true,
placementProperties: {
hasSSD: "true",
nodeColor: "green",
someProperty: "5",
},
vmExtensions: [
{
name: "Microsoft.Azure.Geneva.GenevaMonitoring",
type: "GenevaMonitoring",
autoUpgradeMinorVersion: true,
publisher: "Microsoft.Azure.Geneva",
settings: {},
typeHandlerVersion: "2.0",
},
],
vmImageOffer: "WindowsServer",
vmImagePublisher: "MicrosoftWindowsServer",
vmImageSku: "2016-Datacenter-Server-Core",
vmImageVersion: "latest",
vmInstanceCount: -1,
vmManagedIdentity: {
userAssignedIdentities: [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2",
],
},
vmSecrets: [
{
sourceVault: {
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault",
},
vaultCertificates: [
{
certificateStore: "My",
certificateUrl:
"https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c",
},
],
},
],
vmSize: "Standard_DS3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperation_example_max.json
*/
async function putANodeTypeWithMaximumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE-testResourceGroup-testRegion-test";
const parameters: NodeType = {
additionalDataDisks: [
{ diskLetter: "F", diskSizeGB: 256, diskType: "StandardSSD_LRS", lun: 1 },
{ diskLetter: "G", diskSizeGB: 150, diskType: "Premium_LRS", lun: 2 },
],
additionalNetworkInterfaceConfigurations: [
{
name: "nic-1",
dscpConfiguration: {
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig",
},
enableAcceleratedNetworking: true,
ipConfigurations: [
{
name: "ipconfig-1",
applicationGatewayBackendAddressPools: [
{
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest",
},
],
loadBalancerBackendAddressPools: [
{
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool",
},
],
loadBalancerInboundNatPools: [
{
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool",
},
],
privateIPAddressVersion: "IPv4",
publicIPAddressConfiguration: {
name: "publicip-1",
ipTags: [{ ipTagType: "RoutingPreference", tag: "Internet" }],
publicIPAddressVersion: "IPv4",
},
subnet: {
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1",
},
},
],
},
],
capacities: { clientConnections: "65536" },
computerNamePrefix: "BE",
dataDiskLetter: "S",
dataDiskSizeGB: 200,
dataDiskType: "Premium_LRS",
dscpConfigurationId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig",
enableAcceleratedNetworking: true,
enableEncryptionAtHost: true,
enableNodePublicIP: true,
enableNodePublicIPv6: true,
enableOverProvisioning: false,
evictionPolicy: "Deallocate",
frontendConfigurations: [
{
applicationGatewayBackendAddressPoolId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest",
loadBalancerBackendAddressPoolId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool",
loadBalancerInboundNatPoolId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool",
},
],
isPrimary: false,
isSpotVM: true,
isStateless: true,
multiplePlacementGroups: true,
natGatewayId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/natGateways/myNatGateway",
placementProperties: {
hasSSD: "true",
nodeColor: "green",
someProperty: "5",
},
secureBootEnabled: true,
securityType: "TrustedLaunch",
serviceArtifactReferenceId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile",
spotRestoreTimeout: "PT30M",
subnetId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1",
useDefaultPublicLoadBalancer: true,
useEphemeralOSDisk: true,
vmExtensions: [
{
name: "Microsoft.Azure.Geneva.GenevaMonitoring",
type: "GenevaMonitoring",
autoUpgradeMinorVersion: true,
enableAutomaticUpgrade: true,
forceUpdateTag: "v.1.0",
publisher: "Microsoft.Azure.Geneva",
settings: {},
setupOrder: ["BeforeSFRuntime"],
typeHandlerVersion: "2.0",
},
],
vmImageOffer: "WindowsServer",
vmImagePublisher: "MicrosoftWindowsServer",
vmImageSku: "2016-Datacenter-Server-Core",
vmImageVersion: "latest",
vmInstanceCount: 10,
vmManagedIdentity: {
userAssignedIdentities: [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2",
],
},
vmSecrets: [
{
sourceVault: {
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault",
},
vaultCertificates: [
{
certificateStore: "My",
certificateUrl:
"https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c",
},
],
},
],
vmSetupActions: ["EnableContainers", "EnableHyperV"],
vmSize: "Standard_DS3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperation_example_min.json
*/
async function putANodeTypeWithMinimumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters: NodeType = {
dataDiskSizeGB: 200,
isPrimary: false,
vmImageOffer: "WindowsServer",
vmImagePublisher: "MicrosoftWindowsServer",
vmImageSku: "2016-Datacenter-Server-Core",
vmImageVersion: "latest",
vmInstanceCount: 10,
vmSize: "Standard_D3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperationStateless_example.json
*/
async function putAnStatelessNodeTypeWithTemporaryDiskForServiceFabric() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters: NodeType = {
enableEncryptionAtHost: true,
isPrimary: false,
isStateless: true,
multiplePlacementGroups: true,
useTempDataDisk: true,
vmExtensions: [
{
name: "Microsoft.Azure.Geneva.GenevaMonitoring",
type: "GenevaMonitoring",
autoUpgradeMinorVersion: true,
publisher: "Microsoft.Azure.Geneva",
settings: {},
typeHandlerVersion: "2.0",
},
],
vmImageOffer: "WindowsServer",
vmImagePublisher: "MicrosoftWindowsServer",
vmImageSku: "2016-Datacenter-Server-Core",
vmImageVersion: "latest",
vmInstanceCount: 10,
vmSize: "Standard_DS3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperationCustomImage_example.json
*/
async function putNodeTypeWithCustomVMImage() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters: NodeType = {
dataDiskSizeGB: 200,
isPrimary: false,
vmImageResourceId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC",
vmInstanceCount: 10,
vmSize: "Standard_D3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperationDedicatedHost_example.json
*/
async function putNodeTypeWithDedicatedHosts() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters: NodeType = {
capacities: {},
dataDiskSizeGB: 200,
dataDiskType: "StandardSSD_LRS",
hostGroupId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup",
isPrimary: false,
placementProperties: {},
vmImageOffer: "WindowsServer",
vmImagePublisher: "MicrosoftWindowsServer",
vmImageSku: "2019-Datacenter",
vmImageVersion: "latest",
vmInstanceCount: 10,
vmSize: "Standard_D8s_v3",
zones: ["1"],
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperationCustomSharedGalleriesImage_example.json
*/
async function putNodeTypeWithSharedGalleriesCustomVMImage() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters: NodeType = {
dataDiskSizeGB: 200,
isPrimary: false,
vmInstanceCount: 10,
vmSharedGalleryImageId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest",
vmSize: "Standard_D3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperationVmImagePlan_example.json
*/
async function putNodeTypeWithVMImagePlan() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters: NodeType = {
dataDiskSizeGB: 200,
isPrimary: false,
vmImageOffer: "windows_2022_test",
vmImagePlan: {
name: "win_2022_test_20_10_gen2",
product: "windows_2022_test",
publisher: "testpublisher",
},
vmImagePublisher: "testpublisher",
vmImageSku: "win_2022_test_20_10_gen2",
vmImageVersion: "latest",
vmInstanceCount: 10,
vmSize: "Standard_D3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
async function main() {
putANodeTypeWithAutoScaleParameters();
putANodeTypeWithMaximumParameters();
putANodeTypeWithMinimumParameters();
putAnStatelessNodeTypeWithTemporaryDiskForServiceFabric();
putNodeTypeWithCustomVMImage();
putNodeTypeWithDedicatedHosts();
putNodeTypeWithSharedGalleriesCustomVMImage();
putNodeTypeWithVMImagePlan();
}
main().catch(console.error);

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

@ -0,0 +1,53 @@
/*
* 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 {
NodeTypeActionParameters,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and removes the state from the cluster.
*
* @summary Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and removes the state from the cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/DeleteNodes_example.json
*/
async function deleteNodes() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters: NodeTypeActionParameters = { nodes: ["BE_0", "BE_3"] };
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.beginDeleteNodeAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
async function main() {
deleteNodes();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Delete a Service Fabric node type of a given managed cluster.
*
* @summary Delete a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypeDeleteOperation_example.json
*/
async function deleteANodeType() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.beginDeleteAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
);
console.log(result);
}
async function main() {
deleteANodeType();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get a Service Fabric node type of a given managed cluster.
*
* @summary Get a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypeGetOperation_example.json
*/
async function getANodeType() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "FE";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.get(
resourceGroupName,
clusterName,
nodeTypeName,
);
console.log(result);
}
async function main() {
getANodeType();
}
main().catch(console.error);

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

@ -0,0 +1,49 @@
/*
* 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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets all Node types of the specified managed cluster.
*
* @summary Gets all Node types of the specified managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypeListOperation_example.json
*/
async function listNodeTypeOfTheSpecifiedManagedCluster() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const resArray = new Array();
for await (let item of client.nodeTypes.listByManagedClusters(
resourceGroupName,
clusterName,
)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
listNodeTypeOfTheSpecifiedManagedCluster();
}
main().catch(console.error);

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

@ -0,0 +1,85 @@
/*
* 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 {
NodeTypeActionParameters,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and activate the nodes back again.
*
* @summary Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and activate the nodes back again.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ReimageNodes_UD_example.json
*/
async function reimageAllNodesByUpgradeDomain() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters: NodeTypeActionParameters = {
updateType: "ByUpgradeDomain",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.beginReimageAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and activate the nodes back again.
*
* @summary Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and activate the nodes back again.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ReimageNodes_example.json
*/
async function reimageNodes() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters: NodeTypeActionParameters = { nodes: ["BE_0", "BE_3"] };
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.beginReimageAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
async function main() {
reimageAllNodesByUpgradeDomain();
reimageNodes();
}
main().catch(console.error);

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

@ -0,0 +1,53 @@
/*
* 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 {
NodeTypeActionParameters,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and activate the nodes back again.
*
* @summary Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and activate the nodes back again.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/RestartNodes_example.json
*/
async function restartNodes() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters: NodeTypeActionParameters = { nodes: ["BE_0", "BE_3"] };
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.beginRestartAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
async function main() {
restartNodes();
}
main().catch(console.error);

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

@ -0,0 +1,86 @@
/*
* 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 {
NodeTypeUpdateParameters,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Update the configuration of a node type of a given managed cluster, only updating tags.
*
* @summary Update the configuration of a node type of a given managed cluster, only updating tags.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePatchOperation_example.json
*/
async function patchANodeType() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters: NodeTypeUpdateParameters = { tags: { a: "b" } };
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.update(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Update the configuration of a node type of a given managed cluster, only updating tags.
*
* @summary Update the configuration of a node type of a given managed cluster, only updating tags.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePatchOperationAutoScale_example.json
*/
async function patchANodeTypeWhileAutoScaling() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters: NodeTypeUpdateParameters = {
sku: { name: "Standard_S0", capacity: 10, tier: "Standard" },
tags: { a: "b" },
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.nodeTypes.update(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
async function main() {
patchANodeType();
patchANodeTypeWhileAutoScaling();
}
main().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.
import { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get long running operation result.
*
* @summary Get long running operation result.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/Long_running_operation_result.json
*/
async function getOperationResult() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const operationId = "00000000-0000-0000-0000-000000001234";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.operationResults.get(location, operationId);
console.log(result);
}
async function main() {
getOperationResult();
}
main().catch(console.error);

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

@ -0,0 +1,64 @@
/*
* 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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get long running operation status.
*
* @summary Get long running operation status.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/Long_running_operation_status_failed.json
*/
async function getFailedOperationStatus() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const operationId = "00000000-0000-0000-0000-000000001234";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.operationStatus.get(location, operationId);
console.log(result);
}
/**
* This sample demonstrates how to Get long running operation status.
*
* @summary Get long running operation status.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/Long_running_operation_status_succeeded.json
*/
async function getSucceededOperationResult() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const operationId = "00000000-0000-0000-0000-000000001234";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.operationStatus.get(location, operationId);
console.log(result);
}
async function main() {
getFailedOperationStatus();
getSucceededOperationResult();
}
main().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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get the list of available Service Fabric resource provider API operations.
*
* @summary Get the list of available Service Fabric resource provider API operations.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/Operations_example.json
*/
async function listAvailableOperations() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const resArray = new Array();
for await (let item of client.operations.list()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
listAvailableOperations();
}
main().catch(console.error);

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

@ -0,0 +1,136 @@
/*
* 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 {
ServiceResource,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Create or update a Service Fabric managed service resource with the specified name.
*
* @summary Create or update a Service Fabric managed service resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ServicePutOperation_example_max.json
*/
async function putAServiceWithMaximumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const serviceName = "myService";
const parameters: ServiceResource = {
location: "eastus",
properties: {
correlationScheme: [
{
scheme: "AlignedAffinity",
serviceName:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService1",
},
],
defaultMoveCost: "Medium",
instanceCount: 5,
minInstanceCount: 3,
minInstancePercentage: 30,
partitionDescription: { partitionScheme: "Singleton" },
placementConstraints: "NodeType==frontend",
scalingPolicies: [
{
scalingMechanism: {
kind: "ScalePartitionInstanceCount",
maxInstanceCount: 9,
minInstanceCount: 3,
scaleIncrement: 2,
},
scalingTrigger: {
kind: "AveragePartitionLoadTrigger",
lowerLoadThreshold: 2,
metricName: "metricName",
scaleInterval: "00:01:00",
upperLoadThreshold: 8,
},
},
],
serviceDnsName: "myservicednsname.myApp",
serviceKind: "Stateless",
serviceLoadMetrics: [{ name: "metric1", defaultLoad: 3, weight: "Low" }],
servicePackageActivationMode: "SharedProcess",
servicePlacementPolicies: [{ type: "NonPartiallyPlaceService" }],
serviceTypeName: "myServiceType",
},
tags: { a: "b" },
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.services.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
applicationName,
serviceName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric managed service resource with the specified name.
*
* @summary Create or update a Service Fabric managed service resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ServicePutOperation_example_min.json
*/
async function putAServiceWithMinimumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const serviceName = "myService";
const parameters: ServiceResource = {
location: "eastus",
properties: {
instanceCount: 1,
partitionDescription: { partitionScheme: "Singleton" },
serviceKind: "Stateless",
serviceTypeName: "myServiceType",
},
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.services.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
applicationName,
serviceName,
parameters,
);
console.log(result);
}
async function main() {
putAServiceWithMaximumParameters();
putAServiceWithMinimumParameters();
}
main().catch(console.error);

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

@ -0,0 +1,50 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Delete a Service Fabric managed service resource with the specified name.
*
* @summary Delete a Service Fabric managed service resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ServiceDeleteOperation_example.json
*/
async function deleteAService() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const serviceName = "myService";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.services.beginDeleteAndWait(
resourceGroupName,
clusterName,
applicationName,
serviceName,
);
console.log(result);
}
async function main() {
deleteAService();
}
main().catch(console.error);

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

@ -0,0 +1,50 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get a Service Fabric service resource created or in the process of being created in the Service Fabric managed application resource.
*
* @summary Get a Service Fabric service resource created or in the process of being created in the Service Fabric managed application resource.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ServiceGetOperation_example.json
*/
async function getAService() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const serviceName = "myService";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.services.get(
resourceGroupName,
clusterName,
applicationName,
serviceName,
);
console.log(result);
}
async function main() {
getAService();
}
main().catch(console.error);

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

@ -0,0 +1,51 @@
/*
* 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 { ServiceFabricManagedClustersManagementClient } from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets all service resources created or in the process of being created in the Service Fabric managed application resource.
*
* @summary Gets all service resources created or in the process of being created in the Service Fabric managed application resource.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ServiceListOperation_example.json
*/
async function getAListOfServiceResources() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const resArray = new Array();
for await (let item of client.services.listByApplications(
resourceGroupName,
clusterName,
applicationName,
)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
getAListOfServiceResources();
}
main().catch(console.error);

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

@ -0,0 +1,55 @@
/*
* 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 {
ServiceUpdateParameters,
ServiceFabricManagedClustersManagementClient,
} from "@azure/arm-servicefabricmanagedclusters";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Updates the tags of a service resource of a given managed cluster.
*
* @summary Updates the tags of a service resource of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ServicePatchOperation_example.json
*/
async function patchAService() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const serviceName = "myService";
const parameters: ServiceUpdateParameters = { tags: { a: "b" } };
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(
credential,
subscriptionId,
);
const result = await client.services.update(
resourceGroupName,
clusterName,
applicationName,
serviceName,
parameters,
);
console.log(result);
}
async function main() {
patchAService();
}
main().catch(console.error);

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

@ -0,0 +1,148 @@
# client library samples for JavaScript (Beta)
These sample programs show how to use the JavaScript client libraries for in some common scenarios.
| **File Name** | **Description** |
| ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [applicationTypeVersionsCreateOrUpdateSample.js][applicationtypeversionscreateorupdatesample] | Create or update a Service Fabric managed application type version resource with the specified name. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeVersionPutOperation_example.json |
| [applicationTypeVersionsDeleteSample.js][applicationtypeversionsdeletesample] | Delete a Service Fabric managed application type version resource with the specified name. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeVersionDeleteOperation_example.json |
| [applicationTypeVersionsGetSample.js][applicationtypeversionsgetsample] | Get a Service Fabric managed application type version resource created or in the process of being created in the Service Fabric managed application type name resource. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeVersionGetOperation_example.json |
| [applicationTypeVersionsListByApplicationTypesSample.js][applicationtypeversionslistbyapplicationtypessample] | Gets all application type version resources created or in the process of being created in the Service Fabric managed application type name resource. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeVersionListOperation_example.json |
| [applicationTypeVersionsUpdateSample.js][applicationtypeversionsupdatesample] | Updates the tags of an application type version resource of a given managed cluster. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeVersionPatchOperation_example.json |
| [applicationTypesCreateOrUpdateSample.js][applicationtypescreateorupdatesample] | Create or update a Service Fabric managed application type name resource with the specified name. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeNamePutOperation_example.json |
| [applicationTypesDeleteSample.js][applicationtypesdeletesample] | Delete a Service Fabric managed application type name resource with the specified name. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeNameDeleteOperation_example.json |
| [applicationTypesGetSample.js][applicationtypesgetsample] | Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric managed cluster resource. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeNameGetOperation_example.json |
| [applicationTypesListSample.js][applicationtypeslistsample] | Gets all application type name resources created or in the process of being created in the Service Fabric managed cluster resource. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeNameListOperation_example.json |
| [applicationTypesUpdateSample.js][applicationtypesupdatesample] | Updates the tags of an application type resource of a given managed cluster. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeNamePatchOperation_example.json |
| [applicationsCreateOrUpdateSample.js][applicationscreateorupdatesample] | Create or update a Service Fabric managed application resource with the specified name. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationPutOperation_example_max.json |
| [applicationsDeleteSample.js][applicationsdeletesample] | Delete a Service Fabric managed application resource with the specified name. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationDeleteOperation_example.json |
| [applicationsGetSample.js][applicationsgetsample] | Get a Service Fabric managed application resource created or in the process of being created in the Service Fabric cluster resource. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationGetOperation_example.json |
| [applicationsListSample.js][applicationslistsample] | Gets all managed application resources created or in the process of being created in the Service Fabric cluster resource. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationListOperation_example.json |
| [applicationsReadUpgradeSample.js][applicationsreadupgradesample] | Get the status of the latest application upgrade. It will query the cluster to find the status of the latest application upgrade. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationActionGetUpgrade_example.json |
| [applicationsResumeUpgradeSample.js][applicationsresumeupgradesample] | Send a request to resume the current application upgrade. This will resume the application upgrade from where it was paused. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationActionResumeUpgrade_example.json |
| [applicationsStartRollbackSample.js][applicationsstartrollbacksample] | Send a request to start a rollback of the current application upgrade. This will start rolling back the application to the previous version. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationActionStartRollback_example.json |
| [applicationsUpdateSample.js][applicationsupdatesample] | Updates the tags of an application resource of a given managed cluster. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationPatchOperation_example.json |
| [managedApplyMaintenanceWindowPostSample.js][managedapplymaintenancewindowpostsample] | Action to Apply Maintenance window on the Service Fabric Managed Clusters, right now. Any pending update will be applied. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedApplyMaintenanceWindowPost_example.json |
| [managedAzResiliencyStatusGetSample.js][managedazresiliencystatusgetsample] | Action to get Az Resiliency Status of all the Base resources constituting Service Fabric Managed Clusters. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/managedAzResiliencyStatusGet_example.json |
| [managedClusterVersionGetByEnvironmentSample.js][managedclusterversiongetbyenvironmentsample] | Gets information about an available Service Fabric cluster code version by environment. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterVersionGetByEnvironment_example.json |
| [managedClusterVersionGetSample.js][managedclusterversiongetsample] | Gets information about an available Service Fabric managed cluster code version. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterVersionGet_example.json |
| [managedClusterVersionListByEnvironmentSample.js][managedclusterversionlistbyenvironmentsample] | Gets all available code versions for Service Fabric cluster resources by environment. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterVersionListByEnvironment.json |
| [managedClusterVersionListSample.js][managedclusterversionlistsample] | Gets all available code versions for Service Fabric cluster resources by location. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterVersionList_example.json |
| [managedClustersCreateOrUpdateSample.js][managedclusterscreateorupdatesample] | Create or update a Service Fabric managed cluster resource with the specified name. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterPutOperation_example_max.json |
| [managedClustersDeleteSample.js][managedclustersdeletesample] | Delete a Service Fabric managed cluster resource with the specified name. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterDeleteOperation_example.json |
| [managedClustersGetSample.js][managedclustersgetsample] | Get a Service Fabric managed cluster resource created or in the process of being created in the specified resource group. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterGetOperation_example.json |
| [managedClustersListByResourceGroupSample.js][managedclusterslistbyresourcegroupsample] | Gets all Service Fabric cluster resources created or in the process of being created in the resource group. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterListByResourceGroupOperation_example.json |
| [managedClustersListBySubscriptionSample.js][managedclusterslistbysubscriptionsample] | Gets all Service Fabric cluster resources created or in the process of being created in the subscription. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterListBySubscriptionOperation_example.json |
| [managedClustersUpdateSample.js][managedclustersupdatesample] | Update the tags of of a Service Fabric managed cluster resource with the specified name. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterPatchOperation_example.json |
| [managedMaintenanceWindowStatusGetSample.js][managedmaintenancewindowstatusgetsample] | Action to get Maintenance Window Status of the Service Fabric Managed Clusters. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedMaintenanceWindowStatusGet_example.json |
| [managedUnsupportedVMSizesGetSample.js][managedunsupportedvmsizesgetsample] | Get unsupported vm size for Service Fabric Managed Clusters. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/managedUnsupportedVMSizesGet_example.json |
| [managedUnsupportedVMSizesListSample.js][managedunsupportedvmsizeslistsample] | Get the lists of unsupported vm sizes for Service Fabric Managed Clusters. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/managedUnsupportedVMSizesList_example.json |
| [nodeTypeSkusListSample.js][nodetypeskuslistsample] | Get a Service Fabric node type supported SKUs. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypeSkusListOperation_example.json |
| [nodeTypesCreateOrUpdateSample.js][nodetypescreateorupdatesample] | Create or update a Service Fabric node type of a given managed cluster. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperationAutoScale_example.json |
| [nodeTypesDeleteNodeSample.js][nodetypesdeletenodesample] | Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and removes the state from the cluster. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/DeleteNodes_example.json |
| [nodeTypesDeleteSample.js][nodetypesdeletesample] | Delete a Service Fabric node type of a given managed cluster. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypeDeleteOperation_example.json |
| [nodeTypesGetSample.js][nodetypesgetsample] | Get a Service Fabric node type of a given managed cluster. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypeGetOperation_example.json |
| [nodeTypesListByManagedClustersSample.js][nodetypeslistbymanagedclusterssample] | Gets all Node types of the specified managed cluster. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypeListOperation_example.json |
| [nodeTypesReimageSample.js][nodetypesreimagesample] | Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and activate the nodes back again. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ReimageNodes_UD_example.json |
| [nodeTypesRestartSample.js][nodetypesrestartsample] | Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and activate the nodes back again. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/RestartNodes_example.json |
| [nodeTypesUpdateSample.js][nodetypesupdatesample] | Update the configuration of a node type of a given managed cluster, only updating tags. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePatchOperation_example.json |
| [operationResultsGetSample.js][operationresultsgetsample] | Get long running operation result. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/Long_running_operation_result.json |
| [operationStatusGetSample.js][operationstatusgetsample] | Get long running operation status. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/Long_running_operation_status_failed.json |
| [operationsListSample.js][operationslistsample] | Get the list of available Service Fabric resource provider API operations. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/Operations_example.json |
| [servicesCreateOrUpdateSample.js][servicescreateorupdatesample] | Create or update a Service Fabric managed service resource with the specified name. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ServicePutOperation_example_max.json |
| [servicesDeleteSample.js][servicesdeletesample] | Delete a Service Fabric managed service resource with the specified name. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ServiceDeleteOperation_example.json |
| [servicesGetSample.js][servicesgetsample] | Get a Service Fabric service resource created or in the process of being created in the Service Fabric managed application resource. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ServiceGetOperation_example.json |
| [servicesListByApplicationsSample.js][serviceslistbyapplicationssample] | Gets all service resources created or in the process of being created in the Service Fabric managed application resource. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ServiceListOperation_example.json |
| [servicesUpdateSample.js][servicesupdatesample] | Updates the tags of a service resource of a given managed cluster. x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ServicePatchOperation_example.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
You need [an Azure subscription][freesub] to run these sample programs.
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node applicationTypeVersionsCreateOrUpdateSample.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 SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID="<servicefabricmanagedclusters subscription id>" SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP="<servicefabricmanagedclusters resource group>" node applicationTypeVersionsCreateOrUpdateSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[applicationtypeversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationTypeVersionsCreateOrUpdateSample.js
[applicationtypeversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationTypeVersionsDeleteSample.js
[applicationtypeversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationTypeVersionsGetSample.js
[applicationtypeversionslistbyapplicationtypessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationTypeVersionsListByApplicationTypesSample.js
[applicationtypeversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationTypeVersionsUpdateSample.js
[applicationtypescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationTypesCreateOrUpdateSample.js
[applicationtypesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationTypesDeleteSample.js
[applicationtypesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationTypesGetSample.js
[applicationtypeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationTypesListSample.js
[applicationtypesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationTypesUpdateSample.js
[applicationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationsCreateOrUpdateSample.js
[applicationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationsDeleteSample.js
[applicationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationsGetSample.js
[applicationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationsListSample.js
[applicationsreadupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationsReadUpgradeSample.js
[applicationsresumeupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationsResumeUpgradeSample.js
[applicationsstartrollbacksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationsStartRollbackSample.js
[applicationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/applicationsUpdateSample.js
[managedapplymaintenancewindowpostsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/managedApplyMaintenanceWindowPostSample.js
[managedazresiliencystatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/managedAzResiliencyStatusGetSample.js
[managedclusterversiongetbyenvironmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/managedClusterVersionGetByEnvironmentSample.js
[managedclusterversiongetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/managedClusterVersionGetSample.js
[managedclusterversionlistbyenvironmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/managedClusterVersionListByEnvironmentSample.js
[managedclusterversionlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/managedClusterVersionListSample.js
[managedclusterscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/managedClustersCreateOrUpdateSample.js
[managedclustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/managedClustersDeleteSample.js
[managedclustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/managedClustersGetSample.js
[managedclusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/managedClustersListByResourceGroupSample.js
[managedclusterslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/managedClustersListBySubscriptionSample.js
[managedclustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/managedClustersUpdateSample.js
[managedmaintenancewindowstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/managedMaintenanceWindowStatusGetSample.js
[managedunsupportedvmsizesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/managedUnsupportedVMSizesGetSample.js
[managedunsupportedvmsizeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/managedUnsupportedVMSizesListSample.js
[nodetypeskuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/nodeTypeSkusListSample.js
[nodetypescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/nodeTypesCreateOrUpdateSample.js
[nodetypesdeletenodesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/nodeTypesDeleteNodeSample.js
[nodetypesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/nodeTypesDeleteSample.js
[nodetypesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/nodeTypesGetSample.js
[nodetypeslistbymanagedclusterssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/nodeTypesListByManagedClustersSample.js
[nodetypesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/nodeTypesReimageSample.js
[nodetypesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/nodeTypesRestartSample.js
[nodetypesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/nodeTypesUpdateSample.js
[operationresultsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/operationResultsGetSample.js
[operationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/operationStatusGetSample.js
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/operationsListSample.js
[servicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/servicesCreateOrUpdateSample.js
[servicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/servicesDeleteSample.js
[servicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/servicesGetSample.js
[serviceslistbyapplicationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/servicesListByApplicationsSample.js
[servicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/samples/v1-beta/javascript/servicesUpdateSample.js
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-servicefabricmanagedclusters?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicefabricmanagedclusters/arm-servicefabricmanagedclusters/README.md

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

@ -0,0 +1,51 @@
/*
* 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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Create or update a Service Fabric managed application type version resource with the specified name.
*
* @summary Create or update a Service Fabric managed application type version resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeVersionPutOperation_example.json
*/
async function putAnApplicationTypeVersion() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const version = "1.0";
const parameters = {
appPackageUrl: "http://fakelink.test.com/MyAppType",
location: "eastus",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applicationTypeVersions.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
applicationTypeName,
version,
parameters,
);
console.log(result);
}
async function main() {
putAnApplicationTypeVersion();
}
main().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.
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Delete a Service Fabric managed application type version resource with the specified name.
*
* @summary Delete a Service Fabric managed application type version resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeVersionDeleteOperation_example.json
*/
async function deleteAnApplicationTypeVersion() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const version = "1.0";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applicationTypeVersions.beginDeleteAndWait(
resourceGroupName,
clusterName,
applicationTypeName,
version,
);
console.log(result);
}
async function main() {
deleteAnApplicationTypeVersion();
}
main().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.
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Get a Service Fabric managed application type version resource created or in the process of being created in the Service Fabric managed application type name resource.
*
* @summary Get a Service Fabric managed application type version resource created or in the process of being created in the Service Fabric managed application type name resource.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeVersionGetOperation_example.json
*/
async function getAnApplicationTypeVersion() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const version = "1.0";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applicationTypeVersions.get(
resourceGroupName,
clusterName,
applicationTypeName,
version,
);
console.log(result);
}
async function main() {
getAnApplicationTypeVersion();
}
main().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.
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Gets all application type version resources created or in the process of being created in the Service Fabric managed application type name resource.
*
* @summary Gets all application type version resources created or in the process of being created in the Service Fabric managed application type name resource.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeVersionListOperation_example.json
*/
async function getAListOfApplicationTypeVersionResources() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.applicationTypeVersions.listByApplicationTypes(
resourceGroupName,
clusterName,
applicationTypeName,
)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
getAListOfApplicationTypeVersionResources();
}
main().catch(console.error);

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

@ -0,0 +1,50 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Updates the tags of an application type version resource of a given managed cluster.
*
* @summary Updates the tags of an application type version resource of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeVersionPatchOperation_example.json
*/
async function patchAnApplicationTypeVersion() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const version = "1.0";
const parameters = {
tags: { a: "b" },
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applicationTypeVersions.update(
resourceGroupName,
clusterName,
applicationTypeName,
version,
parameters,
);
console.log(result);
}
async function main() {
patchAnApplicationTypeVersion();
}
main().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.
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Create or update a Service Fabric managed application type name resource with the specified name.
*
* @summary Create or update a Service Fabric managed application type name resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeNamePutOperation_example.json
*/
async function putAnApplicationType() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const parameters = { location: "eastus" };
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applicationTypes.createOrUpdate(
resourceGroupName,
clusterName,
applicationTypeName,
parameters,
);
console.log(result);
}
async function main() {
putAnApplicationType();
}
main().catch(console.error);

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

@ -0,0 +1,44 @@
/*
* 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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Delete a Service Fabric managed application type name resource with the specified name.
*
* @summary Delete a Service Fabric managed application type name resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeNameDeleteOperation_example.json
*/
async function deleteAnApplicationType() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applicationTypes.beginDeleteAndWait(
resourceGroupName,
clusterName,
applicationTypeName,
);
console.log(result);
}
async function main() {
deleteAnApplicationType();
}
main().catch(console.error);

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

@ -0,0 +1,44 @@
/*
* 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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric managed cluster resource.
*
* @summary Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric managed cluster resource.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeNameGetOperation_example.json
*/
async function getAnApplicationType() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applicationTypes.get(
resourceGroupName,
clusterName,
applicationTypeName,
);
console.log(result);
}
async function main() {
getAnApplicationType();
}
main().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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Gets all application type name resources created or in the process of being created in the Service Fabric managed cluster resource.
*
* @summary Gets all application type name resources created or in the process of being created in the Service Fabric managed cluster resource.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeNameListOperation_example.json
*/
async function getAListOfApplicationTypeNameResources() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.applicationTypes.list(resourceGroupName, clusterName)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
getAListOfApplicationTypeNameResources();
}
main().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.
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Updates the tags of an application type resource of a given managed cluster.
*
* @summary Updates the tags of an application type resource of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationTypeNamePatchOperation_example.json
*/
async function patchAnApplicationType() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationTypeName = "myAppType";
const parameters = { tags: { a: "b" } };
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applicationTypes.update(
resourceGroupName,
clusterName,
applicationTypeName,
parameters,
);
console.log(result);
}
async function main() {
patchAnApplicationType();
}
main().catch(console.error);

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

@ -0,0 +1,113 @@
/*
* 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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Create or update a Service Fabric managed application resource with the specified name.
*
* @summary Create or update a Service Fabric managed application resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationPutOperation_example_max.json
*/
async function putAnApplicationWithMaximumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const parameters = {
location: "eastus",
parameters: { param1: "value1" },
tags: { a: "b" },
upgradePolicy: {
applicationHealthPolicy: {
considerWarningAsError: true,
defaultServiceTypeHealthPolicy: {
maxPercentUnhealthyPartitionsPerService: 0,
maxPercentUnhealthyReplicasPerPartition: 0,
maxPercentUnhealthyServices: 0,
},
maxPercentUnhealthyDeployedApplications: 0,
serviceTypeHealthPolicyMap: {
service1: {
maxPercentUnhealthyPartitionsPerService: 30,
maxPercentUnhealthyReplicasPerPartition: 30,
maxPercentUnhealthyServices: 30,
},
},
},
forceRestart: false,
instanceCloseDelayDuration: 600,
recreateApplication: false,
rollingUpgradeMonitoringPolicy: {
failureAction: "Rollback",
healthCheckRetryTimeout: "00:10:00",
healthCheckStableDuration: "00:05:00",
healthCheckWaitDuration: "00:02:00",
upgradeDomainTimeout: "00:15:00",
upgradeTimeout: "01:00:00",
},
upgradeMode: "UnmonitoredAuto",
upgradeReplicaSetCheckTimeout: 3600,
},
version:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applications.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
applicationName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric managed application resource with the specified name.
*
* @summary Create or update a Service Fabric managed application resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationPutOperation_example_min.json
*/
async function putAnApplicationWithMinimumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const parameters = {
location: "eastus",
version:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applications.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
applicationName,
parameters,
);
console.log(result);
}
async function main() {
putAnApplicationWithMaximumParameters();
putAnApplicationWithMinimumParameters();
}
main().catch(console.error);

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

@ -0,0 +1,44 @@
/*
* 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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Delete a Service Fabric managed application resource with the specified name.
*
* @summary Delete a Service Fabric managed application resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationDeleteOperation_example.json
*/
async function deleteAnApplication() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applications.beginDeleteAndWait(
resourceGroupName,
clusterName,
applicationName,
);
console.log(result);
}
async function main() {
deleteAnApplication();
}
main().catch(console.error);

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

@ -0,0 +1,40 @@
/*
* 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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Get a Service Fabric managed application resource created or in the process of being created in the Service Fabric cluster resource.
*
* @summary Get a Service Fabric managed application resource created or in the process of being created in the Service Fabric cluster resource.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationGetOperation_example.json
*/
async function getAnApplication() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applications.get(resourceGroupName, clusterName, applicationName);
console.log(result);
}
async function main() {
getAnApplication();
}
main().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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Gets all managed application resources created or in the process of being created in the Service Fabric cluster resource.
*
* @summary Gets all managed application resources created or in the process of being created in the Service Fabric cluster resource.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationListOperation_example.json
*/
async function getAListOfApplicationResources() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.applications.list(resourceGroupName, clusterName)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
getAListOfApplicationResources();
}
main().catch(console.error);

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

@ -0,0 +1,44 @@
/*
* 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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Get the status of the latest application upgrade. It will query the cluster to find the status of the latest application upgrade.
*
* @summary Get the status of the latest application upgrade. It will query the cluster to find the status of the latest application upgrade.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationActionGetUpgrade_example.json
*/
async function getAnApplicationUpgrade() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applications.beginReadUpgradeAndWait(
resourceGroupName,
clusterName,
applicationName,
);
console.log(result);
}
async function main() {
getAnApplicationUpgrade();
}
main().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.
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Send a request to resume the current application upgrade. This will resume the application upgrade from where it was paused.
*
* @summary Send a request to resume the current application upgrade. This will resume the application upgrade from where it was paused.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationActionResumeUpgrade_example.json
*/
async function resumeUpgrade() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const parameters = {
upgradeDomainName: "UD1",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applications.beginResumeUpgradeAndWait(
resourceGroupName,
clusterName,
applicationName,
parameters,
);
console.log(result);
}
async function main() {
resumeUpgrade();
}
main().catch(console.error);

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

@ -0,0 +1,44 @@
/*
* 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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Send a request to start a rollback of the current application upgrade. This will start rolling back the application to the previous version.
*
* @summary Send a request to start a rollback of the current application upgrade. This will start rolling back the application to the previous version.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationActionStartRollback_example.json
*/
async function startAnApplicationUpgradeRollback() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applications.beginStartRollbackAndWait(
resourceGroupName,
clusterName,
applicationName,
);
console.log(result);
}
async function main() {
startAnApplicationUpgradeRollback();
}
main().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.
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Updates the tags of an application resource of a given managed cluster.
*
* @summary Updates the tags of an application resource of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ApplicationPatchOperation_example.json
*/
async function patchAnApplication() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const applicationName = "myApp";
const parameters = { tags: { a: "b" } };
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.applications.update(
resourceGroupName,
clusterName,
applicationName,
parameters,
);
console.log(result);
}
async function main() {
patchAnApplication();
}
main().catch(console.error);

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

@ -0,0 +1,40 @@
/*
* 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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Action to Apply Maintenance window on the Service Fabric Managed Clusters, right now. Any pending update will be applied.
*
* @summary Action to Apply Maintenance window on the Service Fabric Managed Clusters, right now. Any pending update will be applied.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedApplyMaintenanceWindowPost_example.json
*/
async function maintenanceWindowStatus() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resourceGroup1";
const clusterName = "mycluster1";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.managedApplyMaintenanceWindow.post(resourceGroupName, clusterName);
console.log(result);
}
async function main() {
maintenanceWindowStatus();
}
main().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.
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Action to get Az Resiliency Status of all the Base resources constituting Service Fabric Managed Clusters.
*
* @summary Action to get Az Resiliency Status of all the Base resources constituting Service Fabric Managed Clusters.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/managedAzResiliencyStatusGet_example.json
*/
async function azResiliencyStatusOfBaseResources() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resourceGroup1";
const clusterName = "mycluster1";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.managedAzResiliencyStatusOperations.get(
resourceGroupName,
clusterName,
);
console.log(result);
}
async function main() {
azResiliencyStatusOfBaseResources();
}
main().catch(console.error);

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

@ -0,0 +1,44 @@
/*
* 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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Gets information about an available Service Fabric cluster code version by environment.
*
* @summary Gets information about an available Service Fabric cluster code version by environment.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterVersionGetByEnvironment_example.json
*/
async function getClusterVersionByEnvironment() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const environment = "Windows";
const clusterVersion = "7.2.477.9590";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.managedClusterVersion.getByEnvironment(
location,
environment,
clusterVersion,
);
console.log(result);
}
async function main() {
getClusterVersionByEnvironment();
}
main().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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Gets information about an available Service Fabric managed cluster code version.
*
* @summary Gets information about an available Service Fabric managed cluster code version.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterVersionGet_example.json
*/
async function getClusterVersion() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const clusterVersion = "7.2.477.9590";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.managedClusterVersion.get(location, clusterVersion);
console.log(result);
}
async function main() {
getClusterVersion();
}
main().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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Gets all available code versions for Service Fabric cluster resources by environment.
*
* @summary Gets all available code versions for Service Fabric cluster resources by environment.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterVersionListByEnvironment.json
*/
async function listClusterVersionsByEnvironment() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const environment = "Windows";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.managedClusterVersion.listByEnvironment(location, environment);
console.log(result);
}
async function main() {
listClusterVersionsByEnvironment();
}
main().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.
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Gets all available code versions for Service Fabric cluster resources by location.
*
* @summary Gets all available code versions for Service Fabric cluster resources by location.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterVersionList_example.json
*/
async function listClusterVersions() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.managedClusterVersion.list(location);
console.log(result);
}
async function main() {
listClusterVersions();
}
main().catch(console.error);

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

@ -0,0 +1,195 @@
/*
* 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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Create or update a Service Fabric managed cluster resource with the specified name.
*
* @summary Create or update a Service Fabric managed cluster resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterPutOperation_example_max.json
*/
async function putAClusterWithMaximumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const parameters = {
addonFeatures: ["DnsService", "BackupRestoreService", "ResourceMonitorService"],
adminPassword: "{vm-password}",
adminUserName: "vmadmin",
allowRdpAccess: true,
applicationTypeVersionsCleanupPolicy: { maxUnusedVersionsToKeep: 3 },
auxiliarySubnets: [
{
name: "testSubnet1",
enableIpv6: true,
networkSecurityGroupId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/networkSecurityGroups/sn1",
privateEndpointNetworkPolicies: "enabled",
privateLinkServiceNetworkPolicies: "enabled",
},
],
clientConnectionPort: 19000,
clusterCodeVersion: "7.1.168.9494",
clusterUpgradeMode: "Manual",
ddosProtectionPlanId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/ddosProtectionPlans/myDDoSProtectionPlan",
dnsName: "myCluster",
enableAutoOSUpgrade: true,
enableHttpGatewayExclusiveAuthMode: true,
enableIpv6: true,
fabricSettings: [
{
name: "ManagedIdentityTokenService",
parameters: [{ name: "IsEnabled", value: "true" }],
},
],
httpGatewayConnectionPort: 19080,
httpGatewayTokenAuthConnectionPort: 19081,
ipTags: [{ ipTagType: "FirstPartyUsage", tag: "SQL" }],
loadBalancingRules: [
{
backendPort: 80,
frontendPort: 80,
probePort: 80,
probeProtocol: "http",
protocol: "http",
},
{
backendPort: 443,
frontendPort: 443,
probePort: 443,
probeProtocol: "http",
protocol: "http",
},
{
backendPort: 10000,
frontendPort: 10000,
loadDistribution: "Default",
probePort: 10000,
probeProtocol: "http",
protocol: "tcp",
},
],
location: "eastus",
networkSecurityRules: [
{
name: "TestName",
description: "Test description",
access: "allow",
destinationAddressPrefixes: ["*"],
destinationPortRanges: ["*"],
direction: "inbound",
priority: 1010,
sourceAddressPrefixes: ["*"],
sourcePortRanges: ["*"],
protocol: "tcp",
},
{
name: "AllowARM",
access: "allow",
destinationAddressPrefix: "*",
destinationPortRange: "33500-33699",
direction: "inbound",
priority: 2002,
sourceAddressPrefix: "AzureResourceManager",
sourcePortRange: "*",
protocol: "*",
},
],
publicIPPrefixId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.Network/publicIPPrefixes/myPublicIPPrefix",
publicIPv6PrefixId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.Network/publicIPPrefixes/myPublicIPv6Prefix",
serviceEndpoints: [{ locations: ["eastus2", "usnorth"], service: "Microsoft.Storage" }],
sku: { name: "Basic" },
tags: {},
upgradeDescription: {
deltaHealthPolicy: {
maxPercentDeltaUnhealthyApplications: 40,
maxPercentDeltaUnhealthyNodes: 20,
maxPercentUpgradeDomainDeltaUnhealthyNodes: 40,
},
forceRestart: false,
healthPolicy: {
maxPercentUnhealthyApplications: 30,
maxPercentUnhealthyNodes: 10,
},
monitoringPolicy: {
healthCheckRetryTimeout: "00:55:00",
healthCheckStableDuration: "00:45:00",
healthCheckWaitDuration: "00:05:00",
upgradeDomainTimeout: "03:00:00",
upgradeTimeout: "12:00:00",
},
},
useCustomVnet: true,
zonalResiliency: true,
zonalUpdateMode: "Fast",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.managedClusters.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric managed cluster resource with the specified name.
*
* @summary Create or update a Service Fabric managed cluster resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterPutOperation_example_min.json
*/
async function putAClusterWithMinimumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const parameters = {
adminPassword: "{vm-password}",
adminUserName: "vmadmin",
clusterUpgradeCadence: "Wave1",
clusterUpgradeMode: "Automatic",
dnsName: "myCluster",
fabricSettings: [
{
name: "ManagedIdentityTokenService",
parameters: [{ name: "IsEnabled", value: "true" }],
},
],
location: "eastus",
sku: { name: "Basic" },
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.managedClusters.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
parameters,
);
console.log(result);
}
async function main() {
putAClusterWithMaximumParameters();
putAClusterWithMinimumParameters();
}
main().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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Delete a Service Fabric managed cluster resource with the specified name.
*
* @summary Delete a Service Fabric managed cluster resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterDeleteOperation_example.json
*/
async function deleteACluster() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.managedClusters.beginDeleteAndWait(resourceGroupName, clusterName);
console.log(result);
}
async function main() {
deleteACluster();
}
main().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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Get a Service Fabric managed cluster resource created or in the process of being created in the specified resource group.
*
* @summary Get a Service Fabric managed cluster resource created or in the process of being created in the specified resource group.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterGetOperation_example.json
*/
async function getACluster() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.managedClusters.get(resourceGroupName, clusterName);
console.log(result);
}
async function main() {
getACluster();
}
main().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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Gets all Service Fabric cluster resources created or in the process of being created in the resource group.
*
* @summary Gets all Service Fabric cluster resources created or in the process of being created in the resource group.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterListByResourceGroupOperation_example.json
*/
async function listClusterByResourceGroup() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.managedClusters.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
listClusterByResourceGroup();
}
main().catch(console.error);

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

@ -0,0 +1,40 @@
/*
* 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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Gets all Service Fabric cluster resources created or in the process of being created in the subscription.
*
* @summary Gets all Service Fabric cluster resources created or in the process of being created in the subscription.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterListBySubscriptionOperation_example.json
*/
async function listManagedClusters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.managedClusters.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
listManagedClusters();
}
main().catch(console.error);

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

@ -0,0 +1,40 @@
/*
* 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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Update the tags of of a Service Fabric managed cluster resource with the specified name.
*
* @summary Update the tags of of a Service Fabric managed cluster resource with the specified name.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedClusterPatchOperation_example.json
*/
async function patchAManagedCluster() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const parameters = { tags: { a: "b" } };
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.managedClusters.update(resourceGroupName, clusterName, parameters);
console.log(result);
}
async function main() {
patchAManagedCluster();
}
main().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.
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Action to get Maintenance Window Status of the Service Fabric Managed Clusters.
*
* @summary Action to get Maintenance Window Status of the Service Fabric Managed Clusters.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/ManagedMaintenanceWindowStatusGet_example.json
*/
async function maintenanceWindowStatus() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resourceGroup1";
const clusterName = "mycluster1";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.managedMaintenanceWindowStatusOperations.get(
resourceGroupName,
clusterName,
);
console.log(result);
}
async function main() {
maintenanceWindowStatus();
}
main().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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Get unsupported vm size for Service Fabric Managed Clusters.
*
* @summary Get unsupported vm size for Service Fabric Managed Clusters.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/managedUnsupportedVMSizesGet_example.json
*/
async function getUnsupportedVMSizes() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const vmSize = "Standard_B1ls1";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.managedUnsupportedVMSizes.get(location, vmSize);
console.log(result);
}
async function main() {
getUnsupportedVMSizes();
}
main().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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Get the lists of unsupported vm sizes for Service Fabric Managed Clusters.
*
* @summary Get the lists of unsupported vm sizes for Service Fabric Managed Clusters.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/managedUnsupportedVMSizesList_example.json
*/
async function listUnsupportedVMSizes() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const location = "eastus";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.managedUnsupportedVMSizes.list(location)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
listUnsupportedVMSizes();
}
main().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.
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Get a Service Fabric node type supported SKUs.
*
* @summary Get a Service Fabric node type supported SKUs.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypeSkusListOperation_example.json
*/
async function listANodeTypeSkUs() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.nodeTypeSkus.list(resourceGroupName, clusterName, nodeTypeName)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
listANodeTypeSkUs();
}
main().catch(console.error);

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

@ -0,0 +1,476 @@
/*
* 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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperationAutoScale_example.json
*/
async function putANodeTypeWithAutoScaleParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters = {
capacities: { clientConnections: "65536" },
dataDiskSizeGB: 200,
dataDiskType: "Premium_LRS",
isPrimary: false,
isStateless: true,
multiplePlacementGroups: true,
placementProperties: {
hasSSD: "true",
nodeColor: "green",
someProperty: "5",
},
vmExtensions: [
{
name: "Microsoft.Azure.Geneva.GenevaMonitoring",
type: "GenevaMonitoring",
autoUpgradeMinorVersion: true,
publisher: "Microsoft.Azure.Geneva",
settings: {},
typeHandlerVersion: "2.0",
},
],
vmImageOffer: "WindowsServer",
vmImagePublisher: "MicrosoftWindowsServer",
vmImageSku: "2016-Datacenter-Server-Core",
vmImageVersion: "latest",
vmInstanceCount: -1,
vmManagedIdentity: {
userAssignedIdentities: [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2",
],
},
vmSecrets: [
{
sourceVault: {
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault",
},
vaultCertificates: [
{
certificateStore: "My",
certificateUrl:
"https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c",
},
],
},
],
vmSize: "Standard_DS3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperation_example_max.json
*/
async function putANodeTypeWithMaximumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE-testResourceGroup-testRegion-test";
const parameters = {
additionalDataDisks: [
{ diskLetter: "F", diskSizeGB: 256, diskType: "StandardSSD_LRS", lun: 1 },
{ diskLetter: "G", diskSizeGB: 150, diskType: "Premium_LRS", lun: 2 },
],
additionalNetworkInterfaceConfigurations: [
{
name: "nic-1",
dscpConfiguration: {
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig",
},
enableAcceleratedNetworking: true,
ipConfigurations: [
{
name: "ipconfig-1",
applicationGatewayBackendAddressPools: [
{
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest",
},
],
loadBalancerBackendAddressPools: [
{
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool",
},
],
loadBalancerInboundNatPools: [
{
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool",
},
],
privateIPAddressVersion: "IPv4",
publicIPAddressConfiguration: {
name: "publicip-1",
ipTags: [{ ipTagType: "RoutingPreference", tag: "Internet" }],
publicIPAddressVersion: "IPv4",
},
subnet: {
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1",
},
},
],
},
],
capacities: { clientConnections: "65536" },
computerNamePrefix: "BE",
dataDiskLetter: "S",
dataDiskSizeGB: 200,
dataDiskType: "Premium_LRS",
dscpConfigurationId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig",
enableAcceleratedNetworking: true,
enableEncryptionAtHost: true,
enableNodePublicIP: true,
enableNodePublicIPv6: true,
enableOverProvisioning: false,
evictionPolicy: "Deallocate",
frontendConfigurations: [
{
applicationGatewayBackendAddressPoolId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest",
loadBalancerBackendAddressPoolId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool",
loadBalancerInboundNatPoolId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool",
},
],
isPrimary: false,
isSpotVM: true,
isStateless: true,
multiplePlacementGroups: true,
natGatewayId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/natGateways/myNatGateway",
placementProperties: {
hasSSD: "true",
nodeColor: "green",
someProperty: "5",
},
secureBootEnabled: true,
securityType: "TrustedLaunch",
serviceArtifactReferenceId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile",
spotRestoreTimeout: "PT30M",
subnetId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1",
useDefaultPublicLoadBalancer: true,
useEphemeralOSDisk: true,
vmExtensions: [
{
name: "Microsoft.Azure.Geneva.GenevaMonitoring",
type: "GenevaMonitoring",
autoUpgradeMinorVersion: true,
enableAutomaticUpgrade: true,
forceUpdateTag: "v.1.0",
publisher: "Microsoft.Azure.Geneva",
settings: {},
setupOrder: ["BeforeSFRuntime"],
typeHandlerVersion: "2.0",
},
],
vmImageOffer: "WindowsServer",
vmImagePublisher: "MicrosoftWindowsServer",
vmImageSku: "2016-Datacenter-Server-Core",
vmImageVersion: "latest",
vmInstanceCount: 10,
vmManagedIdentity: {
userAssignedIdentities: [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2",
],
},
vmSecrets: [
{
sourceVault: {
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault",
},
vaultCertificates: [
{
certificateStore: "My",
certificateUrl:
"https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c",
},
],
},
],
vmSetupActions: ["EnableContainers", "EnableHyperV"],
vmSize: "Standard_DS3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperation_example_min.json
*/
async function putANodeTypeWithMinimumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters = {
dataDiskSizeGB: 200,
isPrimary: false,
vmImageOffer: "WindowsServer",
vmImagePublisher: "MicrosoftWindowsServer",
vmImageSku: "2016-Datacenter-Server-Core",
vmImageVersion: "latest",
vmInstanceCount: 10,
vmSize: "Standard_D3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperationStateless_example.json
*/
async function putAnStatelessNodeTypeWithTemporaryDiskForServiceFabric() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters = {
enableEncryptionAtHost: true,
isPrimary: false,
isStateless: true,
multiplePlacementGroups: true,
useTempDataDisk: true,
vmExtensions: [
{
name: "Microsoft.Azure.Geneva.GenevaMonitoring",
type: "GenevaMonitoring",
autoUpgradeMinorVersion: true,
publisher: "Microsoft.Azure.Geneva",
settings: {},
typeHandlerVersion: "2.0",
},
],
vmImageOffer: "WindowsServer",
vmImagePublisher: "MicrosoftWindowsServer",
vmImageSku: "2016-Datacenter-Server-Core",
vmImageVersion: "latest",
vmInstanceCount: 10,
vmSize: "Standard_DS3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperationCustomImage_example.json
*/
async function putNodeTypeWithCustomVMImage() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters = {
dataDiskSizeGB: 200,
isPrimary: false,
vmImageResourceId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC",
vmInstanceCount: 10,
vmSize: "Standard_D3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperationDedicatedHost_example.json
*/
async function putNodeTypeWithDedicatedHosts() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters = {
capacities: {},
dataDiskSizeGB: 200,
dataDiskType: "StandardSSD_LRS",
hostGroupId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup",
isPrimary: false,
placementProperties: {},
vmImageOffer: "WindowsServer",
vmImagePublisher: "MicrosoftWindowsServer",
vmImageSku: "2019-Datacenter",
vmImageVersion: "latest",
vmInstanceCount: 10,
vmSize: "Standard_D8s_v3",
zones: ["1"],
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperationCustomSharedGalleriesImage_example.json
*/
async function putNodeTypeWithSharedGalleriesCustomVMImage() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters = {
dataDiskSizeGB: 200,
isPrimary: false,
vmInstanceCount: 10,
vmSharedGalleryImageId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest",
vmSize: "Standard_D3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/NodeTypePutOperationVmImagePlan_example.json
*/
async function putNodeTypeWithVMImagePlan() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters = {
dataDiskSizeGB: 200,
isPrimary: false,
vmImageOffer: "windows_2022_test",
vmImagePlan: {
name: "win_2022_test_20_10_gen2",
product: "windows_2022_test",
publisher: "testpublisher",
},
vmImagePublisher: "testpublisher",
vmImageSku: "win_2022_test_20_10_gen2",
vmImageVersion: "latest",
vmInstanceCount: 10,
vmSize: "Standard_D3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
async function main() {
putANodeTypeWithAutoScaleParameters();
putANodeTypeWithMaximumParameters();
putANodeTypeWithMinimumParameters();
putAnStatelessNodeTypeWithTemporaryDiskForServiceFabric();
putNodeTypeWithCustomVMImage();
putNodeTypeWithDedicatedHosts();
putNodeTypeWithSharedGalleriesCustomVMImage();
putNodeTypeWithVMImagePlan();
}
main().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.
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and removes the state from the cluster.
*
* @summary Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and removes the state from the cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/stable/2024-04-01/examples/DeleteNodes_example.json
*/
async function deleteNodes() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters = { nodes: ["BE_0", "BE_3"] };
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginDeleteNodeAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
console.log(result);
}
async function main() {
deleteNodes();
}
main().catch(console.error);

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