release connectedvmware package (#22891)

* release connectedvmware package

* update files

* Update pnpm-lock.yaml

* Update _meta.json

* Update pnpm-lock.yaml

* Update ignore-links.txt

Co-authored-by: kazrael2119 <98569699+kazrael2119@users.noreply.github.com>
This commit is contained in:
azraelczw 2022-08-19 14:48:09 +08:00 коммит произвёл GitHub
Родитель ae3776d311
Коммит 1b161bd1bf
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
270 изменённых файлов: 28010 добавлений и 1 удалений

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

@ -47,6 +47,7 @@ specifiers:
'@rush-temp/arm-compute-profile-2020-09-01-hybrid': file:./projects/arm-compute-profile-2020-09-01-hybrid.tgz
'@rush-temp/arm-confidentialledger': file:./projects/arm-confidentialledger.tgz
'@rush-temp/arm-confluent': file:./projects/arm-confluent.tgz
'@rush-temp/arm-connectedvmware': file:./projects/arm-connectedvmware.tgz
'@rush-temp/arm-consumption': file:./projects/arm-consumption.tgz
'@rush-temp/arm-containerinstance': file:./projects/arm-containerinstance.tgz
'@rush-temp/arm-containerregistry': file:./projects/arm-containerregistry.tgz
@ -349,6 +350,7 @@ dependencies:
'@rush-temp/arm-compute-profile-2020-09-01-hybrid': file:projects/arm-compute-profile-2020-09-01-hybrid.tgz
'@rush-temp/arm-confidentialledger': file:projects/arm-confidentialledger.tgz
'@rush-temp/arm-confluent': file:projects/arm-confluent.tgz
'@rush-temp/arm-connectedvmware': file:projects/arm-connectedvmware.tgz
'@rush-temp/arm-consumption': file:projects/arm-consumption.tgz
'@rush-temp/arm-containerinstance': file:projects/arm-containerinstance.tgz
'@rush-temp/arm-containerregistry': file:projects/arm-containerregistry.tgz
@ -11011,6 +11013,33 @@ packages:
- supports-color
dev: false
file:projects/arm-connectedvmware.tgz:
resolution: {integrity: sha512-12LgkTdZkmzbUPLD2tgNyijsnNZG7HtQfwNdReKatvR6gfPAWLGeNdENOIS7DTE2iuQKf3Tur/ftjFKBNwStqA==, tarball: file:projects/arm-connectedvmware.tgz}
name: '@rush-temp/arm-connectedvmware'
version: 0.0.0
dependencies:
'@azure/identity': 2.1.0
'@microsoft/api-extractor': 7.18.11
'@rollup/plugin-commonjs': 21.1.0_rollup@2.77.2
'@rollup/plugin-json': 4.1.0_rollup@2.77.2
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.77.2
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.2
'@types/chai': 4.3.1
chai: 4.3.6
cross-env: 7.0.3
mkdirp: 1.0.4
mocha: 7.2.0
rimraf: 3.0.2
rollup: 2.77.2
rollup-plugin-sourcemaps: 0.6.3_rollup@2.77.2
tslib: 2.4.0
typescript: 4.6.4
uglify-js: 3.16.3
transitivePeerDependencies:
- '@types/node'
- supports-color
dev: false
file:projects/arm-consumption.tgz:
resolution: {integrity: sha512-NQFxrW/D3odjtPrxLs6gwb+AyosrVpjGVmISx1HvJpfEs12cYKRWGNNYGnKdiv4vjyKW8RWrBEg4SP8duHVDGQ==, tarball: file:projects/arm-consumption.tgz}
name: '@rush-temp/arm-consumption'

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

@ -18,3 +18,4 @@ https://docs.microsoft.com/javascript/api/@azure/arm-fluidrelay?view=azure-node-
https://docs.microsoft.com/javascript/api/@azure/arm-automanage
https://docs.microsoft.com/javascript/api/@azure/arm-automanage?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-devcenter?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-connectedvmware?view=azure-node-preview

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

@ -1820,6 +1820,11 @@
"packageName": "@azure/communication-rooms",
"projectFolder": "sdk/communication/communication-rooms",
"versionPolicyName": "client"
},
{
"packageName": "@azure/arm-connectedvmware",
"projectFolder": "sdk/connectedvmware/arm-connectedvmware",
"versionPolicyName": "management"
}
]
}
}

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

@ -0,0 +1,5 @@
# Release History
## 1.0.0-beta.1 (2022-08-15)
The package of @azure/arm-connectedvmware is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).

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

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2022 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 Arc VMware Management client library for JavaScript
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Arc VMware Management client.
Self service experience for VMware.
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/connectedvmware/arm-connectedvmware) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-connectedvmware) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-connectedvmware?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://nodejs.org/about/releases/)
- Latest versions of Safari, Chrome, Edge and Firefox.
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
### Prerequisites
- An [Azure subscription][azure_sub].
### Install the `@azure/arm-connectedvmware` package
Install the Azure Arc VMware Management client library for JavaScript with `npm`:
```bash
npm install @azure/arm-connectedvmware
```
### Create and authenticate a `AzureArcVMwareManagementServiceAPI`
To create a client object to access the Azure Arc VMware Management API, you will need the `endpoint` of your Azure Arc VMware Management resource and a `credential`. The Azure Arc VMware Management client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your Azure Arc VMware Management 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 Arc VMware Management** 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 { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
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 AzureArcVMwareManagementServiceAPI(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 AzureArcVMwareManagementServiceAPI(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
### AzureArcVMwareManagementServiceAPI
`AzureArcVMwareManagementServiceAPI` is the primary interface for developers using the Azure Arc VMware Management client library. Explore the methods on this client object to understand the different features of the Azure Arc VMware Management 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%2Fconnectedvmware%2Farm-connectedvmware%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": "05bce5fc8e93c97fc3a70072e7510acc41255f6c",
"readme": "specification/connectedvmware/resource-manager/readme.md",
"autorest_command": "autorest --version=3.8.4 --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\\connectedvmware\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220727.1 --generate-sample=true",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.1",
"use": "@autorest/typescript@6.0.0-rc.1.20220727.1"
}

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

@ -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-connectedvmware.d.ts"
},
"messages": {
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}

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

@ -0,0 +1,121 @@
{
"name": "@azure/arm-connectedvmware",
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for AzureArcVMwareManagementServiceAPI.",
"version": "1.0.0-beta.1",
"engines": {
"node": ">=12.0.0"
},
"dependencies": {
"@azure/core-lro": "^2.2.0",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.5.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.8.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-connectedvmware.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "7.18.11",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-multi-entry": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"mkdirp": "^1.0.4",
"rollup": "^2.66.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"typescript": "~4.6.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^2.0.0",
"@azure-tools/test-credential": "^1.0.0",
"mocha": "^7.1.1",
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@azure/dev-tool": "^1.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/connectedvmware/arm-connectedvmware",
"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",
"rollup.config.js",
"tsconfig.json",
"review/*",
"CHANGELOG.md",
"types/*"
],
"scripts": {
"build": "npm run clean && tsc && rollup -c 2>&1 && 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": "api-extractor run --local",
"lint": "echo skipped",
"audit": "echo skipped",
"clean": "rimraf 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/azureArcVMwareManagementServiceAPI.ts",
"prefix": "packageDetails"
}
]
},
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-connectedvmware?view=azure-node-preview"
}
}

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

@ -0,0 +1,4 @@
{
"Entries": [],
"Variables": {}
}

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

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

@ -0,0 +1,122 @@
/*
* 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.
*/
import nodeResolve from "@rollup/plugin-node-resolve";
import cjs from "@rollup/plugin-commonjs";
import sourcemaps from "rollup-plugin-sourcemaps";
import multiEntry from "@rollup/plugin-multi-entry";
import json from "@rollup/plugin-json";
import nodeBuiltins from "builtin-modules";
// #region Warning Handler
/**
* A function that can determine whether a rollup warning should be ignored. If
* the function returns `true`, then the warning will not be displayed.
*/
function ignoreNiseSinonEval(warning) {
return (
warning.code === "EVAL" &&
warning.id &&
(warning.id.includes("node_modules/nise") ||
warning.id.includes("node_modules/sinon")) === true
);
}
function ignoreChaiCircularDependency(warning) {
return (
warning.code === "CIRCULAR_DEPENDENCY" &&
warning.importer && warning.importer.includes("node_modules/chai") === true
);
}
const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
/**
* Construct a warning handler for the shared rollup configuration
* that ignores certain warnings that are not relevant to testing.
*/
function makeOnWarnForTesting() {
return (warning, warn) => {
// If every inhibitor returns false (i.e. no inhibitors), then show the warning
if (warningInhibitors.every((inhib) => !inhib(warning))) {
warn(warning);
}
};
}
// #endregion
function makeBrowserTestConfig() {
const config = {
input: {
include: ["dist-esm/test/**/*.spec.js"],
exclude: ["dist-esm/test/**/node/**"]
},
output: {
file: `dist-test/index.browser.js`,
format: "umd",
sourcemap: true
},
preserveSymlinks: false,
plugins: [
multiEntry({ exports: false }),
nodeResolve({
mainFields: ["module", "browser"]
}),
cjs(),
json(),
sourcemaps()
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
],
onwarn: makeOnWarnForTesting(),
// Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
// rollup started respecting the "sideEffects" field in package.json. Since
// our package.json sets "sideEffects=false", this also applies to test
// code, which causes all tests to be removed by tree-shaking.
treeshake: false
};
return config;
}
const defaultConfigurationOptions = {
disableBrowserBundle: false
};
export function makeConfig(pkg, options) {
options = {
...defaultConfigurationOptions,
...(options || {})
};
const baseConfig = {
// Use the package's module field if it has one
input: pkg["module"] || "dist-esm/src/index.js",
external: [
...nodeBuiltins,
...Object.keys(pkg.dependencies),
...Object.keys(pkg.devDependencies)
],
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
preserveSymlinks: false,
plugins: [sourcemaps(), nodeResolve()]
};
const config = [baseConfig];
if (!options.disableBrowserBundle) {
config.push(makeBrowserTestConfig());
}
return config;
}
export default makeConfig(require("./package.json"));

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

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

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

@ -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 {
Cluster,
ClustersCreateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create Or Update cluster.
*
* @summary Create Or Update cluster.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateCluster.json
*/
async function createCluster() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const clusterName = "HRCluster";
const body: Cluster = {
extendedLocation: {
name:
"/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso",
type: "customLocation"
},
location: "East US",
moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
vCenterId:
"/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"
};
const options: ClustersCreateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.clusters.beginCreateAndWait(
resourceGroupName,
clusterName,
options
);
console.log(result);
}
createCluster().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements cluster DELETE method.
*
* @summary Implements cluster DELETE method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteCluster.json
*/
async function deleteCluster() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const clusterName = "HRCluster";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.clusters.beginDeleteAndWait(
resourceGroupName,
clusterName
);
console.log(result);
}
deleteCluster().catch(console.error);

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

@ -0,0 +1,33 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements cluster GET method.
*
* @summary Implements cluster GET method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetCluster.json
*/
async function getCluster() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const clusterName = "HRCluster";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.clusters.get(resourceGroupName, clusterName);
console.log(result);
}
getCluster().catch(console.error);

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

@ -0,0 +1,37 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of clusters in a resource group.
*
* @summary List of clusters in a resource group.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClustersByResourceGroup.json
*/
async function listClustersByResourceGroup() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.clusters.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
listClustersByResourceGroup().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of clusters in a subscription.
*
* @summary List of clusters in a subscription.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClusters.json
*/
async function listClusters() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.clusters.list()) {
resArray.push(item);
}
console.log(resArray);
}
listClusters().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 {
ResourcePatch,
ClustersUpdateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to API to update certain properties of the cluster resource.
*
* @summary API to update certain properties of the cluster resource.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateCluster.json
*/
async function updateCluster() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const clusterName = "HRCluster";
const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } };
const options: ClustersUpdateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.clusters.update(
resourceGroupName,
clusterName,
options
);
console.log(result);
}
updateCluster().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 {
Datastore,
DatastoresCreateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create Or Update datastore.
*
* @summary Create Or Update datastore.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateDatastore.json
*/
async function createDatastore() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const datastoreName = "HRDatastore";
const body: Datastore = {
extendedLocation: {
name:
"/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso",
type: "customLocation"
},
location: "East US",
moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
vCenterId:
"/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"
};
const options: DatastoresCreateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.datastores.beginCreateAndWait(
resourceGroupName,
datastoreName,
options
);
console.log(result);
}
createDatastore().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements datastore DELETE method.
*
* @summary Implements datastore DELETE method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteDatastore.json
*/
async function deleteDatastore() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const datastoreName = "HRDatastore";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.datastores.beginDeleteAndWait(
resourceGroupName,
datastoreName
);
console.log(result);
}
deleteDatastore().catch(console.error);

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

@ -0,0 +1,33 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements datastore GET method.
*
* @summary Implements datastore GET method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetDatastore.json
*/
async function getDatastore() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const datastoreName = "HRDatastore";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.datastores.get(resourceGroupName, datastoreName);
console.log(result);
}
getDatastore().catch(console.error);

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

@ -0,0 +1,37 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of datastores in a resource group.
*
* @summary List of datastores in a resource group.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastoresByResourceGroup.json
*/
async function listDatastoresByResourceGroup() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.datastores.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
listDatastoresByResourceGroup().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of datastores in a subscription.
*
* @summary List of datastores in a subscription.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastores.json
*/
async function listDatastores() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.datastores.list()) {
resArray.push(item);
}
console.log(resArray);
}
listDatastores().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 {
ResourcePatch,
DatastoresUpdateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to API to update certain properties of the datastore resource.
*
* @summary API to update certain properties of the datastore resource.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateDatastore.json
*/
async function updateDatastore() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const datastoreName = "HRDatastore";
const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } };
const options: DatastoresUpdateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.datastores.update(
resourceGroupName,
datastoreName,
options
);
console.log(result);
}
updateDatastore().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 {
GuestAgent,
GuestAgentsCreateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create Or Update GuestAgent.
*
* @summary Create Or Update GuestAgent.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateGuestAgent.json
*/
async function createGuestAgent() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "ContosoVm";
const name = "default";
const body: GuestAgent = {
credentials: { password: "<password>", username: "tempuser" },
httpProxyConfig: { httpsProxy: "http://192.1.2.3:8080" },
provisioningAction: "install"
};
const options: GuestAgentsCreateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.guestAgents.beginCreateAndWait(
resourceGroupName,
virtualMachineName,
name,
options
);
console.log(result);
}
createGuestAgent().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements GuestAgent DELETE method.
*
* @summary Implements GuestAgent DELETE method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteGuestAgent.json
*/
async function deleteGuestAgent() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "ContosoVm";
const name = "default";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.guestAgents.beginDeleteAndWait(
resourceGroupName,
virtualMachineName,
name
);
console.log(result);
}
deleteGuestAgent().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements GuestAgent GET method.
*
* @summary Implements GuestAgent GET method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetGuestAgent.json
*/
async function getGuestAgent() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "ContosoVm";
const name = "default";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.guestAgents.get(
resourceGroupName,
virtualMachineName,
name
);
console.log(result);
}
getGuestAgent().catch(console.error);

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

@ -0,0 +1,39 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns the list of GuestAgent of the given vm.
*
* @summary Returns the list of GuestAgent of the given vm.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GuestAgent_ListByVm.json
*/
async function guestAgentListByVM() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "ContosoVm";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.guestAgents.listByVm(
resourceGroupName,
virtualMachineName
)) {
resArray.push(item);
}
console.log(resArray);
}
guestAgentListByVM().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 {
Host,
HostsCreateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create Or Update host.
*
* @summary Create Or Update host.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHost.json
*/
async function createHost() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const hostName = "HRHost";
const body: Host = {
extendedLocation: {
name:
"/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso",
type: "customLocation"
},
location: "East US",
moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
vCenterId:
"/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"
};
const options: HostsCreateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.hosts.beginCreateAndWait(
resourceGroupName,
hostName,
options
);
console.log(result);
}
createHost().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements host DELETE method.
*
* @summary Implements host DELETE method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHost.json
*/
async function deleteHost() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const hostName = "HRHost";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.hosts.beginDeleteAndWait(
resourceGroupName,
hostName
);
console.log(result);
}
deleteHost().catch(console.error);

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

@ -0,0 +1,33 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements host GET method.
*
* @summary Implements host GET method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHost.json
*/
async function getHost() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const hostName = "HRHost";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.hosts.get(resourceGroupName, hostName);
console.log(result);
}
getHost().catch(console.error);

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

@ -0,0 +1,35 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of hosts in a resource group.
*
* @summary List of hosts in a resource group.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHostsByResourceGroup.json
*/
async function listHostsByResourceGroup() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.hosts.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
}
console.log(resArray);
}
listHostsByResourceGroup().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of hosts in a subscription.
*
* @summary List of hosts in a subscription.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHosts.json
*/
async function listHosts() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.hosts.list()) {
resArray.push(item);
}
console.log(resArray);
}
listHosts().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 {
ResourcePatch,
HostsUpdateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to API to update certain properties of the host resource.
*
* @summary API to update certain properties of the host resource.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateHost.json
*/
async function updateHost() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const hostName = "HRHost";
const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } };
const options: HostsUpdateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.hosts.update(
resourceGroupName,
hostName,
options
);
console.log(result);
}
updateHost().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 {
HybridIdentityMetadata,
HybridIdentityMetadataCreateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create Or Update HybridIdentityMetadata.
*
* @summary Create Or Update HybridIdentityMetadata.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHybridIdentityMetadata.json
*/
async function createHybridIdentityMetadata() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "ContosoVm";
const metadataName = "default";
const body: HybridIdentityMetadata = {
publicKey: "8ec7d60c-9700-40b1-8e6e-e5b2f6f477f2",
vmId: "f8b82dff-38ef-4220-99ef-d3a3f86ddc6c"
};
const options: HybridIdentityMetadataCreateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.hybridIdentityMetadataOperations.create(
resourceGroupName,
virtualMachineName,
metadataName,
options
);
console.log(result);
}
createHybridIdentityMetadata().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements HybridIdentityMetadata DELETE method.
*
* @summary Implements HybridIdentityMetadata DELETE method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHybridIdentityMetadata.json
*/
async function deleteHybridIdentityMetadata() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "ContosoVm";
const metadataName = "default";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.hybridIdentityMetadataOperations.delete(
resourceGroupName,
virtualMachineName,
metadataName
);
console.log(result);
}
deleteHybridIdentityMetadata().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements HybridIdentityMetadata GET method.
*
* @summary Implements HybridIdentityMetadata GET method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHybridIdentityMetadata.json
*/
async function getHybridIdentityMetadata() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "ContosoVm";
const metadataName = "default";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.hybridIdentityMetadataOperations.get(
resourceGroupName,
virtualMachineName,
metadataName
);
console.log(result);
}
getHybridIdentityMetadata().catch(console.error);

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

@ -0,0 +1,39 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns the list of HybridIdentityMetadata of the given vm.
*
* @summary Returns the list of HybridIdentityMetadata of the given vm.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/HybridIdentityMetadata_ListByVm.json
*/
async function hybridIdentityMetadataListByVM() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "ContosoVm";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.hybridIdentityMetadataOperations.listByVm(
resourceGroupName,
virtualMachineName
)) {
resArray.push(item);
}
console.log(resArray);
}
hybridIdentityMetadataListByVM().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 {
InventoryItem,
InventoryItemsCreateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create Or Update InventoryItem.
*
* @summary Create Or Update InventoryItem.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateInventoryItem.json
*/
async function createInventoryItem() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const vcenterName = "ContosoVCenter";
const inventoryItemName = "testItem";
const body: InventoryItem = { inventoryType: "ResourcePool" };
const options: InventoryItemsCreateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.inventoryItems.create(
resourceGroupName,
vcenterName,
inventoryItemName,
options
);
console.log(result);
}
createInventoryItem().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements inventoryItem DELETE method.
*
* @summary Implements inventoryItem DELETE method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteInventoryItem.json
*/
async function deleteInventoryItem() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const vcenterName = "ContosoVCenter";
const inventoryItemName = "testItem";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.inventoryItems.delete(
resourceGroupName,
vcenterName,
inventoryItemName
);
console.log(result);
}
deleteInventoryItem().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements InventoryItem GET method.
*
* @summary Implements InventoryItem GET method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetInventoryItem.json
*/
async function getInventoryItem() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const vcenterName = "ContosoVCenter";
const inventoryItemName = "testItem";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.inventoryItems.get(
resourceGroupName,
vcenterName,
inventoryItemName
);
console.log(result);
}
getInventoryItem().catch(console.error);

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

@ -0,0 +1,39 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns the list of inventoryItems of the given vCenter.
*
* @summary Returns the list of inventoryItems of the given vCenter.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/InventoryItems_ListByVCenter.json
*/
async function inventoryItemsListByVCenter() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const vcenterName = "ContosoVCenter";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.inventoryItems.listByVCenter(
resourceGroupName,
vcenterName
)) {
resArray.push(item);
}
console.log(resArray);
}
inventoryItemsListByVCenter().catch(console.error);

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

@ -0,0 +1,52 @@
/*
* 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 {
MachineExtension,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to The operation to create or update the extension.
*
* @summary The operation to create or update the extension.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/PUTExtension.json
*/
async function createOrUpdateAMachineExtensionPut() {
const subscriptionId = "{subscriptionId}";
const resourceGroupName = "myResourceGroup";
const name = "myMachine";
const extensionName = "CustomScriptExtension";
const extensionParameters: MachineExtension = {
typePropertiesType: "CustomScriptExtension",
location: "eastus2euap",
publisher: "Microsoft.Compute",
settings: {
commandToExecute:
'powershell.exe -c "Get-Process | Where-Object { $_.CPU -gt 10000 }"'
},
typeHandlerVersion: "1.10"
};
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.machineExtensions.beginCreateOrUpdateAndWait(
resourceGroupName,
name,
extensionName,
extensionParameters
);
console.log(result);
}
createOrUpdateAMachineExtensionPut().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to The operation to delete the extension.
*
* @summary The operation to delete the extension.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DELETEExtension.json
*/
async function deleteAMachineExtension() {
const subscriptionId = "{subscriptionId}";
const resourceGroupName = "myResourceGroup";
const name = "myMachine";
const extensionName = "MMA";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.machineExtensions.beginDeleteAndWait(
resourceGroupName,
name,
extensionName
);
console.log(result);
}
deleteAMachineExtension().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to The operation to get the extension.
*
* @summary The operation to get the extension.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GETExtension.json
*/
async function getMachineExtension() {
const subscriptionId = "{subscriptionId}";
const resourceGroupName = "myResourceGroup";
const name = "myMachine";
const extensionName = "CustomScriptExtension";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.machineExtensions.get(
resourceGroupName,
name,
extensionName
);
console.log(result);
}
getMachineExtension().catch(console.error);

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

@ -0,0 +1,39 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to The operation to get all extensions of a non-Azure machine
*
* @summary The operation to get all extensions of a non-Azure machine
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/LISTExtension.json
*/
async function getAllMachineExtensions() {
const subscriptionId = "{subscriptionId}";
const resourceGroupName = "myResourceGroup";
const name = "myMachine";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.machineExtensions.list(
resourceGroupName,
name
)) {
resArray.push(item);
}
console.log(resArray);
}
getAllMachineExtensions().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 {
MachineExtensionUpdate,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to The operation to update the extension.
*
* @summary The operation to update the extension.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateExtension.json
*/
async function createOrUpdateAMachineExtensionPatch() {
const subscriptionId = "{subscriptionId}";
const resourceGroupName = "myResourceGroup";
const name = "myMachine";
const extensionName = "CustomScriptExtension";
const extensionParameters: MachineExtensionUpdate = {
type: "CustomScriptExtension",
publisher: "Microsoft.Compute",
settings: {
commandToExecute:
'powershell.exe -c "Get-Process | Where-Object { $_.CPU -lt 100 }"'
},
typeHandlerVersion: "1.10"
};
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.machineExtensions.beginUpdateAndWait(
resourceGroupName,
name,
extensionName,
extensionParameters
);
console.log(result);
}
createOrUpdateAMachineExtensionPatch().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of all operations.
*
* @summary Returns list of all operations.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListOperations.json
*/
async function listOperations() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.operations.list()) {
resArray.push(item);
}
console.log(resArray);
}
listOperations().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 {
ResourcePool,
ResourcePoolsCreateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create Or Update resourcePool.
*
* @summary Create Or Update resourcePool.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateResourcePool.json
*/
async function createResourcePool() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const resourcePoolName = "HRPool";
const body: ResourcePool = {
extendedLocation: {
name:
"/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso",
type: "customLocation"
},
location: "East US",
moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
vCenterId:
"/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"
};
const options: ResourcePoolsCreateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.resourcePools.beginCreateAndWait(
resourceGroupName,
resourcePoolName,
options
);
console.log(result);
}
createResourcePool().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements resourcePool DELETE method.
*
* @summary Implements resourcePool DELETE method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteResourcePool.json
*/
async function deleteResourcePool() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const resourcePoolName = "HRPool";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.resourcePools.beginDeleteAndWait(
resourceGroupName,
resourcePoolName
);
console.log(result);
}
deleteResourcePool().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements resourcePool GET method.
*
* @summary Implements resourcePool GET method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetResourcePool.json
*/
async function getResourcePool() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const resourcePoolName = "HRPool";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.resourcePools.get(
resourceGroupName,
resourcePoolName
);
console.log(result);
}
getResourcePool().catch(console.error);

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

@ -0,0 +1,37 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of resourcePools in a resource group.
*
* @summary List of resourcePools in a resource group.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePoolsByResourceGroup.json
*/
async function listResourcePoolsByResourceGroup() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.resourcePools.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
listResourcePoolsByResourceGroup().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of resourcePools in a subscription.
*
* @summary List of resourcePools in a subscription.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePools.json
*/
async function listResourcePools() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.resourcePools.list()) {
resArray.push(item);
}
console.log(resArray);
}
listResourcePools().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 {
ResourcePatch,
ResourcePoolsUpdateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to API to update certain properties of the resourcePool resource.
*
* @summary API to update certain properties of the resourcePool resource.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateResourcePool.json
*/
async function updateResourcePool() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const resourcePoolName = "HRPool";
const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } };
const options: ResourcePoolsUpdateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.resourcePools.update(
resourceGroupName,
resourcePoolName,
options
);
console.log(result);
}
updateResourcePool().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 {
VCenter,
VCentersCreateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create Or Update vCenter.
*
* @summary Create Or Update vCenter.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVCenter.json
*/
async function createVCenter() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const vcenterName = "ContosoVCenter";
const body: VCenter = {
credentials: { password: "<password>", username: "tempuser" },
extendedLocation: {
name:
"/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso",
type: "customLocation"
},
fqdn: "ContosoVMware.contoso.com",
location: "East US",
port: 1234
};
const options: VCentersCreateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.vCenters.beginCreateAndWait(
resourceGroupName,
vcenterName,
options
);
console.log(result);
}
createVCenter().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements vCenter DELETE method.
*
* @summary Implements vCenter DELETE method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVCenter.json
*/
async function deleteVCenter() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const vcenterName = "ContosoVCenter";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.vCenters.beginDeleteAndWait(
resourceGroupName,
vcenterName
);
console.log(result);
}
deleteVCenter().catch(console.error);

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

@ -0,0 +1,33 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements vCenter GET method.
*
* @summary Implements vCenter GET method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVCenter.json
*/
async function getVCenter() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const vcenterName = "ContosoVCenter";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.vCenters.get(resourceGroupName, vcenterName);
console.log(result);
}
getVCenter().catch(console.error);

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

@ -0,0 +1,37 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of vCenters in a resource group.
*
* @summary List of vCenters in a resource group.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCentersByResourceGroup.json
*/
async function listVCentersByResourceGroup() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.vCenters.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
listVCentersByResourceGroup().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of vCenters in a subscription.
*
* @summary List of vCenters in a subscription.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCenters.json
*/
async function listVCenters() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.vCenters.list()) {
resArray.push(item);
}
console.log(resArray);
}
listVCenters().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 {
ResourcePatch,
VCentersUpdateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to API to update certain properties of the vCenter resource.
*
* @summary API to update certain properties of the vCenter resource.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVCenter.json
*/
async function updateVCenter() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const vcenterName = "ContosoVCenter";
const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } };
const options: VCentersUpdateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.vCenters.update(
resourceGroupName,
vcenterName,
options
);
console.log(result);
}
updateVCenter().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 {
VirtualMachineTemplate,
VirtualMachineTemplatesCreateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create Or Update virtual machine template.
*
* @summary Create Or Update virtual machine template.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachineTemplate.json
*/
async function createVirtualMachineTemplate() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineTemplateName = "WebFrontEndTemplate";
const body: VirtualMachineTemplate = {
extendedLocation: {
name:
"/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso",
type: "customLocation"
},
location: "East US",
moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
vCenterId:
"/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"
};
const options: VirtualMachineTemplatesCreateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualMachineTemplates.beginCreateAndWait(
resourceGroupName,
virtualMachineTemplateName,
options
);
console.log(result);
}
createVirtualMachineTemplate().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements virtual machine template DELETE method.
*
* @summary Implements virtual machine template DELETE method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachineTemplate.json
*/
async function deleteVirtualMachineTemplate() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineTemplateName = "WebFrontEndTemplate";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualMachineTemplates.beginDeleteAndWait(
resourceGroupName,
virtualMachineTemplateName
);
console.log(result);
}
deleteVirtualMachineTemplate().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements virtual machine template GET method.
*
* @summary Implements virtual machine template GET method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachineTemplate.json
*/
async function getVirtualMachineTemplate() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineTemplateName = "WebFrontEndTemplate";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualMachineTemplates.get(
resourceGroupName,
virtualMachineTemplateName
);
console.log(result);
}
getVirtualMachineTemplate().catch(console.error);

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

@ -0,0 +1,37 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of virtualMachineTemplates in a resource group.
*
* @summary List of virtualMachineTemplates in a resource group.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplatesByResourceGroup.json
*/
async function listVirtualMachineTemplatesByResourceGroup() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.virtualMachineTemplates.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
listVirtualMachineTemplatesByResourceGroup().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of virtualMachineTemplates in a subscription.
*
* @summary List of virtualMachineTemplates in a subscription.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplates.json
*/
async function listVirtualMachineTemplates() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.virtualMachineTemplates.list()) {
resArray.push(item);
}
console.log(resArray);
}
listVirtualMachineTemplates().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 {
ResourcePatch,
VirtualMachineTemplatesUpdateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to API to update certain properties of the virtual machine template resource.
*
* @summary API to update certain properties of the virtual machine template resource.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachineTemplate.json
*/
async function updateVirtualMachineTemplate() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineTemplateName = "WebFrontEndTemplate";
const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } };
const options: VirtualMachineTemplatesUpdateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualMachineTemplates.update(
resourceGroupName,
virtualMachineTemplateName,
options
);
console.log(result);
}
updateVirtualMachineTemplate().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to The operation to assess patches on a vSphere VMware machine identity in Azure.
*
* @summary The operation to assess patches on a vSphere VMware machine identity in Azure.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineAssessPatches.json
*/
async function assessPatchStateOfAMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroupName";
const name = "myMachineName";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualMachines.beginAssessPatchesAndWait(
resourceGroupName,
name
);
console.log(result);
}
assessPatchStateOfAMachine().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 {
VirtualMachine,
VirtualMachinesCreateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create Or Update virtual machine.
*
* @summary Create Or Update virtual machine.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachine.json
*/
async function createVirtualMachine() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "DemoVM";
const body: VirtualMachine = {
extendedLocation: {
name:
"/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso",
type: "customLocation"
},
hardwareProfile: { memorySizeMB: 4196, numCPUs: 4 },
location: "East US",
resourcePoolId:
"/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool",
templateId:
"/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate",
vCenterId:
"/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"
};
const options: VirtualMachinesCreateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualMachines.beginCreateAndWait(
resourceGroupName,
virtualMachineName,
options
);
console.log(result);
}
createVirtualMachine().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements virtual machine DELETE method.
*
* @summary Implements virtual machine DELETE method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachine.json
*/
async function deleteVirtualMachine() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "DemoVM";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualMachines.beginDeleteAndWait(
resourceGroupName,
virtualMachineName
);
console.log(result);
}
deleteVirtualMachine().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements virtual machine GET method.
*
* @summary Implements virtual machine GET method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachine.json
*/
async function getVirtualMachine() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "DemoVM";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualMachines.get(
resourceGroupName,
virtualMachineName
);
console.log(result);
}
getVirtualMachine().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 {
VirtualMachineInstallPatchesParameters,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to The operation to install patches on a vSphere VMware machine identity in Azure.
*
* @summary The operation to install patches on a vSphere VMware machine identity in Azure.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineInstallPatches.json
*/
async function installPatchStateOfAMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroupName";
const name = "myMachineName";
const installPatchesInput: VirtualMachineInstallPatchesParameters = {
maximumDuration: "PT3H",
rebootSetting: "IfRequired",
windowsParameters: {
classificationsToInclude: ["Critical", "Security"],
maxPatchPublishDate: new Date("2022-01-15T02:36:43.0539904+00:00")
}
};
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualMachines.beginInstallPatchesAndWait(
resourceGroupName,
name,
installPatchesInput
);
console.log(result);
}
installPatchStateOfAMachine().catch(console.error);

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

@ -0,0 +1,37 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of virtualMachines in a resource group.
*
* @summary List of virtualMachines in a resource group.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachinesByResourceGroup.json
*/
async function listVirtualMachinesByResourceGroup() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.virtualMachines.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
listVirtualMachinesByResourceGroup().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of virtualMachines in a subscription.
*
* @summary List of virtualMachines in a subscription.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachines.json
*/
async function listVirtualMachines() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.virtualMachines.list()) {
resArray.push(item);
}
console.log(resArray);
}
listVirtualMachines().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Restart virtual machine.
*
* @summary Restart virtual machine.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/RestartVirtualMachine.json
*/
async function restartVirtualMachine() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "DemoVM";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualMachines.beginRestartAndWait(
resourceGroupName,
virtualMachineName
);
console.log(result);
}
restartVirtualMachine().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Start virtual machine.
*
* @summary Start virtual machine.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StartVirtualMachine.json
*/
async function startVirtualMachine() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "DemoVM";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualMachines.beginStartAndWait(
resourceGroupName,
virtualMachineName
);
console.log(result);
}
startVirtualMachine().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 {
StopVirtualMachineOptions,
VirtualMachinesStopOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Stop virtual machine.
*
* @summary Stop virtual machine.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StopVirtualMachine.json
*/
async function stopVirtualMachine() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "DemoVM";
const body: StopVirtualMachineOptions = { skipShutdown: true };
const options: VirtualMachinesStopOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualMachines.beginStopAndWait(
resourceGroupName,
virtualMachineName,
options
);
console.log(result);
}
stopVirtualMachine().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 {
VirtualMachineUpdate,
VirtualMachinesUpdateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to API to update certain properties of the virtual machine resource.
*
* @summary API to update certain properties of the virtual machine resource.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachine.json
*/
async function updateVirtualMachine() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "DemoVM";
const body: VirtualMachineUpdate = {
tags: { tag1: "value1", tag2: "value2" }
};
const options: VirtualMachinesUpdateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualMachines.beginUpdateAndWait(
resourceGroupName,
virtualMachineName,
options
);
console.log(result);
}
updateVirtualMachine().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 {
VirtualNetwork,
VirtualNetworksCreateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create Or Update virtual network.
*
* @summary Create Or Update virtual network.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualNetwork.json
*/
async function createVirtualNetwork() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualNetworkName = "ProdNetwork";
const body: VirtualNetwork = {
extendedLocation: {
name:
"/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso",
type: "customLocation"
},
location: "East US",
moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
vCenterId:
"/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"
};
const options: VirtualNetworksCreateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualNetworks.beginCreateAndWait(
resourceGroupName,
virtualNetworkName,
options
);
console.log(result);
}
createVirtualNetwork().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements virtual network DELETE method.
*
* @summary Implements virtual network DELETE method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualNetwork.json
*/
async function deleteVirtualNetwork() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualNetworkName = "ProdNetwork";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualNetworks.beginDeleteAndWait(
resourceGroupName,
virtualNetworkName
);
console.log(result);
}
deleteVirtualNetwork().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Implements virtual network GET method.
*
* @summary Implements virtual network GET method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualNetwork.json
*/
async function getVirtualNetwork() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualNetworkName = "ProdNetwork";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualNetworks.get(
resourceGroupName,
virtualNetworkName
);
console.log(result);
}
getVirtualNetwork().catch(console.error);

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

@ -0,0 +1,37 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of virtualNetworks in a resource group.
*
* @summary List of virtualNetworks in a resource group.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworksByResourceGroup.json
*/
async function listVirtualNetworksByResourceGroup() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.virtualNetworks.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
listVirtualNetworksByResourceGroup().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List of virtualNetworks in a subscription.
*
* @summary List of virtualNetworks in a subscription.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworks.json
*/
async function listVirtualNetworks() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.virtualNetworks.list()) {
resArray.push(item);
}
console.log(resArray);
}
listVirtualNetworks().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 {
ResourcePatch,
VirtualNetworksUpdateOptionalParams,
AzureArcVMwareManagementServiceAPI
} from "@azure/arm-connectedvmware";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to API to update certain properties of the virtual network resource.
*
* @summary API to update certain properties of the virtual network resource.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualNetwork.json
*/
async function updateVirtualNetwork() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualNetworkName = "ProdNetwork";
const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } };
const options: VirtualNetworksUpdateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(
credential,
subscriptionId
);
const result = await client.virtualNetworks.update(
resourceGroupName,
virtualNetworkName,
options
);
console.log(result);
}
updateVirtualNetwork().catch(console.error);

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

@ -0,0 +1,190 @@
# 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** |
| ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [clustersCreateSample.js][clusterscreatesample] | Create Or Update cluster. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateCluster.json |
| [clustersDeleteSample.js][clustersdeletesample] | Implements cluster DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteCluster.json |
| [clustersGetSample.js][clustersgetsample] | Implements cluster GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetCluster.json |
| [clustersListByResourceGroupSample.js][clusterslistbyresourcegroupsample] | List of clusters in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClustersByResourceGroup.json |
| [clustersListSample.js][clusterslistsample] | List of clusters in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClusters.json |
| [clustersUpdateSample.js][clustersupdatesample] | API to update certain properties of the cluster resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateCluster.json |
| [datastoresCreateSample.js][datastorescreatesample] | Create Or Update datastore. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateDatastore.json |
| [datastoresDeleteSample.js][datastoresdeletesample] | Implements datastore DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteDatastore.json |
| [datastoresGetSample.js][datastoresgetsample] | Implements datastore GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetDatastore.json |
| [datastoresListByResourceGroupSample.js][datastoreslistbyresourcegroupsample] | List of datastores in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastoresByResourceGroup.json |
| [datastoresListSample.js][datastoreslistsample] | List of datastores in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastores.json |
| [datastoresUpdateSample.js][datastoresupdatesample] | API to update certain properties of the datastore resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateDatastore.json |
| [guestAgentsCreateSample.js][guestagentscreatesample] | Create Or Update GuestAgent. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateGuestAgent.json |
| [guestAgentsDeleteSample.js][guestagentsdeletesample] | Implements GuestAgent DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteGuestAgent.json |
| [guestAgentsGetSample.js][guestagentsgetsample] | Implements GuestAgent GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetGuestAgent.json |
| [guestAgentsListByVMSample.js][guestagentslistbyvmsample] | Returns the list of GuestAgent of the given vm. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GuestAgent_ListByVm.json |
| [hostsCreateSample.js][hostscreatesample] | Create Or Update host. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHost.json |
| [hostsDeleteSample.js][hostsdeletesample] | Implements host DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHost.json |
| [hostsGetSample.js][hostsgetsample] | Implements host GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHost.json |
| [hostsListByResourceGroupSample.js][hostslistbyresourcegroupsample] | List of hosts in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHostsByResourceGroup.json |
| [hostsListSample.js][hostslistsample] | List of hosts in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHosts.json |
| [hostsUpdateSample.js][hostsupdatesample] | API to update certain properties of the host resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateHost.json |
| [hybridIdentityMetadataCreateSample.js][hybrididentitymetadatacreatesample] | Create Or Update HybridIdentityMetadata. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHybridIdentityMetadata.json |
| [hybridIdentityMetadataDeleteSample.js][hybrididentitymetadatadeletesample] | Implements HybridIdentityMetadata DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHybridIdentityMetadata.json |
| [hybridIdentityMetadataGetSample.js][hybrididentitymetadatagetsample] | Implements HybridIdentityMetadata GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHybridIdentityMetadata.json |
| [hybridIdentityMetadataListByVMSample.js][hybrididentitymetadatalistbyvmsample] | Returns the list of HybridIdentityMetadata of the given vm. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/HybridIdentityMetadata_ListByVm.json |
| [inventoryItemsCreateSample.js][inventoryitemscreatesample] | Create Or Update InventoryItem. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateInventoryItem.json |
| [inventoryItemsDeleteSample.js][inventoryitemsdeletesample] | Implements inventoryItem DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteInventoryItem.json |
| [inventoryItemsGetSample.js][inventoryitemsgetsample] | Implements InventoryItem GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetInventoryItem.json |
| [inventoryItemsListByVCenterSample.js][inventoryitemslistbyvcentersample] | Returns the list of inventoryItems of the given vCenter. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/InventoryItems_ListByVCenter.json |
| [machineExtensionsCreateOrUpdateSample.js][machineextensionscreateorupdatesample] | The operation to create or update the extension. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/PUTExtension.json |
| [machineExtensionsDeleteSample.js][machineextensionsdeletesample] | The operation to delete the extension. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DELETEExtension.json |
| [machineExtensionsGetSample.js][machineextensionsgetsample] | The operation to get the extension. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GETExtension.json |
| [machineExtensionsListSample.js][machineextensionslistsample] | The operation to get all extensions of a non-Azure machine x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/LISTExtension.json |
| [machineExtensionsUpdateSample.js][machineextensionsupdatesample] | The operation to update the extension. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateExtension.json |
| [operationsListSample.js][operationslistsample] | Returns list of all operations. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListOperations.json |
| [resourcePoolsCreateSample.js][resourcepoolscreatesample] | Create Or Update resourcePool. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateResourcePool.json |
| [resourcePoolsDeleteSample.js][resourcepoolsdeletesample] | Implements resourcePool DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteResourcePool.json |
| [resourcePoolsGetSample.js][resourcepoolsgetsample] | Implements resourcePool GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetResourcePool.json |
| [resourcePoolsListByResourceGroupSample.js][resourcepoolslistbyresourcegroupsample] | List of resourcePools in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePoolsByResourceGroup.json |
| [resourcePoolsListSample.js][resourcepoolslistsample] | List of resourcePools in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePools.json |
| [resourcePoolsUpdateSample.js][resourcepoolsupdatesample] | API to update certain properties of the resourcePool resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateResourcePool.json |
| [vCentersCreateSample.js][vcenterscreatesample] | Create Or Update vCenter. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVCenter.json |
| [vCentersDeleteSample.js][vcentersdeletesample] | Implements vCenter DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVCenter.json |
| [vCentersGetSample.js][vcentersgetsample] | Implements vCenter GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVCenter.json |
| [vCentersListByResourceGroupSample.js][vcenterslistbyresourcegroupsample] | List of vCenters in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCentersByResourceGroup.json |
| [vCentersListSample.js][vcenterslistsample] | List of vCenters in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCenters.json |
| [vCentersUpdateSample.js][vcentersupdatesample] | API to update certain properties of the vCenter resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVCenter.json |
| [virtualMachineTemplatesCreateSample.js][virtualmachinetemplatescreatesample] | Create Or Update virtual machine template. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachineTemplate.json |
| [virtualMachineTemplatesDeleteSample.js][virtualmachinetemplatesdeletesample] | Implements virtual machine template DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachineTemplate.json |
| [virtualMachineTemplatesGetSample.js][virtualmachinetemplatesgetsample] | Implements virtual machine template GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachineTemplate.json |
| [virtualMachineTemplatesListByResourceGroupSample.js][virtualmachinetemplateslistbyresourcegroupsample] | List of virtualMachineTemplates in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplatesByResourceGroup.json |
| [virtualMachineTemplatesListSample.js][virtualmachinetemplateslistsample] | List of virtualMachineTemplates in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplates.json |
| [virtualMachineTemplatesUpdateSample.js][virtualmachinetemplatesupdatesample] | API to update certain properties of the virtual machine template resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachineTemplate.json |
| [virtualMachinesAssessPatchesSample.js][virtualmachinesassesspatchessample] | The operation to assess patches on a vSphere VMware machine identity in Azure. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineAssessPatches.json |
| [virtualMachinesCreateSample.js][virtualmachinescreatesample] | Create Or Update virtual machine. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachine.json |
| [virtualMachinesDeleteSample.js][virtualmachinesdeletesample] | Implements virtual machine DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachine.json |
| [virtualMachinesGetSample.js][virtualmachinesgetsample] | Implements virtual machine GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachine.json |
| [virtualMachinesInstallPatchesSample.js][virtualmachinesinstallpatchessample] | The operation to install patches on a vSphere VMware machine identity in Azure. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineInstallPatches.json |
| [virtualMachinesListByResourceGroupSample.js][virtualmachineslistbyresourcegroupsample] | List of virtualMachines in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachinesByResourceGroup.json |
| [virtualMachinesListSample.js][virtualmachineslistsample] | List of virtualMachines in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachines.json |
| [virtualMachinesRestartSample.js][virtualmachinesrestartsample] | Restart virtual machine. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/RestartVirtualMachine.json |
| [virtualMachinesStartSample.js][virtualmachinesstartsample] | Start virtual machine. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StartVirtualMachine.json |
| [virtualMachinesStopSample.js][virtualmachinesstopsample] | Stop virtual machine. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StopVirtualMachine.json |
| [virtualMachinesUpdateSample.js][virtualmachinesupdatesample] | API to update certain properties of the virtual machine resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachine.json |
| [virtualNetworksCreateSample.js][virtualnetworkscreatesample] | Create Or Update virtual network. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualNetwork.json |
| [virtualNetworksDeleteSample.js][virtualnetworksdeletesample] | Implements virtual network DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualNetwork.json |
| [virtualNetworksGetSample.js][virtualnetworksgetsample] | Implements virtual network GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualNetwork.json |
| [virtualNetworksListByResourceGroupSample.js][virtualnetworkslistbyresourcegroupsample] | List of virtualNetworks in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworksByResourceGroup.json |
| [virtualNetworksListSample.js][virtualnetworkslistsample] | List of virtualNetworks in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworks.json |
| [virtualNetworksUpdateSample.js][virtualnetworksupdatesample] | API to update certain properties of the virtual network resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualNetwork.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/).
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 clustersCreateSample.js
```
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
```bash
npx cross-env node clustersCreateSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[clusterscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersCreateSample.js
[clustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersDeleteSample.js
[clustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersGetSample.js
[clusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersListByResourceGroupSample.js
[clusterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersListSample.js
[clustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersUpdateSample.js
[datastorescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresCreateSample.js
[datastoresdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresDeleteSample.js
[datastoresgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresGetSample.js
[datastoreslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresListByResourceGroupSample.js
[datastoreslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresListSample.js
[datastoresupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresUpdateSample.js
[guestagentscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsCreateSample.js
[guestagentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsDeleteSample.js
[guestagentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsGetSample.js
[guestagentslistbyvmsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsListByVMSample.js
[hostscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsCreateSample.js
[hostsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsDeleteSample.js
[hostsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsGetSample.js
[hostslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsListByResourceGroupSample.js
[hostslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsListSample.js
[hostsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsUpdateSample.js
[hybrididentitymetadatacreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataCreateSample.js
[hybrididentitymetadatadeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataDeleteSample.js
[hybrididentitymetadatagetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataGetSample.js
[hybrididentitymetadatalistbyvmsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataListByVMSample.js
[inventoryitemscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsCreateSample.js
[inventoryitemsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsDeleteSample.js
[inventoryitemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsGetSample.js
[inventoryitemslistbyvcentersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsListByVCenterSample.js
[machineextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsCreateOrUpdateSample.js
[machineextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsDeleteSample.js
[machineextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsGetSample.js
[machineextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsListSample.js
[machineextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsUpdateSample.js
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/operationsListSample.js
[resourcepoolscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsCreateSample.js
[resourcepoolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsDeleteSample.js
[resourcepoolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsGetSample.js
[resourcepoolslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsListByResourceGroupSample.js
[resourcepoolslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsListSample.js
[resourcepoolsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsUpdateSample.js
[vcenterscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersCreateSample.js
[vcentersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersDeleteSample.js
[vcentersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersGetSample.js
[vcenterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersListByResourceGroupSample.js
[vcenterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersListSample.js
[vcentersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersUpdateSample.js
[virtualmachinetemplatescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesCreateSample.js
[virtualmachinetemplatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesDeleteSample.js
[virtualmachinetemplatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesGetSample.js
[virtualmachinetemplateslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesListByResourceGroupSample.js
[virtualmachinetemplateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesListSample.js
[virtualmachinetemplatesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesUpdateSample.js
[virtualmachinesassesspatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesAssessPatchesSample.js
[virtualmachinescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesCreateSample.js
[virtualmachinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesDeleteSample.js
[virtualmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesGetSample.js
[virtualmachinesinstallpatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesInstallPatchesSample.js
[virtualmachineslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesListByResourceGroupSample.js
[virtualmachineslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesListSample.js
[virtualmachinesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesRestartSample.js
[virtualmachinesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesStartSample.js
[virtualmachinesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesStopSample.js
[virtualmachinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesUpdateSample.js
[virtualnetworkscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksCreateSample.js
[virtualnetworksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksDeleteSample.js
[virtualnetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksGetSample.js
[virtualnetworkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksListByResourceGroupSample.js
[virtualnetworkslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksListSample.js
[virtualnetworksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksUpdateSample.js
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-connectedvmware?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/connectedvmware/arm-connectedvmware/README.md

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

@ -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 { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create Or Update cluster.
*
* @summary Create Or Update cluster.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateCluster.json
*/
async function createCluster() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const clusterName = "HRCluster";
const body = {
extendedLocation: {
name: "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso",
type: "customLocation",
},
location: "East US",
moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
vCenterId:
"/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter",
};
const options = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
const result = await client.clusters.beginCreateAndWait(resourceGroupName, clusterName, options);
console.log(result);
}
createCluster().catch(console.error);

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

@ -0,0 +1,30 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Implements cluster DELETE method.
*
* @summary Implements cluster DELETE method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteCluster.json
*/
async function deleteCluster() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const clusterName = "HRCluster";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
const result = await client.clusters.beginDeleteAndWait(resourceGroupName, clusterName);
console.log(result);
}
deleteCluster().catch(console.error);

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

@ -0,0 +1,30 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Implements cluster GET method.
*
* @summary Implements cluster GET method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetCluster.json
*/
async function getCluster() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const clusterName = "HRCluster";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
const result = await client.clusters.get(resourceGroupName, clusterName);
console.log(result);
}
getCluster().catch(console.error);

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

@ -0,0 +1,32 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to List of clusters in a resource group.
*
* @summary List of clusters in a resource group.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClustersByResourceGroup.json
*/
async function listClustersByResourceGroup() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.clusters.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
}
console.log(resArray);
}
listClustersByResourceGroup().catch(console.error);

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

@ -0,0 +1,31 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to List of clusters in a subscription.
*
* @summary List of clusters in a subscription.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClusters.json
*/
async function listClusters() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.clusters.list()) {
resArray.push(item);
}
console.log(resArray);
}
listClusters().catch(console.error);

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

@ -0,0 +1,32 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to API to update certain properties of the cluster resource.
*
* @summary API to update certain properties of the cluster resource.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateCluster.json
*/
async function updateCluster() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const clusterName = "HRCluster";
const body = { tags: { tag1: "value1", tag2: "value2" } };
const options = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
const result = await client.clusters.update(resourceGroupName, clusterName, options);
console.log(result);
}
updateCluster().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.
const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create Or Update datastore.
*
* @summary Create Or Update datastore.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateDatastore.json
*/
async function createDatastore() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const datastoreName = "HRDatastore";
const body = {
extendedLocation: {
name: "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso",
type: "customLocation",
},
location: "East US",
moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
vCenterId:
"/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter",
};
const options = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
const result = await client.datastores.beginCreateAndWait(
resourceGroupName,
datastoreName,
options
);
console.log(result);
}
createDatastore().catch(console.error);

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

@ -0,0 +1,30 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Implements datastore DELETE method.
*
* @summary Implements datastore DELETE method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteDatastore.json
*/
async function deleteDatastore() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const datastoreName = "HRDatastore";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
const result = await client.datastores.beginDeleteAndWait(resourceGroupName, datastoreName);
console.log(result);
}
deleteDatastore().catch(console.error);

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

@ -0,0 +1,30 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Implements datastore GET method.
*
* @summary Implements datastore GET method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetDatastore.json
*/
async function getDatastore() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const datastoreName = "HRDatastore";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
const result = await client.datastores.get(resourceGroupName, datastoreName);
console.log(result);
}
getDatastore().catch(console.error);

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

@ -0,0 +1,32 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to List of datastores in a resource group.
*
* @summary List of datastores in a resource group.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastoresByResourceGroup.json
*/
async function listDatastoresByResourceGroup() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.datastores.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
}
console.log(resArray);
}
listDatastoresByResourceGroup().catch(console.error);

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

@ -0,0 +1,31 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to List of datastores in a subscription.
*
* @summary List of datastores in a subscription.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastores.json
*/
async function listDatastores() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.datastores.list()) {
resArray.push(item);
}
console.log(resArray);
}
listDatastores().catch(console.error);

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

@ -0,0 +1,32 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to API to update certain properties of the datastore resource.
*
* @summary API to update certain properties of the datastore resource.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateDatastore.json
*/
async function updateDatastore() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const datastoreName = "HRDatastore";
const body = { tags: { tag1: "value1", tag2: "value2" } };
const options = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
const result = await client.datastores.update(resourceGroupName, datastoreName, options);
console.log(result);
}
updateDatastore().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 { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create Or Update GuestAgent.
*
* @summary Create Or Update GuestAgent.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateGuestAgent.json
*/
async function createGuestAgent() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "ContosoVm";
const name = "default";
const body = {
credentials: { password: "<password>", username: "tempuser" },
httpProxyConfig: { httpsProxy: "http://192.1.2.3:8080" },
provisioningAction: "install",
};
const options = { body };
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
const result = await client.guestAgents.beginCreateAndWait(
resourceGroupName,
virtualMachineName,
name,
options
);
console.log(result);
}
createGuestAgent().catch(console.error);

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

@ -0,0 +1,35 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Implements GuestAgent DELETE method.
*
* @summary Implements GuestAgent DELETE method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteGuestAgent.json
*/
async function deleteGuestAgent() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "ContosoVm";
const name = "default";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
const result = await client.guestAgents.beginDeleteAndWait(
resourceGroupName,
virtualMachineName,
name
);
console.log(result);
}
deleteGuestAgent().catch(console.error);

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

@ -0,0 +1,31 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Implements GuestAgent GET method.
*
* @summary Implements GuestAgent GET method.
* x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetGuestAgent.json
*/
async function getGuestAgent() {
const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b";
const resourceGroupName = "testrg";
const virtualMachineName = "ContosoVm";
const name = "default";
const credential = new DefaultAzureCredential();
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
const result = await client.guestAgents.get(resourceGroupName, virtualMachineName, name);
console.log(result);
}
getGuestAgent().catch(console.error);

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